[SCM] openni/upstream: Imported Upstream version 1.5.2.23

eighthave-guest at users.alioth.debian.org eighthave-guest at users.alioth.debian.org
Mon Jul 2 15:33:43 UTC 2012


The following commit has been merged in the upstream branch:
commit 360c5e8b71c198cb0a7eabd0722a6496c5bc294e
Author: Hans-Christoph Steiner <hans at eds.org>
Date:   Wed Jan 18 22:21:46 2012 -0500

    Imported Upstream version 1.5.2.23

diff --git a/CHANGES b/CHANGES
index ac31615..c181d58 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,227 @@
 Detailed Change log:
 --------------------
 
-Version 1.1.0.41 (Unstable version - Apr 18th 2010)
+Version 1.5.2.23 (Stable version - Dec 28th 2011)
+-------------------------------------------------
+  * C++: IRMetaData didn't have operator() and operator[], which is inconsistent with depth and scene.
+  * Fixed some memory deallocation mismatches.
+  * Remove redundant USB warning message on Linux (this is normal behavior).
+  * Java wrappers: adding getDataPtr(), createDataByteBuffer() and copyDataToBuffer() to Generator class.
+  * NiViewer: did not check if StartGenerating was successful.
+
+Version 1.5.2.7 (Unstable version - Dec 18th 2011)
+--------------------------------------------------
+  * Java UserTracker sample will now draw the limbs only when both joints have a non-zero confidence.
+  * .NET samples will now show their source files in the visual studio project.
+  * NiUserSelection - Enhanced the documentation.
+  * PoseDetectionCapability::StopPoseDetection will now return proper errors.
+  * .Net Wrappers: Disposing a device node now also destroys the node.
+  * xnNodeInfoGetTreeStringRepresentation was added to all wrappers.
+  * Linux: keep ref count for the libusb events thread, so it will be shutdown automatically when all read threads have stopped.
+  * Added option to show low confidence limbs as dotted lines in the user selection sample.
+  * Recordings playbacks: make sure seek is also performed in a lock, so it wouldn't collide with the reader thread.
+  * Bug Fix: The samples cannot be copied to another folder and be compiled.
+  * Data Dump: Adding frame sync information checks.
+  * NiUseExtension sample: added a clear message about the need to register the extension module.
+  * .Net Wrappers: Added the DataPtr property to Generator class.
+  * .Net wrappers: Fixed a bug where MapGenerator.BytesPerPixel was missing.
+  * .Net Wrappers: FindExistingNode now returns null instead of throwing an exception if no node exists.
+  * Java Wrappers: StartPoseDetection and StopPoseDetection are declared deprecated, and were replaced by startPoseDetection and stopPoseDetection.
+  * Linux: Cross compilation is now based on environment variables.
+  * .Net Wrappers: Projective/RealWorld conversion - added a version which accepts a preallocated array.
+  * USB Driver version was updated to 3.1.3.1.
+  * NiBackRecorder: removed unneeded calls to Release().
+  * NiConvertXToONI: removed unused seekNode.
+  * Android: makefiles are now compatible to ndk v7.
+  * .Net Wrapper: Added the missing DeviceIdentificationCapability class.
+  * New API: xnStopSinglePoseDetection.
+  * Bug Fix: Seeking before the first WaitXUpdateAll() caused undetermined behavior.
+  * Android: Added the NiSimpleSkeleton sample.
+  * Java Wrappers: Added missing enum values.
+  * .NET Wrappers: Added missing enum values.
+  * Android UserTracker sample: Adjusted to work without a calibration pose.
+  * USB Driver: adding support for PrimeSense's 0601 product ID.
+  * Log: initializing from INI file would reset the output directory.  
+  * Bug fix: Seeking to the current frame did no re-read it, while seeking to another frame did read it. This caused a bug where seeking to the same frame twice would cause it to return twice.
+
+Version 1.4.0.2 (Unstable version - Nov 17th 2011)
+--------------------------------------------------
+  * Linux bug fix: The USB read thread was using memcpy with overlapping source and dest addresses which caused newer libc libraries to fail. The solution is to use memmove.
+  * Log: fix BC methods behavior to be backwards-compatible to old one.
+  * Added GetNumberOfAvailableGestures() method to GestureGenerator.
+  * .NET BugFix: GetPoseStatus() did not work.
+  * JNI: fix a typo that prevents creating joint orientations.
+  * NiUserSelection: Update to support N closest users and N waves.
+  * Fixed python scripts to also support python 3.
+  * Java Wrapper: Added a new method copyToBuffer for copying data to a preallocated buffer to improve performance (community request).
+  * Mac: Fixed a bug in the linux set thread priority where the struct wasn't zero'd before usage (caused warning on mac osx).
+  * Linux redist bug: .net wrappers were skipped on 64-bit machines by mistake.
+  * Windows Bug Fix: shared memory was always created under the Global namespace (Failed to work with UAC turned on).
+  * Added APIs xnIsPoseSupported, xnGetPoseStatus, through PoseDetectionCapability.
+  * Java Wrappers: added createByteBuffer() to AudioMetaData to access data.
+  * NiRecordRaw: Removed duplicate call to GetProductionNodeByName.
+  * Added NiHandTracker C++ sample.
+  * Added NO_TRACKING to the list of pose detection statuses.
+  * Added NiSimpleSkeleton sample which shows the head movement of skeleton with no graphics.
+  * Added NiUserSelection sample which shows the exit pose (cross hands) and user selection.
+  * Added a new dump, "OpenNIDataFlow", to track data frames.
+  * WaitNoneUpdateAll now doesn't actually read from file (might cause some sleeping), but only triggers another thread to read in the background. 
+
+Version 1.3.4.6 (Unstable version - Nov 7th 2011)
+-------------------------------------------------
+  * In MockGenerator::SetData, change the node to Generating state so it would be recorded properly.
+  * Added new calibration error messages to the XnCalibrationStatus enum.
+  * XnArray: Allow passing base size in the ctor (to save double allocation).
+  * NiViewer: Removed an unnecessary line from file dialog init
+  * Bug fix: When recording from mock node, the first frame is no longer lost.
+  * XnOS: Added the option to create named objects in a way that will be accessible to other sessions.
+  * Renamed Linux-x86* files to Linux*
+  * Linux Bug Fix: xnOSSeekFile64 did not return OK. This caused problems in playback and recording of ONI files.
+  * Added some error log prints to the codecs and players.
+  * C# wrappers: fixed the marshaling of license struct.
+  * Added the function SetDataBytes to XnBitSet so it now accepts a byte buffer of any size. Note: byte order is different when reading from byte array or dword array in little endian platforms.
+  * C# wrappers: fixed a bug related to ProductionNodeDescription. Might break API, but this API would usually crash, so its OK.
+  * Linux: Switched to newer makefiles. SSE is enabled in debug, always declare sysroot (even for /) so that -I=/usr/include/ni could work properly.
+  * Linux: fix cross compilation and add separate scripts to cross compile on specific machine. Also, binary folders are now named according to platform and configuration.
+  * Documentation: Added a section about creating modules.
+  * Backwards Compatibility Workaround: some old recordings marked nodes as not generating though they contained frames. This resulted in "node is locked" error if trying to start generating them.
+
+Version 1.3.4.3 (Unstable version - Oct 10th 2011)
+--------------------------------------------------
+  * Update to newer version of CommonCppMakefile (without the -malign-double flag).
+  * Changed dump API to use void pointer instead of char pointer
+  * Added xnOSDeleteEmptyDirectory and xnOSDeleteDirectoryTree methods.
+  * Adding ScriptNode.Create() to C++ wrappers.
+  * Dumps: New, cleaner interface.
+  * Dumps: Adding dump writers mechanisms, so one can implement a new writer, other than files.
+  * Recordings: Support files bigger than 2 GB.
+  * Samples: default SamplesConfig is now better documented. Global mirror is turned on, instead of every generator.
+  * Java Wrappers: some methods were private by mistake.
+  * Samples Bug Fix: trying to create the rotating device extension would cause a crash if extension sample is not registered with OpenNI.
+  * Bug Fix: StartGenerating would fail on locked nodes even if node is already generating (this caused a bug where declaring a node in the XML which already existed in the recording would fail).
+  * Logs: New, better performance API.
+  * XnPlatform min/max values were wrong.
+
+Version 1.3.3.6 (Stable version - Sep 18th 2011)
+------------------------------------------------
+  * Fixed memory leak in Queue and ThreadSafeQueue.
+  * Java: added AlternativeViewpoint API.
+  * Java Bug Fix: audio was missing getMetaData().
+  * Bug Fix: potential crash in DirectX filter.
+  * Java: added getGeneralProperty and setGeneralProperty overloads which work with byte[].
+  * Java bug fix: imageGenerator.getMetaData().getData() returns map where bytesPerPixel is set to 0.
+  * Bug Fix: Playback now advances even if using xnWaitNoneUpdateAll.
+  * Bug Fix: UnregisterFromCalibrationComplete didn't work properly.
+  * Bug Fix: trying to remove a (non-existing) task from an empty scheduler would cause a crash.
+  * Linux USB device: in kernel 2.6.37, need to wait for control reply before continuing to poll ep0.
+  * Linux USB device: write to data endpoint in asynch IO, and return error if timeout occurred.
+  * Preliminary Android Support. With 2 samples: SimpleViewer and UserTracker.
+  * Preliminary ARM Support.  
+  * Removed some duplicate definitions in OS and Platform of Win32 (ref #1472).
+  * NiUserTracker can now work without depth (it simulates its view perspective).
+  * Java bug fix: improper cleanup in 'Context' object java wrapper. 
+  * NiSimpleRead: Also accept SamplesConfig from local dir.
+  * Windows USB driver: Updated the digital signature.
+  * Fix a small leak - 32 bytes for each created node (the BitSet ctor and dtor weren't called)
+  * .NET wrapper: added a "Current" version to the XnVersion structure.
+  * .NET wrapper: marking all C imports as cdecl.
+  * Java bug fix: memory corruption in some methods and callbacks.
+  * Java bug fix: TellPlayerFrame and GetPlayerNumOfFrames would always throw exception (bad cast).
+  * Java bug fix: callbacks would sometime cause an exception when detaching thread.
+  * API Bug Fix: UnregisterFromCalibrationStart returns XnStatus, but nothing was returned. This function should be a void function, but was left with original signature due to backwards compatibility issues.
+  * XnOS: adding special timeout to sockets Connect method: XN_SOCKET_DEFAULT_TIMEOUT, which give default OS behavior.
+  * .Net wrapper Bug Fix: nodes created using CreateAnyProductionTree will never be destroyed.
+  * .Net wrapper: GetXXXCap now always returns the same object (instead of creating and garbage collecting many objects).
+  * OpenNI filter: Added some validity checks.
+  * XnDump.h: allowing compilation under C.
+  * Linux USB Device: fix enumeration process.
+  * Linux USB Device: control and data endpoints now work.
+  * Win32 Bug Fix: trying to create an unnamed mutex causes Access Violation.
+  * Linux USB: Fix error code when failed to receive from control.
+
+Version 1.3.2.3 (Stable version - July 19th 2011)
+-------------------------------------------------
+  * Windows/Linux: Allow creating mutex even if name contains slashes/backslashes.
+  * Linux installer fix: dir /var/log/ni wasn't created, so installation might fail.
+  * Linux installer fix: do not try to install non-existing .Net wrappers.
+  * Java Bug Fix: ImageMap::createByteBuffer() causes infinite recursion (#1290).
+  * Bug Fix: on rare cases, creating nodes might succeed but return a NULL hNode.
+  * Java wrappers are now installed to /usr/share/java.
+  
+Version 1.3.2.1 (Stable version - July 4th 2011)
+------------------------------------------------
+  * Moved HandTouchingFOVEdge to be a Capability, available through the HandGenerator.
+  * Skeleton Capability:
+	 - CalibrationCallbacks (bundle of CalibrationStart and CalibrationEnd) marked as deprecated
+	 - New callback: CalibrationStart (with RegisterTo/UnregisterFrom) - replacing deprecated CalibrationCallbacks
+	 - Removed forceFixedLength, IsForcedFixedLength, SetPostProcessing - not general API. Instead, int property of XnVFeatures
+  * Pose Detection Capability
+	 - PoseCallbacks (bundle of PoseStart and PoseEnd) marked as deprecated
+	 - New callback: PoseDetected (with RegisterTo/UnregisterFrom) - replacing deprecated PoseCallbacks
+	 - New callback: OutOfPose (with RegisterTo/UnregisterFrom) - replacing deprecated PoseCallbacks
+  * PoseDetectionStatus enum changed, to contain only relevant options
+  * All relevant samples use new APIs.
+  * Memory leak fix - creating temporary C++ wrapper node objects cause memory leaks.
+  * Linux: allowing OpenNI to be installed in a different directory.
+  * Linux Bug Fix: logs are not created if log dir does not exist.
+  * Removed MessageBoxes from uninstallation process.
+  * New Java wrappers and samples!
+  * Bug Fix: Exporter singleton functions might be called *after* its destruction (when global objects are destroyed, destruction order is undetermined).
+  * Raise the shutdown event *after* all nodes have been destroyed (some nodes might call the context or other nodes when destroying)
+  * BugFix: running xml script would startGenerateAll instead of just the ones that were created. NOTE: this also changes behavior so that nodes are now started in the order in which they were written in the script.
+  * Changed recorder buffer size to support UXGA with worst case compression.
+  * NiViewer bug fix: if no depth when NiViewer starts, scale is never drawn, even if depth is created later on.
+  * Initial support for Android.
+  * NiConvertXToONI: now when specifying node type in command line, only nodes of that type are converted.
+  * Bug Fix: NiSimpleViewer crashes when image node does not exist (#1211).
+  * Bug Fix: Unnecessary full file paths in samples csproj files (#964).
+  * Bug Fix: NiAudioSample memory leak (#971).
+  * Bug Fix: wrong error codes returned form semaphore functions.
+  * Added GetDestination() function to Recorder.
+  * Exposed xnNodeInfoAllocate() and xnNodeInfoFree().
+  * Bug Fix: after closing the log, opening it again might not work.
+  * Bug Fix: Create production tree didn't return hNode if already exists.
+  * Added option to query for non-existing nodes only
+  * Added options to xml script for querying existing nodes and non-existing nodes
+  * Added documentation for creating recorder from xml script
+  * Added documentation for querying for existing nodes and non-existing nodes through xml
+  * UpdateVersion.py now updates version number in doxygen project name
+  * Added APIs to register to new callbacks
+    - GestureInProgress
+	- GestureReadyForNextStage
+	- HandTouchingFOV
+	- CalibrationInProgress (with status)
+	- CalibrationComplete (with status)
+	- PoseDetectionInProgress (with status)
+	- UserExit
+	- UserReEnter
+  * Added APIs for forcing fixed length skeleton.
+  * Added API for skeleton post processing.
+
+Version 1.2.0.7 (Stable version - May 9th 2011)
+-----------------------------------------------
+  * Wrappers Bug Fix in C++ and C#: Calling Shutdown() might cause a crash in other objects destructors.
+  * Changed GLES to work properly on CE4100.
+  * Added virtual to LogWriterBase dtor.
+  * Fixed bug in queries - xnIsNodeMatch returned TRUE when there was no match.
+  * Added input pointer validation in xnGetModuleNodeHandle().
+  * C++ Wrapper Bug Fix: CreateProductionTree would not return created node, so node always had a ref count of at least 1.
+  * Log Bug Fix: changing output folder causes file to be created (even if not requested).
+  * Bug Fix: xnAddNeededNode() did not add an already added node, but also didn't notify caller. Changed to add it again.
+  * Bug Fix: playing ONI files does not work in application using deprecated API.
+  * Bug Fix: enumerating with a query might cause a crash.
+  * Bug Fix: playing ONI files might cause extra ref count to context.
+  * Bug Fix: When an enumeration error occurs in running XML file, trying to access this error causes crash.
+  * Ref count dump improvement.
+  * API change: running XML scripts is now done via ScriptNode object, and this object is responsible for the lifetime of created objects.
+  * API change: from now on, context object works with reference count:
+    1. InitFromXml() was marked deprecated. Now has another overload with takes the script node as output.
+	2. RunXmlScript() was marked deprecated. Now has another overload with takes the script node as output.
+	3. RunXmlScriptFromFile() was marked deprecated. Now has another overload with takes the script node as output.
+	4. Shutdown() was marked deprecated. Release() should be used instead (or let dtor do its stuff)
+  * Log: adding LogWriter framework. It is now possible to add other log writers (others than console/file).
+
+Version 1.1.0.41 (Unstable version - Apr 18th 2011)
 ---------------------------------------------------
   * .Net wrapper: adding publisher policy to the installation, to redirect previous versions to current one.
   * Fixed the 32-bit VCRedist problem (the MSI installer didn't call it by mistake)
@@ -13,7 +233,7 @@ Version 1.1.0.41 (Unstable version - Apr 18th 2010)
   * CE4100: stop using /var/lib - filesystem is replaced by tempfs.
   * CE4100: proper support in makefile, redist and install.
 
-Version 1.1.0.39 (Unstable version - Apr 11th 2010)
+Version 1.1.0.39 (Unstable version - Apr 11th 2011)
 ---------------------------------------------------
   * Typo fix: ANTI_FILCKER was misspelled (should be ANTI_FLICKER)
   * Bug Fix #788: NiViewer bug fix: a crash when playback speed is extremely high.
@@ -26,7 +246,7 @@ Version 1.1.0.39 (Unstable version - Apr 11th 2010)
   * NiViewer: improve error message when trying to seek in a live source.
   * .NET wrapper - better reference safety for delegates.
 
-Version 1.1.0.38 (Stable version - Apr 11th 2010)
+Version 1.1.0.38 (Stable version - Apr 11th 2011)
 -------------------------------------------------
   * Fixed .NET requirements in the Win32 installer.
   * Linux Bug Fix: xnOS timeouts did not work well, causing ISO mode to get stuck sometimes when closing the device.
diff --git a/Data/SamplesConfig.xml b/Data/SamplesConfig.xml
index e4f1c91..d4e8cc3 100644
--- a/Data/SamplesConfig.xml
+++ b/Data/SamplesConfig.xml
@@ -1,6 +1,6 @@
 <OpenNI>
 	<Licenses>
-		<!-- Add licenses here 
+		<!-- Add application-specific licenses here 
 		<License vendor="vendor" key="key"/>
 		-->
 	</Licenses>
@@ -14,18 +14,45 @@
 		</Dumps>
 	</Log>
 	<ProductionNodes>
-		<Node type="Depth" name="Depth1">
-			<Configuration>
-				<Mirror on="true"/>
-			</Configuration>
-		</Node>
-		<Node type="Image" name="Image1" stopOnError="false">
+		<!-- Uncomment following line, in order to run from a recording 
+		<Recording file="sampleRec.oni" />
+		-->
+	
+		<!-- Set global mirror -->
+		<GlobalMirror on="true"/>
+		
+		<!-- Create a depth node and give it a name alias (useful if referenced ahead in this script) -->
+		<Node type="Depth" name="MyDepth">
+			<Query>
+				<!-- Uncomment to filter by vendor name, product name, etc.
+				<Vendor>MyVendor inc.</Vendor>
+				<Name>MyProduct</Name>
+				<MinVersion>1.2.3.4</MinVersion>
+				<Capabilities>
+					<Capability>Cropping</Capability>
+				</Capabilities>
+				-->
+			</Query>
 			<Configuration>
-				<Mirror on="true"/>
+				<!-- Uncomment to set requested mode
+				<MapOutputMode xRes="640" yRes="480" FPS="30"/> 
+				-->
+
+				<!-- Uncomment to override global mirror
+				<Mirror on="false" /> 
+				-->
 			</Configuration>
 		</Node>
-		<!--
-		<Node type="Audio" name="Audio1"/>
+		
+		<!-- Create an image node. If it fails, continue anyway. -->
+		<Node type="Image" stopOnError="false" />
+
+		<!-- Uncomment nodes from here if you need them.
+		<Node type="Audio" />
+		<Node type="User" />
+		<Node type="Hands" />
+		<Node type="Gesture" />
+		<Node type="Scene" />
 		-->
 	</ProductionNodes>
 </OpenNI>
diff --git a/Documentation/OpenNI.chm b/Documentation/OpenNI.chm
index c065f8f..fa01467 100644
Binary files a/Documentation/OpenNI.chm and b/Documentation/OpenNI.chm differ
diff --git a/Documentation/OpenNI_UserGuide.pdf b/Documentation/OpenNI_UserGuide.pdf
index a6805fe..1ed9663 100644
Binary files a/Documentation/OpenNI_UserGuide.pdf and b/Documentation/OpenNI_UserGuide.pdf differ
diff --git a/Include/ARC/XnOSARC.h b/Include/ARC/XnOSARC.h
index c3f84ac..a8db65f 100644
--- a/Include/ARC/XnOSARC.h
+++ b/Include/ARC/XnOSARC.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/ARC/XnPlatformARC.h b/Include/ARC/XnPlatformARC.h
index 850f7c3..ff64310 100644
--- a/Include/ARC/XnPlatformARC.h
+++ b/Include/ARC/XnPlatformARC.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -177,10 +177,14 @@ typedef size_t				XnSizeT;
 /** Indicates a deprecated function */
 #define XN_API_DEPRECATED(msg)
 
+#define XN_DEPRECATED_WARNING_IDS			
+#define XN_HIDES_PARENT_METHOD_WARNING_ID	
+#define XN_CONDITION_IS_CONST_WARNING_ID
+#define XN_PRAGMA_START_DISABLED_WARNING_SECTION(warnings)
+#define XN_PRAGMA_STOP_DISABLED_WARNING_SECTION
+
 /** Declares a global shared library export function. */ 
 #define XN_API_EXPORT_INIT()
 
-#define XN_DEPRECATED_WARNING_IDS 1
-
 #endif //_XN_PLATFORM_ARC_H_
 
diff --git a/Include/Android-Arm/XnPlatformAndroid-Arm.h b/Include/Android-Arm/XnPlatformAndroid-Arm.h
new file mode 100644
index 0000000..6308ff7
--- /dev/null
+++ b/Include/Android-Arm/XnPlatformAndroid-Arm.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef _XN_PLATFORM_ANDROID_ARM_H_
+#define _XN_PLATFORM_ANDROID_ARM_H_
+
+// Start with Linux-x86, and override what's different
+#include "../Linux-x86/XnPlatformLinux-x86.h"
+
+//---------------------------------------------------------------------------
+// Platform Basic Definition
+//---------------------------------------------------------------------------
+#undef XN_PLATFORM
+#undef XN_PLATFORM_STRING
+
+#define XN_PLATFORM XN_PLATFORM_ANDROID_ARM
+#define XN_PLATFORM_STRING "Android-Arm"
+
+#define XN_PLATFORM_HAS_NO_TIMED_OPS
+#define XN_PLATFORM_HAS_NO_CLOCK_GETTIME
+#define XN_PLATFORM_HAS_NO_SCHED_PARAM
+#define XN_PLATFORM_HAS_BUILTIN_SEMUN
+
+#define XN_PLATFORM_LINUX_NO_GLIBC
+#define XN_PLATFORM_LINUX_NO_SYSV
+#define XN_PLATFORM_LINUX_NO_GLOB
+#define XN_PLATFORM_LINUX_NO_POSIX_MEMALIGN
+#define XN_PLATFORM_LINUX_NO_SHM
+#define XN_PLATFORM_LINUX_NO_PTHREAD_CANCEL
+
+#endif //_XN_PLATFORM_LINUX_ARM_H_
diff --git a/Include/IXnNodeAllocator.h b/Include/IXnNodeAllocator.h
index d285be7..3f011c6 100644
--- a/Include/IXnNodeAllocator.h
+++ b/Include/IXnNodeAllocator.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/Linux-Arm/XnPlatformLinux-Arm.h b/Include/Linux-Arm/XnPlatformLinux-Arm.h
index eae795d..700655d 100644
--- a/Include/Linux-Arm/XnPlatformLinux-Arm.h
+++ b/Include/Linux-Arm/XnPlatformLinux-Arm.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/Linux-x86/XnOSLinux-x86.h b/Include/Linux-x86/XnOSLinux-x86.h
index 48810bf..6163fb3 100644
--- a/Include/Linux-x86/XnOSLinux-x86.h
+++ b/Include/Linux-x86/XnOSLinux-x86.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -116,7 +116,7 @@ typedef	void* XN_THREAD_PARAM;
 //---------------------------------------------------------------------------
 /** A Xiron mutex type. */
 struct XnMutex;
-typedef	XnMutex* XN_MUTEX_HANDLE;
+typedef	struct XnMutex* XN_MUTEX_HANDLE;
 
 //---------------------------------------------------------------------------
 // Critical Sections
@@ -128,17 +128,8 @@ typedef	XN_MUTEX_HANDLE XN_CRITICAL_SECTION_HANDLE;
 // Events
 //---------------------------------------------------------------------------
 /** A Xiron event type. */ 
-typedef struct
-{
-	int NamedSem;
-	pthread_cond_t cond;
-	pthread_mutex_t mutex;
-	XnBool bSignaled;
-	XnBool bManualReset;
-	XnBool bNamed;
-	XnChar csSemFileName[XN_FILE_MAX_PATH];
-	int hSemFile;
-} _XnEvent, *XN_EVENT_HANDLE;
+struct _XnEvent;
+typedef struct _XnEvent _XnEvent, *XN_EVENT_HANDLE ;
 
 //---------------------------------------------------------------------------
 // Semaphores
diff --git a/Include/Linux-x86/XnPlatformLinux-x86.h b/Include/Linux-x86/XnPlatformLinux-x86.h
index 179b3cb..835a396 100644
--- a/Include/Linux-x86/XnPlatformLinux-x86.h
+++ b/Include/Linux-x86/XnPlatformLinux-x86.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -34,6 +34,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
+#include <limits.h>
 
 //---------------------------------------------------------------------------
 // Platform Basic Definition
@@ -99,31 +100,31 @@ typedef void (*XnFarProc)(void *);
 typedef size_t				XnSizeT;
 
 /** Max unsigned 8-bit value */ 
-#define XN_MAX_UINT8 255
+#define XN_MAX_UINT8 UCHAR_MAX
 /** Max unsigned 16-bit value */ 
-#define XN_MAX_UINT16 65535
+#define XN_MAX_UINT16 USHRT_MAX
 /** Max unsigned 32-bit value */ 
-#define XN_MAX_UINT32 4294967295UL
+#define XN_MAX_UINT32 UINT_MAX
 /** Max unsigned 64-bit value */ 
-#define XN_MAX_UINT64 18446744073709551615ULL
+#define XN_MAX_UINT64 ULLONG_MAX
 
 /** Min signed 8-bit value */ 
-#define XN_MIN_INT8 -128
+#define XN_MIN_INT8 SCHAR_MIN
 /** Min signed 16-bit value */ 
-#define XN_MIN_INT16 -32768
+#define XN_MIN_INT16 SHRT_MIN
 /** Min signed 32-bit value */ 
-#define XN_MIN_INT32 -2147483648
+#define XN_MIN_INT32 INT_MIN
 /** Min signed 64-bit value */ 
-#define XN_MIN_INT64 -9223372036854775808LL
+#define XN_MIN_INT64 LLONG_MIN
 
 /** Max signed 8-bit value */ 
-#define XN_MAX_INT8 127
+#define XN_MAX_INT8 SCHAR_MAX
 /** Max signed 16-bit value */ 
-#define XN_MAX_INT16 32767
+#define XN_MAX_INT16 SHRT_MAX
 /** Max signed 32-bit value */ 
-#define XN_MAX_INT32 2147483647
+#define XN_MAX_INT32 INT_MAX
 /** Max signed 64-bit value */ 
-#define XN_MAX_INT64 9223372036854775807LL
+#define XN_MAX_INT64 LLONG_MAX
 
 //---------------------------------------------------------------------------
 // Memory
@@ -175,7 +176,13 @@ typedef size_t				XnSizeT;
 #define XN_API_IMPORT 
 
 /** Indicates a deprecated function */
-#define XN_API_DEPRECATED(msg) __attribute__((deprecated))
+#define XN_API_DEPRECATED(msg) __attribute__((warning("This function is deprecated: " msg)))
+
+#define XN_DEPRECATED_WARNING_IDS			
+#define XN_HIDES_PARENT_METHOD_WARNING_ID	
+#define XN_CONDITION_IS_CONST_WARNING_ID
+#define XN_PRAGMA_START_DISABLED_WARNING_SECTION(warnings)
+#define XN_PRAGMA_STOP_DISABLED_WARNING_SECTION
 
 /** Declares a global shared library export function. */ 
 #define XN_API_EXPORT_INIT()
diff --git a/Include/MacOSX/XnPlatformMacOSX.h b/Include/MacOSX/XnPlatformMacOSX.h
index 7eeee4d..d8ee9a3 100644
--- a/Include/MacOSX/XnPlatformMacOSX.h
+++ b/Include/MacOSX/XnPlatformMacOSX.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/Win32/XnOSWin32.h b/Include/Win32/XnOSWin32.h
index ac383e5..8a717a1 100644
--- a/Include/Win32/XnOSWin32.h
+++ b/Include/Win32/XnOSWin32.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -23,36 +23,9 @@
 #define __XN_OS_WIN32_H__
 
 //---------------------------------------------------------------------------
-// Prerequisites
-//---------------------------------------------------------------------------
-#ifndef WINVER						// Allow use of features specific to Windows XP or later
-#define WINVER 0x0501
-#endif
-#ifndef _WIN32_WINNT				// Allow use of features specific to Windows XP or later
-#define _WIN32_WINNT 0x0501
-#endif						
-#ifndef _WIN32_WINDOWS				// Allow use of features specific to Windows 98 or later
-#define _WIN32_WINDOWS 0x0410
-#endif
-#ifndef _WIN32_IE					// Allow use of features specific to IE 6.0 or later
-#define _WIN32_IE 0x0600
-#endif
-#define WIN32_LEAN_AND_MEAN			// Exclude rarely-used stuff from Windows headers
-
-#define _CRT_SECURE_NO_DEPRECATE 1	// Undeprecate CRT functions
-
-//---------------------------------------------------------------------------
 // Includes
 //---------------------------------------------------------------------------
-#include <windows.h>
-#include <time.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <malloc.h>
-#include <io.h>
-#include <assert.h>
-#include <float.h>
-#include <crtdbg.h>
+#include <XnPlatform.h>
 
 //---------------------------------------------------------------------------
 // Files
diff --git a/Include/Win32/XnPlatformWin32.h b/Include/Win32/XnPlatformWin32.h
index b75be14..28e4bc0 100644
--- a/Include/Win32/XnPlatformWin32.h
+++ b/Include/Win32/XnPlatformWin32.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -26,20 +26,23 @@
 // Prerequisites
 //---------------------------------------------------------------------------
 #ifndef WINVER						// Allow use of features specific to Windows XP or later
-#define WINVER 0x0501
+	#define WINVER 0x0501
 #endif
 #ifndef _WIN32_WINNT				// Allow use of features specific to Windows XP or later
-#define _WIN32_WINNT 0x0501
+	#define _WIN32_WINNT 0x0501
 #endif						
 #ifndef _WIN32_WINDOWS				// Allow use of features specific to Windows 98 or later
-#define _WIN32_WINDOWS 0x0410
+	#define _WIN32_WINDOWS 0x0410
 #endif
 #ifndef _WIN32_IE					// Allow use of features specific to IE 6.0 or later
-#define _WIN32_IE 0x0600
+	#define _WIN32_IE 0x0600
 #endif
 #define WIN32_LEAN_AND_MEAN			// Exclude rarely-used stuff from Windows headers
 
-#define _CRT_SECURE_NO_DEPRECATE 1	// Undeprecate CRT functions
+// Undeprecate CRT functions
+#ifndef _CRT_SECURE_NO_DEPRECATE 
+	#define _CRT_SECURE_NO_DEPRECATE 1
+#endif
 
 //---------------------------------------------------------------------------
 // Includes
@@ -124,31 +127,31 @@ typedef FARPROC				XnFarProc;
 typedef size_t				XnSizeT;
 
 /** Max unsigned 8-bit value */ 
-#define XN_MAX_UINT8 255
+#define XN_MAX_UINT8 _UI8_MAX
 /** Max unsigned 16-bit value */ 
-#define XN_MAX_UINT16 65535
+#define XN_MAX_UINT16 _UI16_MAX
 /** Max unsigned 32-bit value */ 
-#define XN_MAX_UINT32 4294967295
+#define XN_MAX_UINT32 _UI32_MAX
 /** Max unsigned 64-bit value */ 
-#define XN_MAX_UINT64 18446744073709551615
+#define XN_MAX_UINT64 _UI64_MAX
 
 /** Min signed 8-bit value */ 
-#define XN_MIN_INT8 -127
+#define XN_MIN_INT8 _I8_MIN
 /** Min signed 16-bit value */ 
-#define XN_MIN_INT16 -32767
+#define XN_MIN_INT16 _I16_MIN
 /** Min signed 32-bit value */ 
-#define XN_MIN_INT32 -2147483647
+#define XN_MIN_INT32 _I32_MIN
 /** Min signed 64-bit value */ 
-#define XN_MIN_INT64 -9223372036854775807
+#define XN_MIN_INT64 _I64_MIN
 
 /** Max signed 8-bit value */ 
-#define XN_MAX_INT8 127
+#define XN_MAX_INT8 _I8_MAX
 /** Max signed 16-bit value */ 
-#define XN_MAX_INT16 32767
+#define XN_MAX_INT16 _I16_MAX
 /** Max signed 32-bit value */ 
-#define XN_MAX_INT32 2147483647
+#define XN_MAX_INT32 _I32_MAX
 /** Max signed 64-bit value */ 
-#define XN_MAX_INT64 9223372036854775807
+#define XN_MAX_INT64 _I64_MAX
 
 /** Min double value */
 #define XN_MIN_DOUBLE DBL_MIN 
@@ -212,11 +215,24 @@ typedef size_t				XnSizeT;
 #endif
 
 #ifdef __INTEL_COMPILER
-	#define XN_DEPRECATED_WARNING_IDS	1786
+	#define XN_DEPRECATED_WARNING_IDS			1786
+	#define XN_HIDES_PARENT_METHOD_WARNING_ID	1125
+	#define XN_CONDITION_IS_CONST_WARNING_ID	
 #else
-	#define XN_DEPRECATED_WARNING_IDS	4995 4996
+	#define XN_DEPRECATED_WARNING_IDS			4995 4996
+	#define XN_HIDES_PARENT_METHOD_WARNING_ID	
+	#define XN_CONDITION_IS_CONST_WARNING_ID	4127
 #endif
 
+#define XN_PRAGMA_START_DISABLED_WARNING_SECTION(warnings)			\
+	__pragma(warning(push))											\
+	__pragma(warning(disable:XN_HIDES_PARENT_METHOD_WARNING_ID))
+
+#define XN_PRAGMA_STOP_DISABLED_WARNING_SECTION						\
+	__pragma(warning(pop))
+
+	
+
 /** Declares a global shared library export function. */ 
 #define XN_API_EXPORT_INIT()															\
 	BOOL APIENTRY DllMain (HMODULE /*hModule*/, DWORD nReasonForCall, LPVOID /*lpReserved*/)	\
diff --git a/Include/Win32/usb100.h b/Include/Win32/usb100.h
new file mode 100644
index 0000000..e6a9010
--- /dev/null
+++ b/Include/Win32/usb100.h
@@ -0,0 +1,270 @@
+#ifndef   __USB100_H__
+#define   __USB100_H__
+
+
+#include <PSHPACK1.H>
+
+
+//bmRequest.Dir
+#define BMREQUEST_HOST_TO_DEVICE        0
+#define BMREQUEST_DEVICE_TO_HOST        1
+
+//bmRequest.Type
+#define BMREQUEST_STANDARD              0
+#define BMREQUEST_CLASS                 1
+#define BMREQUEST_VENDOR                2
+
+//bmRequest.Recipient
+#define BMREQUEST_TO_DEVICE             0
+#define BMREQUEST_TO_INTERFACE          1
+#define BMREQUEST_TO_ENDPOINT           2
+#define BMREQUEST_TO_OTHER              3
+
+
+#define MAXIMUM_USB_STRING_LENGTH 255
+
+// values for the bits returned by the USB GET_STATUS command
+#define USB_GETSTATUS_SELF_POWERED                0x01
+#define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED       0x02
+
+
+#define USB_DEVICE_DESCRIPTOR_TYPE                0x01
+#define USB_CONFIGURATION_DESCRIPTOR_TYPE         0x02
+#define USB_STRING_DESCRIPTOR_TYPE                0x03
+#define USB_INTERFACE_DESCRIPTOR_TYPE             0x04
+#define USB_ENDPOINT_DESCRIPTOR_TYPE              0x05
+
+// descriptor types defined by DWG documents
+#define USB_RESERVED_DESCRIPTOR_TYPE              0x06
+#define USB_CONFIG_POWER_DESCRIPTOR_TYPE          0x07
+#define USB_INTERFACE_POWER_DESCRIPTOR_TYPE       0x08
+
+#define USB_DESCRIPTOR_MAKE_TYPE_AND_INDEX(d, i) ((USHORT)((USHORT)d<<8 | i))
+
+//
+// Values for bmAttributes field of an
+// endpoint descriptor
+//
+
+#define USB_ENDPOINT_TYPE_MASK                    0x03
+
+#define USB_ENDPOINT_TYPE_CONTROL                 0x00
+#define USB_ENDPOINT_TYPE_ISOCHRONOUS             0x01
+#define USB_ENDPOINT_TYPE_BULK                    0x02
+#define USB_ENDPOINT_TYPE_INTERRUPT               0x03
+
+
+//
+// definitions for bits in the bmAttributes field of a 
+// configuration descriptor.
+//
+#define USB_CONFIG_POWERED_MASK                   0xc0
+
+#define USB_CONFIG_BUS_POWERED                    0x80
+#define USB_CONFIG_SELF_POWERED                   0x40
+#define USB_CONFIG_REMOTE_WAKEUP                  0x20
+
+//
+// Endpoint direction bit, stored in address
+//
+
+#define USB_ENDPOINT_DIRECTION_MASK               0x80
+
+// test direction bit in the bEndpointAddress field of
+// an endpoint descriptor.
+#define USB_ENDPOINT_DIRECTION_OUT(addr)          (!((addr) & USB_ENDPOINT_DIRECTION_MASK))
+#define USB_ENDPOINT_DIRECTION_IN(addr)           ((addr) & USB_ENDPOINT_DIRECTION_MASK)
+
+//
+// USB defined request codes
+// see chapter 9 of the USB 1.0 specifcation for
+// more information.
+//
+
+// These are the correct values based on the USB 1.0
+// specification
+
+#define USB_REQUEST_GET_STATUS                    0x00
+#define USB_REQUEST_CLEAR_FEATURE                 0x01
+
+#define USB_REQUEST_SET_FEATURE                   0x03
+
+#define USB_REQUEST_SET_ADDRESS                   0x05
+#define USB_REQUEST_GET_DESCRIPTOR                0x06
+#define USB_REQUEST_SET_DESCRIPTOR                0x07
+#define USB_REQUEST_GET_CONFIGURATION             0x08
+#define USB_REQUEST_SET_CONFIGURATION             0x09
+#define USB_REQUEST_GET_INTERFACE                 0x0A
+#define USB_REQUEST_SET_INTERFACE                 0x0B
+#define USB_REQUEST_SYNC_FRAME                    0x0C
+
+
+//
+// defined USB device classes
+//
+
+
+#define USB_DEVICE_CLASS_RESERVED           0x00
+#define USB_DEVICE_CLASS_AUDIO              0x01
+#define USB_DEVICE_CLASS_COMMUNICATIONS     0x02
+#define USB_DEVICE_CLASS_HUMAN_INTERFACE    0x03
+#define USB_DEVICE_CLASS_MONITOR            0x04
+#define USB_DEVICE_CLASS_PHYSICAL_INTERFACE 0x05
+#define USB_DEVICE_CLASS_POWER              0x06
+#define USB_DEVICE_CLASS_PRINTER            0x07
+#define USB_DEVICE_CLASS_STORAGE            0x08
+#define USB_DEVICE_CLASS_HUB                0x09
+#define USB_DEVICE_CLASS_VENDOR_SPECIFIC    0xFF
+
+//
+// USB Core defined Feature selectors
+//
+
+#define USB_FEATURE_ENDPOINT_STALL          0x0000
+#define USB_FEATURE_REMOTE_WAKEUP           0x0001
+
+//
+// USB DWG defined Feature selectors
+//
+
+#define USB_FEATURE_INTERFACE_POWER_D0      0x0002
+#define USB_FEATURE_INTERFACE_POWER_D1      0x0003
+#define USB_FEATURE_INTERFACE_POWER_D2      0x0004
+#define USB_FEATURE_INTERFACE_POWER_D3      0x0005
+
+typedef struct _USB_DEVICE_DESCRIPTOR {
+    UCHAR bLength;
+    UCHAR bDescriptorType;
+    USHORT bcdUSB;
+    UCHAR bDeviceClass;
+    UCHAR bDeviceSubClass;
+    UCHAR bDeviceProtocol;
+    UCHAR bMaxPacketSize0;
+    USHORT idVendor;
+    USHORT idProduct;
+    USHORT bcdDevice;
+    UCHAR iManufacturer;
+    UCHAR iProduct;
+    UCHAR iSerialNumber;
+    UCHAR bNumConfigurations;
+} USB_DEVICE_DESCRIPTOR, *PUSB_DEVICE_DESCRIPTOR;
+
+typedef struct _USB_ENDPOINT_DESCRIPTOR {
+    UCHAR bLength;
+    UCHAR bDescriptorType;
+    UCHAR bEndpointAddress;
+    UCHAR bmAttributes;
+    USHORT wMaxPacketSize;
+    UCHAR bInterval;
+} USB_ENDPOINT_DESCRIPTOR, *PUSB_ENDPOINT_DESCRIPTOR;
+
+typedef struct _USB_CONFIGURATION_DESCRIPTOR {
+    UCHAR bLength;
+    UCHAR bDescriptorType;
+    USHORT wTotalLength;
+    UCHAR bNumInterfaces;
+    UCHAR bConfigurationValue;
+    UCHAR iConfiguration;
+    UCHAR bmAttributes;
+    UCHAR MaxPower;
+} USB_CONFIGURATION_DESCRIPTOR, *PUSB_CONFIGURATION_DESCRIPTOR;
+
+typedef struct _USB_INTERFACE_DESCRIPTOR {
+    UCHAR bLength;
+    UCHAR bDescriptorType;
+    UCHAR bInterfaceNumber;
+    UCHAR bAlternateSetting;
+    UCHAR bNumEndpoints;
+    UCHAR bInterfaceClass;
+    UCHAR bInterfaceSubClass;
+    UCHAR bInterfaceProtocol;
+    UCHAR iInterface;
+} USB_INTERFACE_DESCRIPTOR, *PUSB_INTERFACE_DESCRIPTOR;
+
+typedef struct _USB_STRING_DESCRIPTOR {
+    UCHAR bLength;
+    UCHAR bDescriptorType;
+    WCHAR bString[1];
+} USB_STRING_DESCRIPTOR, *PUSB_STRING_DESCRIPTOR;
+
+typedef struct _USB_COMMON_DESCRIPTOR {
+    UCHAR bLength;
+    UCHAR bDescriptorType;
+} USB_COMMON_DESCRIPTOR, *PUSB_COMMON_DESCRIPTOR;
+
+
+//
+// Standard USB HUB definitions 
+//
+// See Chapter 11 USB core specification
+//
+
+typedef struct _USB_HUB_DESCRIPTOR {
+    UCHAR        bDescriptorLength;      // Length of this descriptor
+    UCHAR        bDescriptorType;        // Hub configuration type
+    UCHAR        bNumberOfPorts;         // number of ports on this hub
+    USHORT       wHubCharacteristics;    // Hub Charateristics
+    UCHAR        bPowerOnToPowerGood;    // port power on till power good in 2ms
+    UCHAR        bHubControlCurrent;     // max current in mA
+    //
+    // room for 255 ports power control and removable bitmask
+    UCHAR        bRemoveAndPowerMask[64];       
+} USB_HUB_DESCRIPTOR, *PUSB_HUB_DESCRIPTOR;
+
+
+//
+// Structures defined by various DWG feature documents
+//
+
+
+//
+// See DWG USB Feature Specification: Interface Power Management
+//
+
+#define USB_SUPPORT_D0_COMMAND      0x01
+#define USB_SUPPORT_D1_COMMAND      0x02
+#define USB_SUPPORT_D2_COMMAND      0x04
+#define USB_SUPPORT_D3_COMMAND      0x08
+
+#define USB_SUPPORT_D1_WAKEUP       0x10
+#define USB_SUPPORT_D2_WAKEUP       0x20
+
+
+typedef struct _USB_CONFIGURATION_POWER_DESCRIPTOR {
+    UCHAR bLength;
+    UCHAR bDescriptorType;
+    UCHAR SelfPowerConsumedD0[3];
+    UCHAR bPowerSummaryId;
+    UCHAR bBusPowerSavingD1;
+    UCHAR bSelfPowerSavingD1;
+    UCHAR bBusPowerSavingD2;
+    UCHAR bSelfPowerSavingD2; 
+    UCHAR bBusPowerSavingD3;
+    UCHAR bSelfPowerSavingD3; 
+    USHORT TransitionTimeFromD1;
+    USHORT TransitionTimeFromD2;
+    USHORT TransitionTimeFromD3;
+} USB_CONFIGURATION_POWER_DESCRIPTOR, *PUSB_CONFIGURATION_POWER_DESCRIPTOR;
+
+
+typedef struct _USB_INTERFACE_POWER_DESCRIPTOR {
+    UCHAR bLength;
+    UCHAR bDescriptorType;
+    UCHAR bmCapabilitiesFlags;
+    UCHAR bBusPowerSavingD1;
+    UCHAR bSelfPowerSavingD1;
+    UCHAR bBusPowerSavingD2;
+    UCHAR bSelfPowerSavingD2; 
+    UCHAR bBusPowerSavingD3;
+    UCHAR bSelfPowerSavingD3; 
+    USHORT TransitionTimeFromD1;
+    USHORT TransitionTimeFromD2;
+    USHORT TransitionTimeFromD3;
+} USB_INTERFACE_POWER_DESCRIPTOR, *PUSB_INTERFACE_POWER_DESCRIPTOR;
+
+
+#include <POPPACK.H>
+
+
+#endif   /* __USB100_H__ */
+
diff --git a/Include/XnAlgorithms.h b/Include/XnAlgorithms.h
index 1cc5f5b..18a6f33 100644
--- a/Include/XnAlgorithms.h
+++ b/Include/XnAlgorithms.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnArray.h b/Include/XnArray.h
index 88a09d0..5571a36 100644
--- a/Include/XnArray.h
+++ b/Include/XnArray.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -43,9 +43,9 @@ public:
 	typedef const T* ConstIterator;
 
 	/** Default constructor. Initializes the array to BASE_SIZE. **/
-	XnArray()
+	XnArray(XnUInt32 nBaseSize = BASE_SIZE)
 	{
-		Init();
+		Init(nBaseSize);
 	}
 
 	/** Copy constructor. Initializes this array from another array of the same type. **/
@@ -273,13 +273,13 @@ public:
 		return m_pData[nIndex];
 	}
 
-	/** @returns a modifiable itertor pointing to the beginning of this array. **/
+	/** @returns a modifiable iterator pointing to the beginning of this array. **/
 	Iterator begin()
 	{
 		return &m_pData[0];
 	}
 
-	/** @returns a const itertor pointing to the beginning of this array. **/
+	/** @returns a const iterator pointing to the beginning of this array. **/
 	ConstIterator begin() const
 	{
 		return &m_pData[0];
@@ -298,10 +298,10 @@ public:
 	}
 
 private:
-	void Init()
+	void Init(XnUInt32 nBaseSize = BASE_SIZE)
 	{
-		m_pData = XN_NEW_ARR(T, BASE_SIZE);
-		m_nAllocatedSize = BASE_SIZE;
+		m_pData = XN_NEW_ARR(T, nBaseSize);
+		m_nAllocatedSize = nBaseSize;
 		m_nSize = 0;
 	}
 
diff --git a/Include/XnBaseNode.h b/Include/XnBaseNode.h
index f2520f7..348d332 100644
--- a/Include/XnBaseNode.h
+++ b/Include/XnBaseNode.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -48,12 +48,12 @@ typedef struct XnBaseNode
 /**
  * Provide an available xnBaseNode from the node pool.
  */ 
-XN_C_API XnBaseNode* xnAllocateBaseNode();
+XN_C_API XnBaseNode* XN_C_DECL xnAllocateBaseNode();
 
 /**
  * Release an xnBaseNode to the node pool.
  * @param	pNode	[in]	The base node to return to the pool.
  */ 
-XN_C_API void xnDeallocateBaseNode(XnBaseNode* pNode);
+XN_C_API void XN_C_DECL xnDeallocateBaseNode(XnBaseNode* pNode);
 
 #endif //_NINODEALLOC_H
diff --git a/Include/XnBitSet.h b/Include/XnBitSet.h
index 52f0ae3..7b25e1a 100644
--- a/Include/XnBitSet.h
+++ b/Include/XnBitSet.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -75,6 +75,21 @@ public:
 		return XN_STATUS_OK;
 	}
 
+	/** Copies raw data from a buffer of bytes to this bitset. **/
+	XnStatus SetDataBytes(const XnUInt8* pData, XnUInt32 nSizeInBytes)
+	{
+		//XnStatus nRetVal = m_array.SetData(reinterpret_cast<const XnUInt32*>(pData), XN_MAX(1, nSizeInBytes >> 2));
+		XnUInt32 nSizeInDwords = XN_MAX(1, nSizeInBytes >> 2);
+		XnStatus nRetVal = m_array.SetSize(nSizeInDwords);
+		XN_IS_STATUS_OK(nRetVal);
+		for (XnUInt32 nDwordIdx = 0, nByteIdx = 0; nDwordIdx < nSizeInDwords; nDwordIdx++, nByteIdx += 4)
+		{
+			m_array[nDwordIdx] = ((pData[nByteIdx] << 24) | (pData[nByteIdx + 1] << 16) | (pData[nByteIdx + 2] << 8) | pData[nByteIdx + 3] );
+		}
+		m_nSize = (nSizeInBytes << 3);
+		return XN_STATUS_OK;
+	}
+
 	/** @returns The raw data of this bitset as a buffer of dwords. **/
 	const XnUInt32* GetData() const
 	{
diff --git a/Include/XnCallback.h b/Include/XnCallback.h
index f96df9d..a627bee 100644
--- a/Include/XnCallback.h
+++ b/Include/XnCallback.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnCodecIDs.h b/Include/XnCodecIDs.h
index 6dfe26c..6b202bb 100644
--- a/Include/XnCodecIDs.h
+++ b/Include/XnCodecIDs.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnContext.h b/Include/XnContext.h
index 082dce7..1106df9 100644
--- a/Include/XnContext.h
+++ b/Include/XnContext.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -98,50 +98,145 @@ xnNodeInfoListFree(pNodesList);
  *
  * @param	ppContext	[out]	Output location for context pointer.
  */
-XN_C_API XnStatus xnInit(XnContext** ppContext);
+XN_C_API XnStatus XN_C_DECL xnInit(XnContext** ppContext);
 
 /**
  * @brief Runs an XML script in the given context.
  *
+ * @param	pContext		[in]		The context to be configured.
+ * @param	strFileName		[in]		The name of the file containing the script. for a full description of the XML structure, see @ref xmlscripts.
+ * @param	pErrors			[in/out]	Optional. If provided, will be filled with enumeration errors.
+ * @param	phScriptNode	[out]		Handle to a node holding all the nodes created from the script. When no longer
+ *										needed, the node can be released, causing all those nodes to dec ref.
+ */
+XN_C_API XnStatus XN_C_DECL xnContextRunXmlScriptFromFileEx(XnContext* pContext, const XnChar* strFileName, XnEnumerationErrors* pErrors, XnNodeHandle* phScriptNode);
+
+/**
+ * @brief Runs an XML script in the given context.
+ * NOTE: when using this function, the context will be the owner of the created nodes, so those nodes and
+ * the context will only be destroyed if calling @ref xnShutdown(). It is highly suggested to use
+ * @ref xnContextRunXmlScriptFromFileEx() instead, which returns a node referencing created nodes, making the caller
+ * owner of those nodes.
+ *
  * @param	pContext	[in]		The context to be configured.
  * @param	strFileName	[in]		The name of the file containing the script. for a full description of the XML structure, see @ref xmlscripts.
  * @param	pErrors		[in/out]	Optional. If provided, will be filled with enumeration errors.
  */
-XN_C_API XnStatus xnContextRunXmlScriptFromFile(XnContext* pContext, const XnChar* strFileName, XnEnumerationErrors* pErrors);
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnContextRunXmlScriptFromFileEx() instead") xnContextRunXmlScriptFromFile(XnContext* pContext, const XnChar* strFileName, XnEnumerationErrors* pErrors);
+
+/**
+ * @brief Runs an XML script in the given context.
+ *
+ * @param	pContext		[in]		The context.
+ * @param	xmlScript		[in]		A string representation of the XML script. for a full description of the XML structure, see @ref xmlscripts.
+ * @param	pErrors			[in/out]	Optional. If provided, will be filled with enumeration errors.
+ * @param	phScriptNode	[out]		Handle to a node holding all the nodes created from the script. When no longer
+ *										needed, the node can be released, causing all those nodes to dec ref.
+ */
+XN_C_API XnStatus XN_C_DECL xnContextRunXmlScriptEx(XnContext* pContext, const XnChar* xmlScript, XnEnumerationErrors* pErrors, XnNodeHandle* phScriptNode);
 
 /**
  * @brief Runs an XML script in the given context.
+ * NOTE: when using this function, the context will be the owner of the created nodes, so those nodes and
+ * the context will only be destroyed if calling @ref xnShutdown(). It is highly suggested to use
+ * @ref xnContextRunXmlScriptEx() instead, which returns a node referencing created nodes, making the caller
+ * owner of those nodes.
  *
  * @param	pContext	[in]		The context.
  * @param	xmlScript	[in]		A string representation of the XML script. for a full description of the XML structure, see @ref xmlscripts.
  * @param	pErrors		[in/out]	Optional. If provided, will be filled with enumeration errors.
  */
-XN_C_API XnStatus xnContextRunXmlScript(XnContext* pContext, const XnChar* xmlScript, XnEnumerationErrors* pErrors);
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnContextRunXmlScriptEx() instead") XN_C_DECL xnContextRunXmlScript(XnContext* pContext, const XnChar* xmlScript, XnEnumerationErrors* pErrors);
 
 /**
  * @brief Initializes OpenNI context, and then configures it using the given file.
  *
+ * @param	strFileName		[in]		The name of the file to read configuration from.
+ * @param	ppContext		[out]		Output location for context pointer.
+ * @param	pErrors			[in/out]	Optional. If provided, will be filled with enumeration errors.
+ * @param	phScriptNode	[out]		Handle to a node holding all the nodes created from the script. When no longer
+ *										needed, the node can be released, causing all those nodes to dec ref.
+ */
+XN_C_API XnStatus XN_C_DECL xnInitFromXmlFileEx(const XnChar* strFileName, XnContext** ppContext, XnEnumerationErrors* pErrors, XnNodeHandle* phScriptNode);
+
+/**
+ * @brief Initializes OpenNI context, and then configures it using the given file.
+ * NOTE: when using this function, the context will be the owner of the created nodes, so those nodes and
+ * the context will only be destroyed if calling @ref xnShutdown(). It is highly suggested to use
+ * @ref xnInitFromXmlFileEx() instead, which returns a node referencing created nodes, making the caller
+ * owner of those nodes.
+ *
  * @param	strFileName	[in]		The name of the file to read configuration from.
  * @param	ppContext	[out]		Output location for context pointer.
  * @param	pErrors		[in/out]	Optional. If provided, will be filled with enumeration errors.
  */
-XN_C_API XnStatus xnInitFromXmlFile(const XnChar* strFileName, XnContext** ppContext, XnEnumerationErrors* pErrors);
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnInitFromXmlFileEx() instead") XN_C_DECL xnInitFromXmlFile(const XnChar* strFileName, XnContext** ppContext, XnEnumerationErrors* pErrors);
 
 /**
  * @brief Opens a recording file, adding all nodes in it to the context.
  *
+ * @param	pContext		[in]	The context.
+ * @param	strFileName		[in]	The file to open.
+ * @param	phPlayerNode	[out]	The created player node.
+ */
+XN_C_API XnStatus XN_C_DECL xnContextOpenFileRecordingEx(XnContext* pContext, const XnChar* strFileName, XnNodeHandle* phPlayerNode);
+
+/**
+ * @brief Opens a recording file, adding all nodes in it to the context.
+ * NOTE: when using this function, the context will be the owner of the created player node, so this nodes and
+ * the context will only be destroyed if calling @ref xnShutdown(). It is highly suggested to use
+ * @ref xnContextOpenFileRecordingEx() instead, which returns the player node, making the caller
+ * owner of this node.
+ *
  * @param	pContext	[in]	The context.
  * @param	strFileName	[in]	The file to open.
  */
-XN_C_API XnStatus xnContextOpenFileRecording(XnContext* pContext, const XnChar* strFileName);
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnContextOpenFileRecordingEx() instead") XN_C_DECL xnContextOpenFileRecording(XnContext* pContext, const XnChar* strFileName);
+
+/**
+ * @brief Adds a reference to the context object.
+ *
+ * @param	pContext	[in]	The context.
+ */
+XN_C_API XnStatus XN_C_DECL xnContextAddRef(XnContext* pContext);
+
+/**
+ * @brief Releases a context object, decreasing its ref count by 1. If reference count has reached 0,
+ * the context will be destroyed.
+ *
+ * @param	pContext	[in]	The context.
+ */
+XN_C_API void XN_C_DECL xnContextRelease(XnContext* pContext);
+
+/**
+ * @brief Shuts down an OpenNI context, destroying all its nodes. Do not call any function of this
+ * context or any correlated node after calling this method.
+ * NOTE: this function destroys the context and all the nodes it holds and so should be used very carefully.
+ * Normally you should just call @ref xnContextRelease()
+ *
+ * @param	pContext	[in]	The context to be destroyed.
+ */
+XN_C_API void XN_API_DEPRECATED("Use xnContextRelease() instead") XN_C_DECL xnShutdown(XnContext* pContext);
 
 /**
- * @brief Shuts down the OpenNI library. No other OpenNI function can be called after calling this
- * function.
+ * @brief Forces a context to shutdown, destroying all nodes. This function is used for backwards compatibility
+ * and should not be called by any client. Please use @ref xnContextRelease() instead.
  *
  * @param	pContext	[in]	The context to be destroyed.
  */
-XN_C_API void xnShutdown(XnContext* pContext);
+XN_C_API void XN_C_DECL xnForceShutdown(XnContext* pContext);
+
+/**
+ * @brief Registers for context shutting down event. This function is used for backwards compatibility and 
+ * should not be called by any client.
+ */
+XN_C_API XnStatus XN_C_DECL xnContextRegisterForShutdown(XnContext* pContext, XnContextShuttingDownHandler pHandler, void* pCookie, XnCallbackHandle* phCallback);
+
+/**
+ * @brief Unregisters from context shutting down event. This function is used for backwards compatibility and 
+ * should not be called by any client.
+ */
+XN_C_API void XN_C_DECL xnContextUnregisterFromShutdown(XnContext* pContext, XnCallbackHandle hCallback);
 
 // @}
 
@@ -160,7 +255,7 @@ XN_C_API void xnShutdown(XnContext* pContext);
  * @param	ppTreesList		[out]		A list of possible production trees.
  * @param	pErrors			[in/out]	Optional. If provided, will be filled with enumeration errors.
  */
-XN_C_API XnStatus xnEnumerateProductionTrees(
+XN_C_API XnStatus XN_C_DECL xnEnumerateProductionTrees(
 	XnContext* pContext,
 	XnProductionNodeType Type, 
 	const XnNodeQuery* pQuery,
@@ -176,7 +271,7 @@ XN_C_API XnStatus xnEnumerateProductionTrees(
  * @param	pTree			[in]		A production tree to create.
  * @param	phNode			[out]		A handle to the newly created node.
  */
-XN_C_API XnStatus xnCreateProductionTree(
+XN_C_API XnStatus XN_C_DECL xnCreateProductionTree(
 	 XnContext* pContext,
 	 XnNodeInfo* pTree,
 	 XnNodeHandle* phNode
@@ -193,7 +288,7 @@ XN_C_API XnStatus xnCreateProductionTree(
  * @param	phNode			[out]		A handle to the newly created node.
  * @param	pErrors			[in/out]	Optional. If provided, will be filled with enumeration errors.
  */
-XN_C_API XnStatus xnCreateAnyProductionTree(
+XN_C_API XnStatus XN_C_DECL xnCreateAnyProductionTree(
 	XnContext* pContext,
 	XnProductionNodeType type,
 	XnNodeQuery* pQuery,
@@ -212,7 +307,7 @@ XN_C_API XnStatus xnCreateAnyProductionTree(
  * @param	strName			[in]		Optional. The name of the node. If NULL is provided, a name will be automatically generated.
  * @param	phNode			[out]		A handle to the newly created node.
  */
-XN_C_API XnStatus xnCreateMockNode(
+XN_C_API XnStatus XN_C_DECL xnCreateMockNode(
 	XnContext* pContext, 
 	XnProductionNodeType type,
 	const XnChar* strName,
@@ -230,7 +325,7 @@ XN_C_API XnStatus xnCreateMockNode(
  * @param	strName			[in]		The name of the node. If set to NULL, a name will be generated based on the name of hOriginalNode.
  * @param	phMockNode		[out]		A handle to the newly created mock node.
  */
-XN_C_API XnStatus xnCreateMockNodeBasedOn(
+XN_C_API XnStatus XN_C_DECL xnCreateMockNodeBasedOn(
 	XnContext* pContext,
 	XnNodeHandle hOriginalNode,
 	const XnChar* strName,
@@ -242,7 +337,7 @@ XN_C_API XnStatus xnCreateMockNodeBasedOn(
  *
  * @param	hNode	[in]	A handle to the node.
  */
-XN_C_API XnStatus xnProductionNodeAddRef(XnNodeHandle hNode);
+XN_C_API XnStatus XN_C_DECL xnProductionNodeAddRef(XnNodeHandle hNode);
 
 /**
  * References a production node, increasing its reference count by 1.
@@ -250,7 +345,7 @@ XN_C_API XnStatus xnProductionNodeAddRef(XnNodeHandle hNode);
  *
  * @param	hNode	[in]	A handle to the node.
  */
-XN_C_API XnStatus XN_API_DEPRECATED("Please use xnProductionNodeAddRef() instead.") xnRefProductionNode(XnNodeHandle hNode);
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnProductionNodeAddRef() instead.") XN_C_DECL xnRefProductionNode(XnNodeHandle hNode);
 
 /**
  * @brief Unreference a production node, decreasing its reference count by 1. If the reference count reaches zero,
@@ -258,7 +353,7 @@ XN_C_API XnStatus XN_API_DEPRECATED("Please use xnProductionNodeAddRef() instead
  *
  * @param	hNode	[in]	A handle to the node.
  */
-XN_C_API void xnProductionNodeRelease(XnNodeHandle hNode);
+XN_C_API void XN_C_DECL xnProductionNodeRelease(XnNodeHandle hNode);
 
 /**
  * Unreference a production node, decreasing its reference count by 1. If the reference count reaches zero,
@@ -267,7 +362,7 @@ XN_C_API void xnProductionNodeRelease(XnNodeHandle hNode);
  *
  * @param	hNode	[in]	A handle to the node.
  */
-XN_C_API void XN_API_DEPRECATED("Please use xnProductionNodeRelease() instead.") xnUnrefProductionNode(XnNodeHandle hNode);
+XN_C_API void XN_API_DEPRECATED("Please use xnProductionNodeRelease() instead.") XN_C_DECL xnUnrefProductionNode(XnNodeHandle hNode);
 
 /**
  * @brief Gets a list of all existing node in the context. Each node that was returned increases its ref count.
@@ -276,7 +371,7 @@ XN_C_API void XN_API_DEPRECATED("Please use xnProductionNodeRelease() instead.")
  * @param	pContext	[in]	OpenNI context.
  * @param	ppList		[out]	A linked list of current existing nodes
  */
-XN_C_API XnStatus xnEnumerateExistingNodes(XnContext* pContext, XnNodeInfoList** ppList);
+XN_C_API XnStatus XN_C_DECL xnEnumerateExistingNodes(XnContext* pContext, XnNodeInfoList** ppList);
 
 /**
  * @brief Gets a list of all existing node in the context. Each node that was returned increases its ref count.
@@ -286,7 +381,7 @@ XN_C_API XnStatus xnEnumerateExistingNodes(XnContext* pContext, XnNodeInfoList**
  * @param	type		[in]	Type to look for.
  * @param	ppList		[out]	A linked list of current existing nodes
  */
-XN_C_API XnStatus xnEnumerateExistingNodesByType(XnContext* pContext, XnProductionNodeType type, XnNodeInfoList** ppList);
+XN_C_API XnStatus XN_C_DECL xnEnumerateExistingNodesByType(XnContext* pContext, XnProductionNodeType type, XnNodeInfoList** ppList);
 
 /**
  * @brief Returns the first found existing node of the specified type.
@@ -295,7 +390,13 @@ XN_C_API XnStatus xnEnumerateExistingNodesByType(XnContext* pContext, XnProducti
  * @param	type		[in]	Type to look for.
  * @param	phNode		[out]	A handle to the found node.
  */
-XN_C_API XnStatus xnFindExistingNodeByType(
+XN_C_API XnStatus XN_C_DECL xnFindExistingRefNodeByType(
+	XnContext* pContext,
+	XnProductionNodeType type,
+	XnNodeHandle* phNode
+	);
+
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnFindExistingRefNodeByType() instead") XN_C_DECL xnFindExistingNodeByType(
 	XnContext* pContext,
 	XnProductionNodeType type,
 	XnNodeHandle* phNode
@@ -310,7 +411,13 @@ XN_C_API XnStatus xnFindExistingNodeByType(
  *
  * @return XN_STATUS_BAD_NODE_NAME if node by name of strInstanceName doesn't exist.
  */
-XN_C_API XnStatus xnGetNodeHandleByName(
+XN_C_API XnStatus XN_C_DECL xnGetRefNodeHandleByName(
+	XnContext* pContext,
+	const XnChar* strInstanceName,
+	XnNodeHandle* phNode
+	);
+
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnGetRefNodeHandleByName() instead") XN_C_DECL xnGetNodeHandleByName(
 	XnContext* pContext,
 	const XnChar* strInstanceName,
 	XnNodeHandle* phNode
@@ -328,7 +435,7 @@ XN_C_API XnStatus xnGetNodeHandleByName(
  *
  * @param	pContext		[in]	OpenNI context.
  */
-XN_C_API XnStatus xnWaitAndUpdateAll(XnContext* pContext);
+XN_C_API XnStatus XN_C_DECL xnWaitAndUpdateAll(XnContext* pContext);
 
 /**
  * @brief Updates all generators nodes in the context, waiting for a specific one to have new data.
@@ -336,14 +443,14 @@ XN_C_API XnStatus xnWaitAndUpdateAll(XnContext* pContext);
  * @param	pContext		[in]	OpenNI context.
  * @param	hNode			[in]	The node to wait for.
  */
-XN_C_API XnStatus xnWaitOneUpdateAll(XnContext* pContext, XnNodeHandle hNode);
+XN_C_API XnStatus XN_C_DECL xnWaitOneUpdateAll(XnContext* pContext, XnNodeHandle hNode);
 
 /**
  * @brief Updates all generators nodes in the context, once any of them have new data.
  *
  * @param	pContext		[in]	OpenNI context.
  */
-XN_C_API XnStatus xnWaitAnyUpdateAll(XnContext* pContext);
+XN_C_API XnStatus XN_C_DECL xnWaitAnyUpdateAll(XnContext* pContext);
 
 /**
  * @brief Updates all generator nodes in the context, without any waiting. If a node has new data,
@@ -351,21 +458,21 @@ XN_C_API XnStatus xnWaitAnyUpdateAll(XnContext* pContext);
  *
  * @param	pContext		[in]	OpenNI context.
  */
-XN_C_API XnStatus xnWaitNoneUpdateAll(XnContext* pContext);
+XN_C_API XnStatus XN_C_DECL xnWaitNoneUpdateAll(XnContext* pContext);
 
 /**
  * @brief Make sure all generators are generating data.
  *
  * @param	pContext		[in]	OpenNI context.
  */
-XN_C_API XnStatus xnStartGeneratingAll(XnContext* pContext);
+XN_C_API XnStatus XN_C_DECL xnStartGeneratingAll(XnContext* pContext);
 
 /**
  * @brief Stop all generators from generating data.
  *
  * @param	pContext		[in]	OpenNI context.
  */
-XN_C_API XnStatus xnStopGeneratingAll(XnContext* pContext);
+XN_C_API XnStatus XN_C_DECL xnStopGeneratingAll(XnContext* pContext);
 
 /**
  * @brief Sets the global mirror flag. This will set all current existing nodes' mirror state, and also 
@@ -374,14 +481,14 @@ XN_C_API XnStatus xnStopGeneratingAll(XnContext* pContext);
  * @param	pContext		[in]	OpenNI context.
  * @param	bMirror			[in]	New Mirror state.
  */
-XN_C_API XnStatus xnSetGlobalMirror(XnContext* pContext, XnBool bMirror);
+XN_C_API XnStatus XN_C_DECL xnSetGlobalMirror(XnContext* pContext, XnBool bMirror);
 
 /**
  * @brief Gets the global mirror flag.
  *
  * @param	pContext		[in]	OpenNI context.
  */
-XN_C_API XnBool xnGetGlobalMirror(XnContext* pContext);
+XN_C_API XnBool XN_C_DECL xnGetGlobalMirror(XnContext* pContext);
 
 /**
  * @brief Gets the global error state of the context. If one of the nodes in the context is in error state,
@@ -390,7 +497,7 @@ XN_C_API XnBool xnGetGlobalMirror(XnContext* pContext);
  *
  * @param	pContext		[in]	OpenNI context.
  */
-XN_C_API XnStatus xnGetGlobalErrorState(XnContext* pContext);
+XN_C_API XnStatus XN_C_DECL xnGetGlobalErrorState(XnContext* pContext);
 
 /**
  * @brief Registers a callback function to global error state changes.
@@ -400,7 +507,7 @@ XN_C_API XnStatus xnGetGlobalErrorState(XnContext* pContext);
  * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
  * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromGlobalErrorStateChange().
  */
-XN_C_API XnStatus xnRegisterToGlobalErrorStateChange
+XN_C_API XnStatus XN_C_DECL xnRegisterToGlobalErrorStateChange
 	(XnContext* pContext, XnErrorStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
@@ -410,7 +517,7 @@ XN_C_API XnStatus xnRegisterToGlobalErrorStateChange
  * @param	pContext	 [in]	OpenNI context.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToGlobalErrorStateChange().
  */
-XN_C_API void xnUnregisterFromGlobalErrorStateChange
+XN_C_API void XN_C_DECL xnUnregisterFromGlobalErrorStateChange
 	(XnContext* pContext, XnCallbackHandle hCallback);
 
 /// @}
diff --git a/Include/XnCppWrapper.h b/Include/XnCppWrapper.h
index 8c2a2c1..007e13a 100644
--- a/Include/XnCppWrapper.h
+++ b/Include/XnCppWrapper.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -810,6 +810,29 @@ namespace xn
 		/// @copydoc OutputMetaData::WritableData
 		inline XnIRPixel* WritableData() { return (XnIRPixel*)MapMetaData::WritableData(); }
 
+		/**
+		 * Gets the value of the pixel
+		 *
+		 * @param	nIndex		[in]	The index of the pixel in the buffer.
+		 */
+		inline const XnIRPixel& operator[](XnUInt32 nIndex) const 
+		{ 
+			XN_ASSERT(nIndex < (XRes()*YRes()));
+			return Data()[nIndex]; 
+		}
+
+		/**
+		 * Gets the value of the pixel
+		 *
+		 * @param	x		[in]	X-coordinate of the pixel in the map
+		 * @param	y		[in]	Y-coordinate of the pixel in the map
+		 */
+		inline const XnIRPixel& operator()(XnUInt32 x, XnUInt32 y) const 
+		{
+			XN_ASSERT(x < XRes() && y < YRes());
+			return Data()[y*XRes() + x]; 
+		}
+
 		/// Gets a light object wrapping the IR map
 		inline const xn::IRMap& IRMap() const { return m_irMap; }
 		/// Gets a light object wrapping the writable IR map
@@ -1000,17 +1023,31 @@ namespace xn
 		 *
 		 * @param	hNode		[in]	A node handle.
 		 */
-		inline NodeWrapper(XnNodeHandle hNode) : m_hNode(NULL)
+		inline NodeWrapper(XnNodeHandle hNode) : m_hNode(NULL), m_hShuttingDownCallback(NULL)
 		{
 			NodeWrapper::SetHandle(hNode);
 		}
 
+		inline NodeWrapper(const NodeWrapper& other) : m_hNode(NULL), m_hShuttingDownCallback(NULL)
+		{
+			NodeWrapper::SetHandle(other.GetHandle());
+		}
+
+		inline NodeWrapper& operator=(const NodeWrapper& other)
+		{
+			NodeWrapper::SetHandle(other.GetHandle());
+			return *this;
+		}
+
 		inline ~NodeWrapper()
 		{
+			NodeWrapper::SetHandle(NULL);
 		}
 
+		inline operator XnNodeHandle() const { return GetHandle(); }
+
 		/// Gets the underlying C handle.
-		inline operator XnNodeHandle() const { return m_hNode; }
+		inline XnNodeHandle GetHandle() const { return m_hNode; }
 
 		/**
 		 * Checks if two node wrappers point to the same object.
@@ -1019,7 +1056,7 @@ namespace xn
 		 */
 		inline XnBool operator==(const NodeWrapper& other)
 		{
-			return (m_hNode == other.m_hNode);
+			return (GetHandle() == other.GetHandle());
 		}
 
 		/**
@@ -1029,39 +1066,87 @@ namespace xn
 		 */
 		inline XnBool operator!=(const NodeWrapper& other)
 		{
-			return (m_hNode != other.m_hNode);
+			return (GetHandle() != other.GetHandle());
 		}
 
 		/// TRUE if the object points to an actual node, FALSE otherwise.
-		inline XnBool IsValid() const { return (m_hNode != NULL); }
+		inline XnBool IsValid() const { return (GetHandle() != NULL); }
 		
 		/** @copybrief xnGetNodeName()
 		 * For full details and usage, see @ref xnGetNodeName()
 		 */
-		const XnChar* GetName() const {return xnGetNodeName(m_hNode); }
+		const XnChar* GetName() const {return xnGetNodeName(GetHandle()); }
 
 		/** @copybrief xnProductionNodeAddRef
 		 * For full details and usage, see @ref xnProductionNodeAddRef
 		 */
-		inline XnStatus AddRef() { return xnProductionNodeAddRef(m_hNode); }
+		inline XnStatus AddRef() { return xnProductionNodeAddRef(GetHandle()); }
 
 		/** @copybrief xnProductionNodeRelease
 		 * For full details and usage, see @ref xnProductionNodeRelease
 		 */
 		inline void Release() 
 		{
-			xnProductionNodeRelease(m_hNode);
-			m_hNode = NULL;
+			NodeWrapper::SetHandle(NULL);
 		}
 
 		inline XnStatus XN_API_DEPRECATED("Please use AddRef() instead.") Ref() { return AddRef(); }
 		inline void XN_API_DEPRECATED("Please use Release() instead.") Unref() { Release(); }
 
 		/// Replaces the object being pointed.
-		inline void SetHandle(XnNodeHandle hNode) { m_hNode = hNode; }
+		inline void SetHandle(XnNodeHandle hNode) 
+		{ 
+			if (m_hNode == hNode)
+			{
+				// Optimization: do nothing
+				return;
+			}
 
-	protected:
+			// check currently held node. If we're holding a node, release it
+			if (m_hNode != NULL)
+			{
+				XnContext* pContext = xnGetRefContextFromNodeHandle(m_hNode);
+				xnContextUnregisterFromShutdown(pContext, m_hShuttingDownCallback);
+				xnContextRelease(pContext);
+				xnProductionNodeRelease(m_hNode);
+			}
+
+			// check new node handle, if it points to a node, add ref to it
+			if (hNode != NULL)
+			{
+				XnStatus nRetVal = xnProductionNodeAddRef(hNode);
+				XN_ASSERT(nRetVal == XN_STATUS_OK);
+
+				XnContext* pContext = xnGetRefContextFromNodeHandle(hNode);
+
+				nRetVal = xnContextRegisterForShutdown(pContext, ContextShuttingDownCallback, this, &m_hShuttingDownCallback);
+				XN_ASSERT(nRetVal == XN_STATUS_OK);
+
+				xnContextRelease(pContext);
+			}
+
+			m_hNode = hNode; 
+		}
+
+		inline void TakeOwnership(XnNodeHandle hNode)
+		{
+			SetHandle(hNode);
+
+			if (hNode != NULL)
+			{
+				xnProductionNodeRelease(hNode);
+			}
+		}
+
+	private:
 		XnNodeHandle m_hNode;
+		XnCallbackHandle m_hShuttingDownCallback;
+
+		static void XN_CALLBACK_TYPE ContextShuttingDownCallback(XnContext* /*pContext*/, void* pCookie)
+		{
+			NodeWrapper* pThis = (NodeWrapper*)pCookie;
+			pThis->m_hNode = NULL;
+		}
 	};
 
 	//---------------------------------------------------------------------------
@@ -1080,7 +1165,7 @@ namespace xn
 		 *
 		 * @param	pInfo		[in]	The C object to wrap
 		 */
-		NodeInfo(XnNodeInfo* pInfo) : m_pNeededNodes(NULL)
+		NodeInfo(XnNodeInfo* pInfo) : m_pNeededNodes(NULL), m_bOwnerOfNode(FALSE)
 		{
 			SetUnderlyingObject(pInfo);
 		}
@@ -1090,7 +1175,7 @@ namespace xn
 		 *
 		 * @param	other		[in]	An object to copy from.
 		 */
-		NodeInfo(const NodeInfo& other) : m_pNeededNodes(NULL)
+		NodeInfo(const NodeInfo& other) : m_pNeededNodes(NULL), m_bOwnerOfNode(FALSE)
 		{
 			SetUnderlyingObject(other.m_pInfo);
 		}
@@ -1144,7 +1229,8 @@ namespace xn
 
 		/** @copybrief xnNodeInfoGetCreationInfo
 		 * For full details and usage, see @ref xnNodeInfoGetCreationInfo
-		 */		inline const XnChar* GetCreationInfo() const
+		 */		
+		inline const XnChar* GetCreationInfo() const
 		{
 			return xnNodeInfoGetCreationInfo(m_pInfo);
 		}
@@ -1171,11 +1257,21 @@ namespace xn
 			return xnNodeInfoGetAdditionalData(m_pInfo);
 		}
 
+		/** @copybrief xnNodeInfoGetTreeStringRepresentation
+		 * For full details and usage, see @ref xnNodeInfoGetTreeStringRepresentation
+		 */
+		inline XnStatus GetTreeStringRepresentation(XnChar* csResultBuffer, XnUInt32 nBufferSize) const
+		{
+			return xnNodeInfoGetTreeStringRepresentation(m_pInfo, csResultBuffer, nBufferSize);
+		}
+
 	private:
 		inline void SetUnderlyingObject(XnNodeInfo* pInfo);
 
 		XnNodeInfo* m_pInfo;
 		mutable NodeInfoList* m_pNeededNodes;
+		XnBool m_bOwnerOfNode; // backwards compatibility
+		friend class Context;
 	};
 
 	//---------------------------------------------------------------------------
@@ -1191,20 +1287,27 @@ namespace xn
 	{
 	public:
 		/// Ctor
-		inline Query()
+		inline Query() : m_bAllocated(TRUE)
 		{
 			xnNodeQueryAllocate(&m_pQuery);
 		}
 
+		inline Query(XnNodeQuery* pNodeQuery) : m_bAllocated(FALSE), m_pQuery(pNodeQuery)
+		{
+		}
+
 		/// Dtor
 		~Query()
 		{
-			xnNodeQueryFree(m_pQuery);
-			m_pQuery = NULL;
+			if (m_bAllocated)
+			{
+				xnNodeQueryFree(m_pQuery);
+			}
 		}
 
 		/// Gets the underlying C object
-		inline XnNodeQuery* GetUnderlyingObject() const { return m_pQuery; }
+		inline const XnNodeQuery* GetUnderlyingObject() const { return m_pQuery; }
+		inline XnNodeQuery* GetUnderlyingObject() { return m_pQuery; }
 
 		/** @copybrief xnNodeQuerySetVendor()
 		 * For full details and usage, see @ref xnNodeQuerySetVendor()
@@ -1288,6 +1391,7 @@ namespace xn
 
 	private:
 		XnNodeQuery* m_pQuery;
+		XnBool m_bAllocated;
 	};
 
 	//---------------------------------------------------------------------------
@@ -1556,7 +1660,7 @@ namespace xn
 	 * @ingroup cppref
 	 * Base class for all capabilities.
 	 */
-	class Capability
+	class Capability : public NodeWrapper
 	{
 	public:
 		/**
@@ -1564,20 +1668,8 @@ namespace xn
 		 *
 		 * @param	hNode		[in]	The node handle
 		 */
-		Capability(XnNodeHandle hNode) : m_hNode(hNode) {}
-
-		/**
-		 * Replaces the node handle
-		 *
-		 * @param	hNode		[in]	Underlying node handle
-		 */
-		inline void SetUnderlyingHandle(XnNodeHandle hNode)
-		{
-			m_hNode = hNode;
-		}
-
-	protected:
-		XnNodeHandle m_hNode;
+		Capability(XnNodeHandle hNode) : NodeWrapper(hNode) {}
+		Capability(const NodeWrapper& node) : NodeWrapper(node) {}
 	};
 
 	/**
@@ -1593,13 +1685,14 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		ErrorStateCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		ErrorStateCapability(const NodeWrapper& node) : Capability(node) {}
 
 		/** @copybrief xnGetNodeErrorState
 		 * For full details and usage, see @ref xnGetNodeErrorState
 		 */
 		inline XnStatus GetErrorState() const
 		{
-			return xnGetNodeErrorState(m_hNode);
+			return xnGetNodeErrorState(GetHandle());
 		}
 
 		/** @copybrief xnRegisterToNodeErrorStateChange
@@ -1607,7 +1700,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToErrorStateChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToNodeErrorStateChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToNodeErrorStateChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromNodeErrorStateChange
@@ -1615,7 +1708,7 @@ namespace xn
 		 */
 		inline void UnregisterFromErrorStateChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromNodeErrorStateChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromNodeErrorStateChange, GetHandle(), hCallback);
 		}
 	};
 
@@ -1633,13 +1726,14 @@ namespace xn
 		 * @param	strCap		[in]	Name of the capability
 		 */
 		GeneralIntCapability(XnNodeHandle hNode, const XnChar* strCap) : Capability(hNode), m_strCap(strCap) {}
+		GeneralIntCapability(const NodeWrapper& node) : Capability(node) {}
 
 		/** @copybrief xnGetGeneralIntRange
 		 * For full details and usage, see @ref xnGetGeneralIntRange
 		 */
 		inline void GetRange(XnInt32& nMin, XnInt32& nMax, XnInt32& nStep, XnInt32& nDefault, XnBool& bIsAutoSupported) const
 		{
-			xnGetGeneralIntRange(m_hNode, m_strCap, &nMin, &nMax, &nStep, &nDefault, &bIsAutoSupported);
+			xnGetGeneralIntRange(GetHandle(), m_strCap, &nMin, &nMax, &nStep, &nDefault, &bIsAutoSupported);
 		}
 
 		/** @copybrief xnGetGeneralIntValue
@@ -1648,7 +1742,7 @@ namespace xn
 		inline XnInt32 Get()
 		{
 			XnInt32 nValue;
-			xnGetGeneralIntValue(m_hNode, m_strCap, &nValue);
+			xnGetGeneralIntValue(GetHandle(), m_strCap, &nValue);
 			return nValue;
 		}
 
@@ -1657,7 +1751,7 @@ namespace xn
 		 */
 		inline XnStatus Set(XnInt32 nValue)
 		{
-			return xnSetGeneralIntValue(m_hNode, m_strCap, nValue);
+			return xnSetGeneralIntValue(GetHandle(), m_strCap, nValue);
 		}
 
 		/** @copybrief xnRegisterToGeneralIntValueChange
@@ -1687,18 +1781,19 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline ProductionNode(XnNodeHandle hNode = NULL) : NodeWrapper(hNode) {}
+		inline ProductionNode(const NodeWrapper& other) : NodeWrapper(other) {}
 
 		/** @copybrief xnGetNodeInfo
 		 * For full details and usage, see @ref xnGetNodeInfo
 		 */
-		inline NodeInfo GetInfo() const { return NodeInfo(xnGetNodeInfo(m_hNode)); }
+		inline NodeInfo GetInfo() const { return NodeInfo(xnGetNodeInfo(GetHandle())); }
 
 		/** @copybrief xnAddNeededNode
 		 * For full details and usage, see @ref xnAddNeededNode
 		 */
 		inline XnStatus AddNeededNode(ProductionNode& needed)
 		{
-			return xnAddNeededNode(m_hNode, needed.m_hNode);
+			return xnAddNeededNode(GetHandle(), needed.GetHandle());
 		}
 
 		/** @copybrief xnRemoveNeededNode
@@ -1706,7 +1801,7 @@ namespace xn
 		 */
 		inline XnStatus RemoveNeededNode(ProductionNode& needed)
 		{
-			return xnRemoveNeededNode(m_hNode, needed.m_hNode);
+			return xnRemoveNeededNode(GetHandle(), needed.GetHandle());
 		}
 
 		/** @copybrief xnGetContextFromNodeHandle
@@ -1719,7 +1814,7 @@ namespace xn
 		 */
 		inline XnBool IsCapabilitySupported(const XnChar* strCapabilityName) const
 		{
-			return xnIsCapabilitySupported(m_hNode, strCapabilityName);
+			return xnIsCapabilitySupported(GetHandle(), strCapabilityName);
 		}
 
 		/** @copybrief xnSetIntProperty
@@ -1727,7 +1822,7 @@ namespace xn
 		 */
 		inline XnStatus SetIntProperty(const XnChar* strName, XnUInt64 nValue)
 		{
-			return xnSetIntProperty(m_hNode, strName, nValue);
+			return xnSetIntProperty(GetHandle(), strName, nValue);
 		}
 
 		/** @copybrief xnSetRealProperty
@@ -1735,7 +1830,7 @@ namespace xn
 		 */
 		inline XnStatus SetRealProperty(const XnChar* strName, XnDouble dValue)
 		{
-			return xnSetRealProperty(m_hNode, strName, dValue);
+			return xnSetRealProperty(GetHandle(), strName, dValue);
 		}
 
 		/** @copybrief xnSetStringProperty
@@ -1743,7 +1838,7 @@ namespace xn
 		 */
 		inline XnStatus SetStringProperty(const XnChar* strName, const XnChar* strValue)
 		{
-			return xnSetStringProperty(m_hNode, strName, strValue);
+			return xnSetStringProperty(GetHandle(), strName, strValue);
 		}
 
 		/** @copybrief xnSetGeneralProperty
@@ -1751,7 +1846,7 @@ namespace xn
 		 */
 		inline XnStatus SetGeneralProperty(const XnChar* strName, XnUInt32 nBufferSize, const void* pBuffer)
 		{
-			return xnSetGeneralProperty(m_hNode, strName, nBufferSize, pBuffer);
+			return xnSetGeneralProperty(GetHandle(), strName, nBufferSize, pBuffer);
 		}
 
 		/** @copybrief xnGetIntProperty
@@ -1759,7 +1854,7 @@ namespace xn
 		 */
 		inline XnStatus GetIntProperty(const XnChar* strName, XnUInt64& nValue) const
 		{
-			return xnGetIntProperty(m_hNode, strName, &nValue);
+			return xnGetIntProperty(GetHandle(), strName, &nValue);
 		}
 
 		/** @copybrief xnGetRealProperty
@@ -1767,7 +1862,7 @@ namespace xn
 		 */
 		inline XnStatus GetRealProperty(const XnChar* strName, XnDouble &dValue) const
 		{
-			return xnGetRealProperty(m_hNode, strName, &dValue);
+			return xnGetRealProperty(GetHandle(), strName, &dValue);
 		}
 
 		/** @copybrief xnGetStringProperty
@@ -1775,7 +1870,7 @@ namespace xn
 		 */
 		inline XnStatus GetStringProperty(const XnChar* strName, XnChar* csValue, XnUInt32 nBufSize) const
 		{
-			return xnGetStringProperty(m_hNode, strName, csValue, nBufSize);
+			return xnGetStringProperty(GetHandle(), strName, csValue, nBufSize);
 		}
 
 		/** @copybrief xnGetGeneralProperty
@@ -1783,7 +1878,7 @@ namespace xn
 		 */
 		inline XnStatus GetGeneralProperty(const XnChar* strName, XnUInt32 nBufferSize, void* pBuffer) const
 		{
-			return xnGetGeneralProperty(m_hNode, strName, nBufferSize, pBuffer);
+			return xnGetGeneralProperty(GetHandle(), strName, nBufferSize, pBuffer);
 		}
 
 		/** @copybrief xnLockNodeForChanges
@@ -1791,7 +1886,7 @@ namespace xn
 		 */
 		inline XnStatus LockForChanges(XnLockHandle* phLock)
 		{
-			return xnLockNodeForChanges(m_hNode, phLock);
+			return xnLockNodeForChanges(GetHandle(), phLock);
 		}
 
 		/** @copybrief xnUnlockNodeForChanges
@@ -1799,7 +1894,7 @@ namespace xn
 		 */
 		inline void UnlockForChanges(XnLockHandle hLock)
 		{
-			xnUnlockNodeForChanges(m_hNode, hLock);
+			xnUnlockNodeForChanges(GetHandle(), hLock);
 		}
 
 		/** @copybrief xnLockedNodeStartChanges
@@ -1807,7 +1902,7 @@ namespace xn
 		 */
 		inline XnStatus LockedNodeStartChanges(XnLockHandle hLock)
 		{
-			return xnLockedNodeStartChanges(m_hNode, hLock);
+			return xnLockedNodeStartChanges(GetHandle(), hLock);
 		}
 
 		/** @copybrief xnLockedNodeEndChanges
@@ -1815,7 +1910,7 @@ namespace xn
 		 */
 		inline void LockedNodeEndChanges(XnLockHandle hLock)
 		{
-			xnLockedNodeEndChanges(m_hNode, hLock);
+			xnLockedNodeEndChanges(GetHandle(), hLock);
 		}
 
 		/**
@@ -1825,7 +1920,7 @@ namespace xn
 		 */
 		inline const ErrorStateCapability GetErrorStateCap() const
 		{
-			return ErrorStateCapability(m_hNode);
+			return ErrorStateCapability(GetHandle());
 		}
 
 		/**
@@ -1835,7 +1930,7 @@ namespace xn
 		 */
 		inline ErrorStateCapability GetErrorStateCap()
 		{
-			return ErrorStateCapability(m_hNode);
+			return ErrorStateCapability(GetHandle());
 		}
 
 		/**
@@ -1847,7 +1942,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetGeneralIntCap(const XnChar* strCapability)
 		{
-			return GeneralIntCapability(m_hNode, strCapability);
+			return GeneralIntCapability(GetHandle(), strCapability);
 		}
 	};
 
@@ -1864,13 +1959,14 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		DeviceIdentificationCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		DeviceIdentificationCapability(const NodeWrapper& node) : Capability(node) {}
 
 		/** @copybrief xnGetDeviceName
 		 * For full details and usage, see @ref xnGetDeviceName
 		 */
 		inline XnStatus GetDeviceName(XnChar* strBuffer, XnUInt32 nBufferSize)
 		{
-			return xnGetDeviceName(m_hNode, strBuffer, &nBufferSize);
+			return xnGetDeviceName(GetHandle(), strBuffer, &nBufferSize);
 		}
 
 		/** @copybrief xnGetVendorSpecificData
@@ -1878,7 +1974,7 @@ namespace xn
 		 */
 		inline XnStatus GetVendorSpecificData(XnChar* strBuffer, XnUInt32 nBufferSize)
 		{
-			return xnGetVendorSpecificData(m_hNode, strBuffer, &nBufferSize);
+			return xnGetVendorSpecificData(GetHandle(), strBuffer, &nBufferSize);
 		}
 
 		/** @copybrief xnGetSerialNumber
@@ -1886,7 +1982,7 @@ namespace xn
 		 */
 		inline XnStatus GetSerialNumber(XnChar* strBuffer, XnUInt32 nBufferSize)
 		{
-			return xnGetSerialNumber(m_hNode, strBuffer, &nBufferSize);
+			return xnGetSerialNumber(GetHandle(), strBuffer, &nBufferSize);
 		}
 	};
 
@@ -1903,6 +1999,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline Device(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
+		inline Device(const NodeWrapper& other) : ProductionNode(other) {}
 
 		/** @copybrief xnCreateDevice
 		 * For full details and usage, see @ref xnCreateDevice
@@ -1916,7 +2013,7 @@ namespace xn
 		 */
 		inline DeviceIdentificationCapability GetIdentificationCap()
 		{
-			return DeviceIdentificationCapability(m_hNode);
+			return DeviceIdentificationCapability(GetHandle());
 		}
 	};
 
@@ -1933,13 +2030,14 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline MirrorCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		MirrorCapability(const NodeWrapper& node) : Capability(node) {}
 
 		/** @copybrief xnSetMirror
 		 * For full details and usage, see @ref xnSetMirror
 		 */
 		inline XnStatus SetMirror(XnBool bMirror)
 		{
-			return xnSetMirror(m_hNode, bMirror);
+			return xnSetMirror(GetHandle(), bMirror);
 		}
 
 		/** @copybrief xnIsMirrored
@@ -1947,7 +2045,7 @@ namespace xn
 		 */
 		inline XnBool IsMirrored() const
 		{
-			return xnIsMirrored(m_hNode);
+			return xnIsMirrored(GetHandle());
 		}
 
 		/** @copybrief xnRegisterToMirrorChange
@@ -1955,7 +2053,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToMirrorChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToMirrorChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToMirrorChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromMirrorChange
@@ -1963,7 +2061,7 @@ namespace xn
 		 */
 		inline void UnregisterFromMirrorChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromMirrorChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromMirrorChange, GetHandle(), hCallback);
 		}
 	};
 
@@ -1980,13 +2078,14 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline AlternativeViewPointCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		AlternativeViewPointCapability(const NodeWrapper& node) : Capability(node) {}
 
 		/** @copybrief xnIsViewPointSupported
 		 * For full details and usage, see @ref xnIsViewPointSupported
 		 */
 		inline XnBool IsViewPointSupported(ProductionNode& otherNode) const
 		{
-			return xnIsViewPointSupported(m_hNode, otherNode);
+			return xnIsViewPointSupported(GetHandle(), otherNode.GetHandle());
 		}
 
 		/** @copybrief xnSetViewPoint
@@ -1994,7 +2093,7 @@ namespace xn
 		 */
 		inline XnStatus SetViewPoint(ProductionNode& otherNode)
 		{
-			return xnSetViewPoint(m_hNode, otherNode);
+			return xnSetViewPoint(GetHandle(), otherNode.GetHandle());
 		}
 
 		/** @copybrief xnResetViewPoint
@@ -2002,7 +2101,7 @@ namespace xn
 		 */
 		inline XnStatus ResetViewPoint()
 		{
-			return xnResetViewPoint(m_hNode);
+			return xnResetViewPoint(GetHandle());
 		}
 
 		/** @copybrief xnIsViewPointAs
@@ -2010,7 +2109,7 @@ namespace xn
 		 */
 		inline XnBool IsViewPointAs(ProductionNode& otherNode) const
 		{
-			return xnIsViewPointAs(m_hNode, otherNode);
+			return xnIsViewPointAs(GetHandle(), otherNode.GetHandle());
 		}
 
 		/** @copybrief xnRegisterToViewPointChange
@@ -2018,7 +2117,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToViewPointChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToViewPointChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToViewPointChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromViewPointChange
@@ -2026,7 +2125,7 @@ namespace xn
 		 */
 		inline void UnregisterFromViewPointChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromViewPointChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromViewPointChange, GetHandle(), hCallback);
 		}
 	};
 
@@ -2043,6 +2142,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline FrameSyncCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		FrameSyncCapability(const NodeWrapper& node) : Capability(node) {}
 
 		/** @copybrief xnCanFrameSyncWith
 		 * For full details and usage, see @ref xnCanFrameSyncWith
@@ -2069,7 +2169,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToFrameSyncChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToFrameSyncChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToFrameSyncChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromFrameSyncChange
@@ -2077,7 +2177,7 @@ namespace xn
 		 */
 		inline void UnregisterFromFrameSyncChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromFrameSyncChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromFrameSyncChange, GetHandle(), hCallback);
 		}
 	};
 
@@ -2094,13 +2194,14 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline Generator(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
+		inline Generator(const NodeWrapper& other) : ProductionNode(other) {}
 
 		/** @copybrief xnStartGenerating
 		 * For full details and usage, see @ref xnStartGenerating
 		 */
 		inline XnStatus StartGenerating()
 		{
-			return xnStartGenerating(m_hNode);
+			return xnStartGenerating(GetHandle());
 		}
 
 		/** @copybrief xnIsGenerating
@@ -2108,7 +2209,7 @@ namespace xn
 		 */
 		inline XnBool IsGenerating() const
 		{
-			return xnIsGenerating(m_hNode);
+			return xnIsGenerating(GetHandle());
 		}
 
 		/** @copybrief xnStopGenerating
@@ -2116,7 +2217,7 @@ namespace xn
 		 */
 		inline XnStatus StopGenerating()
 		{
-			return xnStopGenerating(m_hNode);
+			return xnStopGenerating(GetHandle());
 		}
 
 		/** @copybrief xnRegisterToGenerationRunningChange
@@ -2124,7 +2225,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToGenerationRunningChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle &hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToGenerationRunningChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToGenerationRunningChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromGenerationRunningChange
@@ -2132,7 +2233,7 @@ namespace xn
 		 */
 		inline void UnregisterFromGenerationRunningChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromGenerationRunningChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromGenerationRunningChange, GetHandle(), hCallback);
 		}
 
 		/** @copybrief xnRegisterToNewDataAvailable
@@ -2140,7 +2241,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToNewDataAvailable(StateChangedHandler handler, void* pCookie, XnCallbackHandle &hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToNewDataAvailable, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToNewDataAvailable, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromNewDataAvailable
@@ -2148,7 +2249,7 @@ namespace xn
 		 */
 		inline void UnregisterFromNewDataAvailable(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromNewDataAvailable, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromNewDataAvailable, GetHandle(), hCallback);
 		}
 
 		/** @copybrief xnIsNewDataAvailable
@@ -2156,7 +2257,7 @@ namespace xn
 		 */
 		inline XnBool IsNewDataAvailable(XnUInt64* pnTimestamp = NULL) const
 		{
-			return xnIsNewDataAvailable(m_hNode, pnTimestamp);
+			return xnIsNewDataAvailable(GetHandle(), pnTimestamp);
 		}
 
 		/** @copybrief xnWaitAndUpdateData
@@ -2164,7 +2265,7 @@ namespace xn
 		 */
 		inline XnStatus WaitAndUpdateData()
 		{
-			return xnWaitAndUpdateData(m_hNode);
+			return xnWaitAndUpdateData(GetHandle());
 		}
 
 		/** @copybrief xnIsDataNew
@@ -2172,7 +2273,7 @@ namespace xn
 		 */
 		inline XnBool IsDataNew() const
 		{
-			return xnIsDataNew(m_hNode);
+			return xnIsDataNew(GetHandle());
 		}
 
 		/** @copybrief xnGetData
@@ -2180,7 +2281,7 @@ namespace xn
 		 */
 		inline const void* GetData()
 		{
-			return xnGetData(m_hNode);
+			return xnGetData(GetHandle());
 		}
 		
 		/** @copybrief xnGetDataSize
@@ -2188,7 +2289,7 @@ namespace xn
 		 */
 		inline XnUInt32 GetDataSize() const
 		{
-			return xnGetDataSize(m_hNode);
+			return xnGetDataSize(GetHandle());
 		}
 
 		/** @copybrief xnGetTimestamp
@@ -2196,7 +2297,7 @@ namespace xn
 		 */
 		inline XnUInt64 GetTimestamp() const
 		{
-			return xnGetTimestamp(m_hNode);
+			return xnGetTimestamp(GetHandle());
 		}
 
 		/** @copybrief xnGetFrameID
@@ -2204,7 +2305,7 @@ namespace xn
 		 */
 		inline XnUInt32 GetFrameID() const
 		{
-			return xnGetFrameID(m_hNode);
+			return xnGetFrameID(GetHandle());
 		}
 
 		/**
@@ -2214,7 +2315,7 @@ namespace xn
 		 */
 		inline const MirrorCapability GetMirrorCap() const
 		{ 
-			return MirrorCapability(m_hNode); 
+			return MirrorCapability(GetHandle()); 
 		}
 
 		/**
@@ -2224,7 +2325,7 @@ namespace xn
 		 */
 		inline MirrorCapability GetMirrorCap()
 		{ 
-			return MirrorCapability(m_hNode); 
+			return MirrorCapability(GetHandle()); 
 		}
 
 		/**
@@ -2234,7 +2335,7 @@ namespace xn
 		 */
 		inline const AlternativeViewPointCapability GetAlternativeViewPointCap() const
 		{ 
-			return AlternativeViewPointCapability(m_hNode); 
+			return AlternativeViewPointCapability(GetHandle()); 
 		}
 
 		/**
@@ -2244,7 +2345,7 @@ namespace xn
 		 */
 		inline AlternativeViewPointCapability GetAlternativeViewPointCap()
 		{ 
-			return AlternativeViewPointCapability(m_hNode); 
+			return AlternativeViewPointCapability(GetHandle()); 
 		}
 
 		/**
@@ -2254,7 +2355,7 @@ namespace xn
 		 */
 		inline const FrameSyncCapability GetFrameSyncCap() const
 		{
-			return FrameSyncCapability(m_hNode);
+			return FrameSyncCapability(GetHandle());
 		}
 
 		/**
@@ -2264,7 +2365,7 @@ namespace xn
 		 */
 		inline FrameSyncCapability GetFrameSyncCap()
 		{
-			return FrameSyncCapability(m_hNode);
+			return FrameSyncCapability(GetHandle());
 		}
 	};
 
@@ -2281,6 +2382,7 @@ namespace xn
 		 * @param	hNode		[in]	A node handle
 		 */
 		inline Recorder(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
+		inline Recorder(const NodeWrapper& other) : ProductionNode(other) {}
 
 		/** @copybrief xnCreateRecorder
 		 * For full details and usage, see @ref xnCreateRecorder
@@ -2292,7 +2394,12 @@ namespace xn
 		 */
 		inline XnStatus SetDestination(XnRecordMedium destType, const XnChar* strDest)
 		{
-			return xnSetRecorderDestination(m_hNode, destType, strDest);
+			return xnSetRecorderDestination(GetHandle(), destType, strDest);
+		}
+
+		inline XnStatus GetDestination(XnRecordMedium& destType, XnChar* strDest, XnUInt32 nBufSize)
+		{
+			return xnGetRecorderDestination(GetHandle(), &destType, strDest, nBufSize);
 		}
 
 		/** @copybrief xnAddNodeToRecording
@@ -2300,7 +2407,7 @@ namespace xn
 		 */
 		inline XnStatus AddNodeToRecording(ProductionNode& Node, XnCodecID compression = XN_CODEC_NULL)
 		{
-			return xnAddNodeToRecording(m_hNode, Node, compression);
+			return xnAddNodeToRecording(GetHandle(), Node.GetHandle(), compression);
 		}
 
 		/** @copybrief xnRemoveNodeFromRecording
@@ -2308,7 +2415,7 @@ namespace xn
 		 */
 		inline XnStatus RemoveNodeFromRecording(ProductionNode& Node)
 		{
-			return xnRemoveNodeFromRecording(m_hNode, Node);
+			return xnRemoveNodeFromRecording(GetHandle(), Node.GetHandle());
 		}
 
 		/** @copybrief xnRecord
@@ -2316,7 +2423,7 @@ namespace xn
 		 */
 		inline XnStatus Record()
 		{
-			return xnRecord(m_hNode);
+			return xnRecord(GetHandle());
 		}
 	};
 
@@ -2333,6 +2440,7 @@ namespace xn
 		 * @param	hNode		[in]	Player node handle
 		 */
 		inline Player(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
+		inline Player(const NodeWrapper& other) : ProductionNode(other) {}
 
 		/** @copybrief xnCreatePlayer
 		 * For full details and usage, see @ref xnCreatePlayer
@@ -2344,7 +2452,7 @@ namespace xn
 		 */
 		inline XnStatus SetRepeat(XnBool bRepeat)
 		{
-			return xnSetPlayerRepeat(m_hNode, bRepeat);
+			return xnSetPlayerRepeat(GetHandle(), bRepeat);
 		}
 
 		/** @copybrief xnSetPlayerSource
@@ -2352,7 +2460,7 @@ namespace xn
 		 */
 		inline XnStatus SetSource(XnRecordMedium sourceType, const XnChar* strSource)
 		{
-			return xnSetPlayerSource(m_hNode, sourceType, strSource);
+			return xnSetPlayerSource(GetHandle(), sourceType, strSource);
 		}
 
 		/** @copybrief xnGetPlayerSource
@@ -2360,7 +2468,7 @@ namespace xn
 		 */
 		inline XnStatus GetSource(XnRecordMedium &sourceType, XnChar* strSource, XnUInt32 nBufSize) const
 		{
-			return xnGetPlayerSource(m_hNode, &sourceType, strSource, nBufSize);
+			return xnGetPlayerSource(GetHandle(), &sourceType, strSource, nBufSize);
 		}
 
 		/** @copybrief xnPlayerReadNext
@@ -2368,7 +2476,7 @@ namespace xn
 		 */
 		inline XnStatus ReadNext()
 		{
-			return xnPlayerReadNext(m_hNode);
+			return xnPlayerReadNext(GetHandle());
 		}
 
 		/** @copybrief xnSeekPlayerToTimeStamp
@@ -2376,7 +2484,7 @@ namespace xn
 		 */
 		inline XnStatus SeekToTimeStamp(XnInt64 nTimeOffset, XnPlayerSeekOrigin origin)
 		{
-			return xnSeekPlayerToTimeStamp(m_hNode, nTimeOffset, origin);
+			return xnSeekPlayerToTimeStamp(GetHandle(), nTimeOffset, origin);
 		}
 
 		/** @copybrief xnSeekPlayerToFrame
@@ -2384,7 +2492,7 @@ namespace xn
 		 */
 		inline XnStatus SeekToFrame(const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin)
 		{
-			return xnSeekPlayerToFrame(m_hNode, strNodeName, nFrameOffset, origin);
+			return xnSeekPlayerToFrame(GetHandle(), strNodeName, nFrameOffset, origin);
 		}
 
 		/** @copybrief xnTellPlayerTimestamp
@@ -2392,7 +2500,7 @@ namespace xn
 		 */
 		inline XnStatus TellTimestamp(XnUInt64& nTimestamp) const
 		{
-			return xnTellPlayerTimestamp(m_hNode, &nTimestamp);
+			return xnTellPlayerTimestamp(GetHandle(), &nTimestamp);
 		}
 
 		/** @copybrief xnTellPlayerFrame
@@ -2400,7 +2508,7 @@ namespace xn
 		 */
 		inline XnStatus TellFrame(const XnChar* strNodeName, XnUInt32& nFrame) const
 		{
-			return xnTellPlayerFrame(m_hNode, strNodeName, &nFrame);
+			return xnTellPlayerFrame(GetHandle(), strNodeName, &nFrame);
 		}
 
 		/** @copybrief xnGetPlayerNumFrames
@@ -2408,7 +2516,7 @@ namespace xn
 		 */
 		inline XnStatus GetNumFrames(const XnChar* strNodeName, XnUInt32& nFrames) const
 		{
-			return xnGetPlayerNumFrames(m_hNode, strNodeName, &nFrames);
+			return xnGetPlayerNumFrames(GetHandle(), strNodeName, &nFrames);
 		}
 
 		/** @copybrief xnGetPlayerSupportedFormat
@@ -2416,7 +2524,7 @@ namespace xn
 		 */
 		inline const XnChar* GetSupportedFormat() const
 		{
-			return xnGetPlayerSupportedFormat(m_hNode);
+			return xnGetPlayerSupportedFormat(GetHandle());
 		}
 
 		/** @copybrief xnEnumeratePlayerNodes
@@ -2425,7 +2533,7 @@ namespace xn
 		inline XnStatus EnumerateNodes(NodeInfoList& list) const
 		{
 			XnNodeInfoList* pList;
-			XnStatus nRetVal = xnEnumeratePlayerNodes(m_hNode, &pList);
+			XnStatus nRetVal = xnEnumeratePlayerNodes(GetHandle(), &pList);
 			XN_IS_STATUS_OK(nRetVal);
 
 			list.ReplaceUnderlyingObject(pList);
@@ -2438,7 +2546,7 @@ namespace xn
 		 */
 		inline XnBool IsEOF() const
 		{
-			return xnIsPlayerAtEOF(m_hNode);
+			return xnIsPlayerAtEOF(GetHandle());
 		}
 
 		/** @copybrief xnRegisterToEndOfFileReached
@@ -2446,7 +2554,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToEndOfFileReached(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToEndOfFileReached, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToEndOfFileReached, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromEndOfFileReached
@@ -2454,7 +2562,7 @@ namespace xn
 		 */
 		inline void UnregisterFromEndOfFileReached(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromEndOfFileReached, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromEndOfFileReached, GetHandle(), hCallback);
 		}
 
 		/** @copybrief xnSetPlaybackSpeed
@@ -2462,7 +2570,7 @@ namespace xn
 		 */
 		inline XnStatus SetPlaybackSpeed(XnDouble dSpeed)
 		{
-			return xnSetPlaybackSpeed(m_hNode, dSpeed);
+			return xnSetPlaybackSpeed(GetHandle(), dSpeed);
 		}
 
 		/** @copybrief xnGetPlaybackSpeed
@@ -2470,7 +2578,7 @@ namespace xn
 		 */
 		inline XnDouble GetPlaybackSpeed() const
 		{
-			return xnGetPlaybackSpeed(m_hNode);
+			return xnGetPlaybackSpeed(GetHandle());
 		}
 	};
 
@@ -2487,13 +2595,14 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline CroppingCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		CroppingCapability(const NodeWrapper& node) : Capability(node) {}
 
 		/** @copybrief xnSetCropping
 		 * For full details and usage, see @ref xnSetCropping
 		 */
 		inline XnStatus SetCropping(const XnCropping& Cropping)
 		{
-			return xnSetCropping(m_hNode, &Cropping);
+			return xnSetCropping(GetHandle(), &Cropping);
 		}
 
 		/** @copybrief xnGetCropping
@@ -2501,7 +2610,7 @@ namespace xn
 		 */
 		inline XnStatus GetCropping(XnCropping& Cropping) const
 		{
-			return xnGetCropping(m_hNode, &Cropping);
+			return xnGetCropping(GetHandle(), &Cropping);
 		}
 
 		/** @copybrief xnRegisterToCroppingChange
@@ -2509,7 +2618,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToCroppingChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToCroppingChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToCroppingChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromCroppingChange
@@ -2517,7 +2626,7 @@ namespace xn
 		 */
 		inline void UnregisterFromCroppingChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromCroppingChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromCroppingChange, GetHandle(), hCallback);
 		}
 	};
 
@@ -2534,13 +2643,14 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline AntiFlickerCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		AntiFlickerCapability(const NodeWrapper& node) : Capability(node) {}
 
 		/** @copybrief xnSetPowerLineFrequency
 		 * For full details and usage, see @ref xnSetPowerLineFrequency
 		 */
 		inline XnStatus SetPowerLineFrequency(XnPowerLineFrequency nFrequency)
 		{
-			return xnSetPowerLineFrequency(m_hNode, nFrequency);
+			return xnSetPowerLineFrequency(GetHandle(), nFrequency);
 		}
 
 		/** @copybrief xnGetPowerLineFrequency
@@ -2548,7 +2658,7 @@ namespace xn
 		 */
 		inline XnPowerLineFrequency GetPowerLineFrequency()
 		{
-			return xnGetPowerLineFrequency(m_hNode);
+			return xnGetPowerLineFrequency(GetHandle());
 		}
 
 		/** @copybrief xnRegisterToPowerLineFrequencyChange
@@ -2556,7 +2666,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToPowerLineFrequencyChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToPowerLineFrequencyChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToPowerLineFrequencyChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromPowerLineFrequencyChange
@@ -2564,7 +2674,7 @@ namespace xn
 		 */
 		inline void UnregisterFromPowerLineFrequencyChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromPowerLineFrequencyChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromPowerLineFrequencyChange, GetHandle(), hCallback);
 		}
 	};
 
@@ -2581,13 +2691,14 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline MapGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
+		inline MapGenerator(const NodeWrapper& other) : Generator(other) {}
 
 		/** @copybrief xnGetSupportedMapOutputModesCount
 		 * For full details and usage, see @ref xnGetSupportedMapOutputModesCount
 		 */
 		inline XnUInt32 GetSupportedMapOutputModesCount() const
 		{
-			return xnGetSupportedMapOutputModesCount(m_hNode);
+			return xnGetSupportedMapOutputModesCount(GetHandle());
 		}
 
 		/** @copybrief xnGetSupportedMapOutputModes
@@ -2595,7 +2706,7 @@ namespace xn
 		 */
 		inline XnStatus GetSupportedMapOutputModes(XnMapOutputMode* aModes, XnUInt32& nCount) const
 		{
-			return xnGetSupportedMapOutputModes(m_hNode, aModes, &nCount);
+			return xnGetSupportedMapOutputModes(GetHandle(), aModes, &nCount);
 		}
 
 		/** @copybrief xnSetMapOutputMode
@@ -2603,7 +2714,7 @@ namespace xn
 		 */
 		inline XnStatus SetMapOutputMode(const XnMapOutputMode& OutputMode)
 		{
-			return xnSetMapOutputMode(m_hNode, &OutputMode);
+			return xnSetMapOutputMode(GetHandle(), &OutputMode);
 		}
 
 		/** @copybrief xnGetMapOutputMode
@@ -2611,7 +2722,7 @@ namespace xn
 		 */
 		inline XnStatus GetMapOutputMode(XnMapOutputMode &OutputMode) const
 		{
-			return xnGetMapOutputMode(m_hNode, &OutputMode);
+			return xnGetMapOutputMode(GetHandle(), &OutputMode);
 		}
 
 		/** @copybrief xnGetBytesPerPixel
@@ -2619,7 +2730,7 @@ namespace xn
 		 */
 		inline XnUInt32 GetBytesPerPixel() const
 		{
-			return xnGetBytesPerPixel(m_hNode);
+			return xnGetBytesPerPixel(GetHandle());
 		}
 
 		/** @copybrief xnRegisterToMapOutputModeChange
@@ -2627,7 +2738,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToMapOutputModeChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToMapOutputModeChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToMapOutputModeChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromMapOutputModeChange
@@ -2635,7 +2746,7 @@ namespace xn
 		 */
 		inline void UnregisterFromMapOutputModeChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromMapOutputModeChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromMapOutputModeChange, GetHandle(), hCallback);
 		}
 
 		/**
@@ -2645,7 +2756,7 @@ namespace xn
 		 */
 		inline const CroppingCapability GetCroppingCap() const
 		{
-			return CroppingCapability(m_hNode);
+			return CroppingCapability(GetHandle());
 		}
 
 		/**
@@ -2655,7 +2766,7 @@ namespace xn
 		 */
 		inline CroppingCapability GetCroppingCap()
 		{
-			return CroppingCapability(m_hNode);
+			return CroppingCapability(GetHandle());
 		}
 
 		/**
@@ -2665,7 +2776,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetBrightnessCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_BRIGHTNESS);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_BRIGHTNESS);
 		}
 
 		/**
@@ -2675,7 +2786,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetContrastCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_CONTRAST);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_CONTRAST);
 		}
 
 		/**
@@ -2685,7 +2796,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetHueCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_HUE);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_HUE);
 		}
 
 		/**
@@ -2695,7 +2806,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetSaturationCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_SATURATION);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_SATURATION);
 		}
 
 		/**
@@ -2705,7 +2816,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetSharpnessCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_SHARPNESS);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_SHARPNESS);
 		}
 
 		/**
@@ -2715,7 +2826,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetGammaCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_GAMMA);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_GAMMA);
 		}
 
 		/**
@@ -2725,7 +2836,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetWhiteBalanceCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_COLOR_TEMPERATURE);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_COLOR_TEMPERATURE);
 		}
 
 		/**
@@ -2735,7 +2846,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetBacklightCompensationCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_BACKLIGHT_COMPENSATION);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_BACKLIGHT_COMPENSATION);
 		}
 
 		/**
@@ -2745,7 +2856,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetGainCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_GAIN);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_GAIN);
 		}
 
 		/**
@@ -2755,7 +2866,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetPanCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_PAN);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_PAN);
 		}
 
 		/**
@@ -2765,7 +2876,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetTiltCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_TILT);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_TILT);
 		}
 
 		/**
@@ -2775,7 +2886,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetRollCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_ROLL);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_ROLL);
 		}
 
 		/**
@@ -2785,7 +2896,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetZoomCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_ZOOM);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_ZOOM);
 		}
 
 		/**
@@ -2795,7 +2906,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetExposureCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_EXPOSURE);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_EXPOSURE);
 		}
 
 		/**
@@ -2805,7 +2916,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetIrisCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_IRIS);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_IRIS);
 		}
 
 		/**
@@ -2815,7 +2926,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetFocusCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_FOCUS);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_FOCUS);
 		}
 
 		/**
@@ -2825,7 +2936,7 @@ namespace xn
 		 */
 		inline GeneralIntCapability GetLowLightCompensationCap()
 		{
-			return GeneralIntCapability(m_hNode, XN_CAPABILITY_LOW_LIGHT_COMPENSATION);
+			return GeneralIntCapability(GetHandle(), XN_CAPABILITY_LOW_LIGHT_COMPENSATION);
 		}
 
 		/**
@@ -2835,7 +2946,7 @@ namespace xn
 		 */
 		inline AntiFlickerCapability GetAntiFlickerCap()
 		{
-			return AntiFlickerCapability(m_hNode);
+			return AntiFlickerCapability(GetHandle());
 		}
 	};
 
@@ -2852,13 +2963,14 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline UserPositionCapability(XnNodeHandle hNode = NULL) : Capability(hNode) {}
+		UserPositionCapability(const NodeWrapper& node) : Capability(node) {}
 
 		/** @copybrief xnGetSupportedUserPositionsCount
 		 * For full details and usage, see @ref xnGetSupportedUserPositionsCount
 		 */
 		inline XnUInt32 GetSupportedUserPositionsCount() const
 		{
-			return xnGetSupportedUserPositionsCount(m_hNode);
+			return xnGetSupportedUserPositionsCount(GetHandle());
 		}
 
 		/** @copybrief xnSetUserPosition
@@ -2866,7 +2978,7 @@ namespace xn
 		 */
 		inline XnStatus SetUserPosition(XnUInt32 nIndex, const XnBoundingBox3D& Position)
 		{
-			return xnSetUserPosition(m_hNode, nIndex, &Position);
+			return xnSetUserPosition(GetHandle(), nIndex, &Position);
 		}
 
 		/** @copybrief xnGetUserPosition
@@ -2874,7 +2986,7 @@ namespace xn
 		 */
 		inline XnStatus GetUserPosition(XnUInt32 nIndex, XnBoundingBox3D& Position) const
 		{
-			return xnGetUserPosition(m_hNode, nIndex, &Position);
+			return xnGetUserPosition(GetHandle(), nIndex, &Position);
 		}
 
 		/** @copybrief xnRegisterToUserPositionChange
@@ -2882,7 +2994,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToUserPositionChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToUserPositionChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToUserPositionChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromUserPositionChange
@@ -2890,7 +3002,7 @@ namespace xn
 		 */
 		inline void UnregisterFromUserPositionChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromUserPositionChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromUserPositionChange, GetHandle(), hCallback);
 		}
 	};
 
@@ -2907,6 +3019,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline DepthGenerator(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
+		inline DepthGenerator(const NodeWrapper& other) : MapGenerator(other) {}
 
 		/** @copybrief xnCreateDepthGenerator
 		 * For full details and usage, see @ref xnCreateDepthGenerator
@@ -2918,7 +3031,7 @@ namespace xn
 		 */
 		inline void GetMetaData(DepthMetaData& metaData) const 
 		{
-			xnGetDepthMetaData(m_hNode, metaData.GetUnderlying());
+			xnGetDepthMetaData(GetHandle(), metaData.GetUnderlying());
 		}
 
 		/** @copybrief xnGetDepthMap
@@ -2926,7 +3039,7 @@ namespace xn
 		 */
 		inline const XnDepthPixel* GetDepthMap() const
 		{
-			return xnGetDepthMap(m_hNode);
+			return xnGetDepthMap(GetHandle());
 		}
 
 		/** @copybrief xnGetDeviceMaxDepth
@@ -2934,7 +3047,7 @@ namespace xn
 		 */
 		inline XnDepthPixel GetDeviceMaxDepth() const
 		{
-			return xnGetDeviceMaxDepth(m_hNode);
+			return xnGetDeviceMaxDepth(GetHandle());
 		}
 
 		/** @copybrief xnGetDepthFieldOfView
@@ -2942,7 +3055,7 @@ namespace xn
 		 */
 		inline XnStatus GetFieldOfView(XnFieldOfView& FOV) const
 		{
-			return xnGetDepthFieldOfView(m_hNode, &FOV);
+			return xnGetDepthFieldOfView(GetHandle(), &FOV);
 		}
 
 		/** @copybrief xnRegisterToDepthFieldOfViewChange
@@ -2950,7 +3063,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToFieldOfViewChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToDepthFieldOfViewChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToDepthFieldOfViewChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromDepthFieldOfViewChange
@@ -2958,7 +3071,7 @@ namespace xn
 		 */
 		inline void UnregisterFromFieldOfViewChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromDepthFieldOfViewChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromDepthFieldOfViewChange, GetHandle(), hCallback);
 		}
 
 		/** @copybrief xnConvertProjectiveToRealWorld
@@ -2966,7 +3079,7 @@ namespace xn
 		 */
 		inline XnStatus ConvertProjectiveToRealWorld(XnUInt32 nCount, const XnPoint3D aProjective[], XnPoint3D aRealWorld[]) const
 		{
-			return xnConvertProjectiveToRealWorld(m_hNode, nCount, aProjective, aRealWorld);
+			return xnConvertProjectiveToRealWorld(GetHandle(), nCount, aProjective, aRealWorld);
 		}
 
 		/** @copybrief xnConvertRealWorldToProjective
@@ -2974,7 +3087,7 @@ namespace xn
 		 */
 		inline XnStatus ConvertRealWorldToProjective(XnUInt32 nCount, const XnPoint3D aRealWorld[], XnPoint3D aProjective[]) const
 		{
-			return xnConvertRealWorldToProjective(m_hNode, nCount, aRealWorld, aProjective);
+			return xnConvertRealWorldToProjective(GetHandle(), nCount, aRealWorld, aProjective);
 		}
 
 		/**
@@ -2984,7 +3097,7 @@ namespace xn
 		 */
 		inline const UserPositionCapability GetUserPositionCap() const
 		{
-			return UserPositionCapability(m_hNode);
+			return UserPositionCapability(GetHandle());
 		}
 
 		/**
@@ -2994,7 +3107,7 @@ namespace xn
 		 */
 		inline UserPositionCapability GetUserPositionCap()
 		{
-			return UserPositionCapability(m_hNode);
+			return UserPositionCapability(GetHandle());
 		}
 	};
 
@@ -3011,6 +3124,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline MockDepthGenerator(XnNodeHandle hNode = NULL) : DepthGenerator(hNode) {}
+		inline MockDepthGenerator(const NodeWrapper& other) : DepthGenerator(other) {}
 
 		/**
 		 * Creates a mock depth generator
@@ -3033,7 +3147,7 @@ namespace xn
 		 */
 		inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnDepthPixel* pDepthMap)
 		{
-			return xnMockDepthSetData(m_hNode, nFrameID, nTimestamp, nDataSize, pDepthMap);
+			return xnMockDepthSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pDepthMap);
 		}
 
 		/**
@@ -3072,6 +3186,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline ImageGenerator(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
+		inline ImageGenerator(const NodeWrapper& other) : MapGenerator(other) {}
 
 		/** @copybrief xnCreateImageGenerator
 		 * For full details and usage, see @ref xnCreateImageGenerator
@@ -3083,7 +3198,7 @@ namespace xn
 		 */
 		inline void GetMetaData(ImageMetaData& metaData) const 
 		{
-			xnGetImageMetaData(m_hNode, metaData.GetUnderlying());
+			xnGetImageMetaData(GetHandle(), metaData.GetUnderlying());
 		}
 
 		/** @copybrief xnGetRGB24ImageMap
@@ -3091,7 +3206,7 @@ namespace xn
 		 */
 		inline const XnRGB24Pixel* GetRGB24ImageMap() const
 		{
-			return xnGetRGB24ImageMap(m_hNode);
+			return xnGetRGB24ImageMap(GetHandle());
 		}
 
 		/** @copybrief xnGetYUV422ImageMap
@@ -3099,7 +3214,7 @@ namespace xn
 		 */
 		inline const XnYUV422DoublePixel* GetYUV422ImageMap() const
 		{
-			return xnGetYUV422ImageMap(m_hNode);
+			return xnGetYUV422ImageMap(GetHandle());
 		}
 
 		/** @copybrief xnGetGrayscale8ImageMap
@@ -3107,7 +3222,7 @@ namespace xn
 		 */
 		inline const XnGrayscale8Pixel* GetGrayscale8ImageMap() const
 		{
-			return xnGetGrayscale8ImageMap(m_hNode);
+			return xnGetGrayscale8ImageMap(GetHandle());
 		}
 
 		/** @copybrief xnGetGrayscale16ImageMap
@@ -3115,7 +3230,7 @@ namespace xn
 		 */
 		inline const XnGrayscale16Pixel* GetGrayscale16ImageMap() const
 		{
-			return xnGetGrayscale16ImageMap(m_hNode);
+			return xnGetGrayscale16ImageMap(GetHandle());
 		}
 
 		/** @copybrief xnGetImageMap() 
@@ -3123,7 +3238,7 @@ namespace xn
 		 */
 		inline const XnUInt8* GetImageMap() const
 		{
-			return xnGetImageMap(m_hNode);
+			return xnGetImageMap(GetHandle());
 		}
 
 		/** @copybrief xnIsPixelFormatSupported
@@ -3131,7 +3246,7 @@ namespace xn
 		 */
 		inline XnBool IsPixelFormatSupported(XnPixelFormat Format) const
 		{
-			return xnIsPixelFormatSupported(m_hNode, Format);
+			return xnIsPixelFormatSupported(GetHandle(), Format);
 		}
 
 		/** @copybrief xnSetPixelFormat
@@ -3139,7 +3254,7 @@ namespace xn
 		 */
 		inline XnStatus SetPixelFormat(XnPixelFormat Format)
 		{
-			return xnSetPixelFormat(m_hNode, Format);
+			return xnSetPixelFormat(GetHandle(), Format);
 		}
 
 		/** @copybrief xnGetPixelFormat
@@ -3147,7 +3262,7 @@ namespace xn
 		 */
 		inline XnPixelFormat GetPixelFormat() const
 		{
-			return xnGetPixelFormat(m_hNode);
+			return xnGetPixelFormat(GetHandle());
 		}
 
 		/** @copybrief xnRegisterToPixelFormatChange
@@ -3155,7 +3270,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToPixelFormatChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToPixelFormatChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToPixelFormatChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromPixelFormatChange
@@ -3163,7 +3278,7 @@ namespace xn
 		 */
 		inline void UnregisterFromPixelFormatChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromPixelFormatChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromPixelFormatChange, GetHandle(), hCallback);
 		}
 	};
 
@@ -3180,6 +3295,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline MockImageGenerator(XnNodeHandle hNode = NULL) : ImageGenerator(hNode) {}
+		inline MockImageGenerator(const NodeWrapper& other) : ImageGenerator(other) {}
 
 		/**
 		 * Creates a mock image generator
@@ -3202,7 +3318,7 @@ namespace xn
 		 */
 		inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pImageMap)
 		{
-			return xnMockImageSetData(m_hNode, nFrameID, nTimestamp, nDataSize, pImageMap);
+			return xnMockImageSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pImageMap);
 		}
 
 		/**
@@ -3241,6 +3357,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline IRGenerator(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
+		inline IRGenerator(const NodeWrapper& other) : MapGenerator(other) {}
 
 		/** @copybrief xnCreateIRGenerator
 		 * For full details and usage, see @ref xnCreateIRGenerator
@@ -3252,7 +3369,7 @@ namespace xn
 		 */
 		inline void GetMetaData(IRMetaData& metaData) const 
 		{ 
-			xnGetIRMetaData(m_hNode, metaData.GetUnderlying());
+			xnGetIRMetaData(GetHandle(), metaData.GetUnderlying());
 		}
 
 		/** @copybrief xnGetIRMap
@@ -3260,7 +3377,7 @@ namespace xn
 		 */
 		inline const XnIRPixel* GetIRMap() const
 		{
-			return xnGetIRMap(m_hNode);
+			return xnGetIRMap(GetHandle());
 		}
 	};
 
@@ -3277,6 +3394,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline MockIRGenerator(XnNodeHandle hNode = NULL) : IRGenerator(hNode) {}
+		inline MockIRGenerator(const NodeWrapper& other) : IRGenerator(other) {}
 
 		/**
 		 * Creates a mock IR generator
@@ -3298,7 +3416,7 @@ namespace xn
 		 */
 		inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnIRPixel* pIRMap)
 		{
-			return xnMockIRSetData(m_hNode, nFrameID, nTimestamp, nDataSize, pIRMap);
+			return xnMockIRSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pIRMap);
 		}
 
 		/**
@@ -3337,6 +3455,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline GestureGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {} 
+		inline GestureGenerator(const NodeWrapper& other) : Generator(other) {}
 
 		/** @copybrief xnCreateGestureGenerator
 		 * For full details and usage, see @ref xnCreateGestureGenerator
@@ -3348,7 +3467,7 @@ namespace xn
 		 */
 		inline XnStatus AddGesture(const XnChar* strGesture, XnBoundingBox3D* pArea)
 		{
-			return xnAddGesture(m_hNode, strGesture, pArea);
+			return xnAddGesture(GetHandle(), strGesture, pArea);
 		}
 
 		/** @copybrief xnRemoveGesture
@@ -3356,7 +3475,7 @@ namespace xn
 		 */
 		inline XnStatus RemoveGesture(const XnChar* strGesture)
 		{
-			return xnRemoveGesture(m_hNode, strGesture);
+			return xnRemoveGesture(GetHandle(), strGesture);
 		}
 
 		/** @copybrief xnGetActiveGestures
@@ -3364,7 +3483,7 @@ namespace xn
 		 */
 		inline XnStatus GetActiveGestures(XnChar*& astrGestures, XnUInt16& nGestures) const
 		{
-			return xnGetActiveGestures(m_hNode, &astrGestures, &nGestures);
+			return xnGetActiveGestures(GetHandle(), &astrGestures, &nGestures);
 		}
 
 		/** @copybrief xnGetActiveGestures
@@ -3372,7 +3491,7 @@ namespace xn
 		 */
 		inline XnStatus GetAllActiveGestures(XnChar** astrGestures, XnUInt32 nNameLength, XnUInt16& nGestures) const
 		{
-			return xnGetAllActiveGestures(m_hNode, astrGestures, nNameLength, &nGestures);
+			return xnGetAllActiveGestures(GetHandle(), astrGestures, nNameLength, &nGestures);
 		}
 
 		/** @copybrief xnEnumerateGestures
@@ -3380,14 +3499,23 @@ namespace xn
 		 */
 		inline XnStatus EnumerateGestures(XnChar*& astrGestures, XnUInt16& nGestures) const
 		{
-			return xnEnumerateGestures(m_hNode, &astrGestures, &nGestures);
+			return xnEnumerateGestures(GetHandle(), &astrGestures, &nGestures);
 		}
+
+        /** @copybrief xnGetNumberOfAvailableGestures
+         * For full details and usage, see @ref xnGetNumberOfAvailableGestures
+         */
+        inline XnUInt16 GetNumberOfAvailableGestures() const
+        {
+            return xnGetNumberOfAvailableGestures(GetHandle());
+        }
+
 		/** @copybrief xnEnumerateAllGestures
 		 * For full details and usage, see @ref xnEnumerateAllGestures
 		 */
 		inline XnStatus EnumerateAllGestures(XnChar** astrGestures, XnUInt32 nNameLength, XnUInt16& nGestures) const
 		{
-			return xnEnumerateAllGestures(m_hNode, astrGestures, nNameLength, &nGestures);
+			return xnEnumerateAllGestures(GetHandle(), astrGestures, nNameLength, &nGestures);
 		}
 
 		/** @copybrief xnIsGestureAvailable
@@ -3395,7 +3523,7 @@ namespace xn
 		 */
 		inline XnBool IsGestureAvailable(const XnChar* strGesture) const
 		{
-			return xnIsGestureAvailable(m_hNode, strGesture);
+			return xnIsGestureAvailable(GetHandle(), strGesture);
 		}
 
 		/** @copybrief xnIsGestureProgressSupported
@@ -3403,7 +3531,7 @@ namespace xn
 		 */
 		inline XnBool IsGestureProgressSupported(const XnChar* strGesture) const
 		{
-			return xnIsGestureProgressSupported(m_hNode, strGesture);
+			return xnIsGestureProgressSupported(GetHandle(), strGesture);
 		}
 
 		/**
@@ -3440,7 +3568,7 @@ namespace xn
 			pGestureCookie->progressHandler = ProgressCB;
 			pGestureCookie->pUserCookie = pCookie;
 
-			nRetVal = xnRegisterGestureCallbacks(m_hNode, GestureRecognizedCallback, GestureProgressCallback, pGestureCookie, &pGestureCookie->hCallback);
+			nRetVal = xnRegisterGestureCallbacks(GetHandle(), GestureRecognizedCallback, GestureProgressCallback, pGestureCookie, &pGestureCookie->hCallback);
 			if (nRetVal != XN_STATUS_OK)
 			{
 				xnOSFree(pGestureCookie);
@@ -3458,7 +3586,7 @@ namespace xn
 		inline void UnregisterGestureCallbacks(XnCallbackHandle hCallback)
 		{
 			GestureCookie* pGestureCookie = (GestureCookie*)hCallback;
-			xnUnregisterGestureCallbacks(m_hNode, pGestureCookie->hCallback);
+			xnUnregisterGestureCallbacks(GetHandle(), pGestureCookie->hCallback);
 			xnOSFree(pGestureCookie);
 		}
 
@@ -3467,7 +3595,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToGestureChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToGestureChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToGestureChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromGestureChange
@@ -3475,7 +3603,92 @@ namespace xn
 		 */
 		inline void UnregisterFromGestureChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromGestureChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromGestureChange, GetHandle(), hCallback);
+		}
+
+		/**
+		 * Callback for indication that a certain gesture is in progress
+		 *
+		 * @param	generator	[in]	The node that raised the event.
+		 * @param	strGesture	[in]	The gesture that is on its way to being recognized.
+		 * @param	pPosition	[in]	The current position of the hand that is performing the gesture.
+		 * @param	pCookie		[in]	A user-provided cookie that was given when registering to this event.
+		 */
+		typedef void (XN_CALLBACK_TYPE* GestureIntermediateStageCompleted)(GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie);
+		/** @copybrief xnRegisterToGestureIntermediateStageCompleted
+		 * For full details and usage, see @ref xnRegisterToGestureIntermediateStageCompleted
+		 */
+		XnStatus RegisterToGestureIntermediateStageCompleted(GestureIntermediateStageCompleted handler, void* pCookie, XnCallbackHandle& hCallback)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			GestureIntermediateStageCompletedCookie* pGestureCookie;
+			XN_VALIDATE_ALLOC(pGestureCookie, GestureIntermediateStageCompletedCookie);
+			pGestureCookie->handler = handler;
+			pGestureCookie->pUserCookie = pCookie;
+
+			nRetVal = xnRegisterToGestureIntermediateStageCompleted(GetHandle(), GestureIntermediateStageCompletedCallback, pGestureCookie, &pGestureCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnOSFree(pGestureCookie);
+				return (nRetVal);
+			}
+
+			hCallback = pGestureCookie;
+
+			return (XN_STATUS_OK);
+		}
+		/** @copybrief xnUnregisterFromGestureIntermediateStageCompleted
+		 * For full details and usage, see @ref xnUnregisterFromGestureIntermediateStageCompleted
+		 */
+		inline void UnregisterFromGestureIntermediateStageCompleted(XnCallbackHandle hCallback)
+		{
+			GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)hCallback;
+			xnUnregisterFromGestureIntermediateStageCompleted(GetHandle(), pGestureCookie->hCallback);
+			xnOSFree(pGestureCookie);
+		}
+
+		/**
+		 * Callback for indication that a certain gesture is ready for its next stage (whatever that is)
+		 *
+		 * @param	generator	[in]	The node that raised the event.
+		 * @param	strGesture	[in]	The gesture that is on its way to being recognized.
+		 * @param	pPosition	[in]	The current position of the hand that is performing the gesture.
+		 * @param	pCookie		[in]	A user-provided cookie that was given when registering to this event.
+		 */
+		typedef void (XN_CALLBACK_TYPE* GestureReadyForNextIntermediateStage)(GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie);
+		/** @copybrief xnRegisterToGestureReadyForNextIntermediateStage
+		 * For full details and usage, see @ref xnRegisterToGestureReadyForNextIntermediateStage
+		 */
+		XnStatus RegisterToGestureReadyForNextIntermediateStage(GestureReadyForNextIntermediateStage handler, void* pCookie, XnCallbackHandle& hCallback)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			GestureReadyForNextIntermediateStageCookie* pGestureCookie;
+			XN_VALIDATE_ALLOC(pGestureCookie, GestureReadyForNextIntermediateStageCookie);
+			pGestureCookie->handler = handler;
+			pGestureCookie->pUserCookie = pCookie;
+
+			nRetVal = xnRegisterToGestureReadyForNextIntermediateStage(GetHandle(), GestureReadyForNextIntermediateStageCallback, pGestureCookie, &pGestureCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnOSFree(pGestureCookie);
+				return (nRetVal);
+			}
+
+			hCallback = pGestureCookie;
+
+			return (XN_STATUS_OK);
+		}
+
+		/** @copybrief xnUnregisterFromGestureReadyForNextIntermediateStage
+		 * For full details and usage, see @ref xnUnregisterFromGestureReadyForNextIntermediateStage
+		 */
+		inline void UnregisterFromGestureReadyForNextIntermediateStageCallbacks(XnCallbackHandle hCallback)
+		{
+			GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)hCallback;
+			xnUnregisterFromGestureReadyForNextIntermediateStage(GetHandle(), pGestureCookie->hCallback);
+			xnOSFree(pGestureCookie);
 		}
 
 	private:
@@ -3506,6 +3719,40 @@ namespace xn
 				pGestureCookie->progressHandler(gen, strGesture, pPosition, fProgress, pGestureCookie->pUserCookie);
 			}
 		}
+
+		typedef struct GestureIntermediateStageCompletedCookie
+		{
+			GestureIntermediateStageCompleted handler;
+			void* pUserCookie;
+			XnCallbackHandle hCallback;
+		} GestureIntermediateStageCompletedCookie;
+
+		static void XN_CALLBACK_TYPE GestureIntermediateStageCompletedCallback(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie)
+		{
+			GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)pCookie;
+			GestureGenerator gen(hNode);
+			if (pGestureCookie->handler != NULL)
+			{
+				pGestureCookie->handler(gen, strGesture, pPosition, pGestureCookie->pUserCookie);
+			}
+		}
+
+		typedef struct GestureReadyForNextIntermediateStageCookie
+		{
+			GestureReadyForNextIntermediateStage handler;
+			void* pUserCookie;
+			XnCallbackHandle hCallback;
+		} GestureReadyForNextIntermediateStageCookie;
+
+		static void XN_CALLBACK_TYPE GestureReadyForNextIntermediateStageCallback(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie)
+		{
+			GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)pCookie;
+			GestureGenerator gen(hNode);
+			if (pGestureCookie->handler != NULL)
+			{
+				pGestureCookie->handler(gen, strGesture, pPosition, pGestureCookie->pUserCookie);
+			}
+		}
 	};
 
 	/**
@@ -3521,6 +3768,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline SceneAnalyzer(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
+		inline SceneAnalyzer(const NodeWrapper& other) : MapGenerator(other) {}
 
 		/** @copybrief xnCreateSceneAnalyzer
 		 * For full details and usage, see @ref xnCreateSceneAnalyzer
@@ -3532,7 +3780,7 @@ namespace xn
 		 */
 		inline void GetMetaData(SceneMetaData& metaData) const
 		{
-			xnGetSceneMetaData(m_hNode, metaData.GetUnderlying());
+			xnGetSceneMetaData(GetHandle(), metaData.GetUnderlying());
 		}
 
 		/** @copybrief xnGetLabelMap
@@ -3540,7 +3788,7 @@ namespace xn
 		 */
 		inline const XnLabel* GetLabelMap() const
 		{
-			return xnGetLabelMap(m_hNode);
+			return xnGetLabelMap(GetHandle());
 		}
 
 		/** @copybrief xnGetFloor
@@ -3548,11 +3796,89 @@ namespace xn
 		 */
 		inline XnStatus GetFloor(XnPlane3D& Plane) const
 		{
-			return xnGetFloor(m_hNode, &Plane);
+			return xnGetFloor(GetHandle(), &Plane);
 		}
 	};
 
 	/**
+	* @ingroup cppref
+	* Allows access to <b>Hand touching FOV edge</b> capability functions. see @ref HandTouchingFOVEdgeCapability for additional details.
+	*/
+	class HandTouchingFOVEdgeCapability : public Capability
+	{
+	public:
+		/**
+		* Ctor
+		*
+		* @param	hNode		[in]	Node handle
+		*/
+		inline HandTouchingFOVEdgeCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		HandTouchingFOVEdgeCapability(const NodeWrapper& node) : Capability(node) {}
+
+		/**
+		* Callback for the hand getting close to the edge of the FOV
+		*
+		* @param	touchingfov	[in]	the hand touching fov edge capability that raised this event.
+		* @param	user		[in]	The id of the hand that disappeared.
+		* @param	pPosition	[in]	The position of the hand.
+		* @param	fTime		[in]	Timestamp, in seconds.
+		* @param	eDir		[in]	Direction of the FOV touched
+		* @param	pCookie		[in]	A user-provided cookie that was given when registering to this event.
+		*/
+		typedef void (XN_CALLBACK_TYPE* HandTouchingFOVEdge)(HandTouchingFOVEdgeCapability& touchingfov, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, XnDirection eDir, void* pCookie);
+		/** @copybrief xnRegisterToHandTouchingFOVEdge
+		* For full details and usage, see @ref xnRegisterToHandTouchingFOVEdge
+		*/
+		inline XnStatus RegisterToHandTouchingFOVEdge(HandTouchingFOVEdge handler, void* pCookie, XnCallbackHandle& hCallback)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			HandTouchingFOVEdgeCookie* pHandCookie;
+			XN_VALIDATE_ALLOC(pHandCookie, HandTouchingFOVEdgeCookie);
+			pHandCookie->handler = handler;
+			pHandCookie->pUserCookie = pCookie;
+
+			nRetVal = xnRegisterToHandTouchingFOVEdge(GetHandle(), HandTouchingFOVEdgeCB, pHandCookie, &pHandCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnOSFree(pHandCookie);
+				return (nRetVal);
+			}
+
+			hCallback = pHandCookie;
+
+			return (XN_STATUS_OK);
+		}
+
+		/** @copybrief xnUnregisterFromHandTouchingFOVEdge
+		* For full details and usage, see @ref xnUnregisterFromHandTouchingFOVEdge
+		*/
+		inline void UnregisterFromHandTouchingFOVEdge(XnCallbackHandle hCallback)
+		{
+			HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)hCallback;
+			xnUnregisterFromHandTouchingFOVEdge(GetHandle(), pHandCookie->hCallback);
+			xnOSFree(pHandCookie);
+		}
+	private:
+		typedef struct HandTouchingFOVEdgeCookie
+		{
+			HandTouchingFOVEdge handler;
+			void* pUserCookie;
+			XnCallbackHandle hCallback;
+		} HandTouchingFOVEdgeCookie;
+
+		static void XN_CALLBACK_TYPE HandTouchingFOVEdgeCB(XnNodeHandle hNode, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, XnDirection eDir, void* pCookie)
+		{
+			HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)pCookie;
+			HandTouchingFOVEdgeCapability cap(hNode);
+			if (pHandCookie->handler != NULL)
+			{
+				pHandCookie->handler(cap, user, pPosition, fTime, eDir, pHandCookie->pUserCookie);
+			}
+		}
+
+	};
+	/**
 	 * @ingroup cppref
 	 * Represents a Hands Generator node
 	 */
@@ -3565,6 +3891,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline HandsGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
+		inline HandsGenerator(const NodeWrapper& other) : Generator(other) {}
 
 		/** @copybrief xnCreateHandsGenerator
 		 * For full details and usage, see @ref xnCreateHandsGenerator
@@ -3615,7 +3942,7 @@ namespace xn
 			pHandCookie->destroyHandler = DestroyCB;
 			pHandCookie->pUserCookie = pCookie;
 
-			nRetVal = xnRegisterHandCallbacks(m_hNode, HandCreateCB, HandUpdateCB, HandDestroyCB, pHandCookie, &pHandCookie->hCallback);
+			nRetVal = xnRegisterHandCallbacks(GetHandle(), HandCreateCB, HandUpdateCB, HandDestroyCB, pHandCookie, &pHandCookie->hCallback);
 			if (nRetVal != XN_STATUS_OK)
 			{
 				xnOSFree(pHandCookie);
@@ -3633,7 +3960,7 @@ namespace xn
 		inline void UnregisterHandCallbacks(XnCallbackHandle hCallback)
 		{
 			HandCookie* pHandCookie = (HandCookie*)hCallback;
-			xnUnregisterHandCallbacks(m_hNode, pHandCookie->hCallback);
+			xnUnregisterHandCallbacks(GetHandle(), pHandCookie->hCallback);
 			xnOSFree(pHandCookie);
 		}
 
@@ -3642,7 +3969,7 @@ namespace xn
 		 */
 		inline XnStatus StopTracking(XnUserID user)
 		{
-			return xnStopTracking(m_hNode, user);
+			return xnStopTracking(GetHandle(), user);
 		}
 
 		/** @copybrief xnStopTrackingAll
@@ -3650,7 +3977,7 @@ namespace xn
 		 */
 		inline XnStatus StopTrackingAll()
 		{
-			return xnStopTrackingAll(m_hNode);
+			return xnStopTrackingAll(GetHandle());
 		}
 
 		/** @copybrief xnStartTracking
@@ -3658,7 +3985,7 @@ namespace xn
 		 */
 		inline XnStatus StartTracking(const XnPoint3D& ptPosition)
 		{
-			return xnStartTracking(m_hNode, &ptPosition);
+			return xnStartTracking(GetHandle(), &ptPosition);
 		}
 
 		/** @copybrief xnSetTrackingSmoothing
@@ -3666,7 +3993,27 @@ namespace xn
 		 */
 		inline XnStatus SetSmoothing(XnFloat fSmoothingFactor)
 		{
-			return xnSetTrackingSmoothing(m_hNode, fSmoothingFactor);
+			return xnSetTrackingSmoothing(GetHandle(), fSmoothingFactor);
+		}
+
+		/**
+		* Gets an @ref HandTouchingFOVEdgeCapability object for accessing hand touching FOV edge callbacks functionality.
+		* It is the application responsibility to check first if @ref XN_CAPABILITY_HAND_TOUCHING_FOV_EDGE is supported
+		* by calling @ref IsCapabilitySupported().
+		*/
+		inline const HandTouchingFOVEdgeCapability GetHandTouchingFOVEdgeCap() const
+		{
+			return HandTouchingFOVEdgeCapability(GetHandle());
+		}
+
+		/**
+		* Gets an @ref HandTouchingFOVEdgeCapability object for accessing hand touching FOV edge callbacks functionality.
+		* It is the application responsibility to check first if @ref XN_CAPABILITY_HAND_TOUCHING_FOV_EDGE is supported
+		* by calling @ref IsCapabilitySupported().
+		*/
+		inline HandTouchingFOVEdgeCapability GetHandTouchingFOVEdgeCap()
+		{
+			return HandTouchingFOVEdgeCapability(GetHandle());
 		}
 
 	private:
@@ -3721,13 +4068,14 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline SkeletonCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		SkeletonCapability(const NodeWrapper& node) : Capability(node) {}
 
 		/** @copybrief xnIsJointAvailable
 		 * For full details and usage, see @ref xnIsJointAvailable
 		 */
 		inline XnBool IsJointAvailable(XnSkeletonJoint eJoint) const
 		{
-			return xnIsJointAvailable(m_hNode, eJoint);
+			return xnIsJointAvailable(GetHandle(), eJoint);
 		}
 
 		/** @copybrief xnIsProfileAvailable
@@ -3735,7 +4083,7 @@ namespace xn
 		 */
 		inline XnBool IsProfileAvailable(XnSkeletonProfile eProfile) const
 		{
-			return xnIsProfileAvailable(m_hNode, eProfile);
+			return xnIsProfileAvailable(GetHandle(), eProfile);
 		}
 
 		/** @copybrief xnSetSkeletonProfile
@@ -3743,7 +4091,7 @@ namespace xn
 		 */
 		inline XnStatus SetSkeletonProfile(XnSkeletonProfile eProfile)
 		{
-			return xnSetSkeletonProfile(m_hNode, eProfile);
+			return xnSetSkeletonProfile(GetHandle(), eProfile);
 		}
 
 		/** @copybrief xnSetJointActive
@@ -3751,7 +4099,7 @@ namespace xn
 		 */
 		inline XnStatus SetJointActive(XnSkeletonJoint eJoint, XnBool bState)
 		{
-			return xnSetJointActive(m_hNode, eJoint, bState);
+			return xnSetJointActive(GetHandle(), eJoint, bState);
 		}
 
 		/** @copybrief xnIsJointActive
@@ -3760,7 +4108,7 @@ namespace xn
 		XN_API_DEPRECATED("Use the version with one argument") 
 		inline XnBool IsJointActive(XnSkeletonJoint eJoint, XnBool /*bState*/) const
 		{
-			return xnIsJointActive(m_hNode, eJoint);
+			return xnIsJointActive(GetHandle(), eJoint);
 		}
 
 		/** @copybrief xnIsJointActive
@@ -3768,7 +4116,7 @@ namespace xn
 		 */
 		inline XnBool IsJointActive(XnSkeletonJoint eJoint) const
 		{
-			return xnIsJointActive(m_hNode, eJoint);
+			return xnIsJointActive(GetHandle(), eJoint);
 		}
 
 		/** @copybrief xnRegisterToJointConfigurationChange
@@ -3776,7 +4124,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToJointConfigurationChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToJointConfigurationChange, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToJointConfigurationChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromJointConfigurationChange
@@ -3784,7 +4132,7 @@ namespace xn
 		 */
 		inline void UnregisterFromJointConfigurationChange(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromJointConfigurationChange, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromJointConfigurationChange, GetHandle(), hCallback);
 		}
 
 		/** @copybrief xnEnumerateActiveJoints
@@ -3792,7 +4140,7 @@ namespace xn
 		 */
 		inline XnStatus EnumerateActiveJoints(XnSkeletonJoint* pJoints, XnUInt16& nJoints) const
 		{
-			return xnEnumerateActiveJoints(m_hNode, pJoints, &nJoints);
+			return xnEnumerateActiveJoints(GetHandle(), pJoints, &nJoints);
 		}
 
 		/** @copybrief xnGetSkeletonJoint
@@ -3800,7 +4148,7 @@ namespace xn
 		 */
 		inline XnStatus GetSkeletonJoint(XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointTransformation& Joint) const
 		{
-			return xnGetSkeletonJoint(m_hNode, user, eJoint, &Joint);
+			return xnGetSkeletonJoint(GetHandle(), user, eJoint, &Joint);
 		}
 
 		/** @copybrief xnGetSkeletonJointPosition
@@ -3808,7 +4156,7 @@ namespace xn
 		 */
 		inline XnStatus GetSkeletonJointPosition(XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointPosition& Joint) const
 		{
-			return xnGetSkeletonJointPosition(m_hNode, user, eJoint, &Joint);
+			return xnGetSkeletonJointPosition(GetHandle(), user, eJoint, &Joint);
 		}
 
 		/** @copybrief xnGetSkeletonJointOrientation
@@ -3816,7 +4164,7 @@ namespace xn
 		 */
 		inline XnStatus GetSkeletonJointOrientation(XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointOrientation& Joint) const
 		{
-			return xnGetSkeletonJointOrientation(m_hNode, user, eJoint, &Joint);
+			return xnGetSkeletonJointOrientation(GetHandle(), user, eJoint, &Joint);
 		}
 
 		/** @copybrief xnIsSkeletonTracking
@@ -3824,7 +4172,7 @@ namespace xn
 		 */
 		inline XnBool IsTracking(XnUserID user) const
 		{
-			return xnIsSkeletonTracking(m_hNode, user);
+			return xnIsSkeletonTracking(GetHandle(), user);
 		}
 
 		/** @copybrief xnIsSkeletonCalibrated
@@ -3832,7 +4180,7 @@ namespace xn
 		 */
 		inline XnBool IsCalibrated(XnUserID user) const
 		{
-			return xnIsSkeletonCalibrated(m_hNode, user);
+			return xnIsSkeletonCalibrated(GetHandle(), user);
 		}
 
 		/** @copybrief xnIsSkeletonCalibrating
@@ -3840,7 +4188,7 @@ namespace xn
 		 */
 		inline XnBool IsCalibrating(XnUserID user) const
 		{
-			return xnIsSkeletonCalibrating(m_hNode, user);
+			return xnIsSkeletonCalibrating(GetHandle(), user);
 		}
 
 		/** @copybrief xnRequestSkeletonCalibration
@@ -3848,7 +4196,7 @@ namespace xn
 		 */
 		inline XnStatus RequestCalibration(XnUserID user, XnBool bForce)
 		{
-			return xnRequestSkeletonCalibration(m_hNode, user, bForce);
+			return xnRequestSkeletonCalibration(GetHandle(), user, bForce);
 		}
 
 		/** @copybrief xnAbortSkeletonCalibration
@@ -3856,7 +4204,7 @@ namespace xn
 		 */
 		inline XnStatus AbortCalibration(XnUserID user)
 		{
-			return xnAbortSkeletonCalibration(m_hNode, user);
+			return xnAbortSkeletonCalibration(GetHandle(), user);
 		}
 
 		/** @copybrief xnSaveSkeletonCalibrationDataToFile
@@ -3864,7 +4212,7 @@ namespace xn
 		*/
 		inline XnStatus SaveCalibrationDataToFile(XnUserID user, const XnChar* strFileName)
 		{
-			return xnSaveSkeletonCalibrationDataToFile(m_hNode, user, strFileName);
+			return xnSaveSkeletonCalibrationDataToFile(GetHandle(), user, strFileName);
 		}
 
 		/** @copybrief xnLoadSkeletonCalibrationDataFromFile
@@ -3872,7 +4220,7 @@ namespace xn
 		*/
 		inline XnStatus LoadCalibrationDataFromFile(XnUserID user, const XnChar* strFileName)
 		{
-			return xnLoadSkeletonCalibrationDataFromFile(m_hNode, user, strFileName);
+			return xnLoadSkeletonCalibrationDataFromFile(GetHandle(), user, strFileName);
 		}
 
 		/** @copybrief xnSaveSkeletonCalibrationData
@@ -3880,7 +4228,7 @@ namespace xn
 		 */
 		inline XnStatus SaveCalibrationData(XnUserID user, XnUInt32 nSlot)
 		{
-			return xnSaveSkeletonCalibrationData(m_hNode, user, nSlot);
+			return xnSaveSkeletonCalibrationData(GetHandle(), user, nSlot);
 		}
 
 		/** @copybrief xnLoadSkeletonCalibrationData
@@ -3888,7 +4236,7 @@ namespace xn
 		 */
 		inline XnStatus LoadCalibrationData(XnUserID user, XnUInt32 nSlot)
 		{
-			return xnLoadSkeletonCalibrationData(m_hNode, user, nSlot);
+			return xnLoadSkeletonCalibrationData(GetHandle(), user, nSlot);
 		}
 
 		/** @copybrief xnClearSkeletonCalibrationData
@@ -3896,7 +4244,7 @@ namespace xn
 		 */
 		inline XnStatus ClearCalibrationData(XnUInt32 nSlot)
 		{
-			return xnClearSkeletonCalibrationData(m_hNode, nSlot);
+			return xnClearSkeletonCalibrationData(GetHandle(), nSlot);
 		}
 
 		/** @copybrief xnIsSkeletonCalibrationData
@@ -3904,7 +4252,7 @@ namespace xn
 		 */
 		inline XnBool IsCalibrationData(XnUInt32 nSlot) const
 		{
-			return xnIsSkeletonCalibrationData(m_hNode, nSlot);
+			return xnIsSkeletonCalibrationData(GetHandle(), nSlot);
 		}
 
 		/** @copybrief xnStartSkeletonTracking
@@ -3912,7 +4260,7 @@ namespace xn
 		 */
 		inline XnStatus StartTracking(XnUserID user)
 		{
-			return xnStartSkeletonTracking(m_hNode, user);
+			return xnStartSkeletonTracking(GetHandle(), user);
 		}
 
 		/** @copybrief xnStopSkeletonTracking
@@ -3920,7 +4268,7 @@ namespace xn
 		 */
 		inline XnStatus StopTracking(XnUserID user)
 		{
-			return xnStopSkeletonTracking(m_hNode, user);
+			return xnStopSkeletonTracking(GetHandle(), user);
 		}
 
 		/** @copybrief xnResetSkeleton
@@ -3928,7 +4276,7 @@ namespace xn
 		 */
 		inline XnStatus Reset(XnUserID user)
 		{
-			return xnResetSkeleton(m_hNode, user);
+			return xnResetSkeleton(GetHandle(), user);
 		}
 
 		/** @copybrief xnNeedPoseForSkeletonCalibration
@@ -3936,7 +4284,7 @@ namespace xn
 		 */
 		inline XnBool NeedPoseForCalibration() const
 		{
-			return xnNeedPoseForSkeletonCalibration(m_hNode);
+			return xnNeedPoseForSkeletonCalibration(GetHandle());
 		}
 
 		/** @copybrief xnGetSkeletonCalibrationPose
@@ -3944,7 +4292,7 @@ namespace xn
 		 */
 		inline XnStatus GetCalibrationPose(XnChar* strPose) const
 		{
-			return xnGetSkeletonCalibrationPose(m_hNode, strPose);
+			return xnGetSkeletonCalibrationPose(GetHandle(), strPose);
 		}
 
 		/** @copybrief xnSetSkeletonSmoothing
@@ -3952,7 +4300,7 @@ namespace xn
 		 */
 		inline XnStatus SetSmoothing(XnFloat fSmoothingFactor)
 		{
-			return xnSetSkeletonSmoothing(m_hNode, fSmoothingFactor);
+			return xnSetSkeletonSmoothing(GetHandle(), fSmoothingFactor);
 		}
 
 		/**
@@ -3976,7 +4324,7 @@ namespace xn
 		/** @copybrief xnRegisterCalibrationCallbacks
 		 * For full details and usage, see @ref xnRegisterCalibrationCallbacks
 		 */
-		inline XnStatus RegisterCalibrationCallbacks(CalibrationStart CalibrationStartCB, CalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle& hCallback)
+		inline XnStatus XN_API_DEPRECATED("Please use RegisterToCalibrationStart/Complete") RegisterCalibrationCallbacks(CalibrationStart CalibrationStartCB, CalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle& hCallback)
 		{
 			XnStatus nRetVal = XN_STATUS_OK;
 
@@ -3986,7 +4334,10 @@ namespace xn
 			pSkeletonCookie->endHandler = CalibrationEndCB;
 			pSkeletonCookie->pUserCookie = pCookie;
 
-			nRetVal = xnRegisterCalibrationCallbacks(m_hNode, CalibrationStartCallback, CalibrationEndCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
+#pragma warning (push)
+#pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
+			nRetVal = xnRegisterCalibrationCallbacks(GetHandle(), CalibrationStartBundleCallback, CalibrationEndBundleCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
+#pragma warning (pop)
 			if (nRetVal != XN_STATUS_OK)
 			{
 				xnOSFree(pSkeletonCookie);
@@ -4001,73 +4352,246 @@ namespace xn
 		/** @copybrief xnUnregisterCalibrationCallbacks
 		 * For full details and usage, see @ref xnUnregisterCalibrationCallbacks
 		 */
-		inline void UnregisterCalibrationCallbacks(XnCallbackHandle hCallback)
+		inline void XN_API_DEPRECATED("Please use UnregisterFromCalibrationStart/Complete") UnregisterCalibrationCallbacks(XnCallbackHandle hCallback)
 		{
 			SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)hCallback;
-			xnUnregisterCalibrationCallbacks(m_hNode, pSkeletonCookie->hCallback);
+#pragma warning (push)
+#pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
+			xnUnregisterCalibrationCallbacks(GetHandle(), pSkeletonCookie->hCallback);
+#pragma warning (pop)
 			xnOSFree(pSkeletonCookie);
 		}
 
-	private:
-		typedef struct SkeletonCookie
-		{
-			CalibrationStart startHandler;
-			CalibrationEnd endHandler;
-			void* pUserCookie;
-			XnCallbackHandle hCallback;
-		} SkeletonCookie;
-
-		static void XN_CALLBACK_TYPE CalibrationStartCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
+		/** @copybrief xnRegisterToCalibrationStart
+		 * For full details and usage, see @ref xnRegisterToCalibrationStart
+		 */
+		inline XnStatus RegisterToCalibrationStart(CalibrationStart handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
-			SkeletonCapability cap(hNode);
-			if (pSkeletonCookie->startHandler != NULL)
+			XnStatus nRetVal = XN_STATUS_OK;
+			CalibrationStartCookie* pCalibrationCookie;
+			XN_VALIDATE_ALLOC(pCalibrationCookie, CalibrationStartCookie);
+			pCalibrationCookie->handler = handler;
+			pCalibrationCookie->pUserCookie = pCookie;
+			nRetVal = xnRegisterToCalibrationStart(GetHandle(), CalibrationStartCallback, pCalibrationCookie, &pCalibrationCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
 			{
-				pSkeletonCookie->startHandler(cap, user, pSkeletonCookie->pUserCookie);
+				xnOSFree(pCalibrationCookie);
+				return nRetVal;
 			}
+			hCallback = pCalibrationCookie;
+			return XN_STATUS_OK;
 		}
 
-		static void XN_CALLBACK_TYPE CalibrationEndCallback(XnNodeHandle hNode, XnUserID user, XnBool bSuccess, void* pCookie)
+		/** @copybrief xnUnregisterFromCalibrationStart
+		 * For full details and usage, see @ref xnUnregisterFromCalibrationStart.
+		 *
+		 * Note: due to history constraints, this function has an XnStatus return value. In practice, it
+		 * will always succeed. The user can safely ignore the return value.
+		 */
+		inline XnStatus UnregisterFromCalibrationStart(XnCallbackHandle hCallback)
 		{
-			SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
-			SkeletonCapability cap(hNode);
-			if (pSkeletonCookie->endHandler != NULL)
-			{
-				pSkeletonCookie->endHandler(cap, user, bSuccess, pSkeletonCookie->pUserCookie);
-			}
+			CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)hCallback;
+			xnUnregisterFromCalibrationStart(GetHandle(), pCalibrationCookie->hCallback);
+			xnOSFree(pCalibrationCookie);
+			return XN_STATUS_OK;
 		}
-	};
 
-	/**
-	 * @ingroup cppref
-	 * Allows access to <b>Pose Detection</b> capability functions. see @ref pose for additional details.
-	 */
-	class PoseDetectionCapability : public Capability
-	{
-	public:
 		/**
-		 * Ctor
-		 *
-		 * @param	hNode		[in]	Node handle
+		 * Callback for indication that a specific user's skeleton is calibrating, and its current status
+		 * 
+		 * @param	hNode				[in]	The node that raised the event.
+		 * @param	user				[in]	The id of the user for which calibration was attempted.
+		 * @param	calibrationError	[in]	the current status of the calibration
+		 * @param	pCookie				[in]	A user-provided cookie that was given when registering to this event.
 		 */
-		inline PoseDetectionCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		typedef void (XN_CALLBACK_TYPE* CalibrationInProgress)(SkeletonCapability& skeleton, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie);
 
-		/**
-		 * Callback for indication that a specific user has entered a pose, or left it.
-		 *
-		 * @param	pose		[in]	The node that raised the event.
-		 * @param	strPose		[in]	The pose that is relevant to the callback.
-		 * @param	user		[in]	The id of the user that entered the pose or left it.
-		 * @param	pCookie		[in]	A user-provided cookie that was given when registering to this event.
+		/** @copybrief xnRegisterToCalibrationInProgress
+		 * For full details and usage, see @ref xnRegisterToCalibrationInProgress
 		 */
-		typedef void (XN_CALLBACK_TYPE* PoseDetection)(PoseDetectionCapability& pose, const XnChar* strPose, XnUserID user, void* pCookie);
-
+		inline XnStatus RegisterToCalibrationInProgress(CalibrationInProgress handler, void* pCookie, XnCallbackHandle& hCallback)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			CalibrationInProgressCookie* pSkeletonCookie;
+			XN_VALIDATE_ALLOC(pSkeletonCookie, CalibrationInProgressCookie);
+			pSkeletonCookie->handler = handler;
+			pSkeletonCookie->pUserCookie = pCookie;
+
+			nRetVal = xnRegisterToCalibrationInProgress(GetHandle(), CalibrationInProgressCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnOSFree(pSkeletonCookie);
+				return (nRetVal);
+			}
+
+			hCallback = pSkeletonCookie;
+
+			return (XN_STATUS_OK);
+		}
+
+		/** @copybrief xnUnregisterFromCalibrationInProgress
+		 * For full details and usage, see @ref xnUnregisterFromCalibrationInProgress
+		 */
+		inline void UnregisterFromCalibrationInProgress(XnCallbackHandle hCallback)
+		{
+			CalibrationInProgressCookie* pSkeletonCookie = (CalibrationInProgressCookie*)hCallback;
+			xnUnregisterFromCalibrationInProgress(GetHandle(), pSkeletonCookie->hCallback);
+			xnOSFree(pSkeletonCookie);
+		}
+
+		/**
+		 * Callback for indication that a specific user's skeleton has now completed the calibration process, with a status
+		 * 
+		 * @param	hNode				[in]	The node that raised the event.
+		 * @param	user				[in]	The id of the user for which calibration was attempted.
+		 * @param	calibrationError	[in]	The status in which the calibration has ended.
+		 * @param	pCookie				[in]	A user-provided cookie that was given when registering to this event.
+		 */
+		typedef void (XN_CALLBACK_TYPE* CalibrationComplete)(SkeletonCapability& skeleton, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie);
+		/** @copybrief xnRegisterToCalibrationComplete
+		 * For full details and usage, see @ref xnRegisterToCalibrationComplete
+		 */
+		inline XnStatus RegisterToCalibrationComplete(CalibrationComplete handler, void* pCookie, XnCallbackHandle& hCallback)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			CalibrationCompleteCookie* pSkeletonCookie;
+			XN_VALIDATE_ALLOC(pSkeletonCookie, CalibrationCompleteCookie);
+			pSkeletonCookie->handler = handler;
+			pSkeletonCookie->pUserCookie = pCookie;
+
+			nRetVal = xnRegisterToCalibrationComplete(GetHandle(), CalibrationCompleteCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnOSFree(pSkeletonCookie);
+				return (nRetVal);
+			}
+
+			hCallback = pSkeletonCookie;
+
+			return (XN_STATUS_OK);
+		}
+
+		/** @copybrief xnUnregisterFromCalibrationComplete
+		 * For full details and usage, see @ref xnUnregisterFromCalibrationComplete
+		 */
+		inline void UnregisterFromCalibrationComplete(XnCallbackHandle hCallback)
+		{
+			CalibrationCompleteCookie* pSkeletonCookie = (CalibrationCompleteCookie*)hCallback;
+			xnUnregisterFromCalibrationComplete(GetHandle(), pSkeletonCookie->hCallback);
+			xnOSFree(pSkeletonCookie);
+		}
+	private:
+		typedef struct SkeletonCookie
+		{
+			CalibrationStart startHandler;
+			CalibrationEnd endHandler;
+			void* pUserCookie;
+			XnCallbackHandle hCallback;
+		} SkeletonCookie;
+
+		static void XN_CALLBACK_TYPE CalibrationStartBundleCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
+		{
+			SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
+			SkeletonCapability cap(hNode);
+			if (pSkeletonCookie->startHandler != NULL)
+			{
+				pSkeletonCookie->startHandler(cap, user, pSkeletonCookie->pUserCookie);
+			}
+		}
+
+		static void XN_CALLBACK_TYPE CalibrationEndBundleCallback(XnNodeHandle hNode, XnUserID user, XnBool bSuccess, void* pCookie)
+		{
+			SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
+			SkeletonCapability cap(hNode);
+			if (pSkeletonCookie->endHandler != NULL)
+			{
+				pSkeletonCookie->endHandler(cap, user, bSuccess, pSkeletonCookie->pUserCookie);
+			}
+		}
+		typedef struct CalibrationStartCookie
+		{
+			CalibrationStart handler;
+			void* pUserCookie;
+			XnCallbackHandle hCallback;
+		} CalibrationStartCookie;
+
+		static void XN_CALLBACK_TYPE CalibrationStartCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
+		{
+			CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)pCookie;
+			SkeletonCapability cap(hNode);
+			if (pCalibrationCookie->handler != NULL)
+			{
+				pCalibrationCookie->handler(cap, user, pCalibrationCookie->pUserCookie);
+			}
+		}
+		typedef struct CalibrationInProgressCookie
+		{
+			CalibrationInProgress handler;
+			void* pUserCookie;
+			XnCallbackHandle hCallback;
+		} CalibrationInProgressCookie;
+
+		static void XN_CALLBACK_TYPE CalibrationInProgressCallback(XnNodeHandle hNode, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie)
+		{
+			CalibrationInProgressCookie* pSkeletonCookie = (CalibrationInProgressCookie*)pCookie;
+			SkeletonCapability cap(hNode);
+			if (pSkeletonCookie->handler != NULL)
+			{
+				pSkeletonCookie->handler(cap, user, calibrationError, pSkeletonCookie->pUserCookie);
+			}
+		}
+
+		typedef struct CalibrationCompleteCookie
+		{
+			CalibrationComplete handler;
+			void* pUserCookie;
+			XnCallbackHandle hCallback;
+		} CalibrationCompleteCookie;
+
+		static void XN_CALLBACK_TYPE CalibrationCompleteCallback(XnNodeHandle hNode, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie)
+		{
+			CalibrationCompleteCookie* pSkeletonCookie = (CalibrationCompleteCookie*)pCookie;
+			SkeletonCapability cap(hNode);
+			if (pSkeletonCookie->handler != NULL)
+			{
+				pSkeletonCookie->handler(cap, user, calibrationError, pSkeletonCookie->pUserCookie);
+			}
+		}
+	};
+
+	/**
+	 * @ingroup cppref
+	 * Allows access to <b>Pose Detection</b> capability functions. see @ref pose for additional details.
+	 */
+	class PoseDetectionCapability : public Capability
+	{
+	public:
+		/**
+		 * Ctor
+		 *
+		 * @param	hNode		[in]	Node handle
+		 */
+		inline PoseDetectionCapability(XnNodeHandle hNode) : Capability(hNode) {}
+		PoseDetectionCapability(const NodeWrapper& node) : Capability(node) {}
+
+		/**
+		 * Callback for indication that a specific user has entered a pose, or left it.
+		 *
+		 * @param	pose		[in]	The node that raised the event.
+		 * @param	strPose		[in]	The pose that is relevant to the callback.
+		 * @param	user		[in]	The id of the user that entered the pose or left it.
+		 * @param	pCookie		[in]	A user-provided cookie that was given when registering to this event.
+		 */
+		typedef void (XN_CALLBACK_TYPE* PoseDetection)(PoseDetectionCapability& pose, const XnChar* strPose, XnUserID user, void* pCookie);
+
 		/** @copybrief xnGetNumberOfPoses
 		 * For full details and usage, see @ref xnGetNumberOfPoses
 		 */
 		inline XnUInt32 GetNumberOfPoses() const
 		{
-			return xnGetNumberOfPoses(m_hNode);
+			return xnGetNumberOfPoses(GetHandle());
 		}
 
 		/** @copybrief xnGetAvailablePoses
@@ -4075,22 +4599,32 @@ namespace xn
 		 */
 		inline XnStatus GetAvailablePoses(XnChar** pstrPoses, XnUInt32& nPoses) const
 		{
-			return xnGetAvailablePoses(m_hNode, pstrPoses, &nPoses);
+			return xnGetAvailablePoses(GetHandle(), pstrPoses, &nPoses);
 		}
 		/** @copybrief xnGetAvailablePoses
 		* For full details and usage, see @ref xnGetAvailablePoses
 		*/
 		inline XnStatus GetAllAvailablePoses(XnChar** pstrPoses, XnUInt32 nNameLength, XnUInt32& nPoses) const
 		{
-			return xnGetAllAvailablePoses(m_hNode, pstrPoses, nNameLength, &nPoses);
+			return xnGetAllAvailablePoses(GetHandle(), pstrPoses, nNameLength, &nPoses);
 		}
 
+        inline XnBool IsPoseSupported(const XnChar* strPose)
+        {
+            return xnIsPoseSupported(GetHandle(), strPose);
+        }
+
+        inline XnStatus GetPoseStatus(XnUserID userID, const XnChar* poseName, XnUInt64& poseTime, XnPoseDetectionStatus& eStatus, XnPoseDetectionState& eState)
+        {
+            return xnGetPoseStatus(GetHandle(), userID, poseName, &poseTime, &eStatus, &eState);
+        }
+
 		/** @copybrief xnStartPoseDetection
 		 * For full details and usage, see @ref xnStartPoseDetection
 		 */
 		inline XnStatus StartPoseDetection(const XnChar* strPose, XnUserID user)
 		{
-			return xnStartPoseDetection(m_hNode, strPose, user);
+			return xnStartPoseDetection(GetHandle(), strPose, user);
 		}
 
 		/** @copybrief xnStopPoseDetection
@@ -4098,13 +4632,21 @@ namespace xn
 		 */
 		inline XnStatus StopPoseDetection(XnUserID user)
 		{
-			return xnStopPoseDetection(m_hNode, user);
+			return xnStopPoseDetection(GetHandle(), user);
+		}
+
+		/** @copybrief xnStopSinglePoseDetection
+		 * For full details and usage, see @ref xnStopSinglePoseDetection
+		 */
+		inline XnStatus StopSinglePoseDetection(XnUserID user, const XnChar* strPose)
+		{
+			return xnStopSinglePoseDetection(GetHandle(), user, strPose);
 		}
 
 		/** @copybrief xnRegisterToPoseCallbacks
 		 * For full details and usage, see @ref xnRegisterToPoseCallbacks
 		 */
-		inline XnStatus RegisterToPoseCallbacks(PoseDetection PoseStartCB, PoseDetection PoseEndCB, void* pCookie, XnCallbackHandle& hCallback)
+		inline XnStatus XN_API_DEPRECATED("Please use RegisterToPoseDetected/RegisterToOutOfPose instead") RegisterToPoseCallbacks(PoseDetection PoseStartCB, PoseDetection PoseEndCB, void* pCookie, XnCallbackHandle& hCallback)
 		{
 			XnStatus nRetVal = XN_STATUS_OK;
 
@@ -4114,7 +4656,10 @@ namespace xn
 			pPoseCookie->endHandler = PoseEndCB;
 			pPoseCookie->pPoseCookie = pCookie;
 
-			nRetVal = xnRegisterToPoseCallbacks(m_hNode, PoseDetectionStartCallback, PoseDetectionStartEndCallback, pPoseCookie, &pPoseCookie->hCallback);
+#pragma warning (push)
+#pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
+			nRetVal = xnRegisterToPoseCallbacks(GetHandle(), PoseDetectionStartBundleCallback, PoseDetectionStartEndBundleCallback, pPoseCookie, &pPoseCookie->hCallback);
+#pragma warning (pop)
 			if (nRetVal != XN_STATUS_OK)
 			{
 				xnOSFree(pPoseCookie);
@@ -4129,12 +4674,119 @@ namespace xn
 		/** @copybrief xnUnregisterCalibrationCallbacks
 		 * For full details and usage, see @ref xnUnregisterCalibrationCallbacks
 		 */
-		inline void UnregisterFromPoseCallbacks(XnCallbackHandle hCallback)
+		inline void XN_API_DEPRECATED("Please use UnregisterFromPoseDetected/UnregisterFromOutOfPose instead") UnregisterFromPoseCallbacks(XnCallbackHandle hCallback)
 		{
 			PoseCookie* pPoseCookie = (PoseCookie*)hCallback;
-			xnUnregisterCalibrationCallbacks(m_hNode, pPoseCookie->hCallback);
+#pragma warning (push)
+#pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
+			xnUnregisterFromPoseCallbacks(GetHandle(), pPoseCookie->hCallback);
+#pragma warning (pop)
 			xnOSFree(pPoseCookie);
 		}
+
+		/** @copybrief xnRegisterToPoseDetected
+		 * For full details and usage, see @ref xnRegisterToPoseDetected
+		 */
+		inline XnStatus RegisterToPoseDetected(PoseDetection handler, void* pCookie, XnCallbackHandle& hCallback)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+			PoseDetectionCookie* pPoseCookie;
+			XN_VALIDATE_ALLOC(pPoseCookie, PoseDetectionCookie);
+			pPoseCookie->handler = handler;
+			pPoseCookie->pPoseCookie = pCookie;
+
+			nRetVal = xnRegisterToPoseDetected(GetHandle(), PoseDetectionCallback, pPoseCookie, &pPoseCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnOSFree(pPoseCookie);
+				return nRetVal;
+			}
+			hCallback = pPoseCookie;
+			return XN_STATUS_OK;
+		}
+		/** @copybrief xnRegisterToOutOfPose
+		 * For full details and usage, see @ref xnRegisterToOutOfPose
+		 */
+		inline XnStatus RegisterToOutOfPose(PoseDetection handler, void* pCookie, XnCallbackHandle& hCallback)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+			PoseDetectionCookie* pPoseCookie;
+			XN_VALIDATE_ALLOC(pPoseCookie, PoseDetectionCookie);
+			pPoseCookie->handler = handler;
+			pPoseCookie->pPoseCookie = pCookie;
+
+			nRetVal = xnRegisterToOutOfPose(GetHandle(), PoseDetectionCallback, pPoseCookie, &pPoseCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnOSFree(pPoseCookie);
+				return nRetVal;
+			}
+			hCallback = pPoseCookie;
+			return XN_STATUS_OK;
+		}
+		/** @copybrief xnUnregisterFromPoseDetected
+		 * For full details and usage, see @ref xnUnregisterFromPoseDetected
+		 */
+		inline void UnregisterFromPoseDetected(XnCallbackHandle hCallback)
+		{
+			PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
+			xnUnregisterFromPoseDetected(GetHandle(), pPoseCookie->hCallback);
+			xnOSFree(pPoseCookie);
+		}
+		/** @copybrief xnUnregisterFromOutOfPose
+		 * For full details and usage, see @ref xnUnregisterFromOutOfPose
+		 */
+		inline void UnregisterFromOutOfPose(XnCallbackHandle hCallback)
+		{
+			PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
+			xnUnregisterFromOutOfPose(GetHandle(), pPoseCookie->hCallback);
+			xnOSFree(pPoseCookie);
+		}
+
+		/**
+		 * Callback for indication of the current status of pose detection for a user
+		 *
+		 * @param	pose		[in]	The node that raised the event.
+		 * @param	strPose		[in]	The pose that is relevant to the callback.
+		 * @param	user		[in]	The id of the user that entered the pose or left it.
+		 * @param	poseError	[in]	The current status of the pose detection
+		 * @param	pCookie		[in]	A user-provided cookie that was given when registering to this event.
+		 */
+		typedef void (XN_CALLBACK_TYPE* PoseInProgress)(PoseDetectionCapability& pose, const XnChar* strPose, XnUserID user, XnPoseDetectionStatus poseError, void* pCookie);
+		/** @copybrief xnRegisterToPoseDetectionInProgress
+		 * For full details and usage, see @ref xnRegisterToPoseDetectionInProgress
+		 */
+		inline XnStatus RegisterToPoseInProgress(PoseInProgress handler, void* pCookie, XnCallbackHandle& hCallback)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			PoseInProgressCookie* pPoseCookie;
+			XN_VALIDATE_ALLOC(pPoseCookie, PoseInProgressCookie);
+			pPoseCookie->handler = handler;
+			pPoseCookie->pPoseCookie = pCookie;
+
+			nRetVal = xnRegisterToPoseDetectionInProgress(GetHandle(), PoseDetectionInProgressCallback, pPoseCookie, &pPoseCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnOSFree(pPoseCookie);
+				return (nRetVal);
+			}
+
+			hCallback = pPoseCookie;
+
+			return (XN_STATUS_OK);
+		}
+
+		/** @copybrief xnUnregisterFromPoseDetectionInProgress
+		 * For full details and usage, see @ref xnUnregisterFromPoseDetectionInProgress
+		 */
+		inline void UnregisterFromPoseInProgress(XnCallbackHandle hCallback)
+		{
+			PoseInProgressCookie* pPoseCookie = (PoseInProgressCookie*)hCallback;
+			xnUnregisterFromPoseDetectionInProgress(GetHandle(), pPoseCookie->hCallback);
+			xnOSFree(pPoseCookie);
+		}
+
 	private:
 		typedef struct PoseCookie
 		{
@@ -4144,7 +4796,7 @@ namespace xn
 			XnCallbackHandle hCallback;
 		} PoseCookie;
 
-		static void XN_CALLBACK_TYPE PoseDetectionStartCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
+		static void XN_CALLBACK_TYPE PoseDetectionStartBundleCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
 		{
 			PoseCookie* pPoseCookie = (PoseCookie*)pCookie;
 			PoseDetectionCapability cap(hNode);
@@ -4154,7 +4806,7 @@ namespace xn
 			}
 		}
 
-		static void XN_CALLBACK_TYPE PoseDetectionStartEndCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
+		static void XN_CALLBACK_TYPE PoseDetectionStartEndBundleCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
 		{
 			PoseCookie* pPoseCookie = (PoseCookie*)pCookie;
 			PoseDetectionCapability cap(hNode);
@@ -4163,6 +4815,38 @@ namespace xn
 				pPoseCookie->endHandler(cap, strPose, user, pPoseCookie->pPoseCookie);
 			}
 		}
+		typedef struct PoseDetectionCookie
+		{
+			PoseDetection handler;
+			void* pPoseCookie;
+			XnCallbackHandle hCallback;
+		} PoseDetectionCookie;
+		static void XN_CALLBACK_TYPE PoseDetectionCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
+		{
+			PoseDetectionCookie* pPoseDetectionCookie = (PoseDetectionCookie*)pCookie;
+			PoseDetectionCapability cap(hNode);
+			if (pPoseDetectionCookie->handler != NULL)
+			{
+				pPoseDetectionCookie->handler(cap, strPose, user, pPoseDetectionCookie->pPoseCookie);
+			}
+		}
+
+		typedef struct PoseInProgressCookie
+		{
+			PoseInProgress handler;
+			void* pPoseCookie;
+			XnCallbackHandle hCallback;
+		} PoseInProgressCookie;
+
+		static void XN_CALLBACK_TYPE PoseDetectionInProgressCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, XnPoseDetectionStatus poseErrors, void* pCookie)
+		{
+			PoseInProgressCookie* pPoseCookie = (PoseInProgressCookie*)pCookie;
+			PoseDetectionCapability cap(hNode);
+			if (pPoseCookie->handler != NULL)
+			{
+				pPoseCookie->handler(cap, strPose, user, poseErrors, pPoseCookie->pPoseCookie);
+			}
+		}
 	};
 
 	/**
@@ -4178,6 +4862,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline UserGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
+		inline UserGenerator(const NodeWrapper& other) : Generator(other) {}
 
 		/** @copybrief xnCreateUserGenerator
 		 * For full details and usage, see @ref xnCreateUserGenerator
@@ -4191,7 +4876,7 @@ namespace xn
 		 */
 		inline XnUInt16 GetNumberOfUsers() const
 		{
-			return xnGetNumberOfUsers(m_hNode);
+			return xnGetNumberOfUsers(GetHandle());
 		}
 
 		/** @copybrief xnGetUsers
@@ -4199,7 +4884,7 @@ namespace xn
 		 */
 		inline XnStatus GetUsers(XnUserID aUsers[], XnUInt16& nUsers) const
 		{
-			return xnGetUsers(m_hNode, aUsers, &nUsers);
+			return xnGetUsers(GetHandle(), aUsers, &nUsers);
 		}
 
 		/** @copybrief xnGetUserCoM
@@ -4207,7 +4892,7 @@ namespace xn
 		 */
 		inline XnStatus GetCoM(XnUserID user, XnPoint3D& com) const
 		{
-			return xnGetUserCoM(m_hNode, user, &com);
+			return xnGetUserCoM(GetHandle(), user, &com);
 		}
 
 		/** @copybrief xnGetUserPixels
@@ -4215,7 +4900,7 @@ namespace xn
 		 */
 		inline XnStatus GetUserPixels(XnUserID user, SceneMetaData& smd) const
 		{
-			return xnGetUserPixels(m_hNode, user, smd.GetUnderlying());
+			return xnGetUserPixels(GetHandle(), user, smd.GetUnderlying());
 		}
 		
 		/** @copybrief xnRegisterUserCallbacks
@@ -4231,7 +4916,7 @@ namespace xn
 			pUserCookie->lostHandler = LostUserCB;
 			pUserCookie->pUserCookie = pCookie;
 
-			nRetVal = xnRegisterUserCallbacks(m_hNode, NewUserCallback, LostUserCallback, pUserCookie, &pUserCookie->hCallback);
+			nRetVal = xnRegisterUserCallbacks(GetHandle(), NewUserCallback, LostUserCallback, pUserCookie, &pUserCookie->hCallback);
 			if (nRetVal != XN_STATUS_OK)
 			{
 				xnOSFree(pUserCookie);
@@ -4249,7 +4934,7 @@ namespace xn
 		inline void UnregisterUserCallbacks(XnCallbackHandle hCallback)
 		{
 			UserCookie* pUserCookie = (UserCookie*)hCallback;
-			xnUnregisterUserCallbacks(m_hNode, pUserCookie->hCallback);
+			xnUnregisterUserCallbacks(GetHandle(), pUserCookie->hCallback);
 			xnOSFree(pUserCookie);
 		}
 
@@ -4260,7 +4945,7 @@ namespace xn
 		 */
 		inline const SkeletonCapability GetSkeletonCap() const
 		{
-			return SkeletonCapability(m_hNode);
+			return SkeletonCapability(GetHandle());
 		}
 
 		/**
@@ -4270,7 +4955,7 @@ namespace xn
 		 */
 		inline SkeletonCapability GetSkeletonCap()
 		{
-			return SkeletonCapability(m_hNode);
+			return SkeletonCapability(GetHandle());
 		}
 
 		/**
@@ -4280,7 +4965,7 @@ namespace xn
 		 */
 		inline const PoseDetectionCapability GetPoseDetectionCap() const
 		{
-			return PoseDetectionCapability(m_hNode);
+			return PoseDetectionCapability(GetHandle());
 		}
 
 		/**
@@ -4290,7 +4975,75 @@ namespace xn
 		 */
 		inline PoseDetectionCapability GetPoseDetectionCap()
 		{
-			return PoseDetectionCapability(m_hNode);
+			return PoseDetectionCapability(GetHandle());
+		}
+
+		/** @copybrief xnRegisterToUserExit
+		 * For full details and usage, see @ref xnRegisterToUserExit
+		 */
+		inline XnStatus RegisterToUserExit(UserHandler handler, void* pCookie, XnCallbackHandle& hCallback)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			UserSingleCookie* pUserCookie;
+			XN_VALIDATE_ALLOC(pUserCookie, UserSingleCookie);
+			pUserCookie->handler = handler;
+			pUserCookie->pUserCookie = pCookie;
+
+			nRetVal = xnRegisterToUserExit(GetHandle(), UserSingleCallback, pUserCookie, &pUserCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnOSFree(pUserCookie);
+				return (nRetVal);
+			}
+
+			hCallback = pUserCookie;
+
+			return (XN_STATUS_OK);
+		}
+
+		/** @copybrief xnUnregisterFromUserExit
+		 * For full details and usage, see @ref xnUnregisterFromUserExit
+		 */
+		inline void UnregisterFromUserExit(XnCallbackHandle hCallback)
+		{
+			UserSingleCookie* pUserCookie = (UserSingleCookie*)hCallback;
+			xnUnregisterFromUserExit(GetHandle(), pUserCookie->hCallback);
+			xnOSFree(pUserCookie);
+		}
+
+		/** @copybrief xnRegisterToUserReEnter
+		 * For full details and usage, see @ref xnRegisterToUserReEnter
+		 */
+		inline XnStatus RegisterToUserReEnter(UserHandler handler, void* pCookie, XnCallbackHandle& hCallback)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			UserSingleCookie* pUserCookie;
+			XN_VALIDATE_ALLOC(pUserCookie, UserSingleCookie);
+			pUserCookie->handler = handler;
+			pUserCookie->pUserCookie = pCookie;
+
+			nRetVal = xnRegisterToUserReEnter(GetHandle(), UserSingleCallback, pUserCookie, &pUserCookie->hCallback);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnOSFree(pUserCookie);
+				return (nRetVal);
+			}
+
+			hCallback = pUserCookie;
+
+			return (XN_STATUS_OK);
+		}
+
+		/** @copybrief xnUnregisterFromUserReEnter
+		 * For full details and usage, see @ref xnUnregisterFromUserReEnter
+		 */
+		inline void UnregisterFromUserReEnter(XnCallbackHandle hCallback)
+		{
+			UserSingleCookie* pUserCookie = (UserSingleCookie*)hCallback;
+			xnUnregisterFromUserReEnter(GetHandle(), pUserCookie->hCallback);
+			xnOSFree(pUserCookie);
 		}
 
 	private:
@@ -4321,6 +5074,23 @@ namespace xn
 				pUserCookie->lostHandler(gen, user, pUserCookie->pUserCookie);
 			}
 		}
+
+		typedef struct UserSingleCookie
+		{
+			UserHandler handler;
+			void* pUserCookie;
+			XnCallbackHandle hCallback;
+		} UserSingleCookie;
+
+		static void XN_CALLBACK_TYPE UserSingleCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
+		{
+			UserSingleCookie* pUserCookie = (UserSingleCookie*)pCookie;
+			UserGenerator gen(hNode);
+			if (pUserCookie->handler != NULL)
+			{
+				pUserCookie->handler(gen, user, pUserCookie->pUserCookie);
+			}
+		}
 	};
 
 	/**
@@ -4336,6 +5106,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline AudioGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
+		inline AudioGenerator(const NodeWrapper& other) : Generator(other) {}
 
 		/** @copybrief xnCreateAudioGenerator
 		 * For full details and usage, see @ref xnCreateAudioGenerator
@@ -4347,7 +5118,7 @@ namespace xn
 		 */
 		inline void GetMetaData(AudioMetaData& metaData) const
 		{
-			xnGetAudioMetaData(m_hNode, metaData.GetUnderlying());
+			xnGetAudioMetaData(GetHandle(), metaData.GetUnderlying());
 		}
 
 		/** @copybrief xnGetAudioBuffer
@@ -4355,7 +5126,7 @@ namespace xn
 		 */
 		inline const XnUChar* GetAudioBuffer() const
 		{
-			return xnGetAudioBuffer(m_hNode);
+			return xnGetAudioBuffer(GetHandle());
 		}
 
 		/** @copybrief xnGetSupportedWaveOutputModesCount
@@ -4363,7 +5134,7 @@ namespace xn
 		 */
 		inline XnUInt32 GetSupportedWaveOutputModesCount() const
 		{
-			return xnGetSupportedWaveOutputModesCount(m_hNode);
+			return xnGetSupportedWaveOutputModesCount(GetHandle());
 		}
 
 		/** @copybrief xnGetSupportedWaveOutputModes
@@ -4371,7 +5142,7 @@ namespace xn
 		 */
 		inline XnStatus GetSupportedWaveOutputModes(XnWaveOutputMode* aSupportedModes, XnUInt32& nCount) const
 		{
-			return xnGetSupportedWaveOutputModes(m_hNode, aSupportedModes, &nCount);
+			return xnGetSupportedWaveOutputModes(GetHandle(), aSupportedModes, &nCount);
 		}
 
 		/** @copybrief xnSetWaveOutputMode
@@ -4379,7 +5150,7 @@ namespace xn
 		 */
 		inline XnStatus SetWaveOutputMode(const XnWaveOutputMode& OutputMode)
 		{
-			return xnSetWaveOutputMode(m_hNode, &OutputMode);
+			return xnSetWaveOutputMode(GetHandle(), &OutputMode);
 		}
 
 		/** @copybrief xnGetWaveOutputMode
@@ -4387,7 +5158,7 @@ namespace xn
 		 */
 		inline XnStatus GetWaveOutputMode(XnWaveOutputMode& OutputMode) const
 		{
-			return xnGetWaveOutputMode(m_hNode, &OutputMode);
+			return xnGetWaveOutputMode(GetHandle(), &OutputMode);
 		}
 
 		/** @copybrief xnRegisterToWaveOutputModeChanges
@@ -4395,7 +5166,7 @@ namespace xn
 		 */
 		inline XnStatus RegisterToWaveOutputModeChanges(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return _RegisterToStateChange(xnRegisterToWaveOutputModeChanges, m_hNode, handler, pCookie, hCallback);
+			return _RegisterToStateChange(xnRegisterToWaveOutputModeChanges, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		/** @copybrief xnUnregisterFromWaveOutputModeChanges
@@ -4403,7 +5174,7 @@ namespace xn
 		 */
 		inline void UnregisterFromWaveOutputModeChanges(XnCallbackHandle hCallback)
 		{
-			_UnregisterFromStateChange(xnUnregisterFromWaveOutputModeChanges, m_hNode, hCallback);
+			_UnregisterFromStateChange(xnUnregisterFromWaveOutputModeChanges, GetHandle(), hCallback);
 		}
 	};
 
@@ -4420,6 +5191,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline MockAudioGenerator(XnNodeHandle hNode = NULL) : AudioGenerator(hNode) {}
+		inline MockAudioGenerator(const NodeWrapper& other) : AudioGenerator(other) {}
 
 		/**
 		 * Creates a mock audio generator
@@ -4442,7 +5214,7 @@ namespace xn
 		 */
 		inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pAudioBuffer)
 		{
-			return xnMockAudioSetData(m_hNode, nFrameID, nTimestamp, nDataSize, pAudioBuffer);
+			return xnMockAudioSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pAudioBuffer);
 		}
 
 		/**
@@ -4472,19 +5244,17 @@ namespace xn
 	{
 	public:
 		MockRawGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
+		MockRawGenerator(const NodeWrapper& other) : Generator(other) {}
 
 		inline XnStatus Create(Context& context, const XnChar* strName = NULL);
 
 		inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const void* pData)
 		{
-			return xnMockRawSetData(m_hNode, nFrameID, nTimestamp, nDataSize, pData);
+			return xnMockRawSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pData);
 		}
 
 	};
 
-	//---------------------------------------------------------------------------
-	// Codec
-	//---------------------------------------------------------------------------
 	/**
 	 * @ingroup cppref
 	 * Represents a Codec node.
@@ -4498,6 +5268,7 @@ namespace xn
 		 * @param	hNode		[in]	Node handle
 		 */
 		inline Codec(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
+		inline Codec(const NodeWrapper& other) : ProductionNode(other) {}
 
 		/** @copybrief xnCreateCodec
 		 * For full details and usage, see @ref xnCreateCodec
@@ -4509,7 +5280,7 @@ namespace xn
 		 */
 		inline XnCodecID GetCodecID() const
 		{
-			return xnGetCodecID(m_hNode);
+			return xnGetCodecID(GetHandle());
 		}
 
 		/** @copybrief xnEncodeData
@@ -4517,7 +5288,7 @@ namespace xn
 		 */
 		inline XnStatus EncodeData(const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten) const
 		{
-			return xnEncodeData(m_hNode, pSrc, nSrcSize, pDst, nDstSize, pnBytesWritten);
+			return xnEncodeData(GetHandle(), pSrc, nSrcSize, pDst, nDstSize, pnBytesWritten);
 		}
 
 		/** @copybrief xnDecodeData
@@ -4525,10 +5296,45 @@ namespace xn
 		 */
 		inline XnStatus DecodeData(const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten) const
 		{
-			return xnDecodeData(m_hNode, pSrc, nSrcSize, pDst, nDstSize, pnBytesWritten);
+			return xnDecodeData(GetHandle(), pSrc, nSrcSize, pDst, nDstSize, pnBytesWritten);
 		}
 	};
 
+	/**
+	 * @ingroup cppref
+	 * Represents a Script node.
+	 */
+	class ScriptNode : public ProductionNode
+	{
+	public:
+		/**
+		 * Ctor
+		 *
+		 * @param	hNode		[in]	Node handle
+		 */
+		inline ScriptNode(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
+		inline ScriptNode(const NodeWrapper& other) : ProductionNode(other) {}
+
+		inline XnStatus Create(Context& context, const XnChar* strFormat);
+
+		inline const XnChar* GetSupportedFormat()
+		{
+			return xnScriptNodeGetSupportedFormat(GetHandle());
+		}
+
+		inline XnStatus LoadScriptFromFile(const XnChar* strFileName)
+		{
+			return xnLoadScriptFromFile(GetHandle(), strFileName);
+		}
+
+		inline XnStatus LoadScriptFromString(const XnChar* strScript)
+		{
+			return xnLoadScriptFromString(GetHandle(), strScript);
+		}
+
+		inline XnStatus Run(EnumerationErrors* pErrors);
+	};
+
 	//---------------------------------------------------------------------------
 	// EnumerationErrors
 	//---------------------------------------------------------------------------
@@ -4655,25 +5461,39 @@ namespace xn
 	{
 	public:
 		/// Ctor
-		inline Context() : m_pContext(NULL), m_bAllocated(FALSE) {}
+		inline Context() : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL) {}
+
 		/**
 		 * Ctor
 		 *
 		 * @param	pContext		[in]	Underlying C object
 		 */
-		inline Context(XnContext* pContext) : m_pContext(pContext), m_bAllocated(FALSE) {}
+		inline Context(XnContext* pContext) : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL)
+		{
+			SetHandle(pContext);
+		}
+
 		/**
 		 * Copy Ctor
 		 *
 		 * @param	other		[in]	Another context. Note that the context will only be destroyed when
 		 *								The original object is destroyed.
 		 */
-		inline Context(const Context& other) : m_pContext(other.m_pContext), m_bAllocated(FALSE) {}
+		inline Context(const Context& other) : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL)
+		{
+			SetHandle(other.m_pContext);
+		}
 
 		/// Dtor
 		~Context() 
 		{ 
-			FreeImpl();
+			SetHandle(NULL);
+		}
+
+		inline Context& operator=(const Context& other)
+		{
+			SetHandle(other.m_pContext);
+			return *this;
 		}
 
 		/// Gets the underlying C object
@@ -4684,53 +5504,152 @@ namespace xn
 		 */
 		inline XnStatus Init()
 		{
-			XnStatus nRetVal = xnInit(&m_pContext);
+			XnContext* pContext = NULL;
+			XnStatus nRetVal = xnInit(&pContext);
 			XN_IS_STATUS_OK(nRetVal);
+
+			TakeOwnership(pContext);
 			m_bAllocated = TRUE;
+
 			return (XN_STATUS_OK);
 		}
 
 		/** @copybrief xnContextRunXmlScript
 		 * For full details and usage, see @ref xnContextRunXmlScript
 		 */
-		inline XnStatus RunXmlScript(const XnChar* strScript, EnumerationErrors* pErrors = NULL)
+		inline XnStatus XN_API_DEPRECATED("Use other overload!") RunXmlScript(const XnChar* strScript, EnumerationErrors* pErrors = NULL)
 		{
+			m_bUsingDeprecatedAPI = TRUE;
+			#pragma warning (push)
+			#pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
 			return xnContextRunXmlScript(m_pContext, strScript, pErrors == NULL ? NULL : pErrors->GetUnderlying());
+			#pragma warning (pop)
+		}
+
+		/** @copybrief xnContextRunXmlScript
+		 * For full details and usage, see @ref xnContextRunXmlScript
+		 */
+		inline XnStatus RunXmlScript(const XnChar* strScript, ScriptNode& scriptNode, EnumerationErrors* pErrors = NULL)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+			
+			XnNodeHandle hScriptNode;
+			nRetVal = xnContextRunXmlScriptEx(m_pContext, strScript, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
+			XN_IS_STATUS_OK(nRetVal);
+
+			scriptNode.TakeOwnership(hScriptNode);
+			
+			return (XN_STATUS_OK);
 		}
 
 		/** @copybrief xnContextRunXmlScriptFromFile
 		 * For full details and usage, see @ref xnContextRunXmlScriptFromFile
 		 */
-		inline XnStatus RunXmlScriptFromFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
+		inline XnStatus XN_API_DEPRECATED("Use other overload!") RunXmlScriptFromFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
 		{
+			m_bUsingDeprecatedAPI = TRUE;
+			#pragma warning (push)
+			#pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
 			return xnContextRunXmlScriptFromFile(m_pContext, strFileName, pErrors == NULL ? NULL : pErrors->GetUnderlying());
+			#pragma warning (pop)
+		}
+
+		/** @copybrief xnContextRunXmlScriptFromFileEx
+		 * For full details and usage, see @ref xnContextRunXmlScriptFromFileEx
+		 */
+		inline XnStatus RunXmlScriptFromFile(const XnChar* strFileName, ScriptNode& scriptNode, EnumerationErrors* pErrors = NULL)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			XnNodeHandle hScriptNode;
+			nRetVal = xnContextRunXmlScriptFromFileEx(m_pContext, strFileName, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
+			XN_IS_STATUS_OK(nRetVal);
+
+			scriptNode.TakeOwnership(hScriptNode);
+
+			return (XN_STATUS_OK);
 		}
 
 		/** @copybrief xnInitFromXmlFile
 		 * For full details and usage, see @ref xnInitFromXmlFile
 		 */
-		inline XnStatus InitFromXmlFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
+		inline XnStatus XN_API_DEPRECATED("Use other overload!") InitFromXmlFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
 		{
-			XnStatus nRetVal = xnInitFromXmlFile(strFileName, &m_pContext, pErrors == NULL ? NULL : pErrors->GetUnderlying());
+			XnContext* pContext = NULL;
+			m_bUsingDeprecatedAPI = TRUE;
+
+			#pragma warning (push)
+			#pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
+			XnStatus nRetVal = xnInitFromXmlFile(strFileName, &pContext, pErrors == NULL ? NULL : pErrors->GetUnderlying());
+			#pragma warning (pop)
 			XN_IS_STATUS_OK(nRetVal);
+
+			TakeOwnership(pContext);
 			m_bAllocated = TRUE;
+
+			return (XN_STATUS_OK);
+		}
+
+		/** @copybrief xnInitFromXmlFile
+		 * For full details and usage, see @ref xnInitFromXmlFile
+		 */
+		inline XnStatus InitFromXmlFile(const XnChar* strFileName, ScriptNode& scriptNode, EnumerationErrors* pErrors = NULL)
+		{
+			XnContext* pContext = NULL;
+
+			XnNodeHandle hScriptNode;
+			XnStatus nRetVal = xnInitFromXmlFileEx(strFileName, &pContext, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
+			XN_IS_STATUS_OK(nRetVal);
+
+			scriptNode.TakeOwnership(hScriptNode);
+			TakeOwnership(pContext);
+			m_bAllocated = TRUE;
+
 			return (XN_STATUS_OK);
 		}
 
 		/** @copybrief xnContextOpenFileRecording
 		 * For full details and usage, see @ref xnContextOpenFileRecording
 		 */
-		inline XnStatus OpenFileRecording(const XnChar* strFileName)
+		inline XnStatus XN_API_DEPRECATED("Use other overload!") OpenFileRecording(const XnChar* strFileName)
 		{
+			m_bUsingDeprecatedAPI = TRUE;
+			#pragma warning (push)
+			#pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
 			return xnContextOpenFileRecording(m_pContext, strFileName);
+			#pragma warning (pop)
+		}
+
+		/** @copybrief xnContextOpenFileRecording
+		 * For full details and usage, see @ref xnContextOpenFileRecording
+		 */
+		inline XnStatus OpenFileRecording(const XnChar* strFileName, ProductionNode& playerNode)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+			
+			XnNodeHandle hPlayer;
+			nRetVal = xnContextOpenFileRecordingEx(m_pContext, strFileName, &hPlayer);
+			XN_IS_STATUS_OK(nRetVal);
+
+			playerNode.TakeOwnership(hPlayer);
+			
+			return (XN_STATUS_OK);
 		}
 
 		/** @copybrief xnCreateMockNode
 		 * For full details and usage, see @ref xnCreateMockNode
 		 */
-		inline XnStatus CreateMockNode(XnProductionNodeType type, const XnChar* strName, ProductionNode& node)
+		inline XnStatus CreateMockNode(XnProductionNodeType type, const XnChar* strName, ProductionNode& mockNode)
 		{
-			return xnCreateMockNode(m_pContext, type, strName, &node.m_hNode);
+			XnStatus nRetVal = XN_STATUS_OK;
+			
+			XnNodeHandle hMockNode;
+			nRetVal = xnCreateMockNode(m_pContext, type, strName, &hMockNode);
+			XN_IS_STATUS_OK(nRetVal);
+
+			mockNode.TakeOwnership(hMockNode);
+			
+			return (XN_STATUS_OK);
 		}
 
 		/** @copybrief xnCreateMockNodeBasedOn
@@ -4738,7 +5657,15 @@ namespace xn
 		 */
 		inline XnStatus CreateMockNodeBasedOn(ProductionNode& originalNode, const XnChar* strName, ProductionNode& mockNode)
 		{
-			return xnCreateMockNodeBasedOn(m_pContext, originalNode.m_hNode, strName, &mockNode.m_hNode);
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			XnNodeHandle hMockNode;
+			nRetVal = xnCreateMockNodeBasedOn(m_pContext, originalNode, strName, &hMockNode);
+			XN_IS_STATUS_OK(nRetVal);
+
+			mockNode.TakeOwnership(hMockNode);
+
+			return (XN_STATUS_OK);
 		}
 
 		/** @copybrief xnCreateCodec
@@ -4746,17 +5673,44 @@ namespace xn
 		 */
 		inline XnStatus CreateCodec(XnCodecID codecID, ProductionNode& initializerNode, Codec& codec)
 		{
-			return xnCreateCodec(m_pContext, codecID, initializerNode, &codec.m_hNode);
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			XnNodeHandle hCodec;
+			nRetVal =  xnCreateCodec(m_pContext, codecID, initializerNode.GetHandle(), &hCodec);
+			XN_IS_STATUS_OK(nRetVal);
+
+			codec.TakeOwnership(hCodec);
+
+			return (XN_STATUS_OK);
+		}
+
+		/** @copybrief xnContextAddRef
+		 * For full details and usage, see @ref xnContextAddRef
+		 */
+		inline XnStatus AddRef()
+		{
+			return xnContextAddRef(m_pContext);
+		}
+
+		/** @copybrief xnContextRelease
+		 * For full details and usage, see @ref xnContextRelease
+		 */
+		inline void Release()
+		{
+			SetHandle(NULL);
 		}
 
 		/** @copybrief xnShutdown
 		 * For full details and usage, see @ref xnShutdown
 		 */
-		inline void Shutdown()
+		inline void XN_API_DEPRECATED("You may use Release() instead, or count on dtor") Shutdown()
 		{
 			if (m_pContext != NULL)
 			{
+				#pragma warning (push)
+				#pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
 				xnShutdown(m_pContext);
+				#pragma warning (pop)
 				m_pContext = NULL;
 			}
 		}
@@ -4788,11 +5742,11 @@ namespace xn
 		/** @copybrief xnEnumerateProductionTrees
 		 * For full details and usage, see @ref xnEnumerateProductionTrees
 		 */
-		XnStatus EnumerateProductionTrees(XnProductionNodeType Type, Query* pQuery, NodeInfoList& TreesList, EnumerationErrors* pErrors = NULL) const
+		XnStatus EnumerateProductionTrees(XnProductionNodeType Type, const Query* pQuery, NodeInfoList& TreesList, EnumerationErrors* pErrors = NULL) const
 		{
 			XnStatus nRetVal = XN_STATUS_OK;
 
-			XnNodeQuery* pInternalQuery = (pQuery != NULL) ? pQuery->GetUnderlyingObject() : NULL;
+			const XnNodeQuery* pInternalQuery = (pQuery != NULL) ? pQuery->GetUnderlyingObject() : NULL;
 
 			XnNodeInfoList* pList = NULL;
 			nRetVal = xnEnumerateProductionTrees(m_pContext, Type, pInternalQuery, &pList, pErrors == NULL ? NULL : pErrors->GetUnderlying());
@@ -4816,7 +5770,23 @@ namespace xn
 			nRetVal = xnCreateAnyProductionTree(m_pContext, type, pInternalQuery, &hNode, pErrors == NULL ? NULL : pErrors->GetUnderlying());
 			XN_IS_STATUS_OK(nRetVal);
 
-			node.SetHandle(hNode);
+			node.TakeOwnership(hNode);
+
+			return (XN_STATUS_OK);
+		}
+
+		/** @copybrief xnCreateProductionTree
+		 * For full details and usage, see @ref xnCreateProductionTree
+		 */
+		XnStatus XN_API_DEPRECATED("Please use other overload") CreateProductionTree(NodeInfo& Tree)
+		{
+			XnStatus nRetVal = XN_STATUS_OK;
+
+			XnNodeHandle hNode;
+			nRetVal = xnCreateProductionTree(m_pContext, Tree, &hNode);
+			XN_IS_STATUS_OK(nRetVal);
+
+			Tree.m_bOwnerOfNode = TRUE;
 
 			return (XN_STATUS_OK);
 		}
@@ -4824,7 +5794,7 @@ namespace xn
 		/** @copybrief xnCreateProductionTree
 		 * For full details and usage, see @ref xnCreateProductionTree
 		 */
-		XnStatus CreateProductionTree(NodeInfo& Tree)
+		XnStatus CreateProductionTree(NodeInfo& Tree, ProductionNode& node)
 		{
 			XnStatus nRetVal = XN_STATUS_OK;
 
@@ -4832,6 +5802,8 @@ namespace xn
 			nRetVal = xnCreateProductionTree(m_pContext, Tree, &hNode);
 			XN_IS_STATUS_OK(nRetVal);
 
+			node.TakeOwnership(hNode);
+
 			return (XN_STATUS_OK);
 		}
 
@@ -4871,10 +5843,10 @@ namespace xn
 			XnStatus nRetVal = XN_STATUS_OK;
 
 			XnNodeHandle hNode;
-			nRetVal = xnFindExistingNodeByType(m_pContext, type, &hNode);
+			nRetVal = xnFindExistingRefNodeByType(m_pContext, type, &hNode);
 			XN_IS_STATUS_OK(nRetVal);
 
-			node.SetHandle(hNode);
+			node.TakeOwnership(hNode);
 
 			return (XN_STATUS_OK);
 		}
@@ -4887,10 +5859,10 @@ namespace xn
 			XnStatus nRetVal = XN_STATUS_OK;
 
 			XnNodeHandle hNode;
-			nRetVal = xnGetNodeHandleByName(m_pContext, strInstanceName, &hNode);
+			nRetVal = xnGetRefNodeHandleByName(m_pContext, strInstanceName, &hNode);
 			XN_IS_STATUS_OK(nRetVal);
 
-			node.SetHandle(hNode);
+			node.TakeOwnership(hNode);
 
 			return (XN_STATUS_OK);
 		}
@@ -4903,9 +5875,11 @@ namespace xn
 			XnStatus nRetVal = XN_STATUS_OK;
 
 			XnNodeHandle hNode;
-			nRetVal = xnGetNodeHandleByName(m_pContext, strInstanceName, &hNode);
+			nRetVal = xnGetRefNodeHandleByName(m_pContext, strInstanceName, &hNode);
 			XN_IS_STATUS_OK(nRetVal);
 
+			xnProductionNodeRelease(hNode);
+
 			nodeInfo = NodeInfo(xnGetNodeInfo(hNode));
 
 			return (XN_STATUS_OK);
@@ -4988,7 +5962,7 @@ namespace xn
 		 */
 		inline XnStatus WaitOneUpdateAll(ProductionNode& node)
 		{
-			return xnWaitOneUpdateAll(m_pContext, node);
+			return xnWaitOneUpdateAll(m_pContext, node.GetHandle());
 		}
 
 		/** @copybrief xnWaitNoneUpdateAll
@@ -5010,26 +5984,59 @@ namespace xn
 		/// Replaces the underlying C object pointed to by this object.
 		inline void SetHandle(XnContext* pContext)
 		{
-			if (m_pContext != pContext)
+			if (m_pContext == pContext)
+			{
+				return;
+			}
+
+			if (m_pContext != NULL)
+			{
+				if (m_bUsingDeprecatedAPI && m_bAllocated)
+				{
+					// Backwards compatibility: call shutdown instead of release, to make old programs get the 
+					// exact same behavior they used to have.
+					xnForceShutdown(m_pContext);
+				}
+				else
+				{
+					xnContextUnregisterFromShutdown(m_pContext, m_hShuttingDownCallback);
+					xnContextRelease(m_pContext);
+				}
+			}
+
+			if (pContext != NULL)
 			{
-				FreeImpl();
-				m_pContext = pContext;
+				XnStatus nRetVal = xnContextAddRef(pContext);
+				XN_ASSERT(nRetVal == XN_STATUS_OK);
+
+				nRetVal = xnContextRegisterForShutdown(pContext, ContextShuttingDownCallback, this, &m_hShuttingDownCallback);
+				XN_ASSERT(nRetVal == XN_STATUS_OK);
 			}
+
+			m_pContext = pContext;
 		}
 
-	private:
-		void FreeImpl()
+		inline void TakeOwnership(XnContext* pContext)
 		{
-			if (m_bAllocated)
+			SetHandle(pContext);
+
+			if (pContext != NULL)
 			{
-				Shutdown();
-				m_pContext = NULL;
-				m_bAllocated = FALSE;
+				xnContextRelease(pContext);
 			}
 		}
 
+	private:
+		static void XN_CALLBACK_TYPE ContextShuttingDownCallback(XnContext* /*pContext*/, void* pCookie)
+		{
+			Context* pThis = (Context*)pCookie;
+			pThis->m_pContext = NULL;
+		}
+
 		XnContext* m_pContext;
+		XnBool m_bUsingDeprecatedAPI;
 		XnBool m_bAllocated;
+		XnCallbackHandle m_hShuttingDownCallback;
 	};
 
 	/**
@@ -5102,7 +6109,7 @@ namespace xn
 
 	inline void ProductionNode::GetContext(Context& context) const
 	{
-		context.SetHandle(xnGetContextFromNodeHandle(m_hNode));
+		context.TakeOwnership(xnGetRefContextFromNodeHandle(GetHandle()));
 	}
 
 	inline NodeInfoList& NodeInfo::GetNeededNodes() const
@@ -5123,28 +6130,29 @@ namespace xn
 			XN_DELETE(m_pNeededNodes);
 		}
 
+		m_bOwnerOfNode = FALSE;
 		m_pInfo = pInfo;
 		m_pNeededNodes = NULL;
 	}
 
 	inline XnBool FrameSyncCapability::CanFrameSyncWith(Generator& other) const
 	{
-		return xnCanFrameSyncWith(m_hNode, other);
+		return xnCanFrameSyncWith(GetHandle(), other.GetHandle());
 	}
 
 	inline XnStatus FrameSyncCapability::FrameSyncWith(Generator& other)
 	{
-		return xnFrameSyncWith(m_hNode, other);
+		return xnFrameSyncWith(GetHandle(), other.GetHandle());
 	}
 
 	inline XnStatus FrameSyncCapability::StopFrameSyncWith(Generator& other)
 	{
-		return xnStopFrameSyncWith(m_hNode, other);
+		return xnStopFrameSyncWith(GetHandle(), other.GetHandle());
 	}
 
 	inline XnBool FrameSyncCapability::IsFrameSyncedWith(Generator& other) const
 	{
-		return xnIsFrameSyncedWith(m_hNode, other);
+		return xnIsFrameSyncedWith(GetHandle(), other.GetHandle());
 	}
 
 	inline XnStatus NodeInfo::GetInstance(ProductionNode& node) const
@@ -5154,7 +6162,13 @@ namespace xn
 			return XN_STATUS_INVALID_OPERATION;
 		}
 
-		node.SetHandle(xnNodeInfoGetHandle(m_pInfo));
+		XnNodeHandle hNode = xnNodeInfoGetRefHandle(m_pInfo);
+		node.TakeOwnership(hNode);
+
+		if (m_bOwnerOfNode)
+		{
+			xnProductionNodeRelease(hNode);
+		}
 
 		return (XN_STATUS_OK);
 	}
@@ -5165,116 +6179,214 @@ namespace xn
 
 	inline XnStatus Device::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
 	{
-		return xnCreateDevice(context.GetUnderlyingObject(), &m_hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateDevice(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus Recorder::Create(Context& context, const XnChar* strFormatName /*= NULL*/)
 	{
-		return xnCreateRecorder(context.GetUnderlyingObject(), strFormatName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateRecorder(context.GetUnderlyingObject(), strFormatName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus Player::Create(Context& context, const XnChar* strFormatName)
 	{
-		return xnCreatePlayer(context.GetUnderlyingObject(), strFormatName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreatePlayer(context.GetUnderlyingObject(), strFormatName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus DepthGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
 	{
-		return xnCreateDepthGenerator(context.GetUnderlyingObject(), &m_hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateDepthGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus MockDepthGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
 	{
-		return xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_DEPTH, strName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_DEPTH, strName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus MockDepthGenerator::CreateBasedOn(DepthGenerator& other, const XnChar* strName /* = NULL */)
 	{
 		Context context;
 		other.GetContext(context);
-		return xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other, strName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus ImageGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
 	{
-		return xnCreateImageGenerator(context.GetUnderlyingObject(), &m_hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateImageGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus MockImageGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
 	{
-		return xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_IMAGE, strName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_IMAGE, strName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus MockImageGenerator::CreateBasedOn(ImageGenerator& other, const XnChar* strName /* = NULL */)
 	{
 		Context context;
 		other.GetContext(context);
-		return xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other, strName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus IRGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
 	{
-		return xnCreateIRGenerator(context.GetUnderlyingObject(), &m_hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateIRGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 	
 	inline XnStatus MockIRGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
 	{
-		return xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_IR, strName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_IR, strName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus MockIRGenerator::CreateBasedOn(IRGenerator& other, const XnChar* strName /* = NULL */)
 	{
 		Context context;
 		other.GetContext(context);
-		return xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other, strName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus GestureGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
 	{
-		return xnCreateGestureGenerator(context.GetUnderlyingObject(), &m_hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateGestureGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus SceneAnalyzer::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
 	{
 		//You're creating a scene!
-		return xnCreateSceneAnalyzer(context.GetUnderlyingObject(), &m_hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateSceneAnalyzer(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus HandsGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
 	{
-		return xnCreateHandsGenerator(context.GetUnderlyingObject(), &m_hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateHandsGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus UserGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
 	{
-		return xnCreateUserGenerator(context.GetUnderlyingObject(), &m_hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateUserGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus AudioGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
 	{
-		return xnCreateAudioGenerator(context.GetUnderlyingObject(), &m_hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateAudioGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus MockAudioGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
 	{
-		return xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_AUDIO, strName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_AUDIO, strName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus MockAudioGenerator::CreateBasedOn(AudioGenerator& other, const XnChar* strName /* = NULL */)
 	{
 		Context context;
 		other.GetContext(context);
-		return xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other, strName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus MockRawGenerator::Create(Context& context, const XnChar* strName /*= NULL*/)
 	{
-		return xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_GENERATOR, strName, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_GENERATOR, strName, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	inline XnStatus Codec::Create(Context& context, XnCodecID codecID, ProductionNode& initializerNode)
 	{
-		return xnCreateCodec(context.GetUnderlyingObject(), codecID, initializerNode, &m_hNode);
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateCodec(context.GetUnderlyingObject(), codecID, initializerNode.GetHandle(), &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
+	}
+
+	inline XnStatus ScriptNode::Run(EnumerationErrors* pErrors)
+	{
+		return xnScriptNodeRun(GetHandle(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
+	}
+
+	inline XnStatus ScriptNode::Create(Context& context, const XnChar* strFormat)
+	{
+		XnNodeHandle hNode;
+		XnStatus nRetVal = xnCreateScriptNode(context.GetUnderlyingObject(), strFormat, &hNode);
+		XN_IS_STATUS_OK(nRetVal);
+		TakeOwnership(hNode);
+		return (XN_STATUS_OK);
 	}
 
 	//---------------------------------------------------------------------------
@@ -5374,7 +6486,7 @@ namespace xn
 		StateChangedCallbackTranslator* pTrans;
 		XN_VALIDATE_NEW(pTrans, StateChangedCallbackTranslator, handler, pCookie);
 
-		nRetVal = xnRegisterToGeneralIntValueChange(m_hNode, m_strCap, pTrans->StateChangedCallback, pTrans, &pTrans->m_hCallback);
+		nRetVal = xnRegisterToGeneralIntValueChange(GetHandle(), m_strCap, pTrans->StateChangedCallback, pTrans, &pTrans->m_hCallback);
 		if (nRetVal != XN_STATUS_OK)
 		{
 			XN_DELETE(pTrans);
@@ -5389,7 +6501,7 @@ namespace xn
 	inline void GeneralIntCapability::UnregisterFromValueChange(XnCallbackHandle hCallback)
 	{
 		StateChangedCallbackTranslator* pTrans = (StateChangedCallbackTranslator*)hCallback;
-		xnUnregisterFromGeneralIntValueChange(m_hNode, m_strCap, pTrans->m_hCallback);
+		xnUnregisterFromGeneralIntValueChange(GetHandle(), m_strCap, pTrans->m_hCallback);
 		XN_DELETE(pTrans);
 	}
 
diff --git a/Include/XnDataTypes.h b/Include/XnDataTypes.h
index 20366bd..d6078d6 100644
--- a/Include/XnDataTypes.h
+++ b/Include/XnDataTypes.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -43,6 +43,8 @@ typedef void* XnValue;
 	class decl ClassName												\
 	{																	\
 	public:																\
+		XN_PRAGMA_START_DISABLED_WARNING_SECTION(XN_CONDITION_IS_CONST_WARNING_ID)	\
+																		\
 		static XnValue CreateValueCopy(Type const& orig)				\
 		{																\
 			if (sizeof(Type) > sizeof(XnValue))							\
@@ -104,6 +106,7 @@ typedef void* XnValue;
 				return *p;												\
 			}															\
 		}																\
+		XN_PRAGMA_STOP_DISABLED_WARNING_SECTION							\
 	};
 
 /** 
diff --git a/Include/XnDerivedCast.h b/Include/XnDerivedCast.h
new file mode 100644
index 0000000..6a89981
--- /dev/null
+++ b/Include/XnDerivedCast.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.1 Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/\
+
+#ifndef __XN_DERIVED_CAST_H__
+#define __XN_DERIVED_CAST_H__
+
+// derived_cast Acts as dynamic_cast without the need for RTTI. used in platforms that not implement RTTI well like Linux-Arm.
+template<class T>
+static T derived_cast(ModuleProductionNode* pPrdNode);
+
+#define DERIVED_CAST_IMPL(T, enm)							\
+	template<>									\
+	T* derived_cast<T*>(ModuleProductionNode* pPrdNode)				\
+	{										\
+		return (T*)pPrdNode->m_aInterfaces[enm];				\
+	}
+
+DERIVED_CAST_IMPL(ModuleDevice, XN_NODE_TYPE_DEVICE)
+DERIVED_CAST_IMPL(ModuleRecorder, XN_NODE_TYPE_RECORDER)
+DERIVED_CAST_IMPL(ModulePlayer, XN_NODE_TYPE_PLAYER)
+DERIVED_CAST_IMPL(ModuleCodec, XN_NODE_TYPE_CODEC)
+DERIVED_CAST_IMPL(ModuleScriptNode, XN_NODE_TYPE_SCRIPT)
+DERIVED_CAST_IMPL(ModuleGenerator, XN_NODE_TYPE_GENERATOR)
+DERIVED_CAST_IMPL(ModuleUserGenerator, XN_NODE_TYPE_USER)
+DERIVED_CAST_IMPL(ModuleHandsGenerator, XN_NODE_TYPE_HANDS)
+DERIVED_CAST_IMPL(ModuleGestureGenerator, XN_NODE_TYPE_GESTURE)
+DERIVED_CAST_IMPL(ModuleAudioGenerator, XN_NODE_TYPE_AUDIO)
+DERIVED_CAST_IMPL(ModuleMapGenerator, XN_NODE_TYPE_MAP_GENERATOR)
+DERIVED_CAST_IMPL(ModuleDepthGenerator, XN_NODE_TYPE_DEPTH)
+DERIVED_CAST_IMPL(ModuleImageGenerator, XN_NODE_TYPE_IMAGE)
+DERIVED_CAST_IMPL(ModuleIRGenerator, XN_NODE_TYPE_IR)
+DERIVED_CAST_IMPL(ModuleSceneAnalyzer, XN_NODE_TYPE_SCENE)
+
+#ifdef dynamic_cast
+#undef dynamic_cast
+#endif
+
+#define dynamic_cast derived_cast
+
+#endif
diff --git a/Include/XnDump.h b/Include/XnDump.h
new file mode 100644
index 0000000..61df758
--- /dev/null
+++ b/Include/XnDump.h
@@ -0,0 +1,202 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __XN_DUMP_H__
+#define __XN_DUMP_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnPlatform.h"
+#include "XnStatus.h"
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+struct XnDumpFile;
+typedef struct XnDumpFile XnDumpFile;
+
+//---------------------------------------------------------------------------
+// Functions
+//---------------------------------------------------------------------------
+
+/**
+* Configures if a specific dump mask is enabled.
+*
+* @param	strMask		[in]	The mask to set.
+* @param	bEnabled	[in]	TRUE to enable this dump, FALSE otherwise.
+*/
+XN_C_API XnStatus XN_C_DECL xnDumpSetMaskState(const XnChar* strMask, XnBool bEnabled);
+
+/**
+* This function checks if a dump mask is enabled
+*
+* @param	strDumpMask	[in]	The mask that should be checked.
+*/
+XN_C_API XnBool XN_C_DECL xnLogIsDumpMaskEnabled(const XnChar* strDumpMask);
+
+/**
+* Opens a file for writing dump.
+*
+* @param	strDumpName		[in]	Name of the dump mask this file belongs to.
+* @param	strNameFormat	[in]	A format string for the name of the file.
+*
+* @returns a file handle for writing data. The file should be closed using @ref xnDumpFileClose().
+*/
+XN_C_API XnDumpFile* XN_C_DECL xnDumpFileOpen(const XnChar* strDumpName, const XnChar* strNameFormat, ...);
+
+/**
+* Opens a file for writing dump using some advanced options.
+* 
+* You would usually prefer to use @ref xnDumpFileOpen().
+*
+* @param	strDumpName		[in]	Name of the dump mask this file belongs to.
+* @param	bForce			[in]	When TRUE, file will be created even if dump is currently off.
+* @param	bSessionDump	[in]	When TRUE, file will be created with current session timestamp as a prefix to its name.
+* @param	strNameFormat	[in]	A format string for the name of the file.
+*
+* @returns a file handle for writing data. The file should be closed using @ref xnDumpFileClose().
+*/
+XN_C_API XnDumpFile* XN_C_DECL xnDumpFileOpenEx(const XnChar* strDumpName, XnBool bForce, XnBool bSessionDump, const XnChar* strNameFormat, ...);
+
+/**
+* Writes a buffer to a dump file.
+*
+* @param	pFile			[in]	Dump file to write to. A pointer retrieved from @ref xnDumpFileOpen.
+* @param	pBuffer			[in]	Data to be written to file.
+* @param	nBufferSize		[in]	Size of the buffer.
+*/
+XN_C_API void XN_C_DECL _xnDumpFileWriteBuffer(XnDumpFile* pFile, const void* pBuffer, XnUInt32 nBufferSize);
+
+/**
+* Writes a formatted string to a dump file.
+*
+* @param	pFile		[in]	Dump file to write to. A pointer retrieved from @ref xnDumpFileOpen.
+* @param	strFormat	[in]	Format string.
+*
+* NOTE: the total length of the string must not exceed 8 KB. If it does, it will be truncated.
+*/
+XN_C_API void XN_C_DECL _xnDumpFileWriteString(XnDumpFile* pFile, const XnChar* strFormat, ...);
+
+/**
+* Closes a dump file.
+*
+* @param	hFile		[in]	Dump file to close. A pointer retrieved from @ref xnDumpFileOpen.
+*/
+XN_C_API void XN_C_DECL _xnDumpFileClose(XnDumpFile* pFile);
+
+#define xnDumpFileWriteBuffer(pFile, pBuffer, nBufferSize)		\
+	if ((pFile) != NULL)										\
+	{															\
+		_xnDumpFileWriteBuffer(pFile, pBuffer, nBufferSize);	\
+	}															\
+
+#define xnDumpFileClose(pFile)									\
+	if ((pFile) != NULL)										\
+	{															\
+		_xnDumpFileClose(pFile);								\
+		pFile = NULL;											\
+	}															\
+
+#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
+	#define xnDumpFileWriteString(pFile, strFormat, ...)			\
+		if ((pFile) != NULL)										\
+		{															\
+			_xnDumpFileWriteString(pFile, strFormat, __VA_ARGS__);	\
+		}
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
+	#define xnDumpFileWriteString(pFile, strFormat, ...)			\
+		if ((pFile) != NULL)										\
+		{															\
+			_xnDumpFileWriteString(pFile, strFormat, ##__VA_ARGS__);\
+		}
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
+	#define xnDumpFileWriteString(pFile, strFormat, ...)			\
+		if ((pFile) != NULL)										\
+		{															\
+			_xnDumpFileWriteString(pFile, strFormat);				\
+		}
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
+	#define xnDumpFileWriteString(pFile, strFormat, arg)			\
+		if ((pFile) != NULL)										\
+		{															\
+			_xnDumpFileWriteString(pFile, strFormat,arg);			\
+		}
+#else
+	#error Xiron Log - Unknown VAARGS type!
+#endif
+
+
+//---------------------------------------------------------------------------
+// Backwards Compatibility Stuff
+//---------------------------------------------------------------------------
+
+#ifndef __XN_NO_BC__
+
+#include "XnOS.h"
+
+typedef struct XnDump 
+{
+	XN_FILE_HANDLE hFile;
+} XnDump;
+
+const XnDump XN_DUMP_CLOSED = { XN_INVALID_FILE_HANDLE };
+
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpInit(XnDump* pDump, const XnChar* csDumpMask, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpForceInit(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpClose(XnDump* pDump);
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpWriteBufferImpl(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize);
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpWriteStringImpl(XnDump dump, const XnChar* csFormat, ...);
+XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpFlush(XnDump dump);
+
+#define xnDumpWriteBuffer(dump, pBuffer, nBufferSize)		\
+	if (dump.hFile != XN_INVALID_FILE_HANDLE)				\
+	{														\
+		xnDumpWriteBufferImpl(dump, pBuffer, nBufferSize);	\
+	}
+
+#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
+	#define xnDumpWriteString(dump, csFormat, ...)						\
+		if ((dump).hFile != XN_INVALID_FILE_HANDLE) {					\
+			xnDumpWriteStringImpl((dump), csFormat, __VA_ARGS__);		\
+		}
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
+	#define xnDumpWriteString(dump, csFormat, ...)						\
+		if ((dump).hFile != XN_INVALID_FILE_HANDLE) {					\
+			xnDumpWriteStringImpl((dump), csFormat, ##__VA_ARGS__);		\
+		}
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
+	#define xnDumpWriteString(dump, csFormat...)						\
+		if ((dump).hFile != XN_INVALID_FILE_HANDLE) {					\
+			xnDumpWriteStringImpl((dump), csFormat);					\
+		}
+#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
+	#define xnDumpWriteString(dump, csFormat, arg)						\
+		if ((dump).hFile != XN_INVALID_FILE_HANDLE) {					\
+			xnDumpWriteStringImpl((dump), csFormat, arg);				\
+		}
+#else
+	#error Xiron Log - Unknown VAARGS type!
+#endif
+
+#endif // #ifndef __XN_NO_BC__
+
+#endif // __XN_DUMP_H__
\ No newline at end of file
diff --git a/Include/XnDumpWriters.h b/Include/XnDumpWriters.h
new file mode 100644
index 0000000..e53714c
--- /dev/null
+++ b/Include/XnDumpWriters.h
@@ -0,0 +1,127 @@
+#ifndef __XN_DUMP_WRITERS_H__
+#define __XN_DUMP_WRITERS_H__ 
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnDump.h"
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+typedef struct XnDumpWriterFileHandle
+{
+	void* pInternal;
+} XnDumpWriterFileHandle;
+
+typedef struct XnDumpWriter
+{
+	void* pCookie;
+	XnDumpWriterFileHandle (XN_CALLBACK_TYPE* OpenFile)(void* pCookie, const XnChar* strDumpName, XnBool bSessionDump, const XnChar* strFileName);
+	void (XN_CALLBACK_TYPE* Write)(void* pCookie, XnDumpWriterFileHandle hFile, const void* pBuffer, XnUInt32 nBufferSize);
+	void (XN_CALLBACK_TYPE* CloseFile)(void* pCookie, XnDumpWriterFileHandle hFile);
+} XnDumpWriter;
+
+//---------------------------------------------------------------------------
+// Functions
+//---------------------------------------------------------------------------
+XN_C_API XnStatus XN_C_DECL xnDumpRegisterWriter(XnDumpWriter* pWriter);
+
+XN_C_API void XN_C_DECL xnDumpUnregisterWriter(XnDumpWriter* pWriter);
+
+XN_C_API XnStatus XN_C_DECL xnDumpSetFilesOutput(XnBool bOn);
+
+//---------------------------------------------------------------------------
+// Helpers
+//---------------------------------------------------------------------------
+#ifdef __cplusplus
+
+class XnDumpWriterBase
+{
+public:
+	XnDumpWriterBase() : m_bRegistered(FALSE)
+	{
+		m_cObject.pCookie = this;
+		m_cObject.OpenFile = OpenFileCallback;
+		m_cObject.Write = WriteCallback;
+		m_cObject.CloseFile = CloseFileCallback;
+	}
+
+	virtual ~XnDumpWriterBase()
+	{
+		Unregister();
+	}
+
+	XnStatus Register()
+	{
+		XnStatus nRetVal = XN_STATUS_OK;
+
+		if (!m_bRegistered)
+		{
+			OnRegister();
+
+			nRetVal = xnDumpRegisterWriter(&m_cObject);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				OnUnregister();
+				return (nRetVal);
+			}
+
+			m_bRegistered = TRUE;
+		}
+
+		return (XN_STATUS_OK);
+	}
+
+	void Unregister()
+	{
+		if (m_bRegistered)
+		{
+			xnDumpUnregisterWriter(&m_cObject);
+			m_bRegistered = FALSE;
+
+			OnUnregister();
+		}
+	}
+
+	inline XnBool IsRegistered() { return m_bRegistered; }
+
+	virtual XnDumpWriterFileHandle OpenFile(const XnChar* strDumpName, XnBool bSessionDump, const XnChar* strFileName) = 0;
+	virtual void Write(XnDumpWriterFileHandle hFile, const void* pBuffer, XnUInt32 nBufferSize) = 0;
+	virtual void CloseFile(XnDumpWriterFileHandle hFile) = 0;
+
+	operator const XnDumpWriter*() const
+	{
+		return &m_cObject;
+	}
+
+protected:
+	virtual void OnRegister() {}
+	virtual void OnUnregister() {}
+
+private:
+	static XnDumpWriterFileHandle XN_CALLBACK_TYPE OpenFileCallback(void* pCookie, const XnChar* strDumpName, XnBool bSessionDump, const XnChar* strFileName)
+	{
+		XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
+		return pThis->OpenFile(strDumpName, bSessionDump, strFileName);
+	}
+
+	static void XN_CALLBACK_TYPE WriteCallback(void* pCookie, XnDumpWriterFileHandle hFile, const void* pBuffer, XnUInt32 nBufferSize)
+	{
+		XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
+		return pThis->Write(hFile, pBuffer, nBufferSize);
+	}
+
+	static void XN_CALLBACK_TYPE CloseFileCallback(void* pCookie, XnDumpWriterFileHandle hFile)
+	{
+		XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
+		return pThis->CloseFile(hFile);
+	}
+
+	XnDumpWriter m_cObject;
+	XnBool m_bRegistered;
+};
+
+#endif
+
+#endif // __XN_DUMP_WRITERS_H__
\ No newline at end of file
diff --git a/Include/XnEnumerationErrors.h b/Include/XnEnumerationErrors.h
index f24ffb4..2e70987 100644
--- a/Include/XnEnumerationErrors.h
+++ b/Include/XnEnumerationErrors.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -66,14 +66,14 @@ typedef struct XnModuleError* XnEnumerationErrorsIterator;
  *
  * @param	ppErrors		[out]	The allocated object
  */
-XN_C_API XnStatus xnEnumerationErrorsAllocate(XnEnumerationErrors** ppErrors);
+XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsAllocate(XnEnumerationErrors** ppErrors);
 
 /**
  * Frees an enumeration errors object
  *
  * @param	pErrors		[in]	Parameter description
  */
-XN_C_API void xnEnumerationErrorsFree(const XnEnumerationErrors* pErrors);
+XN_C_API void XN_C_DECL xnEnumerationErrorsFree(const XnEnumerationErrors* pErrors);
 
 /**
  * Adds an error to the object.
@@ -82,7 +82,7 @@ XN_C_API void xnEnumerationErrorsFree(const XnEnumerationErrors* pErrors);
  * @param	pDesc		[in]	Description of the failing module.
  * @param	nError		[in]	The enumeration error that occurred.
  */
-XN_C_API XnStatus xnEnumerationErrorsAdd(XnEnumerationErrors* pErrors, const XnProductionNodeDescription* pDesc, XnStatus nError);
+XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsAdd(XnEnumerationErrors* pErrors, const XnProductionNodeDescription* pDesc, XnStatus nError);
 
 /**
  * Returns a string representation of the Enumeration Errors object.
@@ -91,49 +91,49 @@ XN_C_API XnStatus xnEnumerationErrorsAdd(XnEnumerationErrors* pErrors, const XnP
  * @param	csBuffer	[in]	A char buffer to be filled.
  * @param	nSize		[in]	Size of the char buffer.
  */
-XN_C_API XnStatus xnEnumerationErrorsToString(const XnEnumerationErrors* pErrors, XnChar* csBuffer, XnUInt32 nSize);
+XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsToString(const XnEnumerationErrors* pErrors, XnChar* csBuffer, XnUInt32 nSize);
 
 /**
  * Clears an Enumeration Errors object from all errors in it.
  *
  * @param	pErrors		[in]	Enumeration Errors object.
  */
-XN_C_API XnStatus xnEnumerationErrorsClear(XnEnumerationErrors* pErrors);
+XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsClear(XnEnumerationErrors* pErrors);
 
 /**
  * Gets an iterator to the first error in the object.
  *
  * @param	pErrors		[in]	Enumeration Errors object.
  */
-XN_C_API XnEnumerationErrorsIterator xnEnumerationErrorsGetFirst(const XnEnumerationErrors* pErrors);
+XN_C_API XnEnumerationErrorsIterator XN_C_DECL xnEnumerationErrorsGetFirst(const XnEnumerationErrors* pErrors);
 
 /**
  * Gets an iterator to the next error in the object.
  *
  * @param	it		[in]	An iterator to an error in the object.
  */
-XN_C_API XnEnumerationErrorsIterator xnEnumerationErrorsGetNext(XnEnumerationErrorsIterator it);
+XN_C_API XnEnumerationErrorsIterator XN_C_DECL xnEnumerationErrorsGetNext(XnEnumerationErrorsIterator it);
 
 /**
  * Checks if an iterator is valid (i.e. points to a real error)
  *
  * @param	it		[in]	The iterator to check.
  */
-XN_C_API XnBool xnEnumerationErrorsIteratorIsValid(XnEnumerationErrorsIterator it);
+XN_C_API XnBool XN_C_DECL xnEnumerationErrorsIteratorIsValid(XnEnumerationErrorsIterator it);
 
 /**
  * Gets the description of the node from current error.
  *
  * @param	it		[in]	The iterator to the error.
  */
-XN_C_API const XnProductionNodeDescription* xnEnumerationErrorsGetCurrentDescription(XnEnumerationErrorsIterator it);
+XN_C_API const XnProductionNodeDescription* XN_C_DECL xnEnumerationErrorsGetCurrentDescription(XnEnumerationErrorsIterator it);
 
 /**
  * Gets the enumeration error caused when enumerating the node.
  *
  * @param	it		[in]	The iterator to the error.
  */
-XN_C_API XnStatus xnEnumerationErrorsGetCurrentError(XnEnumerationErrorsIterator it);
+XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsGetCurrentError(XnEnumerationErrorsIterator it);
 
 /**
  * @}
diff --git a/Include/XnEvent.h b/Include/XnEvent.h
index 0b13488..53efece 100644
--- a/Include/XnEvent.h
+++ b/Include/XnEvent.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -53,7 +53,7 @@ public:
 		xnOSCreateCriticalSection(&m_hLock);
 	}
 
-	~XnEvent()
+	virtual ~XnEvent()
 	{
 		Clear();
 		xnOSCloseCriticalSection(&m_hLock);
@@ -100,7 +100,13 @@ public:
 		// function).
 		{
 			XnAutoCSLocker lock(m_hLock);
-			nRetVal = m_ToBeRemoved.AddLast(pObject);
+
+			// try to remove it from the ToBeAdded list.
+			if (!RemoveCallback(m_ToBeAdded, pObject))
+			{
+				// it's not in this list, so it's probably in the main list
+				nRetVal = m_ToBeRemoved.AddLast(pObject);
+			}
 		}
 		XN_IS_STATUS_OK(nRetVal);
 
@@ -137,15 +143,7 @@ protected:
 		for (XnCallbackPtrList::ConstIterator it = m_ToBeRemoved.begin(); it != m_ToBeRemoved.end(); ++it)
 		{
 			XnCallback* pCallback = *it;
-
-			// check if it's in the list
-			XnCallbackPtrList::Iterator handlerIt = m_Handlers.Find(pCallback);
-			if (handlerIt != m_Handlers.end())
-			{
-				m_Handlers.Remove(handlerIt);
-			}
-
-			XN_DELETE(pCallback);
+			RemoveCallback(m_Handlers, pCallback);
 		}
 		m_ToBeRemoved.Clear();
 
@@ -167,17 +165,33 @@ protected:
 	XnCallbackPtrList m_Handlers;
 	XnCallbackPtrList m_ToBeAdded;
 	XnCallbackPtrList m_ToBeRemoved;
+
+private:
+	XnBool RemoveCallback(XnCallbackPtrList& list, XnCallback* pCallback)
+	{
+		XnCallbackPtrList::Iterator handlerIt = list.Find(pCallback);
+		if (handlerIt != list.end())
+		{
+			list.Remove(handlerIt);
+			XN_DELETE(pCallback);
+			return TRUE;
+		}
+
+		return FALSE;
+	}
 };
 
-#define _XN_RAISE_WITH_RET_CODE(args)			\
-	nRetVal = pFunc(args pCallback->pCookie);	\
-	if (nRetVal != XN_STATUS_OK)				\
-	{											\
-		XnEvent::ApplyListChanges();			\
-		return (nRetVal);						\
+#define _XN_RAISE_WITH_RET_CODE(args)						\
+	{														\
+		XnStatus nRetVal = pFunc(args pCallback->pCookie);	\
+		if (nRetVal != XN_STATUS_OK)						\
+		{													\
+			XnEvent::ApplyListChanges();					\
+			return (nRetVal);								\
+		}													\
 	}
 
-#define _XN_RAISE_NO_RET_CODE(args)				\
+#define _XN_RAISE_NO_RET_CODE(args)						\
 	pFunc(args pCallback->pCookie);
 
 /**
@@ -185,6 +199,7 @@ protected:
 * It is highly recommended not to use this macro directly.
 */
 #define _XN_DECLARE_EVENT_CLASS(_class, _interface, _retVal, _raise, _signature, _raise_sign)				\
+	XN_PRAGMA_START_DISABLED_WARNING_SECTION(XN_HIDES_PARENT_METHOD_WARNING_ID)								\
 	class _interface : protected XnEvent																	\
 	{																										\
 	public:																									\
@@ -205,7 +220,6 @@ protected:
 		}																									\
 		XnStatus Raise(_raise_sign)																			\
 		{																									\
-			XnStatus nRetVal = XN_STATUS_OK;																\
 			XnAutoCSLocker lock(m_hLock);																	\
 			XnEvent::ApplyListChanges();																	\
 			XnEvent::XnCallbackPtrList::Iterator it = XnEvent::m_Handlers.begin();							\
@@ -219,7 +233,9 @@ protected:
 			return (XN_STATUS_OK);																			\
 		}																									\
 		XnStatus Clear() { return XnEvent::Clear(); }														\
-	};
+	};																										\
+	XN_PRAGMA_STOP_DISABLED_WARNING_SECTION
+
 
 #define _XN_SIGNATURE_0ARG()
 #define _XN_FULL_SIGNATURE_0ARG()	void* pCookie
@@ -246,16 +262,8 @@ protected:
 #define _XN_ARGS_5ARG(_name1, _name2, _name3, _name4, _name5) _name1, _name2, _name3, _name4, _name5,
 
 /** Declares an event class */
-#if XN_PLATFORM == XN_PLATFORM_WIN32
-	#define XN_DECLARE_EVENT_0ARG(_class, _interface)											\
-	__pragma(warning(push))\
-	__pragma(warning(disable:4189))\
-		_XN_DECLARE_EVENT_CLASS(_class, _interface, void, _XN_RAISE_NO_RET_CODE(_XN_ARGS_0ARG()), _XN_FULL_SIGNATURE_0ARG(), _XN_SIGNATURE_0ARG())\
-	__pragma(warning(pop))
-#else
-	#define XN_DECLARE_EVENT_0ARG(_class, _interface)											\
-		_XN_DECLARE_EVENT_CLASS(_class, _interface, void, _XN_RAISE_NO_RET_CODE(_XN_ARGS_0ARG()), _XN_FULL_SIGNATURE_0ARG(), _XN_SIGNATURE_0ARG())
-#endif
+#define XN_DECLARE_EVENT_0ARG(_class, _interface)											\
+	_XN_DECLARE_EVENT_CLASS(_class, _interface, void, _XN_RAISE_NO_RET_CODE(_XN_ARGS_0ARG()), _XN_FULL_SIGNATURE_0ARG(), _XN_SIGNATURE_0ARG())
 
 #define XN_DECLARE_EVENT_0ARG_RETVAL(_class, _interface)									\
 	_XN_DECLARE_EVENT_CLASS(_class, _interface, XnStatus, _XN_RAISE_WITH_RET_CODE(_XN_ARGS_0ARG()), _XN_FULL_SIGNATURE_0ARG(), _XN_SIGNATURE_0ARG())
diff --git a/Include/XnFPSCalculator.h b/Include/XnFPSCalculator.h
index f4ca092..98e8583 100644
--- a/Include/XnFPSCalculator.h
+++ b/Include/XnFPSCalculator.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -43,7 +43,7 @@ typedef struct XnFPSDataImpl* XnFPSData;
 * @param	pFPS			[in]	A pointer to an XnFPSData struct.
 * @param	nSamplesCount	[in]	The number of last frames to be kept.
 */
-XN_C_API XnStatus xnFPSInit(XnFPSData* pFPS, XnUInt32 nSamplesCount);
+XN_C_API XnStatus XN_C_DECL xnFPSInit(XnFPSData* pFPS, XnUInt32 nSamplesCount);
 
 /**
 * This function marks that another frame was processed.
@@ -51,7 +51,7 @@ XN_C_API XnStatus xnFPSInit(XnFPSData* pFPS, XnUInt32 nSamplesCount);
 * @param	pFPS	[in]	A pointer to an XnFPSData struct.
 * @param	nNow	[in]	Optional. Current time. When not provided, function will take it itself.
 */
-XN_C_API XnStatus xnFPSMarkFrame(XnFPSData* pFPS, XnUInt64 nNow = 0);
+XN_C_API XnStatus XN_C_DECL xnFPSMarkFrame(XnFPSData* pFPS, XnUInt64 nNow = 0);
 	
 /**
 * This function calculates the average FPS over the last frames.
@@ -60,13 +60,13 @@ XN_C_API XnStatus xnFPSMarkFrame(XnFPSData* pFPS, XnUInt64 nNow = 0);
 * @param	nAverageOver	[in]	The number of milliseconds to average over.
 * @param	nNow			[in]	Optional. Current time. When not provided, function will take it itself.
 */
-XN_C_API XnDouble xnFPSCalc(XnFPSData* pFPS, XnUInt32 nAverageOver = 3000, XnUInt64 nNow = 0);
+XN_C_API XnDouble XN_C_DECL xnFPSCalc(XnFPSData* pFPS, XnUInt32 nAverageOver = 3000, XnUInt64 nNow = 0);
 
 /**
 * This function frees the FPS calculator.
 * 
 * @param	pFPS	[in]	A pointer to an XnFPSData struct.
 */
-XN_C_API XnStatus xnFPSFree(XnFPSData* pFPS);
+XN_C_API XnStatus XN_C_DECL xnFPSFree(XnFPSData* pFPS);
 
 #endif //__XN_FPS_CALCULATOR_H__
diff --git a/Include/XnGeneralBuffer.h b/Include/XnGeneralBuffer.h
index a351c19..c85c742 100644
--- a/Include/XnGeneralBuffer.h
+++ b/Include/XnGeneralBuffer.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnHash.h b/Include/XnHash.h
index 102510e..b4180bb 100644
--- a/Include/XnHash.h
+++ b/Include/XnHash.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnInternalDefs.h b/Include/XnInternalDefs.h
index 393136d..7cee73f 100644
--- a/Include/XnInternalDefs.h
+++ b/Include/XnInternalDefs.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnLicensing.h b/Include/XnLicensing.h
index b048fbe..332f40b 100644
--- a/Include/XnLicensing.h
+++ b/Include/XnLicensing.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -44,7 +44,7 @@
  * @param	pContext	[in]	OpenNI context.
  * @param	pLicense	[in]	A license key.
  */
-XN_C_API XnStatus xnAddLicense(XnContext* pContext, const XnLicense* pLicense);
+XN_C_API XnStatus XN_C_DECL xnAddLicense(XnContext* pContext, const XnLicense* pLicense);
 
 /** 
  * Enumerates all licenses currently registered. The list of licenses should later be freed
@@ -54,7 +54,7 @@ XN_C_API XnStatus xnAddLicense(XnContext* pContext, const XnLicense* pLicense);
  * @param	paLicenses		[out]	An array of license pointers.
  * @param	pnCount			[out]	The number of licenses in the array.
  */
-XN_C_API XnStatus xnEnumerateLicenses(
+XN_C_API XnStatus XN_C_DECL xnEnumerateLicenses(
 	 XnContext* pContext,
 	 XnLicense** paLicenses,
 	 XnUInt32* pnCount
@@ -65,7 +65,7 @@ XN_C_API XnStatus xnEnumerateLicenses(
  *
  * @param	aLicenses	[in]	The list to free.
  */
-XN_C_API void xnFreeLicensesList(XnLicense* aLicenses);
+XN_C_API void XN_C_DECL xnFreeLicensesList(XnLicense* aLicenses);
 
 /** @} */
 
diff --git a/Include/XnList.h b/Include/XnList.h
index fc487d7..3455eab 100644
--- a/Include/XnList.h
+++ b/Include/XnList.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -713,6 +713,11 @@ protected:
 			Translator::FreeValue(val);															\
 			return XN_STATUS_OK;																\
 		}																						\
+		inline XnStatus Remove(Type const& value)												\
+		{																						\
+			Iterator it = Find(value);															\
+			return Remove(it);																	\
+		}																						\
 		inline Iterator begin() { return XnList::begin(); }										\
 		inline ConstIterator begin() const { return XnList::begin(); }							\
 		inline Iterator end() { return XnList::end(); }											\
diff --git a/Include/XnLog.h b/Include/XnLog.h
index e0952b6..84b968b 100644
--- a/Include/XnLog.h
+++ b/Include/XnLog.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -26,52 +26,23 @@
 // Includes
 //---------------------------------------------------------------------------
 #include "XnOS.h"
+#include "XnLogTypes.h"
+#include "XnDump.h"
 
 //---------------------------------------------------------------------------
-// Defines
-//---------------------------------------------------------------------------
-#define XN_LOG_DIR_NAME			"Log"
-#define XN_LOG_MASKS_STRING_LEN	600
-#define XN_MASK_LOG				"Log"
-#define XN_LOG_MASK_ALL			"ALL"
-
-//---------------------------------------------------------------------------
-// Enums
-//---------------------------------------------------------------------------
-typedef enum XnLogSeverity
-{
-	XN_LOG_VERBOSE,
-	XN_LOG_INFO,
-	XN_LOG_WARNING,
-	XN_LOG_ERROR
-} XnLogSeverity;
-
-typedef enum
-{
-	XN_LOG_WRITE_NONE,
-	XN_LOG_WRITE_ALL,
-	XN_LOG_WRITE_MASKS
-} XnLogFilteringType;
-
-//---------------------------------------------------------------------------
-// Types
-//---------------------------------------------------------------------------
-
-typedef struct XnDump 
-{
-	XN_FILE_HANDLE hFile;
-} XnDump;
-
-const XnDump XN_DUMP_CLOSED = { XN_INVALID_FILE_HANDLE };
- 
-//---------------------------------------------------------------------------
 // Exported Function Declaration
 //---------------------------------------------------------------------------
 
+/** 
+ * @name Initialization
+ * Functions for initializing and shutting down the logger.
+ * @{
+ */
+
 /**
 * This function initializes the log system.
 */
-XN_C_API XnStatus xnLogInitSystem();
+XN_C_API XnStatus XN_C_DECL xnLogInitSystem();
 
 /**
 * This function initializes the log from an INI file.
@@ -79,229 +50,387 @@ XN_C_API XnStatus xnLogInitSystem();
 * @param	csINIFile		[in]	The name of the INI file.
 * @param	csSectionName	[in]	The name of the section to read values from.
 */
-XN_C_API XnStatus xnLogInitFromINIFile(const XnChar* csINIFile, const XnChar* csSectionName);
+XN_C_API XnStatus XN_C_DECL xnLogInitFromINIFile(const XnChar* csINIFile, const XnChar* csSectionName);
 
 /**
 * This function initializes the log from an XML file.
 * 
 * @param	strFileName		[in]	The name of the XML file.
 */
-XN_C_API XnStatus xnLogInitFromXmlFile(const XnChar* strFileName);
-
-/**
-* This function closes current log file, and starts a new one
-*/
-XN_C_API XnStatus xnLogStartNewFile();
+XN_C_API XnStatus XN_C_DECL xnLogInitFromXmlFile(const XnChar* strFileName);
 
 /**
 * This function closes the log.
 */
-XN_C_API XnStatus xnLogClose();
+XN_C_API XnStatus XN_C_DECL xnLogClose();
+
+// @}
+
+/** 
+ * @name Filtering Log Messages
+ * Functions for managing filters on the log system.
+ * @{
+ */
 
 /**
-* Configures if a specific log mask is enabled.
+* Sets the minimum severity to be output from a specific mask (logger name).
 *
-* @param	csMask		[in]	The mask to set.
-* @param	bEnabled	[in]	TRUE to enable this mask, FALSE otherwise.
+* @param	strMask		[in]	Name of the logger.
+* @param	minSeverity	[in]	Minimum severity to be output. Use @ref XN_LOG_SEVERITY_NONE to output nothing.
 */
-XN_C_API XnStatus xnLogSetMaskState(const XnChar* csMask, XnBool bEnabled);
+XN_C_API XnStatus XN_C_DECL xnLogSetMaskMinSeverity(const XnChar* strMask, XnLogSeverity minSeverity);
 
 /**
-* Configures if a specific dump mask is enabled.
+* Gets the minimum severity to be output from a specific mask (logger name).
 *
-* @param	csMask		[in]	The mask to set.
-* @param	bEnabled	[in]	TRUE to enable this mask, FALSE otherwise.
+* @param	strMask		[in]	Name of the logger.
+*
+* @returns The minimum severity, or @ref XN_LOG_SEVERITY_NONE is mask will output nothing.
 */
-XN_C_API XnStatus xnDumpSetMaskState(const XnChar* csMask, XnBool bEnabled);
+XN_C_API XnLogSeverity XN_C_DECL xnLogGetMaskMinSeverity(const XnChar* strMask);
+
+// @}
+
+/** 
+ * @name Log Writers
+ * Functions for managing which writers are active in the log system (i.e. which outputs
+ * will be generated).
+ * @{
+ */
 
 /**
-* Configures the minimum severity the log will output.
-*
-* @param	nMinSeverity	[in]	The minimum severity to output.
-*/
-XN_C_API XnStatus xnLogSetSeverityFilter(XnLogSeverity nMinSeverity);
+ * Registers a new Log Writer to receive log entries.
+ *
+ * @param	pWriter			[in]	The writer to register
+ */
+XN_C_API XnStatus XN_C_DECL xnLogRegisterLogWriter(const XnLogWriter* pWriter);
+
+/**
+ * Unregisters a Log Writer from receiving log entries.
+ *
+ * @param	pWriter			[in]	The writer to unregister
+ */
+XN_C_API void XN_C_DECL xnLogUnregisterLogWriter(const XnLogWriter* pWriter);
 
 /**
 * Configures if log entries will be printed to console.
 *
 * @param	bConsoleOutput	[in]	TRUE to print log entries to console, FALSE otherwise.
 */
-XN_C_API XnStatus xnLogSetConsoleOutput(XnBool bConsoleOutput);
+XN_C_API XnStatus XN_C_DECL xnLogSetConsoleOutput(XnBool bConsoleOutput);
 
 /**
 * Configures if log entries will be printed to a log file.
 *
 * @param	bFileOutput	[in]	TRUE to print log entries to the file, FALSE otherwise.
 */
-XN_C_API XnStatus xnLogSetFileOutput(XnBool bFileOutput);
+XN_C_API XnStatus XN_C_DECL xnLogSetFileOutput(XnBool bFileOutput);
+
+// @}
+
+/** 
+ * @name File Output
+ * Functions for configuring how files are created.
+ * @{
+ */
 
 /**
-* Configures if log entries will include the file and line that caused them.
+* This function closes current log file, and starts a new one (if file writer is currently active)
+*/
+XN_C_API XnStatus XN_C_DECL xnLogStartNewFile();
+
+/**
+* Configures if log entries in file will include the file and line that caused them.
 *
 * @param	bLineInfo	[in]	TRUE to print file and line, FALSE otherwise
 */
-XN_C_API XnStatus xnLogSetLineInfo(XnBool bLineInfo);
+XN_C_API XnStatus XN_C_DECL xnLogSetLineInfo(XnBool bLineInfo);
 
 /**
  * Configures the folder under which logs will be written.
  * 
  * @param	strOutputFolder	[in]	Folder to write to
  */ 
-XN_C_API XnStatus xnLogSetOutputFolder(const XnChar* strOutputFolder);
+XN_C_API XnStatus XN_C_DECL xnLogSetOutputFolder(const XnChar* strOutputFolder);
 
-/**
-* This function checks if a mask is enabled.
-*
-* @param	csLogMask	[in]	The mask that should be checked.
-* @param	nSeverity	[in]	The severity.
-*/
-XN_C_API XnBool xnLogIsEnabled(const XnChar* csLogMask, XnLogSeverity nSeverity);
+// @}
 
-/**
-* This function writes a formatted string to the log (only if the mask is turned on)
-* 
-* @param	csLogMask	[in]	The mask under which this log should be written.
-* @param	nSeverity	[in]	The severity of this log.
-* @param	csFile		[in]	The name of the file writing this log entry.
-* @param	nLine		[in]	The line number writing this log entry.
-* @param	csFormat	[in]	A format string.
-*/
-XN_C_API void xnLogWrite(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...);
+/** 
+ * @name Logger API
+ * Functions for writing entries to the log (used mainly by middleware developers)
+ * @{
+ */
 
 /**
-* This function writes a formatted string to the log (only if the mask is turned on), but without
-* marking the timestamp, and without placing the end-of-line marker.
-* It is used for writing complex data to the log file.
-* 
-* @param	csLogMask	[in]	The mask under which this log should be written.
-* @param	nSeverity	[in]	The severity of this log.
-* @param	csFormat	[in]	A format string.
+* Opens a logger for writing.
+*
+* @param	strMask		[in]	Name of the logger to open.
 */
-XN_C_API void xnLogWriteNoEntry(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFormat, ...);
+XN_C_API XnLogger* XN_C_DECL xnLoggerOpen(const XnChar* strMask);
 
 /**
-* This function writes binary data as hex bytes (only if the mask is turned on).
-* 
-* @param	csLogMask	[in]	The mask under which this log should be written.
-* @param	nSeverity	[in]	The severity of this log.
-* @param	csFile		[in]	The name of the file writing this log entry.
-* @param	nLine		[in]	The line number writing this log entry.
-* @param	pBinData	[in]	The binary data to be written.
-* @param	nDataSize	[in]	The number of bytes in the binary data.
-* @param	csFormat	[in]	A format string to precede the binary data.
+* Writes a single log entry.
+*
+* @param	pLogger		[in]	Logger to write to
+* @param	severity	[in]	Severity of the log entry
+* @param	strFile		[in]	Name of the source file
+* @param	nLine		[in]	Line in the source file
+* @param	strFormat	[in]	Format string
+*
+* It is advised to use one of the @ref xnLoggerVerbose, @ref xnLoggerInfo, @ref xnLoggerWarning or
+* @ref xnLoggerError macros instead of calling this method directly.
 */
-XN_C_API void xnLogWriteBinaryData(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* csFormat, ...);
+XN_C_API void XN_C_DECL xnLoggerWrite(XnLogger* pLogger, XnLogSeverity severity, const XnChar* strFile, XnUInt32 nLine, const XnChar* strFormat, ...);
 
 /**
-* This function checks if a dump mask is enabled
+* Writes to a logger without an entry format (i.e. no timestamp, mask name, etc.)
 *
-* @param	csDumpMask	[in]	The mask that should be checked.
+* @param	pLogger		[in]	Logger to write to
+* @param	severity	[in]	Severity of the log entry
+* @param	strFormat	[in]	Format string
 */
-XN_C_API XnBool xnLogIsDumpMaskEnabled(const XnChar* csDumpMask);
+XN_C_API void XN_C_DECL xnLoggerWriteNoEntry(XnLogger* pLogger, XnLogSeverity severity, const XnChar* strFormat, ...);
 
 /**
-* This function creates an XnDump object through which dumps can be written. Dump will only be
-* created if the mask is enabled.
+* Writes binary data to a logger, formatting it to readable text.
 *
-* @param	pDump				[in]	A handle to the dump.
-* @param	csDumpMask			[in]	The mask under which this dump should be written.
-* @param	csHeader			[in]	A header line to be written to the file. When this param is NULL, file will
-*										be opened as a binary file. When param is not NULL, the string will be written
-*										to the file once it is open.
-* @param	csFileNameFormat	[in]	Format of the name to give the file. 
-* @param	...					[in]	Arguments for the file name format string.
+* @param	pLogger		[in]	Logger to write to
+* @param	severity	[in]	Severity of the log entry
+* @param	strFile		[in]	Name of the source file
+* @param	nLine		[in]	Line in the source file
+* @param	pBinData	[in]	A pointer to the binary data to be written
+* @param	nDataSize	[in]	The number of bytes to write
+* @param	strFormat	[in]	Format string for the binary data header
 */
-XN_C_API void xnDumpInit(XnDump* pDump, const XnChar* csDumpMask, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
+XN_C_API void XN_C_DECL xnLoggerWriteBinaryData(XnLogger* pLogger, XnLogSeverity severity, const XnChar* strFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* strFormat, ...);
 
 /**
-* This function creates an XnDump object through which dumps can be written. This dump will be created
-* anyway, and does not depend on log configuration.
+* Checks if a specific severity is enabled for this logger.
 *
-* @param	pDump				[in]	A handle to the dump.
-* @param	csHeader			[in]	A header line to be written to the file. When this param is NULL, file will
-*										be opened as a binary file. When param is not NULL, the string will be written
-*										to the file once it is open.
-* @param	csFileNameFormat	[in]	Format of the name to give the file. 
-* @param	...					[in]	Arguments for the file name format string.
+* @param	pLogger		[in]	Logger to check
+* @param	severity	[in]	Severity to check.
 */
-XN_C_API void xnDumpForceInit(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
+XN_C_API XnBool XN_C_DECL xnLoggerIsEnabled(XnLogger* pLogger, XnLogSeverity severity);
 
 /**
-* This function closes a dump file (use it once file is no longer needed).
-* You can later use xnDumpWriteString and xnDumpWriteBuffer to write to this file.
+* Closes a logger previsouly opened using @ref xnLoggerOpen().
 *
-* @param	pDump	[in]	A pointer to an XnDump struct returned from a call to xnDumpInit.
+* @param	pLogger		[in]	The logger to be closed.
 */
-XN_C_API void xnDumpClose(XnDump* pDump);
+XN_C_API void XN_C_DECL _xnLoggerClose(XnLogger* pLogger);
 
 /**
-* Writes a buffer to the dump.
-* 
-* @param	dump		[in]	The dump to write to.
-* @param	pBuffer		[in]	A pointer to the buffer to write.
-* @param	nBufferSize	[in]	The number of bytes to write from the buffer.
+* Closes a logger and NULLs the handle.
+*
+* @param	pLogger		[in]	The logger to be closed.
 */
-XN_C_API void xnDumpWriteBufferImpl(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize);
-
-inline void xnDumpWriteBuffer(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize)
-{
-	if (dump.hFile != XN_INVALID_FILE_HANDLE)
-	{
-		xnDumpWriteBufferImpl(dump, pBuffer, nBufferSize);
+#define xnLoggerClose(pLogger)			\
+	{									\
+		_xnLoggerClose(pLogger);		\
+		pLogger = NULL;					\
 	}
-}
 
-/**
-* Writes a formatted string to the dump.
-* 
-* @param	dump		[in]	The dump to write to.
-* @param	csFormat	[in]	A format string.
-* @param	...			[in]	Arguments to the format string.
-*/
-XN_C_API void xnDumpWriteStringImpl(XnDump dump, const XnChar* csFormat, ...);
+#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
+	/**
+	* Helper macro for logging. Checks inline if logger is enabled and adds source file and line info.
+	*/
+	#define xnLoggerWriteHelper(pLogger, severity, csFormat, ...)								\
+		if (pLogger != NULL && severity >= pLogger->nMinSeverity)								\
+		{																						\
+			xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, __VA_ARGS__);		\
+		}
 
-#define XN_MASK_RETVAL_CHECKS "RetValChecks"
+	/**
+	* Helper macro for logging. Issues a verbose log entry.
+	*/
+	#define xnLoggerVerbose(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat, __VA_ARGS__)
+	/**
+	* Helper macro for logging. Issues an info log entry.
+	*/
+	#define xnLoggerInfo(pLogger, csFormat, ...)    xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, __VA_ARGS__)
+	/**
+	* Helper macro for logging. Issues a warning log entry.
+	*/
+	#define xnLoggerWarning(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, __VA_ARGS__)
+	/**
+	* Helper macro for logging. Issues an error log entry.
+	*/
+	#define xnLoggerError(pLogger, csFormat, ...)   xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, __VA_ARGS__)
+
+	/**
+	* Helper macro for returning from a function while logging
+	*
+	* @param	pLogger		[in]	The logger to be closed.
+	* @param	nRetVal		[in]	The return value from the function.
+	* @param	severity	[in]	Severity of the log entry
+	* @param	csFormat	[in]	Format string
+	*/
+	#define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat, ...)					\
+		{																					\
+			xnLoggerWriteHelper(pLogger, severity, csFormat, __VA_ARGS__);					\
+			return (nRetVal);																\
+		}
 
-/** Validates return value and writes log message with appropriate status string **/
-#define XN_IS_STATUS_OK_LOG_ERROR(what, nRetVal)													\
-	if (nRetVal != XN_STATUS_OK)																	\
-	{																								\
-		xnLogError(XN_MASK_RETVAL_CHECKS, "Failed to " what ": %s", xnGetStatusString(nRetVal));	\
-		XN_ASSERT(FALSE);																			\
-		return (nRetVal);																			\
-	}
+	/**
+	* Helper macro for returning from a function while logging a warning
+	*
+	* @param	pLogger		[in]	The logger to be closed.
+	* @param	nRetVal		[in]	The return value from the function.
+	* @param	csFormat	[in]	Format string
+	*/
+	#define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat, ...)						\
+		XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat, __VA_ARGS__)
+
+	/**
+	* Helper macro for returning from a function while logging an error
+	*
+	* @param	pLogger		[in]	The logger to be closed.
+	* @param	nRetVal		[in]	The return value from the function.
+	* @param	csFormat	[in]	Format string
+	*/
+	#define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat, ...)						\
+		XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat, __VA_ARGS__)
 
-#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
-	#define xnDumpWriteString(dump, csFormat, ...)					\
-		if ((dump).hFile != XN_INVALID_FILE_HANDLE) {					\
-			xnDumpWriteStringImpl((dump), csFormat, __VA_ARGS__);		\
-		}
 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
-	#define xnDumpWriteString(dump, csFormat, ...)					\
-		if ((dump).hFile != XN_INVALID_FILE_HANDLE) {					\
-			xnDumpWriteStringImpl((dump), csFormat, ##__VA_ARGS__);	\
+	#define xnLoggerWriteHelper(pLogger, severity, csFormat, ...)								\
+		if (pLogger != NULL && severity >= pLogger->nMinSeverity)								\
+		{																						\
+			xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__);		\
 		}
+
+	#define xnLoggerVerbose(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat,## __VA_ARGS__)
+	#define xnLoggerInfo(pLogger, csFormat, ...)    xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, ##__VA_ARGS__)
+	#define xnLoggerWarning(pLogger, csFormat, ...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, ##__VA_ARGS__)
+	#define xnLoggerError(pLogger, csFormat, ...)   xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, ##__VA_ARGS__)
+
+	/* Writes to the log and returns nRetVal */
+	#define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat, ...)					\
+		{																					\
+			xnLoggerWriteHelper(pLogger, severity, csFormat, ##__VA_ARGS__);				\
+			return (nRetVal);																\
+		}
+
+	/* Logs a warning and returns nRetVal */
+	#define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat, ...)						\
+		XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat, ##__VA_ARGS__)
+
+	/* Logs an error and returns nRetVal */
+	#define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat, ...)						\
+		XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat, ##__VA_ARGS__)
+
 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
-	#define xnDumpWriteString(dump, csFormat...)						\
-		if ((dump).hFile != XN_INVALID_FILE_HANDLE) {					\
-			xnDumpWriteStringImpl((dump), csFormat);					\
+	#define xnLoggerWriteHelper(pLogger, severity, csFormat...)									\
+		if (pLogger != NULL && severity >= pLogger->nMinSeverity)								\
+		{																						\
+			xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat);						\
 		}
+
+	#define xnLoggerVerbose(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat)
+	#define xnLoggerInfo(pLogger, csFormat...)    xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat)
+	#define xnLoggerWarning(pLogger, csFormat...) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat)
+	#define xnLoggerError(pLogger, csFormat...)   xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat)
+
+	/* Writes to the log and returns nRetVal */
+	#define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat...)					\
+		{																				\
+			xnLoggerWriteHelper(pLogger, severity, csFormat);							\
+			return (nRetVal);															\
+		}
+
+	/* Logs a warning and returns nRetVal */
+	#define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat...)					\
+		XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat)
+
+	/* Logs an error and returns nRetVal */
+	#define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat...)						\
+		XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat)
+
 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
-	#define xnDumpWriteString(dump, csFormat, arg)						\
-		if ((dump).hFile != XN_INVALID_FILE_HANDLE) {					\
-			xnDumpWriteStringImpl((dump), csFormat, arg);				\
+	#define xnLoggerWriteHelper(pLogger, severity, csFormat, arg)								\
+		if (pLogger != NULL && severity >= pLogger->nMinSeverity)								\
+		{																						\
+			xnLoggerWrite(pLogger, severity, __FILE__, __LINE__, csFormat, arg);				\
+		}
+
+	#define xnLoggerVerbose(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_VERBOSE, csFormat, arg)
+	#define xnLoggerInfo(pLogger, csFormat, arg)    xnLoggerWriteHelper(pLogger, XN_LOG_INFO, csFormat, arg)
+	#define xnLoggerWarning(pLogger, csFormat, arg) xnLoggerWriteHelper(pLogger, XN_LOG_WARNING, csFormat, arg)
+	#define xnLoggerError(pLogger, csFormat, arg)   xnLoggerWriteHelper(pLogger, XN_LOG_ERROR, csFormat, arg)
+
+	/* Writes to the log and returns nRetVal */
+	#define XN_RETURN_WITH_LOG(pLogger, nRetVal, severity, csFormat)					\
+		{																				\
+			xnLoggerWriteHelper(pLogger, severity, csFormat);							\
+			return (nRetVal);															\
 		}
+
+	/* Logs a warning and returns nRetVal */
+	#define XN_RETURN_WITH_WARNING_LOG(pLogger, nRetVal, csFormat)						\
+		XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_WARNING, csFormat)
+
+	/* Logs an error and returns nRetVal */
+	#define XN_RETURN_WITH_ERROR_LOG(pLogger, nRetVal, csFormat)						\
+		XN_RETURN_WITH_LOG(pLogger, nRetVal, XN_LOG_ERROR, csFormat)
+
 #else
 	#error Xiron Log - Unknown VAARGS type!
 #endif
 
+// @}
+
+/** 
+ * @name Misc.
+ * Miscellaneous functions regarding the log system.
+ * @{
+ */
+
 /**
-* Flushes a dump to the disk.
-* 
-* @param	dump		[in]	The dump to flush.
-*/
-XN_C_API void xnDumpFlush(XnDump dump);
+ * Creates a file under the logs directory. The file is session based (see @ref xnLogCreateFileEx() for explanation).
+ *
+ * @param	strFileName	[in]	Name of the file to create
+ * @param	phFile		[out]	The file handle.
+ */
+XN_C_API XnStatus XN_C_DECL xnLogCreateFile(const XnChar* strFileName, XN_FILE_HANDLE* phFile);
+
+/**
+ * Creates a file under the logs directory.
+ *
+ * @param	strFileName		[in]	Name of the file to create
+ * @param	bSessionBased	[in]	TRUE for a session-based file, FALSE otherwise. A session based
+									file also includes the timestamp and process ID of the running
+									process as a prefix to its name.
+ * @param	phFile			[out]	The file handle.
+ */
+XN_C_API XnStatus XN_C_DECL xnLogCreateFileEx(const XnChar* strFileName, XnBool bSessionBased, XN_FILE_HANDLE* phFile);
+
+// @}
+
+#define XN_MASK_RETVAL_CHECKS "RetValChecks"
+
+#if XN_PLATFORM == XN_PLATFORM_ARC
+extern "C" XnLogger* XN_LOGGER_RETVAL_CHECKS;
+#else
+XN_C_API XnLogger* XN_LOGGER_RETVAL_CHECKS;
+#endif
+
+/** Validates return value and writes log message with appropriate status string **/
+#define XN_IS_STATUS_OK_LOG_ERROR(what, nRetVal)														\
+	if (nRetVal != XN_STATUS_OK)																		\
+	{																									\
+		xnLoggerError(XN_LOGGER_RETVAL_CHECKS, "Failed to " what ": %s", xnGetStatusString(nRetVal));	\
+		XN_ASSERT(FALSE);																				\
+		return (nRetVal);																				\
+	}
+
+
+#ifndef __XN_NO_BC__
 
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnLogSetMaskMinSeverity() instead") XN_C_DECL xnLogSetMaskState(const XnChar* csMask, XnBool bEnabled);
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnLogSetMaskMinSeverity() instead") XN_C_DECL xnLogSetSeverityFilter(XnLogSeverity nMinSeverity);
+XN_C_API XnBool XN_C_DECL xnLogIsEnabled(const XnChar* csLogMask, XnLogSeverity nSeverity);
+XN_C_API void XN_C_DECL xnLogWrite(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...);
+XN_C_API void XN_C_DECL xnLogWriteNoEntry(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFormat, ...);
+XN_C_API void XN_C_DECL xnLogWriteBinaryData(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* csFormat, ...);
 
 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
 	#define xnLogVerbose(csLogMask, csFormat, ...)	xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat, __VA_ARGS__)
@@ -310,18 +439,18 @@ XN_C_API void xnDumpFlush(XnDump dump);
 	#define xnLogError(csLogMask, csFormat, ...)	xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, __VA_ARGS__)
 
 	/* Writes to the log and returns nRetVal */
-	#define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...)							\
-		{																						\
-			xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, __VA_ARGS__);		\
-			return (nRetVal);																	\
-		}
+	#define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...)					\
+	{																					\
+		xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, __VA_ARGS__);	\
+		return (nRetVal);																\
+	}
 
 	/* Logs a warning and returns nRetVal */
-	#define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...)						\
+	#define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...)					\
 		XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, __VA_ARGS__)
 
-	/* Logs an error and returns nRetVal */
-	#define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...)							\
+	/* Logs a warning and returns nRetVal */
+	#define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...)						\
 		XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, __VA_ARGS__)
 
 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
@@ -331,35 +460,35 @@ XN_C_API void xnDumpFlush(XnDump dump);
 	#define xnLogError(csLogMask, csFormat, ...)	xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, ##__VA_ARGS__)
 
 	/* Writes to the log and returns nRetVal */
-	#define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...)						\
-	{																						\
-		xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__);		\
-		return (nRetVal);																	\
+	#define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat, ...)					\
+	{																					\
+		xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, ##__VA_ARGS__);	\
+		return (nRetVal);																\
 	}
 
 	/* Logs a warning and returns nRetVal */
-	#define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...)						\
+	#define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, ...)					\
 		XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, ##__VA_ARGS__)
 
 	/* Logs a warning and returns nRetVal */
-	#define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...)							\
+	#define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, ...)						\
 		XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, ##__VA_ARGS__)
 
 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
 	#define xnLogVerbose(csLogMask, csFormat...)	xnLogWrite(csLogMask, XN_LOG_VERBOSE, __FILE__, __LINE__, csFormat)
 	#define xnLogInfo(csLogMask, csFormat...)		xnLogWrite(csLogMask, XN_LOG_INFO, __FILE__, __LINE__, csFormat)
 	#define xnLogWarning(csLogMask, csFormat...)	xnLogWrite(csLogMask, XN_LOG_WARNING, __FILE__, __LINE__, csFormat)
-	#define xnLogError(csLogMask, csFormat...)	xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat)
+	#define xnLogError(csLogMask, csFormat...)		xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat)
 
 	/* Writes to the log and returns nRetVal */
 	#define XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat...)					\
-	{																						\
-		xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat);				\
-		return (nRetVal);																	\
+	{																					\
+		xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat);					\
+		return (nRetVal);																\
 	}
 
 	/* Logs a warning and returns nRetVal */
-	#define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat...)					\
+	#define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat...)						\
 		XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat)
 
 	/* Logs a warning and returns nRetVal */
@@ -367,18 +496,18 @@ XN_C_API void xnDumpFlush(XnDump dump);
 		XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat)
 
 	/* If nRetVal is not ok, writes to the log and returns nRetVal */
-	#define XN_IS_STATUS_OK_LOG(nRetVal, nSeverity, csLogMask, csFormat...)			\
-		if (nRetVal != XN_STATUS_OK)														\
-	{																						\
-		XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat)						\
+	#define XN_IS_STATUS_OK_LOG(nRetVal, nSeverity, csLogMask, csFormat...)				\
+		if (nRetVal != XN_STATUS_OK)													\
+	{																					\
+		XN_LOG_RETURN(nRetVal, nSeverity, csLogMask, csFormat)							\
 	}																						
 
 	/* If nRetVal is not ok, logs a warning and returns nRetVal */
-	#define XN_IS_STATUS_OK_WARNING(nRetVal, csLogMask, csFormat...) \
+	#define XN_IS_STATUS_OK_WARNING(nRetVal, csLogMask, csFormat...)					\
 		XN_IS_STATUS_OK_LOG(nRetVal, XN_LOG_WARNING, csLogMask, csFormat)
 
 	/* If nRetVal is not ok, logs an error and returns nRetVal */
-	#define XN_IS_STATUS_OK_ERROR(nRetVal, csLogMask, csFormat...) \
+	#define XN_IS_STATUS_OK_ERROR(nRetVal, csLogMask, csFormat...)						\
 		XN_IS_STATUS_OK_LOG(nRetVal, XN_LOG_ERROR, csLogMask, csFormat)
 
 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
@@ -388,48 +517,25 @@ XN_C_API void xnDumpFlush(XnDump dump);
 	#define xnLogError(csLogMask, csFormat, args)	xnLogWrite(csLogMask, XN_LOG_ERROR, __FILE__, __LINE__, csFormat, args)
 
 	/* Writes to the log and returns nRetVal */
-	#define XN_LOG_RETURN(nRetVal, nSeverity csLogMask, csFormat, args)						\
-	{																						\
-		xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, args);				\
-		return (nRetVal);																	\
+	#define XN_LOG_RETURN(nRetVal, nSeverity csLogMask, csFormat, args)					\
+	{																					\
+		xnLogWrite(csLogMask, nSeverity, __FILE__, __LINE__, csFormat, args);			\
+		return (nRetVal);																\
 	}
 
 	/* Logs a warning and returns nRetVal */
-	#define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, args)						\
+	#define XN_LOG_WARNING_RETURN(nRetVal, csLogMask, csFormat, args)					\
 		XN_LOG_RETURN(nRetVal, XN_LOG_WARNING, csLogMask, csFormat, args)
 
 	/* Logs an error and returns nRetVal */
-	#define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, args)							\
+	#define XN_LOG_ERROR_RETURN(nRetVal, csLogMask, csFormat, args)						\
 		XN_LOG_RETURN(nRetVal, XN_LOG_ERROR, csLogMask, csFormat, args)
 
 #else
 	#error Xiron Log - Unknown VAARGS type!
 #endif
 
-//#define XN_NO_LOGS
-
-#if (defined(XN_NO_LOGS) && !defined(XN_LOG_IMPL))
-	#define xnLogWrite
-	#define xnLogWriteBinaryData
-	#define xnLogIsDumpMaskEnabled(mask) FALSE
-	#define xnDumpInit(dump,mask,header,format,...) NULL
-	#define xnDumpForceInit(dump,header,format,...) NULL
-	#define xnDumpClose
-	#define xnDumpWriteBufferImpl
-	#define xnDumpWriteStringImpl
-	#undef xnDumpWriteBuffer
-	#define xnDumpWriteBuffer
-	#undef xnDumpWriteString
-	#define xnDumpWriteString
-	#undef xnLogVerbose
-	#define xnLogVerbose
-	#undef xnLogInfo
-	#define xnLogInfo
-	#undef xnLogWarning
-	#define xnLogWarning
-	#undef xnLogError
-	#define xnLogError
-#endif
+#endif // ifndef __XN_NO_BC__
 
 #endif //_XN_LOG_H_
 
diff --git a/Include/XnLogTypes.h b/Include/XnLogTypes.h
new file mode 100644
index 0000000..7b88081
--- /dev/null
+++ b/Include/XnLogTypes.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __XN_LOG_TYPES_H__
+#define __XN_LOG_TYPES_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnPlatform.h"
+#include "XnTypes.h"
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define XN_LOG_DIR_NAME			"Log"
+#define XN_MASK_LOG				"Log"
+#define XN_LOG_MASK_ALL			"ALL"
+#define XN_LOG_MAX_MASK_NAME	16
+
+//---------------------------------------------------------------------------
+// Enums
+//---------------------------------------------------------------------------
+typedef enum XnLogSeverity
+{
+	XN_LOG_VERBOSE = 0,
+	XN_LOG_INFO = 1,
+	XN_LOG_WARNING = 2,
+	XN_LOG_ERROR = 3,
+	XN_LOG_SEVERITY_NONE = 10,
+} XnLogSeverity;
+
+//---------------------------------------------------------------------------
+// Structs
+//---------------------------------------------------------------------------
+typedef struct XnLogger
+{
+	volatile XnLogSeverity nMinSeverity;
+	void* pInternal;
+} XnLogger;
+
+typedef struct XnLogEntry
+{
+	XnUInt64 nTimestamp;
+	XnLogSeverity nSeverity;
+	const XnChar* strSeverity;
+	const XnChar* strMask;
+	const XnChar* strMessage;
+	const XnChar* strFile;
+	XnUInt32 nLine;
+} XnLogEntry;
+
+typedef struct XnLogWriter
+{
+	void* pCookie;
+	void (XN_CALLBACK_TYPE* WriteEntry)(const XnLogEntry* pEntry, void* pCookie);
+	void (XN_CALLBACK_TYPE* WriteUnformatted)(const XnChar* strMessage, void* pCookie);
+	void (XN_CALLBACK_TYPE* OnConfigurationChanged)(void* pCookie);
+	void (XN_CALLBACK_TYPE* OnClosing)(void* pCookie);
+} XnLogWriter;
+
+#endif // __XN_LOG_TYPES_H__
\ No newline at end of file
diff --git a/Include/XnLogWriterBase.h b/Include/XnLogWriterBase.h
new file mode 100644
index 0000000..14ae8b0
--- /dev/null
+++ b/Include/XnLogWriterBase.h
@@ -0,0 +1,128 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __XN_LOG_WRITER_BASE_H__
+#define __XN_LOG_WRITER_BASE_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnLogTypes.h>
+#include <XnLog.h>
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+class XnLogWriterBase
+{
+public:
+	XnLogWriterBase() : m_bRegistered(FALSE)
+	{
+		m_cObject.pCookie = this;
+		m_cObject.WriteEntry = WriteEntryCallback;
+		m_cObject.WriteUnformatted = WriteUnformattedCallback;
+		m_cObject.OnConfigurationChanged = OnConfigurationChangedCallback;
+		m_cObject.OnClosing = OnClosingCallback;
+	}
+
+	virtual ~XnLogWriterBase()
+	{
+		Unregister();
+	}
+
+	XnStatus Register()
+	{
+		XnStatus nRetVal = XN_STATUS_OK;
+		
+		if (!m_bRegistered)
+		{
+			OnRegister();
+
+			nRetVal = xnLogRegisterLogWriter(&m_cObject);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				OnUnregister();
+				return (nRetVal);
+			}
+
+			m_bRegistered = TRUE;
+		}
+		
+		return (XN_STATUS_OK);
+	}
+
+	void Unregister()
+	{
+		if (m_bRegistered)
+		{
+			xnLogUnregisterLogWriter(&m_cObject);
+			m_bRegistered = FALSE;
+
+			OnUnregister();
+		}
+	}
+
+	inline XnBool IsRegistered() { return m_bRegistered; }
+
+	virtual void WriteEntry(const XnLogEntry* pEntry) = 0;
+	virtual void WriteUnformatted(const XnChar* strMessage) = 0;
+	virtual void OnConfigurationChanged() {};
+	virtual void OnClosing() 
+	{
+		Unregister();
+	};
+
+	operator const XnLogWriter*() const
+	{
+		return &m_cObject;
+	}
+
+protected:
+	virtual void OnRegister() {}
+	virtual void OnUnregister() {}
+
+private:
+	static void XN_CALLBACK_TYPE WriteEntryCallback(const XnLogEntry* pEntry, void* pCookie)
+	{
+		XnLogWriterBase* pThis = (XnLogWriterBase*)pCookie;
+		pThis->WriteEntry(pEntry);
+	}
+	static void XN_CALLBACK_TYPE WriteUnformattedCallback(const XnChar* strMessage, void* pCookie)
+	{
+		XnLogWriterBase* pThis = (XnLogWriterBase*)pCookie;
+		pThis->WriteUnformatted(strMessage);
+	}
+	static void XN_CALLBACK_TYPE OnConfigurationChangedCallback(void* pCookie)
+	{
+		XnLogWriterBase* pThis = (XnLogWriterBase*)pCookie;
+		pThis->OnConfigurationChanged();
+	}
+	static void XN_CALLBACK_TYPE OnClosingCallback(void* pCookie)
+	{
+		XnLogWriterBase* pThis = (XnLogWriterBase*)pCookie;
+		pThis->OnClosing();
+	}
+
+	XnLogWriter m_cObject;
+	XnBool m_bRegistered;
+};
+
+#endif // __XN_LOG_WRITER_BASE_H__
diff --git a/Include/XnMacros.h b/Include/XnMacros.h
index 52b067a..555da11 100644
--- a/Include/XnMacros.h
+++ b/Include/XnMacros.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -115,4 +115,14 @@
 			return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW);	\
 		}
 
+/** Disables Copy ctor and assignment operator. Should be placed under "private:" section. */
+#define XN_DISABLE_COPY_AND_ASSIGN(TypeName)			\
+	TypeName(const TypeName&);							\
+	void operator=(const TypeName&)
+
+/** Disables the "local variable is initialized but not referenced" warning (if you need
+    to use this variable in an assert */
+#define XN_REFERENCE_VARIABLE(x)						\
+	((void)x)
+
 #endif //_XN_MACROS_H_
diff --git a/Include/XnModuleCFunctions.h b/Include/XnModuleCFunctions.h
index 0266cf5..42d2d1f 100644
--- a/Include/XnModuleCFunctions.h
+++ b/Include/XnModuleCFunctions.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -26,20 +26,31 @@
 
 using namespace xn;
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsCapabilitySupported(XnModuleNodeHandle hInstance, const XnChar* strCapabilityName)
+#ifdef XN_NO_DYNAMIC_CAST
+#include "XnDerivedCast.h"
+#endif
+
+#define _XN_VALIDATE_CAPABILITY_INTERFACE_RET(capInterface, retVal)		\
+	if (capInterface == NULL)											\
+		return retVal;
+
+#define _XN_VALIDATE_CAPABILITY_INTERFACE(capInterface)		\
+	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(capInterface, XN_STATUS_INVALID_OPERATION)
+
+XnBool XN_CALLBACK_TYPE __ModuleIsCapabilitySupported(XnModuleNodeHandle hInstance, const XnChar* strCapabilityName)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	return pNode->IsCapabilitySupported(strCapabilityName);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleInitNotifications(XnModuleNodeHandle hInstance, XnNodeNotifications* pNotifications, void* pCookie)
+XnStatus XN_CALLBACK_TYPE __ModuleInitNotifications(XnModuleNodeHandle hInstance, XnNodeNotifications* pNotifications, void* pCookie)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleExtendedSerializationInterface* pInterface = pNode->GetExtendedSerializationInterface();
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->NotifyExState(pNotifications, pCookie);
 }
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleStopNotifications(XnModuleNodeHandle hInstance)
+void XN_CALLBACK_TYPE __ModuleStopNotifications(XnModuleNodeHandle hInstance)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleExtendedSerializationInterface* pInterface = pNode->GetExtendedSerializationInterface();
@@ -47,7 +58,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleStopNotifications(XnModuleNodeHand
 	pInterface->UnregisterExNotifications();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetLockState(XnModuleNodeHandle hInstance, XnBool bLocked)
+XnStatus XN_CALLBACK_TYPE __ModuleSetLockState(XnModuleNodeHandle hInstance, XnBool bLocked)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleLockAwareInterface* pInterface = pNode->GetLockAwareInterface();
@@ -55,7 +66,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetLockState(XnModuleNodeHandl
 	return pInterface->SetLockState(bLocked);
 }
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleGetLockState(XnModuleNodeHandle hInstance)
+XnBool XN_CALLBACK_TYPE __ModuleGetLockState(XnModuleNodeHandle hInstance)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleLockAwareInterface* pInterface = pNode->GetLockAwareInterface();
@@ -63,7 +74,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleGetLockState(XnModuleNodeHandle
 	return pInterface->GetLockState();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToLockChange(XnModuleNodeHandle hInstance, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToLockChange(XnModuleNodeHandle hInstance, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleLockAwareInterface* pInterface = pNode->GetLockAwareInterface();
@@ -71,7 +82,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToLockChange(XnModuleN
 	return pInterface->RegisterToLockChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromLockChange(XnModuleNodeHandle hInstance, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromLockChange(XnModuleNodeHandle hInstance, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleLockAwareInterface* pInterface = pNode->GetLockAwareInterface();
@@ -79,7 +90,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromLockChange(XnModuleN
 	pInterface->UnregisterFromLockChange(hCallback);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetErrorState(XnModuleNodeHandle hInstance)
+XnStatus XN_CALLBACK_TYPE __ModuleGetErrorState(XnModuleNodeHandle hInstance)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleErrorStateInterface* pInterface = pNode->GetErrorStateInterface();
@@ -87,7 +98,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetErrorState(XnModuleNodeHand
 	return pInterface->GetErrorState();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToErrorStateChange(XnModuleNodeHandle hInstance, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToErrorStateChange(XnModuleNodeHandle hInstance, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleErrorStateInterface* pInterface = pNode->GetErrorStateInterface();
@@ -95,7 +106,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToErrorStateChange(XnM
 	return pInterface->RegisterToErrorStateChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromErrorStateChange(XnModuleNodeHandle hInstance, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromErrorStateChange(XnModuleNodeHandle hInstance, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleErrorStateInterface* pInterface = pNode->GetErrorStateInterface();
@@ -103,7 +114,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromErrorStateChange(XnM
 	pInterface->UnregisterFromErrorStateChange(hCallback);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntGetRange(XnModuleNodeHandle hInstance, const XnChar* strCap, XnInt32* pnMin, XnInt32* pnMax, XnInt32* pnStep, XnInt32* pnDefault, XnBool* pbIsAutoSupported)
+XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntGetRange(XnModuleNodeHandle hInstance, const XnChar* strCap, XnInt32* pnMin, XnInt32* pnMax, XnInt32* pnStep, XnInt32* pnDefault, XnBool* pbIsAutoSupported)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleGeneralIntInterface* pInterface = pNode->GetGeneralIntInterface(strCap);
@@ -111,7 +122,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntGetRange(XnModuleNod
 	return pInterface->GetRange(strCap, *pnMin, *pnMax, *pnStep, *pnDefault, *pbIsAutoSupported);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntGet(XnModuleNodeHandle hInstance, const XnChar* strCap, XnInt32* pnValue)
+XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntGet(XnModuleNodeHandle hInstance, const XnChar* strCap, XnInt32* pnValue)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleGeneralIntInterface* pInterface = pNode->GetGeneralIntInterface(strCap);
@@ -119,7 +130,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntGet(XnModuleNodeHand
 	return pInterface->Get(strCap, *pnValue);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntSet(XnModuleNodeHandle hInstance, const XnChar* strCap, XnInt32 nValue)
+XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntSet(XnModuleNodeHandle hInstance, const XnChar* strCap, XnInt32 nValue)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	ModuleGeneralIntInterface* pInterface = pNode->GetGeneralIntInterface(strCap);
@@ -127,7 +138,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntSet(XnModuleNodeHand
 	return pInterface->Set(strCap, nValue);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntRegisterToValueChange
+XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntRegisterToValueChange
 	(XnModuleNodeHandle hInstance, const XnChar* strCap, XnModuleStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback)
 {
@@ -137,7 +148,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGeneralIntRegisterToValueChang
 	return pInterface->RegisterToValueChange(strCap, handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGeneralIntUnregisterFromValueChange
+void XN_CALLBACK_TYPE __ModuleGeneralIntUnregisterFromValueChange
 	(XnModuleNodeHandle hInstance, const XnChar* strCap, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
@@ -146,209 +157,209 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGeneralIntUnregisterFromValueChang
 	pInterface->UnregisterFromValueChange(strCap, hCallback);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetIntProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnUInt64 nValue)
+XnStatus XN_CALLBACK_TYPE __ModuleSetIntProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnUInt64 nValue)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	return pNode->SetIntProperty(strName, nValue);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetRealProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnDouble dValue)
+XnStatus XN_CALLBACK_TYPE __ModuleSetRealProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnDouble dValue)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	return pNode->SetRealProperty(strName, dValue);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetStringProperty(XnModuleNodeHandle hInstance, const XnChar* strName, const XnChar* strValue)
+XnStatus XN_CALLBACK_TYPE __ModuleSetStringProperty(XnModuleNodeHandle hInstance, const XnChar* strName, const XnChar* strValue)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	return pNode->SetStringProperty(strName, strValue);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetGeneralProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnUInt32 nBufferSize, const void* pBuffer)
+XnStatus XN_CALLBACK_TYPE __ModuleSetGeneralProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnUInt32 nBufferSize, const void* pBuffer)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	return pNode->SetGeneralProperty(strName, nBufferSize, pBuffer);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetIntProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnUInt64* pnValue)
+XnStatus XN_CALLBACK_TYPE __ModuleGetIntProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnUInt64* pnValue)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	return pNode->GetIntProperty(strName, *pnValue);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetRealProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnDouble* pdValue)
+XnStatus XN_CALLBACK_TYPE __ModuleGetRealProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnDouble* pdValue)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	return pNode->GetRealProperty(strName, *pdValue);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetStringProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnChar* csValue, XnUInt32 nBufSize)
+XnStatus XN_CALLBACK_TYPE __ModuleGetStringProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnChar* csValue, XnUInt32 nBufSize)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	return pNode->GetStringProperty(strName, csValue, nBufSize);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetGeneralProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnUInt32 nBufferSize, void* pBuffer)
+XnStatus XN_CALLBACK_TYPE __ModuleGetGeneralProperty(XnModuleNodeHandle hInstance, const XnChar* strName, XnUInt32 nBufferSize, void* pBuffer)
 {
 	ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;
 	return pNode->GetGeneralProperty(strName, nBufferSize, pBuffer);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetOutputStream(XnModuleNodeHandle hInstance, void *pCookie, XnRecorderOutputStreamInterface *pStream)
+XnStatus XN_CALLBACK_TYPE __ModuleSetOutputStream(XnModuleNodeHandle hInstance, void *pCookie, XnRecorderOutputStreamInterface *pStream)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModuleRecorder* pNode = dynamic_cast<ModuleRecorder*>(pProdNode);
 	return pNode->SetOutputStream(pCookie, pStream);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetInputStream(XnModuleNodeHandle hInstance, void *pStreamCookie, XnPlayerInputStreamInterface *pStream)
+XnStatus XN_CALLBACK_TYPE __ModuleSetInputStream(XnModuleNodeHandle hInstance, void *pStreamCookie, XnPlayerInputStreamInterface *pStream)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->SetInputStream(pStreamCookie, pStream);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleReadNext(XnModuleNodeHandle hInstance)
+XnStatus XN_CALLBACK_TYPE __ModuleReadNext(XnModuleNodeHandle hInstance)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->ReadNext();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetRepeat(XnModuleNodeHandle hInstance, XnBool bRepeat)
+XnStatus XN_CALLBACK_TYPE __ModuleSetRepeat(XnModuleNodeHandle hInstance, XnBool bRepeat)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->SetRepeat(bRepeat);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSeekToTimeStamp(XnModuleNodeHandle hInstance, XnInt64 nTimeOffset, XnPlayerSeekOrigin origin)
+XnStatus XN_CALLBACK_TYPE __ModuleSeekToTimeStamp(XnModuleNodeHandle hInstance, XnInt64 nTimeOffset, XnPlayerSeekOrigin origin)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->SeekToTimeStamp(nTimeOffset, origin);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSeekToFrame(XnModuleNodeHandle hInstance, const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin)
+XnStatus XN_CALLBACK_TYPE __ModuleSeekToFrame(XnModuleNodeHandle hInstance, const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->SeekToFrame(strNodeName, nFrameOffset, origin);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleTellTimestamp(XnModuleNodeHandle hInstance, XnUInt64* pnTimestamp)
+XnStatus XN_CALLBACK_TYPE __ModuleTellTimestamp(XnModuleNodeHandle hInstance, XnUInt64* pnTimestamp)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->TellTimestamp(*pnTimestamp);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleTellFrame(XnModuleNodeHandle hInstance, const XnChar* strNodeName, XnUInt32* pnFrame)
+XnStatus XN_CALLBACK_TYPE __ModuleTellFrame(XnModuleNodeHandle hInstance, const XnChar* strNodeName, XnUInt32* pnFrame)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->TellFrame(strNodeName, *pnFrame);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetNumFrames(XnModuleNodeHandle hInstance, const XnChar* strNodeName, XnUInt32* pnFrames)
+XnStatus XN_CALLBACK_TYPE __ModuleGetNumFrames(XnModuleNodeHandle hInstance, const XnChar* strNodeName, XnUInt32* pnFrames)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->GetNumFrames(strNodeName, *pnFrames);
 }
 
-XN_C_API_EXPORT const XnChar* XN_CALLBACK_TYPE __ModuleGetSupportedFormat(XnModuleNodeHandle hInstance)
+const XnChar* XN_CALLBACK_TYPE __ModuleGetSupportedFormat(XnModuleNodeHandle hInstance)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->GetSupportedFormat();
 }
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsEOF(XnModuleNodeHandle hGenerator)
+XnBool XN_CALLBACK_TYPE __ModuleIsEOF(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->IsEOF();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToEndOfFileReached(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToEndOfFileReached(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->RegisterToEndOfFileReached(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromEndOfFileReached(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromEndOfFileReached(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	pNode->UnregisterFromEndOfFileReached(hCallback);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetNodeNotifications(XnModuleNodeHandle hInstance, void *pNodeNotificationsCookie, XnNodeNotifications *pNodeNotifications)
+XnStatus XN_CALLBACK_TYPE __ModuleSetNodeNotifications(XnModuleNodeHandle hInstance, void *pNodeNotificationsCookie, XnNodeNotifications *pNodeNotifications)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModulePlayer* pNode = dynamic_cast<ModulePlayer*>(pProdNode);
 	return pNode->SetNodeNotifications(pNodeNotificationsCookie, pNodeNotifications);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleOnNodeAdded(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, XnProductionNodeType type, XnCodecID compression)
+XnStatus XN_CALLBACK_TYPE __ModuleOnNodeAdded(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, XnProductionNodeType type, XnCodecID compression)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleRecorder* pNode = dynamic_cast<ModuleRecorder*>(pProdNode);
 	return pNode->OnNodeAdded(strNodeName, type, compression);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleOnNodeRemoved(XnModuleNodeHandle hGenerator, const XnChar *strNodeName)
+XnStatus XN_CALLBACK_TYPE __ModuleOnNodeRemoved(XnModuleNodeHandle hGenerator, const XnChar *strNodeName)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleRecorder* pNode = dynamic_cast<ModuleRecorder*>(pProdNode);
 	return pNode->OnNodeRemoved(strNodeName);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleOnNodeIntPropChanged(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, const XnChar* strPropName, XnUInt64 nValue)
+XnStatus XN_CALLBACK_TYPE __ModuleOnNodeIntPropChanged(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, const XnChar* strPropName, XnUInt64 nValue)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleRecorder* pNode = dynamic_cast<ModuleRecorder*>(pProdNode);
 	return pNode->OnNodeIntPropChanged(strNodeName, strPropName, nValue);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleOnNodeRealPropChanged(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, const XnChar* strPropName, XnDouble dValue)
+XnStatus XN_CALLBACK_TYPE __ModuleOnNodeRealPropChanged(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, const XnChar* strPropName, XnDouble dValue)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleRecorder* pNode = dynamic_cast<ModuleRecorder*>(pProdNode);
 	return pNode->OnNodeRealPropChanged(strNodeName, strPropName, dValue);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleOnNodeStringPropChanged(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, const XnChar* strPropName, const XnChar* strValue)
+XnStatus XN_CALLBACK_TYPE __ModuleOnNodeStringPropChanged(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, const XnChar* strPropName, const XnChar* strValue)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleRecorder* pNode = dynamic_cast<ModuleRecorder*>(pProdNode);
 	return pNode->OnNodeStringPropChanged(strNodeName, strPropName, strValue);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleOnNodeGeneralPropChanged(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, const XnChar* strPropName, XnUInt32 nBufferSize, const void* pBuffer)
+XnStatus XN_CALLBACK_TYPE __ModuleOnNodeGeneralPropChanged(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, const XnChar* strPropName, XnUInt32 nBufferSize, const void* pBuffer)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleRecorder* pNode = dynamic_cast<ModuleRecorder*>(pProdNode);
 	return pNode->OnNodeGeneralPropChanged(strNodeName, strPropName, nBufferSize, pBuffer);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleOnNodeNewData(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, XnUInt64 nTimeStamp, XnUInt32 nFrame, const void *pData, XnUInt32 nSize)
+XnStatus XN_CALLBACK_TYPE __ModuleOnNodeNewData(XnModuleNodeHandle hGenerator, const XnChar *strNodeName, XnUInt64 nTimeStamp, XnUInt32 nFrame, const void *pData, XnUInt32 nSize)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleRecorder* pNode = dynamic_cast<ModuleRecorder*>(pProdNode);
 	return pNode->OnNodeNewData(strNodeName, nTimeStamp, nFrame, pData, nSize);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleOnNodeStateReady(XnModuleNodeHandle hGenerator, const XnChar *strNodeName)
+XnStatus XN_CALLBACK_TYPE __ModuleOnNodeStateReady(XnModuleNodeHandle hGenerator, const XnChar *strNodeName)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleRecorder* pNode = dynamic_cast<ModuleRecorder*>(pProdNode);
 	return pNode->OnNodeStateReady(strNodeName);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetDeviceName(XnModuleNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize)
+XnStatus XN_CALLBACK_TYPE __ModuleGetDeviceName(XnModuleNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModuleDevice* pNode = dynamic_cast<ModuleDevice*>(pProdNode);
@@ -357,7 +368,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetDeviceName(XnModuleNodeHand
 	return pInterface->GetDeviceName(strBuffer, *pnBufferSize);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetVendorSpecificData(XnModuleNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize)
+XnStatus XN_CALLBACK_TYPE __ModuleGetVendorSpecificData(XnModuleNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModuleDevice* pNode = dynamic_cast<ModuleDevice*>(pProdNode);
@@ -366,7 +377,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetVendorSpecificData(XnModule
 	return pInterface->GetVendorSpecificData(strBuffer, *pnBufferSize);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSerialNumber(XnModuleNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize)
+XnStatus XN_CALLBACK_TYPE __ModuleGetSerialNumber(XnModuleNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hInstance;
 	ModuleDevice* pNode = dynamic_cast<ModuleDevice*>(pProdNode);
@@ -375,7 +386,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSerialNumber(XnModuleNodeHa
 	return pInterface->GetSerialNumber(strBuffer, *pnBufferSize);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetMirror(XnModuleNodeHandle hGenerator, XnBool bMirror)
+XnStatus XN_CALLBACK_TYPE __ModuleSetMirror(XnModuleNodeHandle hGenerator, XnBool bMirror)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -384,7 +395,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetMirror(XnModuleNodeHandle h
 	return pInterface->SetMirror(bMirror);
 }
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsMirrored(XnModuleNodeHandle hGenerator)
+XnBool XN_CALLBACK_TYPE __ModuleIsMirrored(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -393,7 +404,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsMirrored(XnModuleNodeHandle hG
 	return pInterface->IsMirrored();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToMirrorChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToMirrorChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -402,7 +413,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToMirrorChange(XnModul
 	return pInterface->RegisterToMirrorChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromMirrorChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromMirrorChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -411,7 +422,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromMirrorChange(XnModul
 	pInterface->UnregisterFromMirrorChange(hCallback);
 }
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsViewPointSupported(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
+XnBool XN_CALLBACK_TYPE __ModuleIsViewPointSupported(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -421,7 +432,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsViewPointSupported(XnModuleNod
 	return pInterface->IsViewPointSupported(node);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetViewPoint(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
+XnStatus XN_CALLBACK_TYPE __ModuleSetViewPoint(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -431,7 +442,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetViewPoint(XnModuleNodeHandl
 	return pInterface->SetViewPoint(node);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleResetViewPoint(XnModuleNodeHandle hGenerator)
+XnStatus XN_CALLBACK_TYPE __ModuleResetViewPoint(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -440,7 +451,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleResetViewPoint(XnModuleNodeHan
 	return pInterface->ResetViewPoint();
 }
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsViewPointAs(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
+XnBool XN_CALLBACK_TYPE __ModuleIsViewPointAs(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -450,7 +461,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsViewPointAs(XnModuleNodeHandle
 	return pInterface->IsViewPointAs(node);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToViewPointChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToViewPointChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -459,7 +470,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToViewPointChange(XnMo
 	return pInterface->RegisterToViewPointChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromViewPointChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromViewPointChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -468,7 +479,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromViewPointChange(XnMo
 	pInterface->UnregisterFromViewPointChange(hCallback);
 }
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleCanFrameSyncWith(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
+XnBool XN_CALLBACK_TYPE __ModuleCanFrameSyncWith(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -478,7 +489,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleCanFrameSyncWith(XnModuleNodeHan
 	return pInterface->CanFrameSyncWith(node);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleFrameSyncWith(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
+XnStatus XN_CALLBACK_TYPE __ModuleFrameSyncWith(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -488,7 +499,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleFrameSyncWith(XnModuleNodeHand
 	return pInterface->FrameSyncWith(node);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStopFrameSyncWith(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
+XnStatus XN_CALLBACK_TYPE __ModuleStopFrameSyncWith(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -498,7 +509,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStopFrameSyncWith(XnModuleNode
 	return pInterface->StopFrameSyncWith(node);
 }
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsFrameSyncedWith(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
+XnBool XN_CALLBACK_TYPE __ModuleIsFrameSyncedWith(XnModuleNodeHandle hGenerator, XnNodeHandle hNode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -508,7 +519,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsFrameSyncedWith(XnModuleNodeHa
 	return pInterface->IsFrameSyncedWith(node);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToFrameSyncChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToFrameSyncChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -517,7 +528,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToFrameSyncChange(XnMo
 	return pInterface->RegisterToFrameSyncChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromFrameSyncChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromFrameSyncChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
@@ -526,98 +537,98 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromFrameSyncChange(XnMo
 	pInterface->UnregisterFromFrameSyncChange(hCallback);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStartGenerating(XnModuleNodeHandle hGenerator)
+XnStatus XN_CALLBACK_TYPE __ModuleStartGenerating(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	return pNode->StartGenerating();
 }
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsGenerating(XnModuleNodeHandle hGenerator)
+XnBool XN_CALLBACK_TYPE __ModuleIsGenerating(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	return pNode->IsGenerating();
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleStopGenerating(XnModuleNodeHandle hGenerator)
+void XN_CALLBACK_TYPE __ModuleStopGenerating(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	pNode->StopGenerating();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToGenerationRunningChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToGenerationRunningChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	return pNode->RegisterToGenerationRunningChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromGenerationRunningChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromGenerationRunningChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	pNode->UnregisterFromGenerationRunningChange(hCallback);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToNewDataAvailable(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToNewDataAvailable(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	return pNode->RegisterToNewDataAvailable(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromNewDataAvailable(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromNewDataAvailable(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	pNode->UnregisterFromNewDataAvailable(hCallback);
 }
 	
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsNewDataAvailable(XnModuleNodeHandle hGenerator, XnUInt64* pnTimestamp)
+XnBool XN_CALLBACK_TYPE __ModuleIsNewDataAvailable(XnModuleNodeHandle hGenerator, XnUInt64* pnTimestamp)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	return pNode->IsNewDataAvailable(*pnTimestamp);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleUpdateData(XnModuleNodeHandle hGenerator)
+XnStatus XN_CALLBACK_TYPE __ModuleUpdateData(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	return pNode->UpdateData();
 }
 
-XN_C_API_EXPORT const void* XN_CALLBACK_TYPE __ModuleGetData(XnModuleNodeHandle hGenerator)
+const void* XN_CALLBACK_TYPE __ModuleGetData(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	return pNode->GetData();
 }
 
-XN_C_API_EXPORT XnUInt32 XN_CALLBACK_TYPE __ModuleGetDataSize(XnModuleNodeHandle hGenerator)
+XnUInt32 XN_CALLBACK_TYPE __ModuleGetDataSize(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	return pNode->GetDataSize();
 }
 
-XN_C_API_EXPORT XnUInt64 XN_CALLBACK_TYPE __ModuleGetTimestamp(XnModuleNodeHandle hGenerator)
+XnUInt64 XN_CALLBACK_TYPE __ModuleGetTimestamp(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	return pNode->GetTimestamp();
 }
 
-XN_C_API_EXPORT XnUInt32 XN_CALLBACK_TYPE __ModuleGetFrameID(XnModuleNodeHandle hGenerator)
+XnUInt32 XN_CALLBACK_TYPE __ModuleGetFrameID(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGenerator* pNode = dynamic_cast<ModuleGenerator*>(pProdNode);
 	return pNode->GetFrameID();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetCropping(XnModuleNodeHandle hGenerator, const XnCropping* pCropping)
+XnStatus XN_CALLBACK_TYPE __ModuleSetCropping(XnModuleNodeHandle hGenerator, const XnCropping* pCropping)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
@@ -626,7 +637,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetCropping(XnModuleNodeHandle
 	return pInterface->SetCropping(*pCropping);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetCropping(XnModuleNodeHandle hGenerator, XnCropping* pCropping)
+XnStatus XN_CALLBACK_TYPE __ModuleGetCropping(XnModuleNodeHandle hGenerator, XnCropping* pCropping)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
@@ -635,7 +646,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetCropping(XnModuleNodeHandle
 	return pInterface->GetCropping(*pCropping);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToCroppingChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToCroppingChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
@@ -644,7 +655,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToCroppingChange(XnMod
 	return pInterface->RegisterToCroppingChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromCroppingChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromCroppingChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
@@ -653,7 +664,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromCroppingChange(XnMod
 	pInterface->UnregisterFromCroppingChange(hCallback);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetPowerLineFrequency(XnModuleNodeHandle hGenerator, XnPowerLineFrequency nFrequency)
+XnStatus XN_CALLBACK_TYPE __ModuleSetPowerLineFrequency(XnModuleNodeHandle hGenerator, XnPowerLineFrequency nFrequency)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
@@ -662,7 +673,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetPowerLineFrequency(XnModule
 	return pInterface->SetPowerLineFrequency(nFrequency);
 }
 
-XN_C_API_EXPORT XnPowerLineFrequency XN_CALLBACK_TYPE __ModuleGetPowerLineFrequency(XnModuleNodeHandle hGenerator)
+XnPowerLineFrequency XN_CALLBACK_TYPE __ModuleGetPowerLineFrequency(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
@@ -671,7 +682,7 @@ XN_C_API_EXPORT XnPowerLineFrequency XN_CALLBACK_TYPE __ModuleGetPowerLineFreque
 	return pInterface->GetPowerLineFrequency();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPowerLineFrequencyChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPowerLineFrequencyChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
@@ -680,7 +691,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPowerLineFrequencyCh
 	return pInterface->RegisterToPowerLineFrequencyChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromPowerLineFrequencyChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromPowerLineFrequencyChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
@@ -689,56 +700,56 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromPowerLineFrequencyCh
 	pInterface->UnregisterFromPowerLineFrequencyChange(hCallback);
 }
 
-XN_C_API_EXPORT XnUInt32 XN_CALLBACK_TYPE __ModuleGetSupportedMapOutputModesCount(XnModuleNodeHandle hGenerator)
+XnUInt32 XN_CALLBACK_TYPE __ModuleGetSupportedMapOutputModesCount(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
 	return pNode->GetSupportedMapOutputModesCount();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSupportedMapOutputModes(XnModuleNodeHandle hGenerator, XnMapOutputMode* aModes, XnUInt32* pnCount)
+XnStatus XN_CALLBACK_TYPE __ModuleGetSupportedMapOutputModes(XnModuleNodeHandle hGenerator, XnMapOutputMode* aModes, XnUInt32* pnCount)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
 	return pNode->GetSupportedMapOutputModes(aModes, *pnCount);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetMapOutputMode(XnModuleNodeHandle hGenerator, const XnMapOutputMode* pOutputMode)
+XnStatus XN_CALLBACK_TYPE __ModuleSetMapOutputMode(XnModuleNodeHandle hGenerator, const XnMapOutputMode* pOutputMode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
 	return pNode->SetMapOutputMode(*pOutputMode);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetMapOutputMode(XnModuleNodeHandle hGenerator, XnMapOutputMode* pOutputMode)
+XnStatus XN_CALLBACK_TYPE __ModuleGetMapOutputMode(XnModuleNodeHandle hGenerator, XnMapOutputMode* pOutputMode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
 	return pNode->GetMapOutputMode(*pOutputMode);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToMapOutputModeChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToMapOutputModeChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
 	return pNode->RegisterToMapOutputModeChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromMapOutputModeChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromMapOutputModeChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
 	pNode->UnregisterFromMapOutputModeChange(hCallback);
 }
 
-XN_C_API_EXPORT XnUInt32 XN_CALLBACK_TYPE __ModuleGetBytesPerPixel(XnModuleNodeHandle hGenerator)
+XnUInt32 XN_CALLBACK_TYPE __ModuleGetBytesPerPixel(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleMapGenerator* pNode = dynamic_cast<ModuleMapGenerator*>(pProdNode);
 	return pNode->GetBytesPerPixel();
 }
 
-XN_C_API_EXPORT XnUInt32 XN_CALLBACK_TYPE __ModuleGetSupportedUserPositionsCount(XnModuleNodeHandle hGenerator)
+XnUInt32 XN_CALLBACK_TYPE __ModuleGetSupportedUserPositionsCount(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleDepthGenerator* pNode = dynamic_cast<ModuleDepthGenerator*>(pProdNode);
@@ -747,7 +758,7 @@ XN_C_API_EXPORT XnUInt32 XN_CALLBACK_TYPE __ModuleGetSupportedUserPositionsCount
 	return pInterface->GetSupportedUserPositionsCount();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetUserPosition(XnModuleNodeHandle hGenerator, XnUInt32 nIndex, const XnBoundingBox3D* pPosition)
+XnStatus XN_CALLBACK_TYPE __ModuleSetUserPosition(XnModuleNodeHandle hGenerator, XnUInt32 nIndex, const XnBoundingBox3D* pPosition)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleDepthGenerator* pNode = dynamic_cast<ModuleDepthGenerator*>(pProdNode);
@@ -756,7 +767,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetUserPosition(XnModuleNodeHa
 	return pInterface->SetUserPosition(nIndex, *pPosition);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetUserPosition(XnModuleNodeHandle hGenerator, XnUInt32 nIndex, XnBoundingBox3D* pPosition)
+XnStatus XN_CALLBACK_TYPE __ModuleGetUserPosition(XnModuleNodeHandle hGenerator, XnUInt32 nIndex, XnBoundingBox3D* pPosition)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleDepthGenerator* pNode = dynamic_cast<ModuleDepthGenerator*>(pProdNode);
@@ -765,7 +776,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetUserPosition(XnModuleNodeHa
 	return pInterface->GetUserPosition(nIndex, *pPosition);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToUserPositionChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToUserPositionChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleDepthGenerator* pNode = dynamic_cast<ModuleDepthGenerator*>(pProdNode);
@@ -774,7 +785,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToUserPositionChange(X
 	return pInterface->RegisterToUserPositionChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromUserPositionChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromUserPositionChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleDepthGenerator* pNode = dynamic_cast<ModuleDepthGenerator*>(pProdNode);
@@ -783,215 +794,256 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromUserPositionChange(X
 	pInterface->UnregisterFromUserPositionChange(hCallback);
 }
 
-XN_C_API_EXPORT XnDepthPixel XN_CALLBACK_TYPE __ModuleGetDeviceMaxDepth(XnModuleNodeHandle hGenerator)
+XnDepthPixel XN_CALLBACK_TYPE __ModuleGetDeviceMaxDepth(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleDepthGenerator* pNode = dynamic_cast<ModuleDepthGenerator*>(pProdNode);
 	return pNode->GetDeviceMaxDepth();
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetFieldOfView(XnModuleNodeHandle hGenerator, XnFieldOfView* pFOV)
+void XN_CALLBACK_TYPE __ModuleGetFieldOfView(XnModuleNodeHandle hGenerator, XnFieldOfView* pFOV)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleDepthGenerator* pNode = dynamic_cast<ModuleDepthGenerator*>(pProdNode);
 	pNode->GetFieldOfView(*pFOV);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToFieldOfViewChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToFieldOfViewChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleDepthGenerator* pNode = dynamic_cast<ModuleDepthGenerator*>(pProdNode);
 	return pNode->RegisterToFieldOfViewChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromFieldOfViewChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromFieldOfViewChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleDepthGenerator* pNode = dynamic_cast<ModuleDepthGenerator*>(pProdNode);
 	pNode->UnregisterFromFieldOfViewChange(hCallback);
 }
 
-XN_C_API_EXPORT XnDepthPixel* XN_CALLBACK_TYPE __ModuleGetDepthMap(XnModuleNodeHandle hGenerator)
+XnDepthPixel* XN_CALLBACK_TYPE __ModuleGetDepthMap(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleDepthGenerator* pNode = dynamic_cast<ModuleDepthGenerator*>(pProdNode);
 	return pNode->GetDepthMap();
 }
 
-XN_C_API_EXPORT XnUInt8* XN_CALLBACK_TYPE __ModuleGetImageMap(XnModuleNodeHandle hGenerator)
+XnUInt8* XN_CALLBACK_TYPE __ModuleGetImageMap(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleImageGenerator* pNode = dynamic_cast<ModuleImageGenerator*>(pProdNode);
 	return pNode->GetImageMap();
 }
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsPixelFormatSupported(XnModuleNodeHandle hGenerator, XnPixelFormat Format)
+XnBool XN_CALLBACK_TYPE __ModuleIsPixelFormatSupported(XnModuleNodeHandle hGenerator, XnPixelFormat Format)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleImageGenerator* pNode = dynamic_cast<ModuleImageGenerator*>(pProdNode);
 	return pNode->IsPixelFormatSupported(Format);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetPixelFormat(XnModuleNodeHandle hGenerator, XnPixelFormat Format)
+XnStatus XN_CALLBACK_TYPE __ModuleSetPixelFormat(XnModuleNodeHandle hGenerator, XnPixelFormat Format)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleImageGenerator* pNode = dynamic_cast<ModuleImageGenerator*>(pProdNode);
 	return pNode->SetPixelFormat(Format);
 }
 
-XN_C_API_EXPORT XnPixelFormat XN_CALLBACK_TYPE __ModuleGetPixelFormat(XnModuleNodeHandle hGenerator)
+XnPixelFormat XN_CALLBACK_TYPE __ModuleGetPixelFormat(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleImageGenerator* pNode = dynamic_cast<ModuleImageGenerator*>(pProdNode);
 	return pNode->GetPixelFormat();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPixelFormatChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPixelFormatChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleImageGenerator* pNode = dynamic_cast<ModuleImageGenerator*>(pProdNode);
 	return pNode->RegisterToPixelFormatChange(handler, pCookie, *phCallback);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromPixelFormatChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromPixelFormatChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleImageGenerator* pNode = dynamic_cast<ModuleImageGenerator*>(pProdNode);
 	pNode->UnregisterFromPixelFormatChange(hCallback);
 }
 
-XN_C_API_EXPORT XnIRPixel* XN_CALLBACK_TYPE __ModuleGetIRMap(XnModuleNodeHandle hGenerator)
+XnIRPixel* XN_CALLBACK_TYPE __ModuleGetIRMap(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleIRGenerator* pNode = dynamic_cast<ModuleIRGenerator*>(pProdNode);
 	return pNode->GetIRMap();
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleAddGesture(XnModuleNodeHandle hGenerator, const XnChar* strGesture, XnBoundingBox3D* pArea)
+XnStatus XN_CALLBACK_TYPE __ModuleAddGesture(XnModuleNodeHandle hGenerator, const XnChar* strGesture, XnBoundingBox3D* pArea)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	return pNode->AddGesture(strGesture, pArea);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRemoveGesture(XnModuleNodeHandle hGenerator, const XnChar* strGesture)
+XnStatus XN_CALLBACK_TYPE __ModuleRemoveGesture(XnModuleNodeHandle hGenerator, const XnChar* strGesture)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	return pNode->RemoveGesture(strGesture);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetActiveGestures(XnModuleNodeHandle hGenerator, XnChar** pstrGestures, XnUInt16* pnGestures)
+XnStatus XN_CALLBACK_TYPE __ModuleGetActiveGestures(XnModuleNodeHandle hGenerator, XnChar** pstrGestures, XnUInt16* pnGestures)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	return pNode->GetActiveGestures(pstrGestures, *pnGestures);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetAllActiveGestures(XnModuleNodeHandle hGenerator, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* pnGestures)
+XnStatus XN_CALLBACK_TYPE __ModuleGetAllActiveGestures(XnModuleNodeHandle hGenerator, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* pnGestures)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	return pNode->GetAllActiveGestures(pstrGestures, nNameLength, *pnGestures);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleEnumerateGestures(XnModuleNodeHandle hGenerator, XnChar** pstrGestures, XnUInt16* pnGestures)
+XnStatus XN_CALLBACK_TYPE __ModuleEnumerateGestures(XnModuleNodeHandle hGenerator, XnChar** pstrGestures, XnUInt16* pnGestures)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	return pNode->EnumerateGestures(pstrGestures, *pnGestures);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleEnumerateAllGestures(XnModuleNodeHandle hGenerator, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* pnGestures)
+XnStatus XN_CALLBACK_TYPE __ModuleEnumerateAllGestures(XnModuleNodeHandle hGenerator, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* pnGestures)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	return pNode->EnumerateAllGestures(pstrGestures, nNameLength, *pnGestures);
 }
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsGestureAvailable(XnModuleNodeHandle hGenerator, const XnChar* strGesture)
+XnBool XN_CALLBACK_TYPE __ModuleIsGestureAvailable(XnModuleNodeHandle hGenerator, const XnChar* strGesture)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	return pNode->IsGestureAvailable(strGesture);
 }
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsGestureProgressSupported(XnModuleNodeHandle hGenerator, const XnChar* strGesture)
+XnBool XN_CALLBACK_TYPE __ModuleIsGestureProgressSupported(XnModuleNodeHandle hGenerator, const XnChar* strGesture)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	return pNode->IsGestureProgressSupported(strGesture);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterGestureCallbacks(XnModuleNodeHandle hGenerator, XnModuleGestureRecognized RecognizedCB, XnModuleGestureProgress ProgressCB, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterGestureCallbacks(XnModuleNodeHandle hGenerator, XnModuleGestureRecognized RecognizedCB, XnModuleGestureProgress ProgressCB, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	return pNode->RegisterGestureCallbacks(RecognizedCB, ProgressCB, pCookie, *phCallback);
 }
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterGestureCallbacks(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterGestureCallbacks(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	pNode->UnregisterGestureCallbacks(hCallback);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToGestureChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToGestureChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	return pNode->RegisterToGestureChange(handler, pCookie, *phCallback);
 }
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromGestureChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromGestureChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
 	pNode->UnregisterFromGestureChange(hCallback);
 }
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToGestureIntermediateStageCompleted(XnModuleNodeHandle hGenerator, XnModuleGestureIntermediateStageCompleted handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
+	return pNode->RegisterToGestureIntermediateStageCompleted(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromGestureIntermediateStageCompleted(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
+	pNode->UnregisterFromGestureIntermediateStageCompleted(hCallback);
+}
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToGestureReadyForNextIntermediateStage(XnModuleNodeHandle hGenerator, XnModuleGestureReadyForNextIntermediateStage handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
+	return pNode->RegisterToGestureReadyForNextIntermediateStage(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromGestureReadyForNextIntermediateStage(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleGestureGenerator* pNode = dynamic_cast<ModuleGestureGenerator*>(pProdNode);
+	pNode->UnregisterFromGestureReadyForNextIntermediateStage(hCallback);
+}
 
-XN_C_API_EXPORT const XnLabel* XN_CALLBACK_TYPE __ModuleGetLabelMap(XnModuleNodeHandle hGenerator)
+const XnLabel* XN_CALLBACK_TYPE __ModuleGetLabelMap(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleSceneAnalyzer* pNode = dynamic_cast<ModuleSceneAnalyzer*>(pProdNode);
 	return pNode->GetLabelMap();
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetFloor(XnModuleNodeHandle hGenerator, XnPlane3D* pPlane)
+XnStatus XN_CALLBACK_TYPE __ModuleGetFloor(XnModuleNodeHandle hGenerator, XnPlane3D* pPlane)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleSceneAnalyzer* pNode = dynamic_cast<ModuleSceneAnalyzer*>(pProdNode);
 	return pNode->GetFloor(*pPlane);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterHandCallbacks(XnModuleNodeHandle hGenerator, XnModuleHandCreate CreateCB, XnModuleHandUpdate UpdateCB, XnModuleHandDestroy DestroyCB, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterHandCallbacks(XnModuleNodeHandle hGenerator, XnModuleHandCreate CreateCB, XnModuleHandUpdate UpdateCB, XnModuleHandDestroy DestroyCB, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleHandsGenerator* pNode = dynamic_cast<ModuleHandsGenerator*>(pProdNode);
 	return pNode->RegisterHandCallbacks(CreateCB, UpdateCB, DestroyCB, pCookie, *phCallback);
 }
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterHandCallbacks(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterHandCallbacks(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleHandsGenerator* pNode = dynamic_cast<ModuleHandsGenerator*>(pProdNode);
 	pNode->UnregisterHandCallbacks(hCallback);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStopTracking(XnModuleNodeHandle hGenerator, XnUserID user)
+XnStatus XN_CALLBACK_TYPE __ModuleStopTracking(XnModuleNodeHandle hGenerator, XnUserID user)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleHandsGenerator* pNode = dynamic_cast<ModuleHandsGenerator*>(pProdNode);
 	return pNode->StopTracking(user);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStopTrackingAll(XnModuleNodeHandle hGenerator)
+XnStatus XN_CALLBACK_TYPE __ModuleStopTrackingAll(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleHandsGenerator* pNode = dynamic_cast<ModuleHandsGenerator*>(pProdNode);
 	return pNode->StopTrackingAll();
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStartTracking(XnModuleNodeHandle hGenerator, const XnPoint3D* pPosition)
+XnStatus XN_CALLBACK_TYPE __ModuleStartTracking(XnModuleNodeHandle hGenerator, const XnPoint3D* pPosition)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleHandsGenerator* pNode = dynamic_cast<ModuleHandsGenerator*>(pProdNode);
 	return pNode->StartTracking(*pPosition);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetTrackingSmoothing(XnModuleNodeHandle hGenerator, XnFloat fSmoothingFactor)
+XnStatus XN_CALLBACK_TYPE __ModuleSetTrackingSmoothing(XnModuleNodeHandle hGenerator, XnFloat fSmoothingFactor)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleHandsGenerator* pNode = dynamic_cast<ModuleHandsGenerator*>(pProdNode);
 	return pNode->SetSmoothing(fSmoothingFactor);
 }
 
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsJointAvailable(XnModuleNodeHandle hGenerator, XnSkeletonJoint eJoint)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToHandTouchingFOVEdgeCallback(XnModuleNodeHandle hGenerator, XnModuleHandTouchingFOVEdge handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleHandsGenerator* pNode = dynamic_cast<ModuleHandsGenerator*>(pProdNode);
+	ModuleHandTouchingFOVEdgeInterface* pInterface = pNode->GetHandTouchingFOVEdgeInterface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
+	return pInterface->RegisterToHandTouchingFOVEdge(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromHandTouchingFOVEdgeCallback(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleHandsGenerator* pNode = dynamic_cast<ModuleHandsGenerator*>(pProdNode);
+	ModuleHandTouchingFOVEdgeInterface* pInterface = pNode->GetHandTouchingFOVEdgeInterface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface, );
+	pInterface->UnregisterFromHandTouchingFOVEdge(hCallback);
+}
+
+XnBool XN_CALLBACK_TYPE __ModuleIsJointAvailable(XnModuleNodeHandle hGenerator, XnSkeletonJoint eJoint)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -999,7 +1051,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsJointAvailable(XnModuleNodeHan
 	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface, FALSE);
 	return pInterface->IsJointAvailable(eJoint);
 }
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsProfileAvailable(XnModuleNodeHandle hGenerator, XnSkeletonProfile eProfile)
+XnBool XN_CALLBACK_TYPE __ModuleIsProfileAvailable(XnModuleNodeHandle hGenerator, XnSkeletonProfile eProfile)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1007,7 +1059,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsProfileAvailable(XnModuleNodeH
 	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface, FALSE);
 	return pInterface->IsProfileAvailable(eProfile);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetSkeletonProfile(XnModuleNodeHandle hGenerator, XnSkeletonProfile eProfile)
+XnStatus XN_CALLBACK_TYPE __ModuleSetSkeletonProfile(XnModuleNodeHandle hGenerator, XnSkeletonProfile eProfile)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1015,7 +1067,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetSkeletonProfile(XnModuleNod
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->SetSkeletonProfile(eProfile);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetJointActive(XnModuleNodeHandle hGenerator, XnSkeletonJoint eJoint, XnBool bState)
+XnStatus XN_CALLBACK_TYPE __ModuleSetJointActive(XnModuleNodeHandle hGenerator, XnSkeletonJoint eJoint, XnBool bState)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1023,7 +1075,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetJointActive(XnModuleNodeHan
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->SetJointActive(eJoint, bState);
 }
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsJointActive(XnModuleNodeHandle hGenerator, XnSkeletonJoint eJoint)
+XnBool XN_CALLBACK_TYPE __ModuleIsJointActive(XnModuleNodeHandle hGenerator, XnSkeletonJoint eJoint)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1031,7 +1083,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsJointActive(XnModuleNodeHandle
 	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface, FALSE);
 	return pInterface->IsJointActive(eJoint);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToJointConfigurationChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToJointConfigurationChange(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1039,7 +1091,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToJointConfigurationCh
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->RegisterToJointConfigurationChange(handler, pCookie, *phCallback);
 }
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromJointConfigurationChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromJointConfigurationChange(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1047,7 +1099,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromJointConfigurationCh
 	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface,);
 	pInterface->UnregisterFromJointConfigurationChange(hCallback);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleEnumerateActiveJoints(XnModuleNodeHandle hGenerator, XnSkeletonJoint* pJoints, XnUInt16* pnJoints)
+XnStatus XN_CALLBACK_TYPE __ModuleEnumerateActiveJoints(XnModuleNodeHandle hGenerator, XnSkeletonJoint* pJoints, XnUInt16* pnJoints)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1055,7 +1107,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleEnumerateActiveJoints(XnModule
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->EnumerateActiveJoints(pJoints, *pnJoints);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonJoint(XnModuleNodeHandle hGenerator, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointTransformation* pJoint)
+XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonJoint(XnModuleNodeHandle hGenerator, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointTransformation* pJoint)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1063,7 +1115,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonJoint(XnModuleNodeH
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->GetSkeletonJoint(user, eJoint, *pJoint);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonJointPosition(XnModuleNodeHandle hGenerator, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointPosition* pJoint)
+XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonJointPosition(XnModuleNodeHandle hGenerator, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointPosition* pJoint)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1071,7 +1123,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonJointPosition(XnMod
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->GetSkeletonJointPosition(user, eJoint, *pJoint);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonJointOrientation(XnModuleNodeHandle hGenerator, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointOrientation* pJoint)
+XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonJointOrientation(XnModuleNodeHandle hGenerator, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointOrientation* pJoint)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1079,7 +1131,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonJointOrientation(Xn
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->GetSkeletonJointOrientation(user, eJoint, *pJoint);
 }
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsSkeletonTracking(XnModuleNodeHandle hGenerator, XnUserID user)
+XnBool XN_CALLBACK_TYPE __ModuleIsSkeletonTracking(XnModuleNodeHandle hGenerator, XnUserID user)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1087,7 +1139,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsSkeletonTracking(XnModuleNodeH
 	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface, FALSE);
 	return pInterface->IsTracking(user);
 }
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsSkeletonCalibrated(XnModuleNodeHandle hGenerator, XnUserID user)
+XnBool XN_CALLBACK_TYPE __ModuleIsSkeletonCalibrated(XnModuleNodeHandle hGenerator, XnUserID user)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1095,7 +1147,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsSkeletonCalibrated(XnModuleNod
 	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface, FALSE);
 	return pInterface->IsCalibrated(user);
 }
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsSkeletonCalibrating(XnModuleNodeHandle hGenerator, XnUserID user)
+XnBool XN_CALLBACK_TYPE __ModuleIsSkeletonCalibrating(XnModuleNodeHandle hGenerator, XnUserID user)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1104,7 +1156,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsSkeletonCalibrating(XnModuleNo
 	return pInterface->IsCalibrating(user);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRequestSkeletonCalibration(XnModuleNodeHandle hGenerator, XnUserID user, XnBool bForce)
+XnStatus XN_CALLBACK_TYPE __ModuleRequestSkeletonCalibration(XnModuleNodeHandle hGenerator, XnUserID user, XnBool bForce)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1112,7 +1164,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRequestSkeletonCalibration(XnM
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->RequestCalibration(user, bForce);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleAbortSkeletonCalibration(XnModuleNodeHandle hGenerator, XnUserID user)
+XnStatus XN_CALLBACK_TYPE __ModuleAbortSkeletonCalibration(XnModuleNodeHandle hGenerator, XnUserID user)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1120,7 +1172,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleAbortSkeletonCalibration(XnMod
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->AbortCalibration(user);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSaveCalibrationDataToFile(XnModuleNodeHandle hGenerator, XnUserID user, const XnChar* strFileName)
+XnStatus XN_CALLBACK_TYPE __ModuleSaveCalibrationDataToFile(XnModuleNodeHandle hGenerator, XnUserID user, const XnChar* strFileName)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1128,7 +1180,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSaveCalibrationDataToFile(XnMo
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->SaveCalibrationDataToFile(user, strFileName);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleLoadCalibrationDataFromFile(XnModuleNodeHandle hGenerator, XnUserID user, const XnChar* strFileName)
+XnStatus XN_CALLBACK_TYPE __ModuleLoadCalibrationDataFromFile(XnModuleNodeHandle hGenerator, XnUserID user, const XnChar* strFileName)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1136,7 +1188,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleLoadCalibrationDataFromFile(Xn
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->LoadCalibrationDataFromFile(user, strFileName);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSaveCalibrationData(XnModuleNodeHandle hGenerator, XnUserID user, XnUInt32 nSlot)
+XnStatus XN_CALLBACK_TYPE __ModuleSaveCalibrationData(XnModuleNodeHandle hGenerator, XnUserID user, XnUInt32 nSlot)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1144,7 +1196,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSaveCalibrationData(XnModuleNo
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->SaveCalibrationData(user, nSlot);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleLoadCalibrationData(XnModuleNodeHandle hGenerator, XnUserID user, XnUInt32 nSlot)
+XnStatus XN_CALLBACK_TYPE __ModuleLoadCalibrationData(XnModuleNodeHandle hGenerator, XnUserID user, XnUInt32 nSlot)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1152,7 +1204,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleLoadCalibrationData(XnModuleNo
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->LoadCalibrationData(user, nSlot);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleClearCalibrationData(XnModuleNodeHandle hGenerator, XnUInt32 nSlot)
+XnStatus XN_CALLBACK_TYPE __ModuleClearCalibrationData(XnModuleNodeHandle hGenerator, XnUInt32 nSlot)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1160,7 +1212,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleClearCalibrationData(XnModuleN
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->ClearCalibrationData(nSlot);
 }
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsCalibrationData(XnModuleNodeHandle hGenerator, XnUInt32 nSlot)
+XnBool XN_CALLBACK_TYPE __ModuleIsCalibrationData(XnModuleNodeHandle hGenerator, XnUInt32 nSlot)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1168,7 +1220,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleIsCalibrationData(XnModuleNodeHa
 	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface, FALSE);
 	return pInterface->IsCalibrationData(nSlot);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStartSkeletonTracking(XnModuleNodeHandle hGenerator, XnUserID user)
+XnStatus XN_CALLBACK_TYPE __ModuleStartSkeletonTracking(XnModuleNodeHandle hGenerator, XnUserID user)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1176,7 +1228,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStartSkeletonTracking(XnModule
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->StartTracking(user);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStopSkeletonTracking(XnModuleNodeHandle hGenerator, XnUserID user)
+XnStatus XN_CALLBACK_TYPE __ModuleStopSkeletonTracking(XnModuleNodeHandle hGenerator, XnUserID user)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1184,7 +1236,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStopSkeletonTracking(XnModuleN
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->StopTracking(user);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleResetSkeleton(XnModuleNodeHandle hGenerator, XnUserID user)
+XnStatus XN_CALLBACK_TYPE __ModuleResetSkeleton(XnModuleNodeHandle hGenerator, XnUserID user)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1192,7 +1244,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleResetSkeleton(XnModuleNodeHand
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->Reset(user);
 }
-XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleNeedPoseForSkeletonCalibration(XnModuleNodeHandle hGenerator)
+XnBool XN_CALLBACK_TYPE __ModuleNeedPoseForSkeletonCalibration(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1200,7 +1252,7 @@ XN_C_API_EXPORT XnBool XN_CALLBACK_TYPE __ModuleNeedPoseForSkeletonCalibration(X
 	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface, FALSE);
 	return pInterface->NeedPoseForCalibration();
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonCalibrationPose(XnModuleNodeHandle hGenerator, XnChar* strPose)
+XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonCalibrationPose(XnModuleNodeHandle hGenerator, XnChar* strPose)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1208,7 +1260,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSkeletonCalibrationPose(XnM
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->GetCalibrationPose(strPose);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetSkeletonSmoothing(XnModuleNodeHandle hGenerator, XnFloat fSmoothingFactor)
+XnStatus XN_CALLBACK_TYPE __ModuleSetSkeletonSmoothing(XnModuleNodeHandle hGenerator, XnFloat fSmoothingFactor)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1216,7 +1268,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetSkeletonSmoothing(XnModuleN
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->SetSmoothing(fSmoothingFactor);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterCalibrationCallbacks(XnModuleNodeHandle hGenerator, XnModuleCalibrationStart CalibrationStartCB, XnModuleCalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterCalibrationCallbacks(XnModuleNodeHandle hGenerator, XnModuleCalibrationStart CalibrationStartCB, XnModuleCalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1224,7 +1276,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterCalibrationCallbacks(X
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->RegisterCalibrationCallbacks(CalibrationStartCB, CalibrationEndCB, pCookie, *phCallback);
 }
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterCalibrationCallbacks(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterCalibrationCallbacks(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1232,8 +1284,58 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterCalibrationCallbacks(XnM
 	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface,);
 	pInterface->UnregisterCalibrationCallbacks(hCallback);
 }
+
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToCalibrationStartCallback(XnModuleNodeHandle hGenerator, XnModuleCalibrationStart handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModuleSkeletonInterface* pInterface = pNode->GetSkeletonInterface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
+	return pInterface->RegisterToCalibrationStart(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromCalibrationStartCallback(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModuleSkeletonInterface* pInterface = pNode->GetSkeletonInterface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface,);
+	pInterface->UnregisterFromCalibrationStart(hCallback);
+}
+
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToCalibrationInProgressCallback(XnModuleNodeHandle hGenerator, XnModuleCalibrationInProgress handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModuleSkeletonInterface* pInterface = pNode->GetSkeletonInterface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
+	return pInterface->RegisterToCalibrationInProgress(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromCalibrationInProgressCallback(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModuleSkeletonInterface* pInterface = pNode->GetSkeletonInterface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface,);
+	pInterface->UnregisterFromCalibrationInProgress(hCallback);
+}
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToCalibrationCompleteCallback(XnModuleNodeHandle hGenerator, XnModuleCalibrationComplete handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModuleSkeletonInterface* pInterface = pNode->GetSkeletonInterface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
+	return pInterface->RegisterToCalibrationComplete(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromCalibrationCompleteCallback(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModuleSkeletonInterface* pInterface = pNode->GetSkeletonInterface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface,);
+	pInterface->UnregisterFromCalibrationComplete(hCallback);
+}
 ///
-XN_C_API_EXPORT XnUInt32 XN_CALLBACK_TYPE __ModuleGetNumberOfPoses(XnModuleNodeHandle hGenerator)
+XnUInt32 XN_CALLBACK_TYPE __ModuleGetNumberOfPoses(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1241,7 +1343,7 @@ XN_C_API_EXPORT XnUInt32 XN_CALLBACK_TYPE __ModuleGetNumberOfPoses(XnModuleNodeH
 	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface, 0);
 	return pInterface->GetNumberOfPoses();
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetAvailablePoses(XnModuleNodeHandle hGenerator, XnChar** pstrPoses, XnUInt32* pnPoses)
+XnStatus XN_CALLBACK_TYPE __ModuleGetAvailablePoses(XnModuleNodeHandle hGenerator, XnChar** pstrPoses, XnUInt32* pnPoses)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1249,7 +1351,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetAvailablePoses(XnModuleNode
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->GetAvailablePoses(pstrPoses, *pnPoses);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetAllAvailablePoses(XnModuleNodeHandle hGenerator, XnChar** pstrPoses, XnUInt32 nNameLength, XnUInt32* pnPoses)
+XnStatus XN_CALLBACK_TYPE __ModuleGetAllAvailablePoses(XnModuleNodeHandle hGenerator, XnChar** pstrPoses, XnUInt32 nNameLength, XnUInt32* pnPoses)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1258,7 +1360,8 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetAllAvailablePoses(XnModuleN
 	return pInterface->GetAllAvailablePoses(pstrPoses, nNameLength, *pnPoses);
 }
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStartPoseDetection(XnModuleNodeHandle hGenerator, const XnChar* strPose, XnUserID user)
+
+XnStatus XN_CALLBACK_TYPE __ModuleStartPoseDetection(XnModuleNodeHandle hGenerator, const XnChar* strPose, XnUserID user)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1266,7 +1369,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStartPoseDetection(XnModuleNod
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->StartPoseDetection(strPose, user);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStopPoseDetection(XnModuleNodeHandle hGenerator, XnUserID user)
+XnStatus XN_CALLBACK_TYPE __ModuleStopPoseDetection(XnModuleNodeHandle hGenerator, XnUserID user)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1274,8 +1377,16 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleStopPoseDetection(XnModuleNode
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->StopPoseDetection(user);
 }
+XnStatus XN_CALLBACK_TYPE __ModuleStopSinglePoseDetection(XnModuleNodeHandle hGenerator, XnUserID user, const XnChar* strPose)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModulePoseDetectionInteface* pInterface = pNode->GetPoseDetectionInteface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
+	return pInterface->StopSinglePoseDetection(user, strPose);
+}
 
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPoseCallbacks(XnModuleNodeHandle hGenerator, XnModulePoseDetectionCallback PoseDetectionStartCB, XnModulePoseDetectionCallback PoseDetectionEndCB, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPoseCallbacks(XnModuleNodeHandle hGenerator, XnModulePoseDetectionCallback PoseDetectionStartCB, XnModulePoseDetectionCallback PoseDetectionEndCB, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1283,7 +1394,7 @@ XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPoseCallbacks(XnModu
 	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
 	return pInterface->RegisterToPoseDetectionCallbacks(PoseDetectionStartCB, PoseDetectionEndCB, pCookie, *phCallback);
 }
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromPoseCallbacks(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromPoseCallbacks(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
@@ -1292,118 +1403,225 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromPoseCallbacks(XnModu
 	pInterface->UnregisterFromPoseDetectionCallbacks(hCallback);
 }
 
-XN_C_API_EXPORT XnUInt16 XN_CALLBACK_TYPE __ModuleGetNumberOfUsers(XnModuleNodeHandle hGenerator)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPoseDetected(XnModuleNodeHandle hGenerator, XnModulePoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModulePoseDetectionInteface* pInterface = pNode->GetPoseDetectionInteface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
+	return pInterface->RegisterToPoseDetected(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromPoseDetected(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModulePoseDetectionInteface* pInterface = pNode->GetPoseDetectionInteface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface,);
+	pInterface->UnregisterFromPoseDetected(hCallback);
+}
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToOutOfPose(XnModuleNodeHandle hGenerator, XnModulePoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModulePoseDetectionInteface* pInterface = pNode->GetPoseDetectionInteface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
+	return pInterface->RegisterToOutOfPose(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromOutOfPose(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModulePoseDetectionInteface* pInterface = pNode->GetPoseDetectionInteface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface,);
+	pInterface->UnregisterFromOutOfPose(hCallback);
+}
+
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToPoseInProgressCallback(XnModuleNodeHandle hGenerator, XnModulePoseDetectionInProgressCallback handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModulePoseDetectionInteface* pInterface = pNode->GetPoseDetectionInteface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE(pInterface);
+	return pInterface->RegisterToPoseDetectionInProgress(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromPoseInProgressCallback(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	ModulePoseDetectionInteface* pInterface = pNode->GetPoseDetectionInteface();
+	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(pInterface,);
+	pInterface->UnregisterFromPoseDetectionInProgress(hCallback);
+}
+
+
+XnUInt16 XN_CALLBACK_TYPE __ModuleGetNumberOfUsers(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
 	return pNode->GetNumberOfUsers();
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetUsers(XnModuleNodeHandle hGenerator, XnUserID* pUsers, XnUInt16* pnUsers)
+XnStatus XN_CALLBACK_TYPE __ModuleGetUsers(XnModuleNodeHandle hGenerator, XnUserID* pUsers, XnUInt16* pnUsers)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
 	return pNode->GetUsers(pUsers, *pnUsers);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetUserCoM(XnModuleNodeHandle hGenerator, XnUserID user, XnPoint3D* pCoM)
+XnStatus XN_CALLBACK_TYPE __ModuleGetUserCoM(XnModuleNodeHandle hGenerator, XnUserID user, XnPoint3D* pCoM)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
 	return pNode->GetCoM(user, *pCoM);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetUserPixels(XnModuleNodeHandle hGenerator, XnUserID user, XnSceneMetaData* pScene)
+XnStatus XN_CALLBACK_TYPE __ModuleGetUserPixels(XnModuleNodeHandle hGenerator, XnUserID user, XnSceneMetaData* pScene)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
 	return pNode->GetUserPixels(user, pScene);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterUserCallbacks(XnModuleNodeHandle hGenerator, XnModuleUserHandler NewUserCB, XnModuleUserHandler LostUserCB, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterUserCallbacks(XnModuleNodeHandle hGenerator, XnModuleUserHandler NewUserCB, XnModuleUserHandler LostUserCB, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
 	return pNode->RegisterUserCallbacks(NewUserCB, LostUserCB, pCookie, *phCallback);
 }
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterUserCallbacks(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterUserCallbacks(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
 	pNode->UnregisterUserCallbacks(hCallback);
 }
 
-XN_C_API_EXPORT XnUChar* XN_CALLBACK_TYPE __ModuleGetAudioBuffer(XnModuleNodeHandle hGenerator)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToUserExitCallback(XnModuleNodeHandle hGenerator, XnModuleUserHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	return pNode->RegisterToUserExit(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromUserExitCallback(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	pNode->UnregisterFromUserExit(hCallback);
+}
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToUserReEnterCallback(XnModuleNodeHandle hGenerator, XnModuleUserHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	return pNode->RegisterToUserReEnter(handler, pCookie, *phCallback);
+}
+void XN_CALLBACK_TYPE __ModuleUnregisterFromUserReEnterCallback(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
+	ModuleUserGenerator* pNode = dynamic_cast<ModuleUserGenerator*>(pProdNode);
+	pNode->UnregisterFromUserReEnter(hCallback);
+}
+
+
+XnUChar* XN_CALLBACK_TYPE __ModuleGetAudioBuffer(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleAudioGenerator* pNode = dynamic_cast<ModuleAudioGenerator*>(pProdNode);
 	return pNode->GetAudioBuffer();
 }
-XN_C_API_EXPORT XnUInt32 XN_CALLBACK_TYPE __ModuleGetSupportedWaveOutputModesCount(XnModuleNodeHandle hGenerator)
+XnUInt32 XN_CALLBACK_TYPE __ModuleGetSupportedWaveOutputModesCount(XnModuleNodeHandle hGenerator)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleAudioGenerator* pNode = dynamic_cast<ModuleAudioGenerator*>(pProdNode);
 	return pNode->GetSupportedWaveOutputModesCount();
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetSupportedWaveOutputModes(XnModuleNodeHandle hGenerator, XnWaveOutputMode* aSupportedModes, XnUInt32* pnCount)
+XnStatus XN_CALLBACK_TYPE __ModuleGetSupportedWaveOutputModes(XnModuleNodeHandle hGenerator, XnWaveOutputMode* aSupportedModes, XnUInt32* pnCount)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleAudioGenerator* pNode = dynamic_cast<ModuleAudioGenerator*>(pProdNode);
 	return pNode->GetSupportedWaveOutputModes(aSupportedModes, *pnCount);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleSetWaveOutputMode(XnModuleNodeHandle hGenerator, const XnWaveOutputMode* pOutputMode)
+XnStatus XN_CALLBACK_TYPE __ModuleSetWaveOutputMode(XnModuleNodeHandle hGenerator, const XnWaveOutputMode* pOutputMode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleAudioGenerator* pNode = dynamic_cast<ModuleAudioGenerator*>(pProdNode);
 	return pNode->SetWaveOutputMode(*pOutputMode);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleGetWaveOutputMode(XnModuleNodeHandle hGenerator, XnWaveOutputMode* pOutputMode)
+XnStatus XN_CALLBACK_TYPE __ModuleGetWaveOutputMode(XnModuleNodeHandle hGenerator, XnWaveOutputMode* pOutputMode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleAudioGenerator* pNode = dynamic_cast<ModuleAudioGenerator*>(pProdNode);
 	return pNode->GetWaveOutputMode(*pOutputMode);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleRegisterToWaveOutputModeChanges(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+XnStatus XN_CALLBACK_TYPE __ModuleRegisterToWaveOutputModeChanges(XnModuleNodeHandle hGenerator, XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleAudioGenerator* pNode = dynamic_cast<ModuleAudioGenerator*>(pProdNode);
 	return pNode->RegisterToWaveOutputModeChanges(handler, pCookie, *phCallback);
 }
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleUnregisterFromWaveOutputModeChanges(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
+void XN_CALLBACK_TYPE __ModuleUnregisterFromWaveOutputModeChanges(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hGenerator;
 	ModuleAudioGenerator* pNode = dynamic_cast<ModuleAudioGenerator*>(pProdNode);
 	pNode->UnregisterFromWaveOutputModeChanges(hCallback);
 }
 
-XN_C_API_EXPORT XnCodecID XN_CALLBACK_TYPE __ModuleGetCodecID(XnModuleNodeHandle hCodec)
+XnCodecID XN_CALLBACK_TYPE __ModuleGetCodecID(XnModuleNodeHandle hCodec)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hCodec;
 	ModuleCodec* pCodec = dynamic_cast<ModuleCodec*>(pProdNode);
 	return pCodec->GetCodecID();
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleCodecInit(XnModuleNodeHandle hCodec, XnNodeHandle hNode)
+XnStatus XN_CALLBACK_TYPE __ModuleCodecInit(XnModuleNodeHandle hCodec, XnNodeHandle hNode)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hCodec;
 	ModuleCodec* pCodec = dynamic_cast<ModuleCodec*>(pProdNode);
 	return pCodec->Init(ProductionNode(hNode));
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleCompressData(XnModuleNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten)
+XnStatus XN_CALLBACK_TYPE __ModuleCompressData(XnModuleNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hCodec;
 	ModuleCodec* pCodec = dynamic_cast<ModuleCodec*>(pProdNode);
 	return pCodec->CompressData(pSrc, nSrcSize, pDst, nDstSize, pnBytesWritten);
 }
-XN_C_API_EXPORT XnStatus XN_CALLBACK_TYPE __ModuleDecompressData(XnModuleNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten)
+XnStatus XN_CALLBACK_TYPE __ModuleDecompressData(XnModuleNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten)
 {
 	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hCodec;
 	ModuleCodec* pCodec = dynamic_cast<ModuleCodec*>(pProdNode);
 	return pCodec->DecompressData(pSrc, nSrcSize, pDst, nDstSize, pnBytesWritten);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetExtendedSerializationInterface(XnModuleExtendedSerializationInterface* pInterface)
+const XnChar* XN_CALLBACK_TYPE __ModuleScriptGetSupportedFormat(XnModuleNodeHandle hScript)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hScript;
+	ModuleScriptNode* pScript = dynamic_cast<ModuleScriptNode*>(pProdNode);
+	return pScript->GetSupportedFormat();
+}
+
+XnStatus XN_CALLBACK_TYPE __ModuleLoadScriptFromFile(XnModuleNodeHandle hScript, const XnChar* strFileName)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hScript;
+	ModuleScriptNode* pScript = dynamic_cast<ModuleScriptNode*>(pProdNode);
+	return pScript->LoadScriptFromFile(strFileName);
+}
+
+XnStatus XN_CALLBACK_TYPE __ModuleLoadScriptFromString(XnModuleNodeHandle hScript, const XnChar* strScript)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hScript;
+	ModuleScriptNode* pScript = dynamic_cast<ModuleScriptNode*>(pProdNode);
+	return pScript->LoadScriptFromString(strScript);
+}
+
+XnStatus XN_CALLBACK_TYPE __ModuleScriptRun(XnModuleNodeHandle hScript, XnNodeInfoList* pCreatedNodes, XnEnumerationErrors* pErrors)
+{
+	ModuleProductionNode* pProdNode = (ModuleProductionNode*)hScript;
+	ModuleScriptNode* pScript = dynamic_cast<ModuleScriptNode*>(pProdNode);
+	NodeInfoList createdNodes(pCreatedNodes);
+	EnumerationErrors errors(pErrors);
+	return pScript->Run(createdNodes, errors);
+}
+
+void XN_CALLBACK_TYPE __ModuleGetExtendedSerializationInterface(XnModuleExtendedSerializationInterface* pInterface)
 {
 	pInterface->InitNotifications = __ModuleInitNotifications;
 	pInterface->StopNotifications = __ModuleStopNotifications;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetLockAwareInterface(XnModuleLockAwareInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetLockAwareInterface(XnModuleLockAwareInterface* pInterface)
 {
 	pInterface->SetLockState = __ModuleSetLockState;
 	pInterface->GetLockState = __ModuleGetLockState;
@@ -1411,14 +1629,14 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetLockAwareInterface(XnModuleLock
 	pInterface->UnregisterFromLockChange = __ModuleUnregisterFromLockChange;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetErrorStateInterface(XnModuleErrorStateInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetErrorStateInterface(XnModuleErrorStateInterface* pInterface)
 {
 	pInterface->GetErrorState = __ModuleGetErrorState;
 	pInterface->RegisterToErrorStateChange = __ModuleRegisterToErrorStateChange;
 	pInterface->UnregisterFromErrorStateChange = __ModuleUnregisterFromErrorStateChange;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetGeneralIntInterface(XnModuleGeneralIntInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetGeneralIntInterface(XnModuleGeneralIntInterface* pInterface)
 {
 	pInterface->GetRange = __ModuleGeneralIntGetRange;
 	pInterface->Get = __ModuleGeneralIntGet;
@@ -1427,7 +1645,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetGeneralIntInterface(XnModuleGen
 	pInterface->UnregisterFromValueChange = __ModuleGeneralIntUnregisterFromValueChange;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetProductionNodeInterface(XnModuleProductionNodeInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetProductionNodeInterface(XnModuleProductionNodeInterface* pInterface)
 {
 	pInterface->IsCapabilitySupported = __ModuleIsCapabilitySupported;
 	pInterface->SetIntProperty = __ModuleSetIntProperty;
@@ -1445,20 +1663,20 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetProductionNodeInterface(XnModul
 	__ModuleGetGeneralIntInterface(pInterface->pGeneralIntInterface);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetDeviceIdentificationInterface(XnModuleDeviceIdentificationInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetDeviceIdentificationInterface(XnModuleDeviceIdentificationInterface* pInterface)
 {
 	pInterface->GetDeviceName = __ModuleGetDeviceName;
 	pInterface->GetVendorSpecificData = __ModuleGetVendorSpecificData;
 	pInterface->GetSerialNumber = __ModuleGetSerialNumber;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetDeviceInterface(XnModuleDeviceInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetDeviceInterface(XnModuleDeviceInterface* pInterface)
 {
 	__ModuleGetProductionNodeInterface(pInterface->pProductionNode);
 	__ModuleGetDeviceIdentificationInterface(pInterface->pDeviceIdentificationInterface);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetMirrorInterface(XnModuleMirrorInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetMirrorInterface(XnModuleMirrorInterface* pInterface)
 {
 	pInterface->SetMirror = __ModuleSetMirror;
 	pInterface->IsMirrored = __ModuleIsMirrored;
@@ -1466,7 +1684,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetMirrorInterface(XnModuleMirrorI
 	pInterface->UnregisterFromMirrorChange = __ModuleUnregisterFromMirrorChange;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetAlternativeViewPointInterface(XnModuleAlternativeViewPointInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetAlternativeViewPointInterface(XnModuleAlternativeViewPointInterface* pInterface)
 {
 	pInterface->IsViewPointSupported = __ModuleIsViewPointSupported;
 	pInterface->SetViewPoint = __ModuleSetViewPoint;
@@ -1476,7 +1694,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetAlternativeViewPointInterface(X
 	pInterface->UnregisterFromViewPointChange = __ModuleUnregisterFromViewPointChange;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetFrameSyncInterface(XnModuleFrameSyncInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetFrameSyncInterface(XnModuleFrameSyncInterface* pInterface)
 {
 	pInterface->CanFrameSyncWith = __ModuleCanFrameSyncWith;
 	pInterface->FrameSyncWith = __ModuleFrameSyncWith;
@@ -1486,7 +1704,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetFrameSyncInterface(XnModuleFram
 	pInterface->UnregisterFromFrameSyncChange = __ModuleUnregisterFromFrameSyncChange;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetGeneratorInterface(XnModuleGeneratorInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetGeneratorInterface(XnModuleGeneratorInterface* pInterface)
 {
 	__ModuleGetProductionNodeInterface(pInterface->pProductionNodeInterface);
 	pInterface->StartGenerating = __ModuleStartGenerating;
@@ -1507,7 +1725,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetGeneratorInterface(XnModuleGene
 	__ModuleGetFrameSyncInterface(pInterface->pFrameSyncInterface);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetNodeNotificationsInterface(XnNodeNotifications *pInterface)
+void XN_CALLBACK_TYPE __ModuleGetNodeNotificationsInterface(XnNodeNotifications *pInterface)
 {
 	pInterface->OnNodeAdded = __ModuleOnNodeAdded;
 	pInterface->OnNodeRemoved = __ModuleOnNodeRemoved;
@@ -1519,14 +1737,14 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetNodeNotificationsInterface(XnNo
 	pInterface->OnNodeNewData = __ModuleOnNodeNewData;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetRecorderInterface(XnModuleRecorderInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetRecorderInterface(XnModuleRecorderInterface* pInterface)
 {
 	pInterface->SetOutputStream = __ModuleSetOutputStream;
 	__ModuleGetProductionNodeInterface(pInterface->pProductionNode);
 	__ModuleGetNodeNotificationsInterface(pInterface->pNodeNotifications);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetPlayerInterface(XnModulePlayerInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetPlayerInterface(XnModulePlayerInterface* pInterface)
 {
 	__ModuleGetProductionNodeInterface(pInterface->pProductionNode);
 	pInterface->SetInputStream = __ModuleSetInputStream;
@@ -1544,7 +1762,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetPlayerInterface(XnModulePlayerI
 	pInterface->UnregisterFromEndOfFileReached = __ModuleUnregisterFromEndOfFileReached;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetCroppingInterface(XnModuleCroppingInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetCroppingInterface(XnModuleCroppingInterface* pInterface)
 {
 	pInterface->SetCropping = __ModuleSetCropping;
 	pInterface->GetCropping = __ModuleGetCropping;
@@ -1552,7 +1770,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetCroppingInterface(XnModuleCropp
 	pInterface->UnregisterFromCroppingChange = __ModuleUnregisterFromCroppingChange;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetAntiFlickerInterface(XnModuleAntiFlickerInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetAntiFlickerInterface(XnModuleAntiFlickerInterface* pInterface)
 {
 	pInterface->SetPowerLineFrequency = __ModuleSetPowerLineFrequency;
 	pInterface->GetPowerLineFrequency = __ModuleGetPowerLineFrequency;
@@ -1560,7 +1778,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetAntiFlickerInterface(XnModuleAn
 	pInterface->UnregisterFromPowerLineFrequencyChange = __ModuleUnregisterFromPowerLineFrequencyChange;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetMapGeneratorInterface(XnModuleMapGeneratorInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetMapGeneratorInterface(XnModuleMapGeneratorInterface* pInterface)
 {
 	__ModuleGetGeneratorInterface(pInterface->pGeneratorInterface);
 	pInterface->GetSupportedMapOutputModesCount = __ModuleGetSupportedMapOutputModesCount;
@@ -1574,7 +1792,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetMapGeneratorInterface(XnModuleM
 	__ModuleGetAntiFlickerInterface(pInterface->pAntiFlickerInterface);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetUserPositionInterface(XnModuleUserPositionCapabilityInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetUserPositionInterface(XnModuleUserPositionCapabilityInterface* pInterface)
 {
 	pInterface->GetSupportedUserPositionsCount = __ModuleGetSupportedUserPositionsCount;
 	pInterface->SetUserPosition = __ModuleSetUserPosition;
@@ -1583,7 +1801,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetUserPositionInterface(XnModuleU
 	pInterface->UnregisterFromUserPositionChange = __ModuleUnregisterFromUserPositionChange;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetDepthGeneratorInterface(XnModuleDepthGeneratorInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetDepthGeneratorInterface(XnModuleDepthGeneratorInterface* pInterface)
 {
 	__ModuleGetMapGeneratorInterface(pInterface->pMapInterface);
 	pInterface->GetDeviceMaxDepth = __ModuleGetDeviceMaxDepth;
@@ -1594,7 +1812,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetDepthGeneratorInterface(XnModul
 	__ModuleGetUserPositionInterface(pInterface->pUserPositionInterface);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetImageGeneratorInterface(XnModuleImageGeneratorInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetImageGeneratorInterface(XnModuleImageGeneratorInterface* pInterface)
 {
 	__ModuleGetMapGeneratorInterface(pInterface->pMapInterface);
 	pInterface->GetImageMap = __ModuleGetImageMap;
@@ -1605,13 +1823,13 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetImageGeneratorInterface(XnModul
 	pInterface->UnregisterFromPixelFormatChange = __ModuleUnregisterFromPixelFormatChange;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetIRGeneratorInterface(XnModuleIRGeneratorInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetIRGeneratorInterface(XnModuleIRGeneratorInterface* pInterface)
 {
 	__ModuleGetMapGeneratorInterface(pInterface->pMapInterface);
 	pInterface->GetIRMap = __ModuleGetIRMap;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetGestureGeneratorInterface(XnModuleGestureGeneratorInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetGestureGeneratorInterface(XnModuleGestureGeneratorInterface* pInterface)
 {
 	__ModuleGetGeneratorInterface(pInterface->pGeneratorInterface);
 	pInterface->AddGesture = __ModuleAddGesture;
@@ -1626,16 +1844,21 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetGestureGeneratorInterface(XnMod
 	pInterface->UnregisterGestureCallbacks = __ModuleUnregisterGestureCallbacks;
 	pInterface->RegisterToGestureChange = __ModuleRegisterToGestureChange;
 	pInterface->UnregisterFromGestureChange = __ModuleUnregisterFromGestureChange;
+
+	pInterface->RegisterToGestureIntermediateStageCompleted = __ModuleRegisterToGestureIntermediateStageCompleted;
+	pInterface->UnregisterFromGestureIntermediateStageCompleted = __ModuleUnregisterFromGestureIntermediateStageCompleted;
+	pInterface->RegisterToGestureReadyForNextIntermediateStage = __ModuleRegisterToGestureReadyForNextIntermediateStage;
+	pInterface->UnregisterFromGestureReadyForNextIntermediateStage = __ModuleUnregisterFromGestureReadyForNextIntermediateStage;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetSceneAnalyzerInterface(XnModuleSceneAnalyzerInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetSceneAnalyzerInterface(XnModuleSceneAnalyzerInterface* pInterface)
 {
 	__ModuleGetMapGeneratorInterface(pInterface->pMapInterface);
 	pInterface->GetLabelMap = __ModuleGetLabelMap;
 	pInterface->GetFloor = __ModuleGetFloor;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetSkeletonInterface(XnModuleSkeletonCapabilityInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetSkeletonInterface(XnModuleSkeletonCapabilityInterface* pInterface)
 {
 	pInterface->IsJointAvailable = __ModuleIsJointAvailable;
 	pInterface->IsProfileAvailable = __ModuleIsProfileAvailable;
@@ -1667,20 +1890,37 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetSkeletonInterface(XnModuleSkele
 	pInterface->SetSmoothing = __ModuleSetSkeletonSmoothing;
 	pInterface->RegisterCalibrationCallbacks = __ModuleRegisterCalibrationCallbacks;
 	pInterface->UnregisterCalibrationCallbacks = __ModuleUnregisterCalibrationCallbacks;
+
+	pInterface->RegisterToCalibrationInProgress = __ModuleRegisterToCalibrationInProgressCallback;
+	pInterface->UnregisterFromCalibrationInProgress = __ModuleUnregisterFromCalibrationInProgressCallback;
+	pInterface->RegisterToCalibrationComplete = __ModuleRegisterToCalibrationCompleteCallback;
+	pInterface->UnregisterFromCalibrationComplete = __ModuleUnregisterFromCalibrationCompleteCallback;
+
+	pInterface->RegisterToCalibrationStart = __ModuleRegisterToCalibrationStartCallback;
+	pInterface->UnregisterFromCalibrationStart = __ModuleUnregisterFromCalibrationStartCallback;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetPoseDetectionInterface(XnModulePoseDetectionCapabilityInterface* pInteface)
+void XN_CALLBACK_TYPE __ModuleGetPoseDetectionInterface(XnModulePoseDetectionCapabilityInterface* pInteface)
 {
 	pInteface->GetNumberOfPoses = __ModuleGetNumberOfPoses;
 	pInteface->GetAvailablePoses = __ModuleGetAvailablePoses;
 	pInteface->GetAllAvailablePoses = __ModuleGetAllAvailablePoses;
 	pInteface->StartPoseDetection = __ModuleStartPoseDetection;
 	pInteface->StopPoseDetection = __ModuleStopPoseDetection;
+	pInteface->StopSinglePoseDetection = __ModuleStopSinglePoseDetection;
 	pInteface->RegisterToPoseCallbacks = __ModuleRegisterToPoseCallbacks;
 	pInteface->UnregisterFromPoseCallbacks = __ModuleUnregisterFromPoseCallbacks;
+
+	pInteface->RegisterToPoseDetectionInProgress = __ModuleRegisterToPoseInProgressCallback;
+	pInteface->UnregisterFromPoseDetectionInProgress = __ModuleUnregisterFromPoseInProgressCallback;
+
+	pInteface->RegisterToPoseDetected = __ModuleRegisterToPoseDetected;
+	pInteface->UnregisterFromPoseDetected = __ModuleUnregisterFromPoseDetected;
+	pInteface->RegisterToOutOfPose = __ModuleRegisterToOutOfPose;
+	pInteface->UnregisterFromOutOfPose = __ModuleUnregisterFromOutOfPose;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetUserGeneratorInterface(XnModuleUserGeneratorInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetUserGeneratorInterface(XnModuleUserGeneratorInterface* pInterface)
 {
 	__ModuleGetGeneratorInterface(pInterface->pGeneratorInterface);
 
@@ -1693,9 +1933,19 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetUserGeneratorInterface(XnModule
 
 	__ModuleGetSkeletonInterface(pInterface->pSkeletonInterface);
 	__ModuleGetPoseDetectionInterface(pInterface->pPoseDetectionInterface);
+
+	pInterface->RegisterToUserExit = __ModuleRegisterToUserExitCallback;
+	pInterface->UnregisterFromUserExit = __ModuleUnregisterFromUserExitCallback;
+	pInterface->RegisterToUserReEnter = __ModuleRegisterToUserReEnterCallback;
+	pInterface->UnregisterFromUserReEnter = __ModuleUnregisterFromUserReEnterCallback;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetHandsGeneratorInterface(XnModuleHandsGeneratorInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetHandTouchingFOVEdgeInterface(XnModuleHandTouchingFOVEdgeCapabilityInterface* pInterface)
+{
+	pInterface->RegisterToHandTouchingFOVEdge = __ModuleRegisterToHandTouchingFOVEdgeCallback;
+	pInterface->UnregisterFromHandTouchingFOVEdge = __ModuleUnregisterFromHandTouchingFOVEdgeCallback;
+}
+void XN_CALLBACK_TYPE __ModuleGetHandsGeneratorInterface(XnModuleHandsGeneratorInterface* pInterface)
 {
 	__ModuleGetGeneratorInterface(pInterface->pGeneratorInterface);
 
@@ -1705,9 +1955,11 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetHandsGeneratorInterface(XnModul
 	pInterface->RegisterHandCallbacks = __ModuleRegisterHandCallbacks;
 	pInterface->UnregisterHandCallbacks = __ModuleUnregisterHandCallbacks;
 	pInterface->SetSmoothing = __ModuleSetTrackingSmoothing;
+
+	__ModuleGetHandTouchingFOVEdgeInterface(pInterface->pHandTouchingFOVEdgeInterface);
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetAudioGeneratorInterface(XnModuleAudioGeneratorInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetAudioGeneratorInterface(XnModuleAudioGeneratorInterface* pInterface)
 {
 	__ModuleGetGeneratorInterface(pInterface->pGeneratorInterface);
 
@@ -1720,7 +1972,7 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetAudioGeneratorInterface(XnModul
 	pInterface->UnregisterFromWaveOutputModeChanges = __ModuleUnregisterFromWaveOutputModeChanges;
 }
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetCodecInterface(XnModuleCodecInterface* pInterface)
+void XN_CALLBACK_TYPE __ModuleGetCodecInterface(XnModuleCodecInterface* pInterface)
 {
 	__ModuleGetProductionNodeInterface(pInterface->pProductionNode);
 
@@ -1730,4 +1982,14 @@ XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetCodecInterface(XnModuleCodecInt
 	pInterface->DecompressData = __ModuleDecompressData;
 }
 
+void XN_CALLBACK_TYPE __ModuleGetScriptNodeInterface(XnModuleScriptNodeInterface* pInterface)
+{
+	__ModuleGetProductionNodeInterface(pInterface->pProductionNode);
+
+	pInterface->GetSupportedFormat = __ModuleScriptGetSupportedFormat;
+	pInterface->LoadScriptFromFile = __ModuleLoadScriptFromFile;
+	pInterface->LoadScriptFromString = __ModuleLoadScriptFromString;
+	pInterface->Run = __ModuleScriptRun;
+}
+
 #endif /* XN_MODULE_C_FUNCTIONS_H_ */
diff --git a/Include/XnModuleCppInterface.h b/Include/XnModuleCppInterface.h
index 075191d..afad737 100644
--- a/Include/XnModuleCppInterface.h
+++ b/Include/XnModuleCppInterface.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -151,6 +151,13 @@ namespace xn
 	class ModuleProductionNode
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleProductionNode()
+		{
+			xnOSMemSet(m_aInterfaces, 0, sizeof(m_aInterfaces));
+			m_aInterfaces[XN_NODE_TYPE_PRODUCTION_NODE] = this;
+		}
+#endif
 		virtual ~ModuleProductionNode() {}
 		virtual XnBool IsCapabilitySupported(const XnChar* /*strCapabilityName*/) { return FALSE; }
 		virtual XnStatus SetIntProperty(const XnChar* /*strName*/, XnUInt64 /*nValue*/) { return XN_STATUS_ERROR; }
@@ -165,6 +172,11 @@ namespace xn
 		virtual ModuleLockAwareInterface* GetLockAwareInterface() { return NULL; }
 		virtual ModuleErrorStateInterface* GetErrorStateInterface() { return NULL; }
 		virtual ModuleGeneralIntInterface* GetGeneralIntInterface(const XnChar* /*strCap*/) { return NULL; }
+
+	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		void* m_aInterfaces[XN_NODE_TYPE_FIRST_EXTENSION];
+#endif
 	};
 
 	class ModuleDeviceIdentificationInterface
@@ -179,6 +191,9 @@ namespace xn
 	class ModuleDevice : virtual public ModuleProductionNode
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleDevice() { m_aInterfaces[XN_NODE_TYPE_DEVICE] = this; }
+#endif
 		virtual ~ModuleDevice() {}
 		virtual ModuleDeviceIdentificationInterface* GetIdentificationInterface() { return NULL; }
 	};
@@ -219,6 +234,9 @@ namespace xn
 	class ModuleGenerator : virtual public ModuleProductionNode
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleGenerator() { m_aInterfaces[XN_NODE_TYPE_GENERATOR] = this;}
+#endif
 		virtual ~ModuleGenerator() {}
 		virtual XnStatus StartGenerating() = 0;
 		virtual XnBool IsGenerating() = 0;
@@ -257,6 +275,9 @@ namespace xn
 		virtual public ModuleNodeNotifications
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleRecorder() { m_aInterfaces[XN_NODE_TYPE_RECORDER] = this; }
+#endif
 		virtual ~ModuleRecorder() {}
 		virtual XnStatus SetOutputStream(void* pCookie, XnRecorderOutputStreamInterface* pStream) = 0;
 	};
@@ -264,6 +285,9 @@ namespace xn
 	class ModulePlayer : virtual public ModuleProductionNode
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModulePlayer() { m_aInterfaces[XN_NODE_TYPE_PLAYER] = this; }
+#endif
 		virtual ~ModulePlayer() {}
 		virtual XnStatus SetInputStream(void* pStreamCookie, XnPlayerInputStreamInterface* pStream) = 0;
 		virtual XnStatus ReadNext() = 0;
@@ -304,6 +328,9 @@ namespace xn
 	class ModuleMapGenerator : virtual public ModuleGenerator
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleMapGenerator() { m_aInterfaces[XN_NODE_TYPE_MAP_GENERATOR] = this; }
+#endif
 		virtual ~ModuleMapGenerator() {}
 		virtual XnUInt32 GetSupportedMapOutputModesCount() = 0;
 		virtual XnStatus GetSupportedMapOutputModes(XnMapOutputMode aModes[], XnUInt32& nCount) = 0;
@@ -330,6 +357,9 @@ namespace xn
 	class ModuleDepthGenerator : virtual public ModuleMapGenerator
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleDepthGenerator() { m_aInterfaces[XN_NODE_TYPE_DEPTH] = this; }
+#endif
 		virtual ~ModuleDepthGenerator() {}
 		virtual const void* GetData() { return GetDepthMap(); }
 		virtual XnUInt32 GetBytesPerPixel() { return sizeof(XnDepthPixel); }
@@ -344,6 +374,9 @@ namespace xn
 	class ModuleImageGenerator : virtual public ModuleMapGenerator
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleImageGenerator() { m_aInterfaces[XN_NODE_TYPE_IMAGE] = this; }
+#endif
 		virtual ~ModuleImageGenerator() {}
 		virtual const void* GetData() { return GetImageMap(); }
 		virtual XnUInt32 GetBytesPerPixel() { return xnGetBytesPerPixelForPixelFormat(GetPixelFormat()); }
@@ -358,6 +391,9 @@ namespace xn
 	class ModuleIRGenerator : virtual public ModuleMapGenerator
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleIRGenerator() { m_aInterfaces[XN_NODE_TYPE_IR] = this; }
+#endif
 		virtual ~ModuleIRGenerator() {}
 		virtual const void* GetData() { return GetIRMap(); }
 		virtual XnUInt32 GetBytesPerPixel() { return sizeof(XnIRPixel); }
@@ -367,6 +403,9 @@ namespace xn
 	class ModuleGestureGenerator : virtual public ModuleGenerator
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleGestureGenerator() { m_aInterfaces[XN_NODE_TYPE_GESTURE] = this; }
+#endif
 		virtual ~ModuleGestureGenerator() {}
 		virtual const void* GetData() { return NULL; }
 		virtual XnStatus AddGesture(const XnChar* strGesture, XnBoundingBox3D* pArea) = 0;
@@ -381,11 +420,19 @@ namespace xn
 		virtual void UnregisterGestureCallbacks(XnCallbackHandle hCallback) = 0;
 		virtual XnStatus RegisterToGestureChange(XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback) = 0;
 		virtual void UnregisterFromGestureChange(XnCallbackHandle hCallback) = 0;
+
+		virtual XnStatus RegisterToGestureIntermediateStageCompleted(XnModuleGestureIntermediateStageCompleted GestureIntermediateStageCompletedCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual void UnregisterFromGestureIntermediateStageCompleted(XnCallbackHandle hCallback) = 0;
+		virtual XnStatus RegisterToGestureReadyForNextIntermediateStage(XnModuleGestureReadyForNextIntermediateStage ReadyForNextIntermediateStageCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual void UnregisterFromGestureReadyForNextIntermediateStage(XnCallbackHandle hCallback) = 0;
 	};
 
 	class ModuleSceneAnalyzer : virtual public ModuleMapGenerator
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleSceneAnalyzer() { m_aInterfaces[XN_NODE_TYPE_SCENE] = this; }
+#endif
 		virtual ~ModuleSceneAnalyzer() {}
 		virtual const void* GetData() { return GetLabelMap(); }
 		virtual XnUInt32 GetBytesPerPixel() { return sizeof(XnLabel); }
@@ -393,9 +440,20 @@ namespace xn
 		virtual XnStatus GetFloor(XnPlane3D& pPlane) = 0;
 	};
 
+	class ModuleHandTouchingFOVEdgeInterface
+	{
+	public:
+		virtual ~ModuleHandTouchingFOVEdgeInterface() {}
+		virtual XnStatus RegisterToHandTouchingFOVEdge(XnModuleHandTouchingFOVEdge TouchingFOVEdgeCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual void UnregisterFromHandTouchingFOVEdge(XnCallbackHandle hCallback) = 0;
+	};
+
 	class ModuleHandsGenerator : virtual public ModuleGenerator
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleHandsGenerator() { m_aInterfaces[XN_NODE_TYPE_HANDS] = this; }
+#endif
 		virtual ~ModuleHandsGenerator() {}
 		virtual const void* GetData() { return NULL; }
 		virtual XnStatus RegisterHandCallbacks(XnModuleHandCreate CreateCB, XnModuleHandUpdate UpdateCB, XnModuleHandDestroy DestroyCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
@@ -404,6 +462,8 @@ namespace xn
 		virtual XnStatus StopTrackingAll() = 0;
 		virtual XnStatus StartTracking(const XnPoint3D& ptPosition) = 0;
 		virtual XnStatus SetSmoothing(XnFloat fSmoothingFactor) = 0;
+
+		virtual ModuleHandTouchingFOVEdgeInterface* GetHandTouchingFOVEdgeInterface() { return NULL; }
 	};
 
 	class ModuleSkeletonInterface
@@ -440,6 +500,14 @@ namespace xn
 		virtual XnStatus SetSmoothing(XnFloat fSmoothingFactor) = 0;
 		virtual XnStatus RegisterCalibrationCallbacks(XnModuleCalibrationStart CalibrationStartCB, XnModuleCalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
 		virtual void UnregisterCalibrationCallbacks(XnCallbackHandle hCallback) = 0;
+
+		virtual XnStatus RegisterToCalibrationInProgress(XnModuleCalibrationInProgress CalibrationInProgressCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual void UnregisterFromCalibrationInProgress(XnCallbackHandle hCallback) = 0;
+		virtual XnStatus RegisterToCalibrationComplete(XnModuleCalibrationComplete CalibrationCompleteCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual void UnregisterFromCalibrationComplete(XnCallbackHandle hCallback) = 0;
+
+		virtual XnStatus RegisterToCalibrationStart(XnModuleCalibrationStart handler, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual void UnregisterFromCalibrationStart(XnCallbackHandle hCallback) = 0;
 	};
 
 	class ModulePoseDetectionInteface
@@ -453,15 +521,26 @@ namespace xn
 
 		virtual XnStatus StartPoseDetection(const XnChar* strPose, XnUserID user) = 0;
 		virtual XnStatus StopPoseDetection(XnUserID user) = 0;
+		virtual XnStatus StopSinglePoseDetection(XnUserID user, const XnChar* strPose) = 0;
 
 		virtual XnStatus RegisterToPoseDetectionCallbacks(XnModulePoseDetectionCallback StartPoseCB, XnModulePoseDetectionCallback EndPoseCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
 		virtual void UnregisterFromPoseDetectionCallbacks(XnCallbackHandle hCallback) = 0;
 
+		virtual XnStatus RegisterToPoseDetectionInProgress(XnModulePoseDetectionInProgressCallback InProgressCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual void UnregisterFromPoseDetectionInProgress(XnCallbackHandle hCallback) = 0;
+
+		virtual XnStatus RegisterToPoseDetected(XnModulePoseDetectionCallback handler, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual XnStatus RegisterToOutOfPose(XnModulePoseDetectionCallback handler, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual void UnregisterFromPoseDetected(XnCallbackHandle hCallback) = 0;
+		virtual void UnregisterFromOutOfPose(XnCallbackHandle hCallback) = 0;
 	};
 
 	class ModuleUserGenerator : virtual public ModuleGenerator
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleUserGenerator() { m_aInterfaces[XN_NODE_TYPE_USER] = this;}
+#endif
 		virtual ~ModuleUserGenerator() {}
 		virtual const void* GetData() { return NULL; }
 		virtual XnUInt16 GetNumberOfUsers() = 0;
@@ -473,11 +552,18 @@ namespace xn
 		virtual ModuleSkeletonInterface* GetSkeletonInterface() { return NULL; }
 		virtual ModulePoseDetectionInteface* GetPoseDetectionInteface() {return NULL;}
 
+		virtual XnStatus RegisterToUserExit(XnModuleUserHandler UserExitCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual void UnregisterFromUserExit(XnCallbackHandle hCallback) = 0;
+		virtual XnStatus RegisterToUserReEnter(XnModuleUserHandler UserReEnterCB, void* pCookie, XnCallbackHandle& hCallback) = 0;
+		virtual void UnregisterFromUserReEnter(XnCallbackHandle hCallback) = 0;
 	};
 
 	class ModuleAudioGenerator : virtual public ModuleGenerator
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleAudioGenerator() { m_aInterfaces[XN_NODE_TYPE_AUDIO] = this; }
+#endif
 		virtual ~ModuleAudioGenerator() {}
 		virtual const void* GetData() { return GetAudioBuffer(); }
 		virtual XnUChar* GetAudioBuffer() = 0;
@@ -492,12 +578,28 @@ namespace xn
 	class ModuleCodec : virtual public ModuleProductionNode
 	{
 	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleCodec() { m_aInterfaces[XN_NODE_TYPE_CODEC] = this; }
+#endif
 		virtual ~ModuleCodec() {}
 		virtual XnCodecID GetCodecID() const = 0;
 		virtual XnStatus Init(const ProductionNode& node) = 0;
 		virtual XnStatus CompressData(const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten) const = 0;
 		virtual XnStatus DecompressData(const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten) const = 0;
 	};
+
+	class ModuleScriptNode : virtual public ModuleProductionNode
+	{
+	public:
+#ifdef XN_NO_DYNAMIC_CAST
+		ModuleScriptNode() { m_aInterfaces[XN_NODE_TYPE_SCRIPT] = this; }
+#endif
+		virtual ~ModuleScriptNode() {}
+		virtual const XnChar* GetSupportedFormat() = 0;
+		virtual XnStatus LoadScriptFromFile(const XnChar* strFileName) = 0;
+		virtual XnStatus LoadScriptFromString(const XnChar* strScript) = 0;
+		virtual XnStatus Run(NodeInfoList& createdNodes, EnumerationErrors& errors) = 0;
+	};
 }
 
 #endif // __XN_MODULE_CPP_INTERFACE_H__
diff --git a/Include/XnModuleCppRegistratration.h b/Include/XnModuleCppRegistratration.h
index 1fa8300..4739a3d 100644
--- a/Include/XnModuleCppRegistratration.h
+++ b/Include/XnModuleCppRegistratration.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -45,11 +45,11 @@ inline XnModuleNodeHandle __ModuleNodeToHandle(xn::ModuleProductionNode* pNode)
 
 #define __XN_EXPORT_NODE_COMMON(ExportedClass, ExportedName, Type)											\
 	/** Create a static global instance. */																	\
-	static ExportedClass ExportedName;																		\
+	static ExportedClass* ExportedName = new ExportedClass();												\
 																											\
 	void XN_CALLBACK_TYPE _CONCAT(ExportedClass,GetDescription)(XnProductionNodeDescription* pDescription)	\
 	{																										\
-		ExportedName.GetDescription(pDescription);															\
+		ExportedName->GetDescription(pDescription);															\
 	}																										\
 																											\
 	XnStatus XN_CALLBACK_TYPE _CONCAT(ExportedClass,EnumerateProductionTrees)								\
@@ -58,7 +58,7 @@ inline XnModuleNodeHandle __ModuleNodeToHandle(xn::ModuleProductionNode* pNode)
 		Context context(pContext);																			\
 		NodeInfoList list(pTreesList);																		\
 		EnumerationErrors errors(pErrors);																	\
-		return ExportedName.EnumerateProductionTrees(context, list, pErrors == NULL ? NULL : &errors);		\
+		return ExportedName->EnumerateProductionTrees(context, list, pErrors == NULL ? NULL : &errors);		\
 	}																										\
 																											\
 	XnStatus XN_CALLBACK_TYPE _CONCAT(ExportedClass,Create)(XnContext* pContext,							\
@@ -75,7 +75,7 @@ inline XnModuleNodeHandle __ModuleNodeToHandle(xn::ModuleProductionNode* pNode)
 		}																									\
 		ModuleProductionNode* pNode;																		\
 		Context context(pContext);																			\
-		XnStatus nRetVal = ExportedName.Create(context, strInstanceName, strCreationInfo,					\
+		XnStatus nRetVal = ExportedName->Create(context, strInstanceName, strCreationInfo,					\
 			pNeeded, strConfigurationDir, &pNode);															\
 		if (nRetVal != XN_STATUS_OK)																		\
 		{																									\
@@ -90,7 +90,7 @@ inline XnModuleNodeHandle __ModuleNodeToHandle(xn::ModuleProductionNode* pNode)
 	void XN_CALLBACK_TYPE _CONCAT(ExportedClass,Destroy)(XnModuleNodeHandle hInstance)						\
 	{																										\
 		ModuleProductionNode* pNode = (ModuleProductionNode*)hInstance;										\
-		ExportedName.Destroy(pNode);																		\
+		ExportedName->Destroy(pNode);																		\
 	}																										\
 																											\
     void XN_CALLBACK_TYPE _CONCAT(ExportedClass,GetExportedInterface)(										\
@@ -109,32 +109,26 @@ inline XnModuleNodeHandle __ModuleNodeToHandle(xn::ModuleProductionNode* pNode)
 #define _XN_EXPORT_NODE_COMMON(ExportedClass, Type)						\
 	__XN_EXPORT_NODE_COMMON(ExportedClass, _g_##ExportedClass, Type)
 
-#define _XN_VALIDATE_CAPABILITY_INTERFACE_RET(capInterface, retVal)		\
-	if (capInterface == NULL)											\
-		return retVal;
-
-#define _XN_VALIDATE_CAPABILITY_INTERFACE(capInterface)		\
-	_XN_VALIDATE_CAPABILITY_INTERFACE_RET(capInterface, XN_STATUS_INVALID_OPERATION)
-
 //---------------------------------------------------------------------------
 // Forward Declarations
 //---------------------------------------------------------------------------
 
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetProductionNodeInterface(XnModuleProductionNodeInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetDeviceInterface(XnModuleDeviceInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetGeneratorInterface(XnModuleGeneratorInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetMapGeneratorInterface(XnModuleMapGeneratorInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetDepthGeneratorInterface(XnModuleDepthGeneratorInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetImageGeneratorInterface(XnModuleImageGeneratorInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetIRGeneratorInterface(XnModuleIRGeneratorInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetUserGeneratorInterface(XnModuleUserGeneratorInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetHandsGeneratorInterface(XnModuleHandsGeneratorInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetGestureGeneratorInterface(XnModuleGestureGeneratorInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetSceneAnalyzerInterface(XnModuleSceneAnalyzerInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetAudioGeneratorInterface(XnModuleAudioGeneratorInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetRecorderInterface(XnModuleRecorderInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetPlayerInterface(XnModulePlayerInterface* pInterface);
-XN_C_API_EXPORT void XN_CALLBACK_TYPE __ModuleGetCodecInterface(XnModuleCodecInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetProductionNodeInterface(XnModuleProductionNodeInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetDeviceInterface(XnModuleDeviceInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetGeneratorInterface(XnModuleGeneratorInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetMapGeneratorInterface(XnModuleMapGeneratorInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetDepthGeneratorInterface(XnModuleDepthGeneratorInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetImageGeneratorInterface(XnModuleImageGeneratorInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetIRGeneratorInterface(XnModuleIRGeneratorInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetUserGeneratorInterface(XnModuleUserGeneratorInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetHandsGeneratorInterface(XnModuleHandsGeneratorInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetGestureGeneratorInterface(XnModuleGestureGeneratorInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetSceneAnalyzerInterface(XnModuleSceneAnalyzerInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetAudioGeneratorInterface(XnModuleAudioGeneratorInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetRecorderInterface(XnModuleRecorderInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetPlayerInterface(XnModulePlayerInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetCodecInterface(XnModuleCodecInterface* pInterface);
+void XN_CALLBACK_TYPE __ModuleGetScriptNodeInterface(XnModuleScriptNodeInterface* pInterface);
 
 //---------------------------------------------------------------------------
 // Utility Macros
@@ -169,6 +163,8 @@ static GetInterfaceFuncPtr __ModuleGetGetInterfaceFunc(XnProductionNodeType type
 		return (GetInterfaceFuncPtr)__ModuleGetHandsGeneratorInterface;
 	else if (xnIsTypeDerivedFrom(type, XN_NODE_TYPE_CODEC))
 		return (GetInterfaceFuncPtr)__ModuleGetCodecInterface;
+	else if (xnIsTypeDerivedFrom(type, XN_NODE_TYPE_SCRIPT))
+		return (GetInterfaceFuncPtr)__ModuleGetScriptNodeInterface;
 	// and continue with abstract ones
 	else if (xnIsTypeDerivedFrom(type, XN_NODE_TYPE_MAP_GENERATOR))
 		return (GetInterfaceFuncPtr)__ModuleGetMapGeneratorInterface;
@@ -242,6 +238,9 @@ static GetInterfaceFuncPtr __ModuleGetGetInterfaceFunc(XnProductionNodeType type
 #define XN_EXPORT_CODEC(ExportedClass)										\
 	_XN_EXPORT_NODE_COMMON(ExportedClass, XN_NODE_TYPE_CODEC)
 
+#define XN_EXPORT_SCRIPT(ExportedClass)										\
+	_XN_EXPORT_NODE_COMMON(ExportedClass, XN_NODE_TYPE_SCRIPT)
+
 //---------------------------------------------------------------------------
 // Exported C functions
 //---------------------------------------------------------------------------
diff --git a/Include/XnModuleInterface.h b/Include/XnModuleInterface.h
index b3b4f82..994ce85 100644
--- a/Include/XnModuleInterface.h
+++ b/Include/XnModuleInterface.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -54,6 +54,8 @@ struct XnModuleRecorderInterface;
 struct XnModulePlayerInterface;
 struct XnModuleGeneratorInterface;
 struct XnModuleCodecInterface;
+struct XnModuleScriptNodeInterface;
+struct XnModuleMapGeneratorInterface;
 
 //---------------------------------------------------------------------------
 // Types
@@ -81,6 +83,9 @@ typedef void (XN_CALLBACK_TYPE* XnModuleStateChangedHandler)(void* pCookie);
 // User
 typedef void (XN_CALLBACK_TYPE* XnModuleUserHandler)(XnUserID user, void* pCookie);
 
+// Hand touching FOV edge
+typedef void (XN_CALLBACK_TYPE* XnModuleHandTouchingFOVEdge)(XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, XnDirection eDir, void* pCookie);
+
 // UI
 typedef void (XN_CALLBACK_TYPE* XnModuleHandCreate)(XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie);
 typedef void (XN_CALLBACK_TYPE* XnModuleHandUpdate)(XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie);
@@ -89,13 +94,18 @@ typedef void (XN_CALLBACK_TYPE* XnModuleHandDestroy)(XnUserID user, XnFloat fTim
 // Gesture Module
 typedef void (XN_CALLBACK_TYPE* XnModuleGestureRecognized)(const XnChar* strGesture, const XnPoint3D* pIDPosition, const XnPoint3D* pEndPosition, void* pCookie);
 typedef void (XN_CALLBACK_TYPE* XnModuleGestureProgress)(const XnChar* strGesture, const XnPoint3D* pPosition, XnFloat fProgress, void* pCookie);
+typedef void (XN_CALLBACK_TYPE* XnModuleGestureIntermediateStageCompleted)(const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie);
+typedef void (XN_CALLBACK_TYPE* XnModuleGestureReadyForNextIntermediateStage)(const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie);
 
 // Skeleton
 typedef void (XN_CALLBACK_TYPE* XnModuleCalibrationStart)(XnUserID user, void* pCookie);
 typedef void (XN_CALLBACK_TYPE* XnModuleCalibrationEnd)(XnUserID user, XnBool bSuccess, void* pCookie);
+typedef void (XN_CALLBACK_TYPE* XnModuleCalibrationInProgress)(XnUserID user, XnCalibrationStatus calibrationError, void* pCookie);
+typedef void (XN_CALLBACK_TYPE* XnModuleCalibrationComplete)(XnUserID user, XnCalibrationStatus calibrationError, void* pCookie);
 
 // Pose Detection
 typedef void (XN_CALLBACK_TYPE* XnModulePoseDetectionCallback)(const XnChar* strPose, XnUserID user, void* pCookie);
+typedef void (XN_CALLBACK_TYPE* XnModulePoseDetectionInProgressCallback)(const XnChar* strPose, XnUserID user, XnPoseDetectionStatus poseError, void* pCookie);
 
 typedef struct XnModuleExportedProductionNodeInterface
 {
@@ -169,6 +179,7 @@ typedef struct XnModuleExportedProductionNodeInterface
 		void (XN_CALLBACK_TYPE* Recorder)(struct XnModuleRecorderInterface* pInterface);
 		void (XN_CALLBACK_TYPE* Player)(struct XnModulePlayerInterface* pInterface);
 		void (XN_CALLBACK_TYPE* Codec)(struct XnModuleCodecInterface* pInterface);
+		void (XN_CALLBACK_TYPE* Script)(struct XnModuleScriptNodeInterface* pInterface);
 
 		void (XN_CALLBACK_TYPE* General)(void* pInterface);
 	} GetInterface;
@@ -1163,6 +1174,12 @@ typedef struct XnModuleGestureGeneratorInterface
 
 	XnStatus (XN_CALLBACK_TYPE* GetAllActiveGestures)(XnModuleNodeHandle hGenerator, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* nGestures);
 	XnStatus (XN_CALLBACK_TYPE* EnumerateAllGestures)(XnModuleNodeHandle hGenerator, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* nGestures);
+
+	XnStatus (XN_CALLBACK_TYPE* RegisterToGestureIntermediateStageCompleted)(XnModuleNodeHandle hGenerator, XnModuleGestureIntermediateStageCompleted GestureIntermediateStageCompletedCB, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromGestureIntermediateStageCompleted)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+	XnStatus (XN_CALLBACK_TYPE* RegisterToGestureReadyForNextIntermediateStage)(XnModuleNodeHandle hGenerator, XnModuleGestureReadyForNextIntermediateStage ReadyForNextIntermediateStageCB, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromGestureReadyForNextIntermediateStage)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+
 } XnModuleGestureGeneratorInterface;
 
 /** Scene Analyzer Interface. */
@@ -1177,6 +1194,12 @@ typedef struct XnModuleSceneAnalyzerInterface
 /**
 * A set of functions supported by user generators who supports the UI capability.
 */
+typedef struct XnModuleHandTouchingFOVEdgeCapabilityInterface
+{
+	XnStatus (XN_CALLBACK_TYPE* RegisterToHandTouchingFOVEdge)(XnModuleNodeHandle hGenerator, XnModuleHandTouchingFOVEdge, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromHandTouchingFOVEdge)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+} XnModuleHandTouchingFOVEdgeCapabilityInterface;
+
 typedef struct XnModuleHandsGeneratorInterface
 {
 	XnModuleGeneratorInterface* pGeneratorInterface;
@@ -1187,6 +1210,9 @@ typedef struct XnModuleHandsGeneratorInterface
 	XnStatus (XN_CALLBACK_TYPE* StopTrackingAll)(XnModuleNodeHandle hGenerator);
 	XnStatus (XN_CALLBACK_TYPE* StartTracking)(XnModuleNodeHandle hGenerator, const XnPoint3D* pPosition);
 	XnStatus (XN_CALLBACK_TYPE* SetSmoothing)(XnModuleNodeHandle hGenerator, XnFloat fSmoothingFactor);
+
+	XnModuleHandTouchingFOVEdgeCapabilityInterface* pHandTouchingFOVEdgeInterface;
+
 } XnModuleHandsGeneratorInterface;
 
 /**
@@ -1226,6 +1252,13 @@ typedef struct XnModuleSkeletonCapabilityInterface
 	XnStatus (XN_CALLBACK_TYPE* SaveCalibrationDataToFile)(XnModuleNodeHandle hGenerator, XnUserID user, const XnChar* strFileName);
 	XnStatus (XN_CALLBACK_TYPE* LoadCalibrationDataFromFile)(XnModuleNodeHandle hGenerator, XnUserID user, const XnChar* strFileName);
 
+	XnStatus (XN_CALLBACK_TYPE* RegisterToCalibrationInProgress)(XnModuleNodeHandle hGenerator, XnModuleCalibrationInProgress CalibrationInProgressCB, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromCalibrationInProgress)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+	XnStatus (XN_CALLBACK_TYPE* RegisterToCalibrationComplete)(XnModuleNodeHandle hGenerator, XnModuleCalibrationComplete CalibrationCompleteCB, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromCalibrationComplete)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+
+	XnStatus (XN_CALLBACK_TYPE* RegisterToCalibrationStart)(XnModuleNodeHandle hGenerator, XnModuleCalibrationStart handler, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromCalibrationStart)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
 } XnModuleSkeletonCapabilityInterface;
 
 typedef struct XnModulePoseDetectionCapabilityInterface
@@ -1238,6 +1271,16 @@ typedef struct XnModulePoseDetectionCapabilityInterface
 	void (XN_CALLBACK_TYPE* UnregisterFromPoseCallbacks)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
 
 	XnStatus (XN_CALLBACK_TYPE* GetAllAvailablePoses)(XnModuleNodeHandle hGenerator, XnChar** pstrPoses, XnUInt32 nNameLength, XnUInt32* pnPoses);
+
+	XnStatus (XN_CALLBACK_TYPE* RegisterToPoseDetectionInProgress)(XnModuleNodeHandle hGenerator, XnModulePoseDetectionInProgressCallback PoseProgressCB, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromPoseDetectionInProgress)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+
+	XnStatus (XN_CALLBACK_TYPE* RegisterToPoseDetected)(XnModuleNodeHandle hGenerator, XnModulePoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromPoseDetected)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+	XnStatus (XN_CALLBACK_TYPE* RegisterToOutOfPose)(XnModuleNodeHandle hGenerator, XnModulePoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromOutOfPose)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+
+	XnStatus (XN_CALLBACK_TYPE* StopSinglePoseDetection)(XnModuleNodeHandle hGenerator, XnUserID user, const XnChar* strPose);
 } XnModulePoseDetectionCapabilityInterface;
 
 /** User generator Interface. */
@@ -1261,6 +1304,11 @@ typedef struct XnModuleUserGeneratorInterface
 	*/
 	XnModulePoseDetectionCapabilityInterface* pPoseDetectionInterface;
 
+	XnStatus (XN_CALLBACK_TYPE* RegisterToUserExit)(XnModuleNodeHandle hGenerator, XnModuleUserHandler UserExitCB, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromUserExit)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+	XnStatus (XN_CALLBACK_TYPE* RegisterToUserReEnter)(XnModuleNodeHandle hGenerator, XnModuleUserHandler UserReEnterCB, void* pCookie, XnCallbackHandle* phCallback);
+	void (XN_CALLBACK_TYPE* UnregisterFromUserReEnter)(XnModuleNodeHandle hGenerator, XnCallbackHandle hCallback);
+
 } XnModuleUserGeneratorInterface;
 
 /** Audio Generator Interface. */
@@ -1287,6 +1335,18 @@ typedef struct XnModuleCodecInterface
 	XnStatus (XN_CALLBACK_TYPE* Init)(XnModuleNodeHandle hCodec, XnNodeHandle hNode);
 	XnStatus (XN_CALLBACK_TYPE* CompressData)(XnModuleNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten);
 	XnStatus (XN_CALLBACK_TYPE* DecompressData)(XnModuleNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten);
+
 } XnModuleCodecInterface;
 
+typedef struct XnModuleScriptNodeInterface
+{
+	XnModuleProductionNodeInterface* pProductionNode;
+
+	const XnChar* (XN_CALLBACK_TYPE* GetSupportedFormat)(XnModuleNodeHandle hScript);
+	XnStatus (XN_CALLBACK_TYPE* LoadScriptFromFile)(XnModuleNodeHandle hScript, const XnChar* strFileName);
+	XnStatus (XN_CALLBACK_TYPE* LoadScriptFromString)(XnModuleNodeHandle hScript, const XnChar* strScript);
+	XnStatus (XN_CALLBACK_TYPE* Run)(XnModuleNodeHandle hScript, XnNodeInfoList* pCreatedNodes, XnEnumerationErrors* pErrors);
+
+} XnModuleScriptNodeInterface;
+
 #endif // __XN_MODULE_INTERFACE_H__
diff --git a/Include/XnNode.h b/Include/XnNode.h
index e1815d1..5ab4658 100644
--- a/Include/XnNode.h
+++ b/Include/XnNode.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnNodeAllocator.h b/Include/XnNodeAllocator.h
index e31961f..14ab956 100644
--- a/Include/XnNodeAllocator.h
+++ b/Include/XnNodeAllocator.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnOS.h b/Include/XnOS.h
index 7370764..0438a96 100644
--- a/Include/XnOS.h
+++ b/Include/XnOS.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -44,7 +44,7 @@
 //---------------------------------------------------------------------------
 #if (XN_PLATFORM == XN_PLATFORM_WIN32)
 	#include "Win32/XnOSWin32.h"
-#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX)
+#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
 	#include "Linux-x86/XnOSLinux-x86.h"
 #elif defined(_ARC)
 	#include "ARC/XnOSARC.h"
@@ -166,50 +166,47 @@ typedef enum {
 /** Creates a new type object and validates that allocation succeeded. */
 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
 	#define XN_VALIDATE_NEW(ptr, type, ...)						\
-		__pragma(warning (push))								\
-		__pragma(warning (disable: 4127))						\
-		do {													\
+		{														\
 			(ptr) = XN_NEW(type, __VA_ARGS__);					\
 			if ((ptr) == NULL)									\
 			{													\
 				return (XN_STATUS_ALLOC_FAILED);				\
 			}													\
-		} while (0)												\
-		__pragma(warning (pop))
+		}
 
 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
 	#define XN_VALIDATE_NEW(ptr, type, ...)						\
-		do {													\
+		{														\
 			(ptr) = XN_NEW(type, ##__VA_ARGS__);				\
 			if ((ptr) == NULL)									\
 			{													\
 				return (XN_STATUS_ALLOC_FAILED);				\
 			}													\
-		} while (0)
+		} 
 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
 	#define XN_VALIDATE_NEW(ptr, type...)						\
-		do {													\
+		{														\
 			(ptr) = XN_NEW(type);								\
 			if ((ptr) == NULL)									\
 			{													\
 				return (XN_STATUS_ALLOC_FAILED);				\
 			}													\
-		} while (0)
+		} 
 #else
 	#define XN_VALIDATE_NEW(ptr, type)							\
-		do {													\
+		{														\
 			(ptr) = XN_NEW(type);								\
 			if ((ptr) == NULL)									\
 			{													\
 				return (XN_STATUS_ALLOC_FAILED);				\
 			}													\
-		} while (0)
+		}
 #endif
 
 /** Creates a new type object, validates that allocation succeeded, and initializes the object (type must have an Init function). */
 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
 	#define XN_VALIDATE_NEW_AND_INIT(ptr, type, ...)			\
-		do {													\
+		{														\
 			XN_VALIDATE_NEW(ptr, type, __VA_ARGS__);			\
 			XnStatus rc = (ptr)->Init();						\
 			if (rc != XN_STATUS_OK)								\
@@ -217,10 +214,10 @@ typedef enum {
 				XN_DELETE(ptr);									\
 				return (rc);									\
 			}													\
-		} while (0)
+		} 
 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
 	#define XN_VALIDATE_NEW_AND_INIT(ptr, type, ...)			\
-		do {													\
+		{														\
 			XN_VALIDATE_NEW(ptr, type, ##__VA_ARGS__);			\
 			XnStatus rc = (ptr)->Init();						\
 			if (rc != XN_STATUS_OK)								\
@@ -228,10 +225,10 @@ typedef enum {
 				XN_DELETE(ptr);									\
 				return (rc);									\
 			}													\
-		} while (0)
+		} 
 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
 	#define XN_VALIDATE_NEW_AND_INIT(ptr, type...)				\
-		do {													\
+		{														\
 			XN_VALIDATE_NEW(ptr, type);							\
 			XnStatus rc = (ptr)->Init();						\
 			if (rc != XN_STATUS_OK)								\
@@ -239,10 +236,10 @@ typedef enum {
 				XN_DELETE(ptr);									\
 				return (rc);									\
 			}													\
-		} while (0)
+		} 
 #else
 	#define XN_VALIDATE_NEW_AND_INIT(ptr, type)					\
-		do {													\
+		{														\
 			XN_VALIDATE_NEW(ptr, type);							\
 			XnStatus rc = (ptr)->Init();						\
 			if (rc != XN_STATUS_OK)								\
@@ -250,7 +247,7 @@ typedef enum {
 				XN_DELETE(ptr);									\
 				return (rc);									\
 			}													\
-		} while (0)
+		} 
 #endif
 
 // Strings
@@ -320,9 +317,9 @@ typedef enum {
 // Exported Function Declaration
 //---------------------------------------------------------------------------
 // Common
-XN_C_API XnStatus xnOSInit();
-XN_C_API XnStatus xnOSShutdown();
-XN_C_API XnStatus xnOSGetInfo(xnOSInfo* pOSInfo);
+XN_C_API XnStatus XN_C_DECL xnOSInit();
+XN_C_API XnStatus XN_C_DECL xnOSShutdown();
+XN_C_API XnStatus XN_C_DECL xnOSGetInfo(xnOSInfo* pOSInfo);
 
 
 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
@@ -352,17 +349,17 @@ typedef enum
 /**
 * Memory Profiling - Logs an allocation of memory.
 */
-XN_C_API void* xnOSLogMemAlloc(void* pMemBlock, XnAllocationType nAllocType, XnUInt32 nBytes, const XnChar* csFunction, const XnChar* csFile, XnUInt32 nLine, const XnChar* csAdditional);
+XN_C_API void* XN_C_DECL xnOSLogMemAlloc(void* pMemBlock, XnAllocationType nAllocType, XnUInt32 nBytes, const XnChar* csFunction, const XnChar* csFile, XnUInt32 nLine, const XnChar* csAdditional);
 
 /**
 * Memory Profiling - Logs freeing of memory.
 */
-XN_C_API void xnOSLogMemFree(const void* pMemBlock);
+XN_C_API void XN_C_DECL xnOSLogMemFree(const void* pMemBlock);
 
 /**
 * Memory Profiling - Prints a current memory report to requested file.
 */
-XN_C_API void xnOSWriteMemoryReport(const XnChar* csFileName);
+XN_C_API void XN_C_DECL xnOSWriteMemoryReport(const XnChar* csFileName);
 
 // for memory profiling, replace all malloc/calloc/free/new/delete calls
 #if (defined XN_MEM_PROFILING) && (!defined(XN_OS_IMPL))
@@ -392,7 +389,7 @@ XN_C_API void xnOSWriteMemoryReport(const XnChar* csFileName);
 		}
 
 		// called only if ctor threw exception
-		static void operator delete(void* p, const XnChar* csFunction, const XnChar* csFile, XnUInt32 nLine, const XnChar* csAdditional)
+		static void operator delete(void* p, const XnChar* /*csFunction*/, const XnChar* /*csFile*/, XnUInt32 /*nLine*/, const XnChar* /*csAdditional*/)
 		{
 			xnOSLogMemFree(p);
 			xnOSFree(p);
@@ -411,7 +408,7 @@ XN_C_API void xnOSWriteMemoryReport(const XnChar* csFileName);
 		}
 
 		// called only if ctor threw exception
-		static void operator delete[](void* p, const XnChar* csFunction, const XnChar* csFile, XnUInt32 nLine, const XnChar* csAdditional)
+		static void operator delete[](void* p, const XnChar* /*csFunction*/, const XnChar* /*csFile*/, XnUInt32 /*nLine*/, const XnChar* /*csAdditional*/)
 		{
 			xnOSLogMemFree(p);
 			xnOSFree(p);
@@ -447,57 +444,65 @@ XN_C_API void xnOSWriteMemoryReport(const XnChar* csFileName);
 #endif
 
 // Files
-XN_C_API XnStatus xnOSGetFileList(const XnChar* cpSearchPattern, const XnChar* cpPrefixPath, XnChar cpFileList[][XN_FILE_MAX_PATH], const XnUInt32 nMaxFiles, XnUInt32* pnFoundFiles);
-XN_C_API XnStatus xnOSOpenFile(const XnChar* cpFileName, const XnUInt32 nFlags, XN_FILE_HANDLE* pFile);
-XN_C_API XnStatus xnOSCloseFile(XN_FILE_HANDLE* pFile);
-XN_C_API XnStatus xnOSReadFile(const XN_FILE_HANDLE File, void* pBuffer, XnUInt32* pnBufferSize);
-XN_C_API XnStatus xnOSWriteFile(const XN_FILE_HANDLE File, const void* pBuffer, const XnUInt32 nBufferSize);
-XN_C_API XnStatus xnOSSeekFile(const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt32 nOffset);
-XN_C_API XnStatus xnOSTellFile(const XN_FILE_HANDLE File, XnUInt32* nFilePos);
-XN_C_API XnStatus xnOSFlushFile(const XN_FILE_HANDLE File);
-XN_C_API XnStatus xnOSDoesFileExist(const XnChar* cpFileName, XnBool* pbResult);
-XN_C_API XnStatus xnOSDoesDirecotyExist(const XnChar* cpDirName, XnBool* pbResult);
-XN_C_API XnStatus xnOSLoadFile(const XnChar* cpFileName, void* pBuffer, const XnUInt32 nBufferSize);
-XN_C_API XnStatus xnOSSaveFile(const XnChar* cpFileName, const void* pBuffer, const XnUInt32 nBufferSize);
-XN_C_API XnStatus xnOSAppendFile(const XnChar* cpFileName, const void* pBuffer, const XnUInt32 nBufferSize);
-XN_C_API XnStatus xnOSGetFileSize(const XnChar* cpFileName, XnUInt32* pnFileSize);
-XN_C_API XnStatus xnOSCreateDirectory(const XnChar* cpDirName);
-XN_C_API XnStatus xnOSGetDirName(const XnChar* cpFilePath, XnChar* cpDirName, const XnUInt32 nBufferSize);
-XN_C_API XnStatus xnOSGetFileName(const XnChar* cpFilePath, XnChar* cpFileName, const XnUInt32 nBufferSize);
-XN_C_API XnStatus xnOSGetFullPathName(const XnChar* strFilePath, XnChar* strFullPath, XnUInt32 nBufferSize);
-XN_C_API XnStatus xnOSGetCurrentDir(XnChar* cpDirName, const XnUInt32 nBufferSize);
-XN_C_API XnStatus xnOSSetCurrentDir(const XnChar* cpDirName);
-XN_C_API XnStatus xnOSDeleteFile(const XnChar* cpFileName);
+XN_C_API XnStatus XN_C_DECL xnOSGetFileList(const XnChar* cpSearchPattern, const XnChar* cpPrefixPath, XnChar cpFileList[][XN_FILE_MAX_PATH], const XnUInt32 nMaxFiles, XnUInt32* pnFoundFiles);
+XN_C_API XnStatus XN_C_DECL xnOSOpenFile(const XnChar* cpFileName, const XnUInt32 nFlags, XN_FILE_HANDLE* pFile);
+XN_C_API XnStatus XN_C_DECL xnOSCloseFile(XN_FILE_HANDLE* pFile);
+XN_C_API XnStatus XN_C_DECL xnOSReadFile(const XN_FILE_HANDLE File, void* pBuffer, XnUInt32* pnBufferSize);
+XN_C_API XnStatus XN_C_DECL xnOSWriteFile(const XN_FILE_HANDLE File, const void* pBuffer, const XnUInt32 nBufferSize);
+XN_C_API XnStatus XN_API_DEPRECATED("Use xnOSSeekFile64() instead") XN_C_DECL 
+			    xnOSSeekFile  (const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt32 nOffset);
+XN_C_API XnStatus XN_C_DECL xnOSSeekFile64(const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt64 nOffset);
+XN_C_API XnStatus XN_API_DEPRECATED("Use xnOSTellFile64() instead") XN_C_DECL 
+			    xnOSTellFile  (const XN_FILE_HANDLE File, XnUInt32* nFilePos);
+XN_C_API XnStatus XN_C_DECL xnOSTellFile64(const XN_FILE_HANDLE File, XnUInt64* nFilePos);
+XN_C_API XnStatus XN_C_DECL xnOSFlushFile(const XN_FILE_HANDLE File);
+XN_C_API XnStatus XN_C_DECL xnOSDoesFileExist(const XnChar* cpFileName, XnBool* pbResult);
+XN_C_API XnStatus XN_C_DECL xnOSDoesDirecotyExist(const XnChar* cpDirName, XnBool* pbResult);
+XN_C_API XnStatus XN_C_DECL xnOSLoadFile(const XnChar* cpFileName, void* pBuffer, const XnUInt32 nBufferSize);
+XN_C_API XnStatus XN_C_DECL xnOSSaveFile(const XnChar* cpFileName, const void* pBuffer, const XnUInt32 nBufferSize);
+XN_C_API XnStatus XN_C_DECL xnOSAppendFile(const XnChar* cpFileName, const void* pBuffer, const XnUInt32 nBufferSize);
+XN_C_API XnStatus XN_API_DEPRECATED("Use xnOSGetFileSize64() instead") XN_C_DECL 
+			    xnOSGetFileSize  (const XnChar* cpFileName, XnUInt32* pnFileSize);
+XN_C_API XnStatus XN_C_DECL xnOSGetFileSize64(const XnChar* cpFileName, XnUInt64* pnFileSize);
+XN_C_API XnStatus XN_C_DECL xnOSCreateDirectory(const XnChar* cpDirName);
+XN_C_API XnStatus XN_C_DECL xnOSGetDirName(const XnChar* cpFilePath, XnChar* cpDirName, const XnUInt32 nBufferSize);
+XN_C_API XnStatus XN_C_DECL xnOSGetFileName(const XnChar* cpFilePath, XnChar* cpFileName, const XnUInt32 nBufferSize);
+XN_C_API XnStatus XN_C_DECL xnOSGetFullPathName(const XnChar* strFilePath, XnChar* strFullPath, XnUInt32 nBufferSize);
+XN_C_API XnStatus XN_C_DECL xnOSGetCurrentDir(XnChar* cpDirName, const XnUInt32 nBufferSize);
+XN_C_API XnStatus XN_C_DECL xnOSSetCurrentDir(const XnChar* cpDirName);
+XN_C_API XnStatus XN_C_DECL xnOSDeleteFile(const XnChar* cpFileName);
+XN_C_API XnStatus XN_C_DECL xnOSDeleteEmptyDirectory(const XnChar* strDirName);
+XN_C_API XnStatus XN_C_DECL xnOSDeleteDirectoryTree(const XnChar* strDirName);
 
 // INI
-XN_C_API XnStatus xnOSReadStringFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnChar* cpDest, const XnUInt32 nDestLength);
-XN_C_API XnStatus xnOSReadFloatFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnFloat* fDest);
-XN_C_API XnStatus xnOSReadDoubleFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnDouble* fDest);
-XN_C_API XnStatus xnOSReadIntFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnUInt32* nDest);
-XN_C_API XnStatus xnOSWriteStringToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnChar* cpSrc);
-XN_C_API XnStatus xnOSWriteFloatToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnFloat fSrc);
-XN_C_API XnStatus xnOSWriteDoubleToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnDouble fSrc);
-XN_C_API XnStatus xnOSWriteIntToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnUInt32 nSrc);
+XN_C_API XnStatus XN_C_DECL xnOSReadStringFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnChar* cpDest, const XnUInt32 nDestLength);
+XN_C_API XnStatus XN_C_DECL xnOSReadFloatFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnFloat* fDest);
+XN_C_API XnStatus XN_C_DECL xnOSReadDoubleFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnDouble* fDest);
+XN_C_API XnStatus XN_C_DECL xnOSReadIntFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnUInt32* nDest);
+XN_C_API XnStatus XN_C_DECL xnOSWriteStringToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnChar* cpSrc);
+XN_C_API XnStatus XN_C_DECL xnOSWriteFloatToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnFloat fSrc);
+XN_C_API XnStatus XN_C_DECL xnOSWriteDoubleToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnDouble fSrc);
+XN_C_API XnStatus XN_C_DECL xnOSWriteIntToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnUInt32 nSrc);
 
 // Shared libraries
-XN_C_API XnStatus xnOSLoadLibrary(const XnChar* cpFileName, XN_LIB_HANDLE* pLibHandle);
-XN_C_API XnStatus xnOSFreeLibrary(const XN_LIB_HANDLE LibHandle);
-XN_C_API XnStatus xnOSGetProcAddress(const XN_LIB_HANDLE LibHandle, const XnChar* cpProcName, XnFarProc* pProcAddr);
+XN_C_API XnStatus XN_C_DECL xnOSLoadLibrary(const XnChar* cpFileName, XN_LIB_HANDLE* pLibHandle);
+XN_C_API XnStatus XN_C_DECL xnOSFreeLibrary(const XN_LIB_HANDLE LibHandle);
+XN_C_API XnStatus XN_C_DECL xnOSGetProcAddress(const XN_LIB_HANDLE LibHandle, const XnChar* cpProcName, XnFarProc* pProcAddr);
 
 struct timespec;
 	
 // Time
-XN_C_API XnStatus xnOSGetEpochTime(XnUInt32* nEpochTime);
-XN_C_API XnStatus xnOSGetTimeStamp(XnUInt64* nTimeStamp);
-XN_C_API XnStatus xnOSGetHighResTimeStamp(XnUInt64* nTimeStamp);
-XN_C_API XnStatus xnOSSleep(XnUInt32 nMilliseconds);
-XN_C_API XnStatus xnOSStartTimer(XnOSTimer* pTimer);
-XN_C_API XnStatus xnOSStartHighResTimer(XnOSTimer* pTimer);
-XN_C_API XnStatus xnOSQueryTimer(XnOSTimer Timer, XnUInt64* pnTimeSinceStart);
-XN_C_API XnStatus xnOSStopTimer(XnOSTimer* pTimer);
-XN_C_API XnStatus xnOSGetMonoTime(struct timespec* pTime);
-XN_C_API XnStatus xnOSGetTimeout(struct timespec* pTime, XnUInt32 nMilliseconds);
-XN_C_API XnStatus xnOSGetAbsTimeout(struct timespec* pTime, XnUInt32 nMilliseconds);
+XN_C_API XnStatus XN_C_DECL xnOSGetEpochTime(XnUInt32* nEpochTime);
+XN_C_API XnStatus XN_C_DECL xnOSGetTimeStamp(XnUInt64* nTimeStamp);
+XN_C_API XnStatus XN_C_DECL xnOSGetHighResTimeStamp(XnUInt64* nTimeStamp);
+XN_C_API XnStatus XN_C_DECL xnOSSleep(XnUInt32 nMilliseconds);
+XN_C_API XnStatus XN_C_DECL xnOSStartTimer(XnOSTimer* pTimer);
+XN_C_API XnStatus XN_C_DECL xnOSStartHighResTimer(XnOSTimer* pTimer);
+XN_C_API XnStatus XN_C_DECL xnOSQueryTimer(XnOSTimer Timer, XnUInt64* pnTimeSinceStart);
+XN_C_API XnStatus XN_C_DECL xnOSStopTimer(XnOSTimer* pTimer);
+XN_C_API XnStatus XN_C_DECL xnOSGetMonoTime(struct timespec* pTime);
+XN_C_API XnStatus XN_C_DECL xnOSGetTimeout(struct timespec* pTime, XnUInt32 nMilliseconds);
+XN_C_API XnStatus XN_C_DECL xnOSGetAbsTimeout(struct timespec* pTime, XnUInt32 nMilliseconds);
 
 // Threads
 typedef enum XnThreadPriority
@@ -508,46 +513,49 @@ typedef enum XnThreadPriority
 	XN_PRIORITY_CRITICAL
 } XnThreadPriority;
 
-XN_C_API XnStatus xnOSCreateThread(XN_THREAD_PROC_PROTO pThreadProc, const XN_THREAD_PARAM pThreadParam, XN_THREAD_HANDLE* pThreadHandle);
-XN_C_API XnStatus xnOSTerminateThread(XN_THREAD_HANDLE* pThreadHandle);
-XN_C_API XnStatus xnOSCloseThread(XN_THREAD_HANDLE* pThreadHandle);
-XN_C_API XnStatus xnOSWaitForThreadExit(XN_THREAD_HANDLE ThreadHandle, XnUInt32 nMilliseconds);
-XN_C_API XnStatus xnOSSetThreadPriority(XN_THREAD_HANDLE ThreadHandle, XnThreadPriority nPriority);
-XN_C_API XnStatus xnOSGetCurrentThreadID(XN_THREAD_ID* pThreadID);
-XN_C_API XnStatus xnOSWaitAndTerminateThread(XN_THREAD_HANDLE* pThreadHandle, XnUInt32 nMilliseconds);
+XN_C_API XnStatus XN_C_DECL xnOSCreateThread(XN_THREAD_PROC_PROTO pThreadProc, const XN_THREAD_PARAM pThreadParam, XN_THREAD_HANDLE* pThreadHandle);
+XN_C_API XnStatus XN_C_DECL xnOSTerminateThread(XN_THREAD_HANDLE* pThreadHandle);
+XN_C_API XnStatus XN_C_DECL xnOSCloseThread(XN_THREAD_HANDLE* pThreadHandle);
+XN_C_API XnStatus XN_C_DECL xnOSWaitForThreadExit(XN_THREAD_HANDLE ThreadHandle, XnUInt32 nMilliseconds);
+XN_C_API XnStatus XN_C_DECL xnOSSetThreadPriority(XN_THREAD_HANDLE ThreadHandle, XnThreadPriority nPriority);
+XN_C_API XnStatus XN_C_DECL xnOSGetCurrentThreadID(XN_THREAD_ID* pThreadID);
+XN_C_API XnStatus XN_C_DECL xnOSWaitAndTerminateThread(XN_THREAD_HANDLE* pThreadHandle, XnUInt32 nMilliseconds);
 
 // Processes
-XN_C_API XnStatus xnOSGetCurrentProcessID(XN_PROCESS_ID* pProcID);
-XN_C_API XnStatus xnOSCreateProcess(const XnChar* strExecutable, XnUInt32 nArgs, const XnChar** pstrArgs, XN_PROCESS_ID* pProcID);
+XN_C_API XnStatus XN_C_DECL xnOSGetCurrentProcessID(XN_PROCESS_ID* pProcID);
+XN_C_API XnStatus XN_C_DECL xnOSCreateProcess(const XnChar* strExecutable, XnUInt32 nArgs, const XnChar** pstrArgs, XN_PROCESS_ID* pProcID);
 
 // Mutex
-XN_C_API XnStatus xnOSCreateMutex(XN_MUTEX_HANDLE* pMutexHandle);
-XN_C_API XnStatus xnOSCreateNamedMutex(XN_MUTEX_HANDLE* pMutexHandle, const XnChar* cpMutexName);
-XN_C_API XnStatus xnOSCloseMutex(XN_MUTEX_HANDLE* pMutexHandle);
-XN_C_API XnStatus xnOSLockMutex(const XN_MUTEX_HANDLE MutexHandle, XnUInt32 nMilliseconds);
-XN_C_API XnStatus xnOSUnLockMutex(const XN_MUTEX_HANDLE MutexHandle);
+XN_C_API XnStatus XN_C_DECL xnOSCreateMutex(XN_MUTEX_HANDLE* pMutexHandle);
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedMutex(XN_MUTEX_HANDLE* pMutexHandle, const XnChar* cpMutexName);
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedMutexEx(XN_MUTEX_HANDLE* pMutexHandle, const XnChar* cpMutexName, XnBool bAllowOtherUsers);
+XN_C_API XnStatus XN_C_DECL xnOSCloseMutex(XN_MUTEX_HANDLE* pMutexHandle);
+XN_C_API XnStatus XN_C_DECL xnOSLockMutex(const XN_MUTEX_HANDLE MutexHandle, XnUInt32 nMilliseconds);
+XN_C_API XnStatus XN_C_DECL xnOSUnLockMutex(const XN_MUTEX_HANDLE MutexHandle);
 
 // Critical Sections
-XN_C_API XnStatus xnOSCreateCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle);
-XN_C_API XnStatus xnOSCloseCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle);
-XN_C_API XnStatus xnOSEnterCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle);
-XN_C_API XnStatus xnOSLeaveCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle);
+XN_C_API XnStatus XN_C_DECL xnOSCreateCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle);
+XN_C_API XnStatus XN_C_DECL xnOSCloseCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle);
+XN_C_API XnStatus XN_C_DECL xnOSEnterCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle);
+XN_C_API XnStatus XN_C_DECL xnOSLeaveCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle);
 
 // Events
-XN_C_API XnStatus xnOSCreateEvent(XN_EVENT_HANDLE* pEventHandle, XnBool bManualReset);
-XN_C_API XnStatus xnOSCreateNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset);
-XN_C_API XnStatus xnOSOpenNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName);
-XN_C_API XnStatus xnOSCloseEvent(XN_EVENT_HANDLE* pEventHandle);
-XN_C_API XnStatus xnOSSetEvent(const XN_EVENT_HANDLE EventHandle);
-XN_C_API XnStatus xnOSResetEvent(const XN_EVENT_HANDLE EventHandle);
-XN_C_API XnStatus xnOSWaitEvent(const XN_EVENT_HANDLE EventHandle, XnUInt32 nMilliseconds);
-XN_C_API XnBool xnOSIsEventSet(const XN_EVENT_HANDLE EventHandle);
+XN_C_API XnStatus XN_C_DECL xnOSCreateEvent(XN_EVENT_HANDLE* pEventHandle, XnBool bManualReset);
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset);
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedEventEx(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset, XnBool bAllowOtherUsers);
+XN_C_API XnStatus XN_C_DECL xnOSOpenNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName);
+XN_C_API XnStatus XN_C_DECL xnOSOpenNamedEventEx(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bAllowOtherUsers);
+XN_C_API XnStatus XN_C_DECL xnOSCloseEvent(XN_EVENT_HANDLE* pEventHandle);
+XN_C_API XnStatus XN_C_DECL xnOSSetEvent(const XN_EVENT_HANDLE EventHandle);
+XN_C_API XnStatus XN_C_DECL xnOSResetEvent(const XN_EVENT_HANDLE EventHandle);
+XN_C_API XnStatus XN_C_DECL xnOSWaitEvent(const XN_EVENT_HANDLE EventHandle, XnUInt32 nMilliseconds);
+XN_C_API XnBool XN_C_DECL xnOSIsEventSet(const XN_EVENT_HANDLE EventHandle);
 
 // Semaphores
-XN_C_API XnStatus xnOSCreateSemaphore(XN_SEMAPHORE_HANDLE* pSemaphoreHandle, XnUInt32 nInitialCount);
-XN_C_API XnStatus xnOSLockSemaphore(XN_SEMAPHORE_HANDLE hSemaphore, XnUInt32 nMilliseconds);
-XN_C_API XnStatus xnOSUnlockSemaphore(XN_SEMAPHORE_HANDLE hSemaphore);
-XN_C_API XnStatus xnOSCloseSemaphore(XN_SEMAPHORE_HANDLE* pSemaphoreHandle);
+XN_C_API XnStatus XN_C_DECL xnOSCreateSemaphore(XN_SEMAPHORE_HANDLE* pSemaphoreHandle, XnUInt32 nInitialCount);
+XN_C_API XnStatus XN_C_DECL xnOSLockSemaphore(XN_SEMAPHORE_HANDLE hSemaphore, XnUInt32 nMilliseconds);
+XN_C_API XnStatus XN_C_DECL xnOSUnlockSemaphore(XN_SEMAPHORE_HANDLE hSemaphore);
+XN_C_API XnStatus XN_C_DECL xnOSCloseSemaphore(XN_SEMAPHORE_HANDLE* pSemaphoreHandle);
 
 /** 
 * Waits for a condition to be met. The condition is evaluated every time an event is set.
@@ -557,25 +565,27 @@ XN_C_API XnStatus xnOSCloseSemaphore(XN_SEMAPHORE_HANDLE* pSemaphoreHandle);
 * @param	pConditionFunc	[in]	A function that should be called to evaluate condition.
 * @param	pConditionData	[in]	A cookie to be passed to the condition functions.
 */
-XN_C_API XnStatus xnOSWaitForCondition(const XN_EVENT_HANDLE EventHandle, XnUInt32 nMilliseconds, XnConditionFunc pConditionFunc, void* pConditionData);
+XN_C_API XnStatus XN_C_DECL xnOSWaitForCondition(const XN_EVENT_HANDLE EventHandle, XnUInt32 nMilliseconds, XnConditionFunc pConditionFunc, void* pConditionData);
 
 // Network
 struct xnOSSocket;
 typedef struct xnOSSocket* XN_SOCKET_HANDLE;
 
-XN_C_API XnStatus xnOSInitNetwork();
-XN_C_API XnStatus xnOSShutdownNetwork();
-XN_C_API XnStatus xnOSCreateSocket(const XnOSSocketType SocketType, const XnChar* cpIPAddress, const XnUInt16 nPort, XN_SOCKET_HANDLE* SocketPtr);
-XN_C_API XnStatus xnOSCloseSocket(XN_SOCKET_HANDLE Socket);
-XN_C_API XnStatus xnOSBindSocket(XN_SOCKET_HANDLE Socket);
-XN_C_API XnStatus xnOSListenSocket(XN_SOCKET_HANDLE Socket);
-XN_C_API XnStatus xnOSAcceptSocket(XN_SOCKET_HANDLE ListenSocket, XN_SOCKET_HANDLE* AcceptSocketPtr, XnUInt32 nMillisecsTimeout);
-XN_C_API XnStatus xnOSConnectSocket(XN_SOCKET_HANDLE Socket, XnUInt32 nMillisecsTimeout);
-XN_C_API XnStatus xnOSSetSocketBufferSize(XN_SOCKET_HANDLE Socket, const XnUInt32 nSocketBufferSize);
-XN_C_API XnStatus xnOSSendNetworkBuffer(XN_SOCKET_HANDLE Socket, const XnChar* cpBuffer, const XnUInt32 nBufferSize);
-XN_C_API XnStatus xnOSSendToNetworkBuffer(XN_SOCKET_HANDLE Socket, const XnChar* cpBuffer, const XnUInt32 nBufferSize, XN_SOCKET_HANDLE SocketTo);
-XN_C_API XnStatus xnOSReceiveNetworkBuffer(XN_SOCKET_HANDLE Socket, XnChar* cpBuffer, XnUInt32* pnBufferSize, XnUInt32 nMillisecsTimeout);
-XN_C_API XnStatus xnOSReceiveFromNetworkBuffer(XN_SOCKET_HANDLE Socket, XnChar* cpBuffer, XnUInt32* pnBufferSize, XN_SOCKET_HANDLE* SocketFrom);
+#define XN_SOCKET_DEFAULT_TIMEOUT 0xFFFEFFFE
+
+XN_C_API XnStatus XN_C_DECL xnOSInitNetwork();
+XN_C_API XnStatus XN_C_DECL xnOSShutdownNetwork();
+XN_C_API XnStatus XN_C_DECL xnOSCreateSocket(const XnOSSocketType SocketType, const XnChar* cpIPAddress, const XnUInt16 nPort, XN_SOCKET_HANDLE* SocketPtr);
+XN_C_API XnStatus XN_C_DECL xnOSCloseSocket(XN_SOCKET_HANDLE Socket);
+XN_C_API XnStatus XN_C_DECL xnOSBindSocket(XN_SOCKET_HANDLE Socket);
+XN_C_API XnStatus XN_C_DECL xnOSListenSocket(XN_SOCKET_HANDLE Socket);
+XN_C_API XnStatus XN_C_DECL xnOSAcceptSocket(XN_SOCKET_HANDLE ListenSocket, XN_SOCKET_HANDLE* AcceptSocketPtr, XnUInt32 nMillisecsTimeout);
+XN_C_API XnStatus XN_C_DECL xnOSConnectSocket(XN_SOCKET_HANDLE Socket, XnUInt32 nMillisecsTimeout);
+XN_C_API XnStatus XN_C_DECL xnOSSetSocketBufferSize(XN_SOCKET_HANDLE Socket, const XnUInt32 nSocketBufferSize);
+XN_C_API XnStatus XN_C_DECL xnOSSendNetworkBuffer(XN_SOCKET_HANDLE Socket, const XnChar* cpBuffer, const XnUInt32 nBufferSize);
+XN_C_API XnStatus XN_C_DECL xnOSSendToNetworkBuffer(XN_SOCKET_HANDLE Socket, const XnChar* cpBuffer, const XnUInt32 nBufferSize, XN_SOCKET_HANDLE SocketTo);
+XN_C_API XnStatus XN_C_DECL xnOSReceiveNetworkBuffer(XN_SOCKET_HANDLE Socket, XnChar* cpBuffer, XnUInt32* pnBufferSize, XnUInt32 nMillisecsTimeout);
+XN_C_API XnStatus XN_C_DECL xnOSReceiveFromNetworkBuffer(XN_SOCKET_HANDLE Socket, XnChar* cpBuffer, XnUInt32* pnBufferSize, XN_SOCKET_HANDLE* SocketFrom);
 
 // Shared Memory
 typedef struct XnOSSharedMemory XnOSSharedMemory, *XN_SHARED_MEMORY_HANDLE;
@@ -588,7 +598,9 @@ typedef struct XnOSSharedMemory XnOSSharedMemory, *XN_SHARED_MEMORY_HANDLE;
  * @param	nAccessFlags	[in]	Creation flags. Can contain XN_OS_FILE_READ, XN_OS_FILE_WRITE or both.
  * @param	phSharedMem		[out]	A handle to the shared-memory block.
  */
-XN_C_API XnStatus xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem);
+XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem);
+
+XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemoryEx(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE* phSharedMem);
 
 /**
  * Opens a shared memory block, and returns the address in which it was mapped to the process' memory.
@@ -597,14 +609,16 @@ XN_C_API XnStatus xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize,
  * @param	nAccessFlags	[in]	Creation flags. Must contain XN_OS_FILE_READ, and optionally XN_OS_FILE_WRITE.
  * @param	phSharedMem		[out]	A handle to the shared-memory block.
  */
-XN_C_API XnStatus xnOSOpenSharedMemory(const XnChar* strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem);
+XN_C_API XnStatus XN_C_DECL xnOSOpenSharedMemory(const XnChar* strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem);
+
+XN_C_API XnStatus XN_C_DECL xnOSOpenSharedMemoryEx(const XnChar* strName, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE* phSharedMem);
 
 /**
  * Closes a shared memory block.
  *
  * @param	hSharedMem		[in]	A handle to the block to be closed.
  */
-XN_C_API XnStatus xnOSCloseSharedMemory(XN_SHARED_MEMORY_HANDLE hSharedMem);
+XN_C_API XnStatus XN_C_DECL xnOSCloseSharedMemory(XN_SHARED_MEMORY_HANDLE hSharedMem);
 
 /**
  * Gets the address in which the shared-memory block is mapped in this process.
@@ -612,14 +626,14 @@ XN_C_API XnStatus xnOSCloseSharedMemory(XN_SHARED_MEMORY_HANDLE hSharedMem);
  * @param	hSharedMem		[in]	A handle to the shared memory block.
  * @param	ppAddress		[out]	The address.
  */
-XN_C_API XnStatus xnOSSharedMemoryGetAddress(XN_SHARED_MEMORY_HANDLE hSharedMem, void** ppAddress);
+XN_C_API XnStatus XN_C_DECL xnOSSharedMemoryGetAddress(XN_SHARED_MEMORY_HANDLE hSharedMem, void** ppAddress);
 
 // Keyboard
-XN_C_API XnBool xnOSWasKeyboardHit();
-XN_C_API XnChar xnOSReadCharFromInput();
+XN_C_API XnBool XN_C_DECL xnOSWasKeyboardHit();
+XN_C_API XnChar XN_C_DECL xnOSReadCharFromInput();
 
 // Debug Utilities
-XN_C_API XnStatus xnOSGetCurrentCallStack(XnUInt32 nFramesToSkip, XnChar** astrFrames, XnUInt32 nMaxNameLength, XnUInt32* pnFrames);
+XN_C_API XnStatus XN_C_DECL xnOSGetCurrentCallStack(XnUInt32 nFramesToSkip, XnChar** astrFrames, XnUInt32 nMaxNameLength, XnUInt32* pnFrames);
 
 XN_STATUS_MESSAGE_MAP_START(XN_ERROR_GROUP_OS)
 XN_STATUS_MESSAGE(XN_STATUS_ALLOC_FAILED, "Memory allocation failed!")
@@ -761,6 +775,9 @@ XN_STATUS_MESSAGE(XN_STATUS_OS_SEMAPHORE_LOCK_FAILED, "Xiron OS failed to lock a
 XN_STATUS_MESSAGE(XN_STATUS_OS_SEMAPHORE_UNLOCK_FAILED, "Xiron OS failed to unlock a semaphore!")
 XN_STATUS_MESSAGE(XN_STATUS_OS_SEMAPHORE_TIMEOUT, "Xiron OS got a semaphore timeout!")
 XN_STATUS_MESSAGE(XN_STATUS_OS_INVALID_SEMAPHORE, "This Xiron OS semaphore is invalid!")
+XN_STATUS_MESSAGE(XN_STATUS_OS_ENV_VAR_NOT_FOUND, "The environment variable could not be found!")
+XN_STATUS_MESSAGE(XN_STATUS_USB_NO_REQUEST_PENDING, "There is no request pending!")
+XN_STATUS_MESSAGE(XN_STATUS_OS_FAILED_TO_DELETE_DIR, "Failed to delete a directory!")
 XN_STATUS_MESSAGE_MAP_END(XN_ERROR_GROUP_OS)
 
 #endif //__XN_OS_H__
diff --git a/Include/XnOSCpp.h b/Include/XnOSCpp.h
index d970e30..04b44b4 100644
--- a/Include/XnOSCpp.h
+++ b/Include/XnOSCpp.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -33,7 +33,7 @@
 class XnAutoCSLocker
 {
 public:
-	inline XnAutoCSLocker(const XnAutoCSLocker& other) : m_hCS(other.m_hCS)
+	inline XnAutoCSLocker(const XnAutoCSLocker& other) : m_hCS(other.m_hCS), m_bLocked(FALSE)
 	{
 		Lock();
 	}
@@ -46,7 +46,7 @@ public:
 		return *this;
 	}
 
-	inline XnAutoCSLocker(XN_CRITICAL_SECTION_HANDLE hCS) : m_hCS(hCS)
+	inline XnAutoCSLocker(XN_CRITICAL_SECTION_HANDLE hCS) : m_hCS(hCS), m_bLocked(FALSE)
 	{
 		Lock();
 	}
@@ -56,20 +56,27 @@ public:
 		Unlock();
 	}
 
-private:
 	inline void Lock()
 	{
-		XnStatus nRetVal = xnOSEnterCriticalSection(&m_hCS);
-		XN_ASSERT(nRetVal == XN_STATUS_OK);
+		if (!m_bLocked)
+		{
+			xnOSEnterCriticalSection(&m_hCS);
+			m_bLocked = TRUE;
+		}
 	}
 
 	inline void Unlock()
 	{
-		XnStatus nRetVal = xnOSLeaveCriticalSection(&m_hCS);
-		XN_ASSERT(nRetVal == XN_STATUS_OK);
+		if (m_bLocked)
+		{
+			xnOSLeaveCriticalSection(&m_hCS);
+			m_bLocked = FALSE;
+		}
 	}
 
+private:
 	XN_CRITICAL_SECTION_HANDLE m_hCS;
+	XnBool m_bLocked;
 };
 
 class XnAutoMutexLocker
@@ -119,14 +126,14 @@ public:
 		return xnOSCreateEvent(&m_hEvent, bManualReset);
 	}
 
-	XnStatus Create(const XnChar* strName, XnBool bManualReset)
+	XnStatus Create(const XnChar* strName, XnBool bManualReset, XnBool bAllowOtherUsers = FALSE)
 	{
-		return xnOSCreateNamedEvent(&m_hEvent, strName, bManualReset);
+		return xnOSCreateNamedEventEx(&m_hEvent, strName, bManualReset, bAllowOtherUsers);
 	}
 
-	XnStatus Open(const XnChar* strName)
+	XnStatus Open(const XnChar* strName, XnBool bEnableOtherUsers = FALSE)
 	{
-		return xnOSOpenNamedEvent(&m_hEvent, strName);
+		return xnOSOpenNamedEventEx(&m_hEvent, strName, bEnableOtherUsers);
 	}
 
 	XnStatus Close()
diff --git a/Include/XnOSMemory.h b/Include/XnOSMemory.h
index 09bfcb3..a3698d5 100644
--- a/Include/XnOSMemory.h
+++ b/Include/XnOSMemory.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -25,23 +25,23 @@
 #include "XnPlatform.h"
 
 // Memory
-XN_C_API void* xnOSMalloc(const XnSizeT nAllocSize);
-XN_C_API void* xnOSMallocAligned(const XnSizeT nAllocSize, const XnSizeT nAlignment);
-XN_C_API void* xnOSCalloc(const XnSizeT nAllocNum, const XnSizeT nAllocSize);
-XN_C_API void* xnOSCallocAligned(const XnSizeT nAllocNum, const XnSizeT nAllocSize, const XnSizeT nAlignment);
-XN_C_API void* xnOSRealloc(void* pMemory, const XnSizeT nAllocSize);
-XN_C_API void* xnOSReallocAligned(void* pMemory, const XnSizeT nAllocSize, const XnSizeT nAlignment);
-XN_C_API void* xnOSRecalloc(void* pMemory, const XnSizeT nAllocNum, const XnSizeT nAllocSize);
-XN_C_API void xnOSFree(const void* pMemBlock);
-XN_C_API void xnOSFreeAligned(const void* pMemBlock);
-XN_C_API void xnOSMemCopy(void* pDest, const void* pSource, XnSizeT nCount);
-XN_C_API XnInt32 xnOSMemCmp(const void *pBuf1, const void *pBuf2, XnSizeT nCount);
-XN_C_API void xnOSMemSet(void* pDest, XnUInt8 nValue, XnSizeT nCount);
-XN_C_API void xnOSMemMove(void* pDest, const void* pSource, XnSizeT nCount);
-XN_C_API XnUInt64 xnOSEndianSwapUINT64(XnUInt64 nValue);
-XN_C_API XnUInt32 xnOSEndianSwapUINT32(XnUInt32 nValue);
-XN_C_API XnUInt16 xnOSEndianSwapUINT16(XnUInt16 nValue);
-XN_C_API XnFloat xnOSEndianSwapFLOAT(XnFloat fValue);
+XN_C_API void* XN_C_DECL xnOSMalloc(const XnSizeT nAllocSize);
+XN_C_API void* XN_C_DECL xnOSMallocAligned(const XnSizeT nAllocSize, const XnSizeT nAlignment);
+XN_C_API void* XN_C_DECL xnOSCalloc(const XnSizeT nAllocNum, const XnSizeT nAllocSize);
+XN_C_API void* XN_C_DECL xnOSCallocAligned(const XnSizeT nAllocNum, const XnSizeT nAllocSize, const XnSizeT nAlignment);
+XN_C_API void* XN_C_DECL xnOSRealloc(void* pMemory, const XnSizeT nAllocSize);
+XN_C_API void* XN_C_DECL xnOSReallocAligned(void* pMemory, const XnSizeT nAllocSize, const XnSizeT nAlignment);
+XN_C_API void* XN_C_DECL xnOSRecalloc(void* pMemory, const XnSizeT nAllocNum, const XnSizeT nAllocSize);
+XN_C_API void XN_C_DECL xnOSFree(const void* pMemBlock);
+XN_C_API void XN_C_DECL xnOSFreeAligned(const void* pMemBlock);
+XN_C_API void XN_C_DECL xnOSMemCopy(void* pDest, const void* pSource, XnSizeT nCount);
+XN_C_API XnInt32 XN_C_DECL xnOSMemCmp(const void *pBuf1, const void *pBuf2, XnSizeT nCount);
+XN_C_API void XN_C_DECL xnOSMemSet(void* pDest, XnUInt8 nValue, XnSizeT nCount);
+XN_C_API void XN_C_DECL xnOSMemMove(void* pDest, const void* pSource, XnSizeT nCount);
+XN_C_API XnUInt64 XN_C_DECL xnOSEndianSwapUINT64(XnUInt64 nValue);
+XN_C_API XnUInt32 XN_C_DECL xnOSEndianSwapUINT32(XnUInt32 nValue);
+XN_C_API XnUInt16 XN_C_DECL xnOSEndianSwapUINT16(XnUInt16 nValue);
+XN_C_API XnFloat XN_C_DECL xnOSEndianSwapFLOAT(XnFloat fValue);
 
 
 #endif // __XNOSMEMORY_H__
diff --git a/Include/XnOSStrings.h b/Include/XnOSStrings.h
index 68b54dd..2832e62 100644
--- a/Include/XnOSStrings.h
+++ b/Include/XnOSStrings.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -23,23 +23,25 @@
 #define __XNOSSTRINGS_H__
 
 #include "XnPlatform.h"
+#include <stdarg.h>
 
 // Strings
-XN_C_API XnStatus xnOSStrPrefix(const XnChar* cpPrefixString, XnChar* cpDestString, const XnUInt32 nDestLength);
-XN_C_API XnStatus xnOSStrAppend(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nDestLength);
-XN_C_API XnStatus xnOSStrCopy(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nDestLength);
-XN_C_API XnUInt32 xnOSStrLen(const XnChar* cpStr);
-XN_C_API XnStatus xnOSStrNCopy(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nCopyLength, const XnUInt32 nDestLength);
-XN_C_API XnStatus xnOSStrCRC32(const XnChar* cpString, XnUInt32* nCRC32);
-XN_C_API XnStatus xnOSStrNCRC32(XnUChar* cpBuffer, XnUInt32 nBufferSize, XnUInt32* nCRC32);
-XN_C_API XnStatus xnOSStrFormat(XnChar* cpDestString, const XnUInt32 nDestLength, XnUInt32* pnCharsWritten, const XnChar* cpFormat, ...);
-XN_C_API XnStatus xnOSStrFormatV(XnChar* cpDestString, const XnUInt32 nDestLength, XnUInt32* pnCharsWritten, const XnChar* cpFormat, va_list args);
-XN_C_API XnInt32  xnOSStrCmp(const XnChar* cpFirstString, const XnChar* cpSecondString);
-XN_C_API XnInt32  xnOSStrCaseCmp(const XnChar* cpFirstString, const XnChar* cpSecondString);
-XN_C_API void     xnOSItoA(XnInt32 nValue, XnChar* cpStr, XnInt32 nBase);
+XN_C_API XnStatus XN_C_DECL xnOSStrPrefix(const XnChar* cpPrefixString, XnChar* cpDestString, const XnUInt32 nDestLength);
+XN_C_API XnStatus XN_C_DECL xnOSStrAppend(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nDestLength);
+XN_C_API XnStatus XN_C_DECL xnOSStrCopy(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nDestLength);
+XN_C_API XnUInt32 XN_C_DECL xnOSStrLen(const XnChar* cpStr);
+XN_C_API XnStatus XN_C_DECL xnOSStrNCopy(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nCopyLength, const XnUInt32 nDestLength);
+XN_C_API XnStatus XN_C_DECL xnOSStrCRC32(const XnChar* cpString, XnUInt32* nCRC32);
+XN_C_API XnStatus XN_C_DECL xnOSStrNCRC32(XnUChar* cpBuffer, XnUInt32 nBufferSize, XnUInt32* nCRC32);
+XN_C_API XnStatus XN_C_DECL xnOSStrFormat(XnChar* cpDestString, const XnUInt32 nDestLength, XnUInt32* pnCharsWritten, const XnChar* cpFormat, ...);
+XN_C_API XnStatus XN_C_DECL xnOSStrFormatV(XnChar* cpDestString, const XnUInt32 nDestLength, XnUInt32* pnCharsWritten, const XnChar* cpFormat, va_list args);
+XN_C_API XnInt32  XN_C_DECL xnOSStrCmp(const XnChar* cpFirstString, const XnChar* cpSecondString);
+XN_C_API XnInt32  XN_C_DECL xnOSStrCaseCmp(const XnChar* cpFirstString, const XnChar* cpSecondString);
+XN_C_API void     XN_C_DECL xnOSItoA(XnInt32 nValue, XnChar* cpStr, XnInt32 nBase);
 /** Should be freed using @ref xnOSFree() */
-XN_C_API XnChar* xnOSStrDup(const XnChar* strSource);
-XN_C_API XnStatus xnOSExpandEnvironmentStrings(const XnChar* strSrc, XnChar* strDest, XnUInt32 nDestSize);
+XN_C_API XnChar* XN_C_DECL xnOSStrDup(const XnChar* strSource);
+XN_C_API XnStatus XN_C_DECL xnOSGetEnvironmentVariable(const XnChar* strEnv, XnChar* strDest, XnUInt32 nDestSize);
+XN_C_API XnStatus XN_C_DECL xnOSExpandEnvironmentStrings(const XnChar* strSrc, XnChar* strDest, XnUInt32 nDestSize);
 
 
 #endif // __XNOSSTRINGS_H__
\ No newline at end of file
diff --git a/Include/XnOpenNI.h b/Include/XnOpenNI.h
index 1032aca..867895e 100644
--- a/Include/XnOpenNI.h
+++ b/Include/XnOpenNI.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnPlatform.h b/Include/XnPlatform.h
index 251e41b..c5e2b9b 100644
--- a/Include/XnPlatform.h
+++ b/Include/XnPlatform.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -34,6 +34,7 @@
 #define XN_PLATFORM_ARC 6
 #define XN_PLATFORM_LINUX_ARM 7
 #define XN_PLATFORM_MACOSX 8
+#define XN_PLATFORM_ANDROID_ARM 9
 
 #define XN_PLATFORM_IS_LITTLE_ENDIAN 1
 #define XN_PLATFORM_IS_BIG_ENDIAN    2
@@ -59,6 +60,8 @@
 	#endif
 
 	#include "Win32/XnPlatformWin32.h"
+#elif defined(ANDROID) && defined(__arm__)
+	#include "Android-Arm/XnPlatformAndroid-Arm.h"
 #elif (linux && (i386 || __x86_64__))
 	#include "Linux-x86/XnPlatformLinux-x86.h"
 #elif (linux && __arm__)
@@ -88,6 +91,8 @@
 
 typedef void (*XnFuncPtr)();
 
+#define XN_COMPILER_ASSERT(x) typedef int compileAssert[x ? 1 : -1]
+
 //---------------------------------------------------------------------------
 // API Export/Import Macros
 //---------------------------------------------------------------------------
diff --git a/Include/XnPrdNode.h b/Include/XnPrdNode.h
index 4e5a281..d2049af 100644
--- a/Include/XnPrdNode.h
+++ b/Include/XnPrdNode.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -51,21 +51,25 @@
  *
  * @param	hNode	[in]	A handle to the node.
  */
-XN_C_API XnNodeInfo* xnGetNodeInfo(XnNodeHandle hNode);
+XN_C_API XnNodeInfo* XN_C_DECL xnGetNodeInfo(XnNodeHandle hNode);
 
 /**
  * @brief Gets the instance name of a node by its handle.
  *
  * @param	hNode	[in]	A handle to the node.
  */
-XN_C_API const XnChar* xnGetNodeName(XnNodeHandle hNode);
+XN_C_API const XnChar* XN_C_DECL xnGetNodeName(XnNodeHandle hNode);
 
 /**
- * @brief Gets the context a node belongs to.
+ * @brief Gets the context a node belongs to. The context ref count is increased. The user
+ * is responsible for releasing the context when it's no longer used.
  *
  * @param	hNode	[in]	A handle to the node.
  */
-XN_C_API XnContext* xnGetContextFromNodeHandle(XnNodeHandle hNode);
+XN_C_API XnContext* XN_C_DECL xnGetRefContextFromNodeHandle(XnNodeHandle hNode);
+
+typedef XnContext* XnContextPtr;
+XN_C_API XnContextPtr XN_API_DEPRECATED("Please use xnGetRefContextFromNodeHandle() instead") XN_C_DECL xnGetContextFromNodeHandle(XnNodeHandle hNode);
 
 /**
  * @brief Checks if a production node supports specific capability.
@@ -73,7 +77,7 @@ XN_C_API XnContext* xnGetContextFromNodeHandle(XnNodeHandle hNode);
  * @param	hInstance			[in]	A handle to the instance to be queried.
  * @param	strCapabilityName	[in]	The name of the capability to check.
  */
-XN_C_API XnBool xnIsCapabilitySupported(XnNodeHandle hInstance, const XnChar* strCapabilityName);
+XN_C_API XnBool XN_C_DECL xnIsCapabilitySupported(XnNodeHandle hInstance, const XnChar* strCapabilityName);
 
 /**
  * @brief Sets an integer property.
@@ -82,7 +86,7 @@ XN_C_API XnBool xnIsCapabilitySupported(XnNodeHandle hInstance, const XnChar* st
  * @param	strName		[in]	Property name
  * @param	nValue		[in]	New value
  */
-XN_C_API XnStatus xnSetIntProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt64 nValue);
+XN_C_API XnStatus XN_C_DECL xnSetIntProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt64 nValue);
 /**
  * @brief Sets a real property.
  *
@@ -90,7 +94,7 @@ XN_C_API XnStatus xnSetIntProperty(XnNodeHandle hInstance, const XnChar* strName
  * @param	strName		[in]	Property name
  * @param	dValue		[in]	New value
  */
-XN_C_API XnStatus xnSetRealProperty(XnNodeHandle hInstance, const XnChar* strName, XnDouble dValue);
+XN_C_API XnStatus XN_C_DECL xnSetRealProperty(XnNodeHandle hInstance, const XnChar* strName, XnDouble dValue);
 /**
  * @brief Sets a string property.
  *
@@ -98,7 +102,7 @@ XN_C_API XnStatus xnSetRealProperty(XnNodeHandle hInstance, const XnChar* strNam
  * @param	strName		[in]	Property name
  * @param	strValue	[in]	New value
  */
-XN_C_API XnStatus xnSetStringProperty(XnNodeHandle hInstance, const XnChar* strName, const XnChar* strValue);
+XN_C_API XnStatus XN_C_DECL xnSetStringProperty(XnNodeHandle hInstance, const XnChar* strName, const XnChar* strValue);
 /**
  * @brief Sets a buffer property.
  *
@@ -107,7 +111,7 @@ XN_C_API XnStatus xnSetStringProperty(XnNodeHandle hInstance, const XnChar* strN
  * @param	nBufferSize	[in]	The size of the buffer passed, in bytes.
  * @param	pBuffer		[in]	The data buffer.
  */
-XN_C_API XnStatus xnSetGeneralProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt32 nBufferSize, const void* pBuffer);
+XN_C_API XnStatus XN_C_DECL xnSetGeneralProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt32 nBufferSize, const void* pBuffer);
 
 /**
  * @brief Gets an integer property.
@@ -116,7 +120,7 @@ XN_C_API XnStatus xnSetGeneralProperty(XnNodeHandle hInstance, const XnChar* str
  * @param	strName		[in]	Property name
  * @param	pnValue		[out]	Current value
  */
-XN_C_API XnStatus xnGetIntProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt64* pnValue);
+XN_C_API XnStatus XN_C_DECL xnGetIntProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt64* pnValue);
 /**
  * @brief Gets a real property.
  *
@@ -124,7 +128,7 @@ XN_C_API XnStatus xnGetIntProperty(XnNodeHandle hInstance, const XnChar* strName
  * @param	strName		[in]	Property name
  * @param	pdValue		[out]	Current value
  */
-XN_C_API XnStatus xnGetRealProperty(XnNodeHandle hInstance, const XnChar* strName, XnDouble* pdValue);
+XN_C_API XnStatus XN_C_DECL xnGetRealProperty(XnNodeHandle hInstance, const XnChar* strName, XnDouble* pdValue);
 /**
  * @brief Gets a string property.
  *
@@ -133,7 +137,7 @@ XN_C_API XnStatus xnGetRealProperty(XnNodeHandle hInstance, const XnChar* strNam
  * @param	csValue		[out]	Current value 
  * @param	nBufSize	[in]	The size of the csValue buffer. 
  */
-XN_C_API XnStatus xnGetStringProperty(XnNodeHandle hInstance, const XnChar* strName, XnChar* csValue, XnUInt32 nBufSize);
+XN_C_API XnStatus XN_C_DECL xnGetStringProperty(XnNodeHandle hInstance, const XnChar* strName, XnChar* csValue, XnUInt32 nBufSize);
 /**
  * @brief Gets a buffer property.
  *
@@ -142,7 +146,7 @@ XN_C_API XnStatus xnGetStringProperty(XnNodeHandle hInstance, const XnChar* strN
  * @param	nBufferSize	[in]	The size of the buffer passed, in bytes.
  * @param	pBuffer		[in]	The data buffer to be filled.
  */
-XN_C_API XnStatus xnGetGeneralProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt32 nBufferSize, void* pBuffer);
+XN_C_API XnStatus XN_C_DECL xnGetGeneralProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt32 nBufferSize, void* pBuffer);
 
 /**
  * @brief Locks a node, not allowing any changes (any "set" function).
@@ -150,7 +154,7 @@ XN_C_API XnStatus xnGetGeneralProperty(XnNodeHandle hInstance, const XnChar* str
  * @param	hInstance	[in]	A handle to the node.
  * @param	phLock		[out]	A handle of the lock, that can be used to manage the lock.
  */
-XN_C_API XnStatus xnLockNodeForChanges(XnNodeHandle hInstance, XnLockHandle* phLock);
+XN_C_API XnStatus XN_C_DECL xnLockNodeForChanges(XnNodeHandle hInstance, XnLockHandle* phLock);
 
 /**
  * @brief Unlocks a previously locked node.
@@ -158,7 +162,7 @@ XN_C_API XnStatus xnLockNodeForChanges(XnNodeHandle hInstance, XnLockHandle* phL
  * @param	hInstance	[in]	A handle to the node.
  * @param	hLock		[in]	The handle of the lock, returned from @ref xnLockNodeForChanges().
  */
-XN_C_API XnStatus xnUnlockNodeForChanges(XnNodeHandle hInstance, XnLockHandle hLock);
+XN_C_API XnStatus XN_C_DECL xnUnlockNodeForChanges(XnNodeHandle hInstance, XnLockHandle hLock);
 
 /**
  * @brief Start changes request on a locked node, without releasing that lock. 
@@ -169,7 +173,7 @@ XN_C_API XnStatus xnUnlockNodeForChanges(XnNodeHandle hInstance, XnLockHandle hL
  * @param	hInstance	[in]	A handle to the node.
  * @param	hLock		[in]	The handle of the lock, returned from @ref xnLockNodeForChanges().
  */
-XN_C_API XnStatus xnLockedNodeStartChanges(XnNodeHandle hInstance, XnLockHandle hLock);
+XN_C_API XnStatus XN_C_DECL xnLockedNodeStartChanges(XnNodeHandle hInstance, XnLockHandle hLock);
 
 /**
  * @brief Ends changes request on a locked node. 
@@ -177,7 +181,7 @@ XN_C_API XnStatus xnLockedNodeStartChanges(XnNodeHandle hInstance, XnLockHandle
  * @param	hInstance	[in]	A handle to the node.
  * @param	hLock		[in]	The handle of the lock, returned from @ref xnLockNodeForChanges().
  */
-XN_C_API XnStatus xnLockedNodeEndChanges(XnNodeHandle hInstance, XnLockHandle hLock);
+XN_C_API XnStatus XN_C_DECL xnLockedNodeEndChanges(XnNodeHandle hInstance, XnLockHandle hLock);
 
 /**
  * @brief Adds another node to the list of needed nodes for this node.
@@ -185,7 +189,7 @@ XN_C_API XnStatus xnLockedNodeEndChanges(XnNodeHandle hInstance, XnLockHandle hL
  * @param	hInstance	[in]	A handle to the node.
  * @param	hNeededNode	[in]	The node that is needed by hInstance.
  */
-XN_C_API XnStatus xnAddNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode);
+XN_C_API XnStatus XN_C_DECL xnAddNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode);
 
 /**
  * @brief Removes a needed node from the list of needed nodes. 
@@ -196,7 +200,7 @@ XN_C_API XnStatus xnAddNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNo
  * @param	hInstance	[in]	A handle to the node.
  * @param	hNeededNode	[in]	The node to be removed from the list.
  */
-XN_C_API XnStatus xnRemoveNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode);
+XN_C_API XnStatus XN_C_DECL xnRemoveNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode);
 
 /** @} */
 
@@ -221,7 +225,7 @@ XN_C_API XnStatus xnRemoveNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeede
  * @param	pQuery				[in]	Optional. Can be used to select which device to create. If not specified, this function may create any device node that is available.
  * @param	pErrors				[in]	Optional. If provided, will be filled with information about device nodes that could not be created.
  */
-XN_C_API XnStatus xnCreateDevice(XnContext* pContext, XnNodeHandle* phDevice, XnNodeQuery* pQuery, XnEnumerationErrors* pErrors);
+XN_C_API XnStatus XN_C_DECL xnCreateDevice(XnContext* pContext, XnNodeHandle* phDevice, XnNodeQuery* pQuery, XnEnumerationErrors* pErrors);
 
 /** @} */
 
@@ -249,7 +253,7 @@ XN_C_API XnStatus xnCreateDevice(XnContext* pContext, XnNodeHandle* phDevice, Xn
  * in such a case, the device name should be truncated to fit in the buffer, and pnBufferSize should be
  * updated to the required size.
  */
-XN_C_API XnStatus xnGetDeviceName(XnNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize);
+XN_C_API XnStatus XN_C_DECL xnGetDeviceName(XnNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize);
 
 /**
  * Gets a vendor-specific string.
@@ -262,7 +266,7 @@ XN_C_API XnStatus xnGetDeviceName(XnNodeHandle hInstance, XnChar* strBuffer, XnU
  * in such a case, the string should be truncated to fit in the buffer, and pnBufferSize should be
  * updated to the required size.
  */
-XN_C_API XnStatus xnGetVendorSpecificData(XnNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize);
+XN_C_API XnStatus XN_C_DECL xnGetVendorSpecificData(XnNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize);
 
 /**
  * Gets the serial number of the device.
@@ -275,7 +279,7 @@ XN_C_API XnStatus xnGetVendorSpecificData(XnNodeHandle hInstance, XnChar* strBuf
  * in such a case, the string should be truncated to fit in the buffer, and pnBufferSize should be
  * updated to the required size.
  */
-XN_C_API XnStatus xnGetSerialNumber(XnNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize);
+XN_C_API XnStatus XN_C_DECL xnGetSerialNumber(XnNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize);
 
 /** @} */
 
@@ -304,7 +308,7 @@ XN_C_API XnStatus xnGetSerialNumber(XnNodeHandle hInstance, XnChar* strBuffer, X
  *
  * @returns The error state of this node.
  */
-XN_C_API XnStatus xnGetNodeErrorState(XnNodeHandle hInstance);
+XN_C_API XnStatus XN_C_DECL xnGetNodeErrorState(XnNodeHandle hInstance);
 
 /**
  * @brief Registers a callback function to error state changes.
@@ -314,7 +318,7 @@ XN_C_API XnStatus xnGetNodeErrorState(XnNodeHandle hInstance);
  * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
  * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromNodeErrorStateChange().
  */
-XN_C_API XnStatus xnRegisterToNodeErrorStateChange
+XN_C_API XnStatus XN_C_DECL xnRegisterToNodeErrorStateChange
 	(XnNodeHandle hInstance, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
@@ -324,7 +328,7 @@ XN_C_API XnStatus xnRegisterToNodeErrorStateChange
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToNodeErrorStateChange().
  */
-XN_C_API void xnUnregisterFromNodeErrorStateChange
+XN_C_API void XN_C_DECL xnUnregisterFromNodeErrorStateChange
 	(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /** @} */
@@ -373,7 +377,7 @@ XN_C_API void xnUnregisterFromNodeErrorStateChange
  * @param	pnDefault			[out]	Default value
  * @param	pbIsAutoSupported	[out]	TRUE if auto adjustment is supported, FALSE otherwise
  */
-XN_C_API XnStatus xnGetGeneralIntRange(XnNodeHandle hNode, const XnChar* strCap, XnInt32* pnMin, XnInt32* pnMax, XnInt32* pnStep, XnInt32* pnDefault, XnBool* pbIsAutoSupported);
+XN_C_API XnStatus XN_C_DECL xnGetGeneralIntRange(XnNodeHandle hNode, const XnChar* strCap, XnInt32* pnMin, XnInt32* pnMax, XnInt32* pnStep, XnInt32* pnDefault, XnBool* pbIsAutoSupported);
 
 /**
  * @brief Gets the current value of this capability
@@ -382,7 +386,7 @@ XN_C_API XnStatus xnGetGeneralIntRange(XnNodeHandle hNode, const XnChar* strCap,
  * @param	strCap				[in]	Name of the capability
  * @param	pnValue				[out]	Current value
  */
-XN_C_API XnStatus xnGetGeneralIntValue(XnNodeHandle hNode, const XnChar* strCap, XnInt32* pnValue);
+XN_C_API XnStatus XN_C_DECL xnGetGeneralIntValue(XnNodeHandle hNode, const XnChar* strCap, XnInt32* pnValue);
 
 /**
  * @brief Sets the current value of this capability
@@ -391,7 +395,7 @@ XN_C_API XnStatus xnGetGeneralIntValue(XnNodeHandle hNode, const XnChar* strCap,
  * @param	strCap				[in]	Name of the capability
  * @param	nValue				[in]	Value to set
  */
-XN_C_API XnStatus xnSetGeneralIntValue(XnNodeHandle hNode, const XnChar* strCap, XnInt32 nValue);
+XN_C_API XnStatus XN_C_DECL xnSetGeneralIntValue(XnNodeHandle hNode, const XnChar* strCap, XnInt32 nValue);
 
 /**
  * @brief Registers a callback function to values changes.
@@ -402,7 +406,7 @@ XN_C_API XnStatus xnSetGeneralIntValue(XnNodeHandle hNode, const XnChar* strCap,
  * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
  * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromGeneralIntValueChange().
  */
-XN_C_API XnStatus xnRegisterToGeneralIntValueChange
+XN_C_API XnStatus XN_C_DECL xnRegisterToGeneralIntValueChange
 	(XnNodeHandle hNode, const XnChar* strCap, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
@@ -413,7 +417,7 @@ XN_C_API XnStatus xnRegisterToGeneralIntValueChange
  * @param	strCap		[in]	Name of the capability
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToGeneralIntValueChange().
  */
-XN_C_API void xnUnregisterFromGeneralIntValueChange
+XN_C_API void XN_C_DECL xnUnregisterFromGeneralIntValueChange
 	(XnNodeHandle hNode, const XnChar* strCap, XnCallbackHandle hCallback);
 
 /** @} */
@@ -444,7 +448,7 @@ XN_C_API void xnUnregisterFromGeneralIntValueChange
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a generator.
  */
-XN_C_API XnStatus xnStartGenerating(XnNodeHandle hInstance);
+XN_C_API XnStatus XN_C_DECL xnStartGenerating(XnNodeHandle hInstance);
 
 /** 
  * @brief Checks if this node is currently generating.
@@ -453,7 +457,7 @@ XN_C_API XnStatus xnStartGenerating(XnNodeHandle hInstance);
  *
  * @returns FALSE if this production node is not a generator.
  */
-XN_C_API XnBool xnIsGenerating(XnNodeHandle hInstance);
+XN_C_API XnBool XN_C_DECL xnIsGenerating(XnNodeHandle hInstance);
 
 /** 
  * @brief Stops generation of the output.
@@ -462,7 +466,7 @@ XN_C_API XnBool xnIsGenerating(XnNodeHandle hInstance);
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a generator.
  */
-XN_C_API XnStatus xnStopGenerating(XnNodeHandle hInstance);
+XN_C_API XnStatus XN_C_DECL xnStopGenerating(XnNodeHandle hInstance);
 
 /**
  * @brief Registers a callback function to be called when generation starts or stops.
@@ -472,7 +476,7 @@ XN_C_API XnStatus xnStopGenerating(XnNodeHandle hInstance);
  * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
  * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromGenerationRunningChange().
  */
-XN_C_API XnStatus xnRegisterToGenerationRunningChange
+XN_C_API XnStatus XN_C_DECL xnRegisterToGenerationRunningChange
 	(XnNodeHandle hInstance, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
@@ -482,7 +486,7 @@ XN_C_API XnStatus xnRegisterToGenerationRunningChange
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToGenerationRunningChange().
  */
-XN_C_API void xnUnregisterFromGenerationRunningChange
+XN_C_API void XN_C_DECL xnUnregisterFromGenerationRunningChange
 	(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /// @}
@@ -503,7 +507,7 @@ XN_C_API void xnUnregisterFromGenerationRunningChange
  * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
  * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromNewDataAvailable().
  */
-XN_C_API XnStatus xnRegisterToNewDataAvailable
+XN_C_API XnStatus XN_C_DECL xnRegisterToNewDataAvailable
 	(XnNodeHandle hInstance, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
@@ -513,7 +517,7 @@ XN_C_API XnStatus xnRegisterToNewDataAvailable
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToNewDataAvailable().
  */
-XN_C_API void xnUnregisterFromNewDataAvailable
+XN_C_API void XN_C_DECL xnUnregisterFromNewDataAvailable
 	(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /**
@@ -522,7 +526,7 @@ XN_C_API void xnUnregisterFromNewDataAvailable
  * @param	hInstance	[in]	A handle to the instance.
  * @param	pnTimestamp	[out]	[Optional] If not NULL, will be filled with that data timestamp.
  */
-XN_C_API XnBool xnIsNewDataAvailable(XnNodeHandle hInstance, XnUInt64* pnTimestamp);
+XN_C_API XnBool XN_C_DECL xnIsNewDataAvailable(XnNodeHandle hInstance, XnUInt64* pnTimestamp);
 
 /// @}
 
@@ -538,7 +542,7 @@ XN_C_API XnBool xnIsNewDataAvailable(XnNodeHandle hInstance, XnUInt64* pnTimesta
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a generator.
  */
-XN_C_API XnStatus xnWaitAndUpdateData(XnNodeHandle hInstance);
+XN_C_API XnStatus XN_C_DECL xnWaitAndUpdateData(XnNodeHandle hInstance);
 
 /// @}
 
@@ -553,7 +557,7 @@ XN_C_API XnStatus xnWaitAndUpdateData(XnNodeHandle hInstance);
  *
  * @param	hInstance	[in]	A handle to the instance.
  */
-XN_C_API XnBool xnIsDataNew(XnNodeHandle hInstance);
+XN_C_API XnBool XN_C_DECL xnIsDataNew(XnNodeHandle hInstance);
 
 /**
  * @brief Gets the current data.
@@ -562,7 +566,7 @@ XN_C_API XnBool xnIsDataNew(XnNodeHandle hInstance);
  *
  * @returns	NULL if this production node is not a generator.
  */
-XN_C_API const void* xnGetData(XnNodeHandle hInstance);
+XN_C_API const void* XN_C_DECL xnGetData(XnNodeHandle hInstance);
 
 /**
  * @brief Gets the size of current data, in bytes.
@@ -571,7 +575,7 @@ XN_C_API const void* xnGetData(XnNodeHandle hInstance);
  *
  * @returns	(XnUInt32)-1 if this production node is not a generator.
  */
-XN_C_API XnUInt32 xnGetDataSize(XnNodeHandle hInstance);
+XN_C_API XnUInt32 XN_C_DECL xnGetDataSize(XnNodeHandle hInstance);
 
 /**
  * @brief Gets the timestamp of current data, in microseconds.
@@ -580,7 +584,7 @@ XN_C_API XnUInt32 xnGetDataSize(XnNodeHandle hInstance);
  *
  * @returns	(XnUInt64)-1 if this production node is not a generator.
  */
-XN_C_API XnUInt64 xnGetTimestamp(XnNodeHandle hInstance);
+XN_C_API XnUInt64 XN_C_DECL xnGetTimestamp(XnNodeHandle hInstance);
 
 /**
  * @brief Gets the frame ID of current data.
@@ -589,7 +593,7 @@ XN_C_API XnUInt64 xnGetTimestamp(XnNodeHandle hInstance);
  *
  * @returns	(XnUInt32)-1 if this production node is not a generator.
  */
-XN_C_API XnUInt32 xnGetFrameID(XnNodeHandle hInstance);
+XN_C_API XnUInt32 XN_C_DECL xnGetFrameID(XnNodeHandle hInstance);
 
 /** @} */
 
@@ -614,14 +618,14 @@ XN_C_API XnUInt32 xnGetFrameID(XnNodeHandle hInstance);
  * @param	hInstance	[in]	A handle to the instance.
  * @param	bMirror		[in]	TRUE for mirroring output, FALSE otherwise.
  */
-XN_C_API XnStatus xnSetMirror(XnNodeHandle hInstance, XnBool bMirror);
+XN_C_API XnStatus XN_C_DECL xnSetMirror(XnNodeHandle hInstance, XnBool bMirror);
 
 /**
  * @brief Gets current mirroring configuration.
  *
  * @param	hInstance	[in]	A handle to the instance.
  */
-XN_C_API XnBool xnIsMirrored(XnNodeHandle hInstance);
+XN_C_API XnBool XN_C_DECL xnIsMirrored(XnNodeHandle hInstance);
 
 /**
  * @brief Registers a callback function to mirror changes.
@@ -631,7 +635,7 @@ XN_C_API XnBool xnIsMirrored(XnNodeHandle hInstance);
  * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
  * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromMirrorChange().
  */
-XN_C_API XnStatus xnRegisterToMirrorChange
+XN_C_API XnStatus XN_C_DECL xnRegisterToMirrorChange
 	(XnNodeHandle hInstance, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
@@ -641,7 +645,7 @@ XN_C_API XnStatus xnRegisterToMirrorChange
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToMirrorChange().
  */
-XN_C_API void xnUnregisterFromMirrorChange
+XN_C_API void XN_C_DECL xnUnregisterFromMirrorChange
 	(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /** @} */
@@ -670,7 +674,7 @@ XN_C_API void xnUnregisterFromMirrorChange
  *
  * @returns TRUE if view point is supported, FALSE otherwise.
  */
-XN_C_API XnBool xnIsViewPointSupported(XnNodeHandle hInstance, XnNodeHandle hOther);
+XN_C_API XnBool XN_C_DECL xnIsViewPointSupported(XnNodeHandle hInstance, XnNodeHandle hOther);
 
 /**
  * @brief Sets the view point of this generator to look like as if placed at another generator location.
@@ -678,14 +682,14 @@ XN_C_API XnBool xnIsViewPointSupported(XnNodeHandle hInstance, XnNodeHandle hOth
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hOther		[in]	The view point to be set.
  */
-XN_C_API XnStatus xnSetViewPoint(XnNodeHandle hInstance, XnNodeHandle hOther);
+XN_C_API XnStatus XN_C_DECL xnSetViewPoint(XnNodeHandle hInstance, XnNodeHandle hOther);
 
 /**
  * @brief Sets the view point of this generator to its normal one.
  *
  * @param	hInstance	[in]	A handle to the instance.
  */
-XN_C_API XnStatus xnResetViewPoint(XnNodeHandle hInstance);
+XN_C_API XnStatus XN_C_DECL xnResetViewPoint(XnNodeHandle hInstance);
 
 /**
  * @brief Checks if current view point is as if coming from the other node view point.
@@ -693,7 +697,7 @@ XN_C_API XnStatus xnResetViewPoint(XnNodeHandle hInstance);
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hOther		[in]	The view point to be checked.
  */
-XN_C_API XnBool xnIsViewPointAs(XnNodeHandle hInstance, XnNodeHandle hOther);
+XN_C_API XnBool XN_C_DECL xnIsViewPointAs(XnNodeHandle hInstance, XnNodeHandle hOther);
 
 /**
  * @brief Registers a callback function to view point changes.
@@ -703,7 +707,7 @@ XN_C_API XnBool xnIsViewPointAs(XnNodeHandle hInstance, XnNodeHandle hOther);
  * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
  * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromViewPointChange().
  */
-XN_C_API XnStatus xnRegisterToViewPointChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
+XN_C_API XnStatus XN_C_DECL xnRegisterToViewPointChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
 
 /**
  * @brief Unregisters a callback function which was registered using @ref xnRegisterToViewPointChange().
@@ -711,7 +715,7 @@ XN_C_API XnStatus xnRegisterToViewPointChange(XnNodeHandle hInstance, XnStateCha
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToViewPointChange().
  */
-XN_C_API void xnUnregisterFromViewPointChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterFromViewPointChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /** @} */
 
@@ -736,7 +740,7 @@ XN_C_API void xnUnregisterFromViewPointChange(XnNodeHandle hInstance, XnCallback
  *
  * @returns TRUE if frame sync to node is supported, FALSE otherwise.
  */
-XN_C_API XnBool xnCanFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
+XN_C_API XnBool XN_C_DECL xnCanFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
 
 /**
  * @brief Activates frame sync with the other node.
@@ -744,7 +748,7 @@ XN_C_API XnBool xnCanFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hOther		[in]	The node to sync to.
  */
-XN_C_API XnStatus xnFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
+XN_C_API XnStatus XN_C_DECL xnFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
 
 /**
  * @brief Stops frame sync with the other node.
@@ -752,7 +756,7 @@ XN_C_API XnStatus xnFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hOther		[in]	The node to sync to.
  */
-XN_C_API XnStatus xnStopFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
+XN_C_API XnStatus XN_C_DECL xnStopFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
 
 /**
  * @brief Checks if current view point is as if coming from the other node view point.
@@ -760,7 +764,7 @@ XN_C_API XnStatus xnStopFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOthe
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hOther		[in]	The node to be checked.
  */
-XN_C_API XnBool xnIsFrameSyncedWith(XnNodeHandle hInstance, XnNodeHandle hOther);
+XN_C_API XnBool XN_C_DECL xnIsFrameSyncedWith(XnNodeHandle hInstance, XnNodeHandle hOther);
 
 /**
  * @brief Registers a callback function to view point changes.
@@ -770,7 +774,7 @@ XN_C_API XnBool xnIsFrameSyncedWith(XnNodeHandle hInstance, XnNodeHandle hOther)
  * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
  * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromFrameSyncChange().
  */
-XN_C_API XnStatus xnRegisterToFrameSyncChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
+XN_C_API XnStatus XN_C_DECL xnRegisterToFrameSyncChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
 
 /**
  * @brief Unregisters a callback function which was registered using @ref xnRegisterToFrameSyncChange().
@@ -778,7 +782,7 @@ XN_C_API XnStatus xnRegisterToFrameSyncChange(XnNodeHandle hInstance, XnStateCha
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToFrameSyncChange().
  */
-XN_C_API void xnUnregisterFromFrameSyncChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterFromFrameSyncChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /** @} */
 
@@ -801,7 +805,7 @@ XN_C_API void xnUnregisterFromFrameSyncChange(XnNodeHandle hInstance, XnCallback
  *
  * @returns	0 if this production node is not a map generator.
  */
-XN_C_API XnUInt32 xnGetSupportedMapOutputModesCount(XnNodeHandle hInstance);
+XN_C_API XnUInt32 XN_C_DECL xnGetSupportedMapOutputModesCount(XnNodeHandle hInstance);
 
 /** 
  * @brief Gets a list of all supported modes. The size of the array that should be passed can be obtained by calling @ref xnGetSupportedMapOutputModesCount().
@@ -813,7 +817,7 @@ XN_C_API XnUInt32 xnGetSupportedMapOutputModesCount(XnNodeHandle hInstance);
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a map generator.
  */
-XN_C_API XnStatus xnGetSupportedMapOutputModes(XnNodeHandle hInstance, XnMapOutputMode* aModes, XnUInt32* pnCount);
+XN_C_API XnStatus XN_C_DECL xnGetSupportedMapOutputModes(XnNodeHandle hInstance, XnMapOutputMode* aModes, XnUInt32* pnCount);
 
 /** 
  * @brief Sets the output mode. 
@@ -823,7 +827,7 @@ XN_C_API XnStatus xnGetSupportedMapOutputModes(XnNodeHandle hInstance, XnMapOutp
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a map generator.
  */
-XN_C_API XnStatus xnSetMapOutputMode(XnNodeHandle hInstance, const XnMapOutputMode* pOutputMode);
+XN_C_API XnStatus XN_C_DECL xnSetMapOutputMode(XnNodeHandle hInstance, const XnMapOutputMode* pOutputMode);
 
 /** 
  * @brief Gets the current output mode. 
@@ -833,7 +837,7 @@ XN_C_API XnStatus xnSetMapOutputMode(XnNodeHandle hInstance, const XnMapOutputMo
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a map generator.
  */
-XN_C_API XnStatus xnGetMapOutputMode(XnNodeHandle hInstance, XnMapOutputMode* pOutputMode);
+XN_C_API XnStatus XN_C_DECL xnGetMapOutputMode(XnNodeHandle hInstance, XnMapOutputMode* pOutputMode);
 
 /**
  * @brief Registers a callback function to mode changes.
@@ -845,7 +849,7 @@ XN_C_API XnStatus xnGetMapOutputMode(XnNodeHandle hInstance, XnMapOutputMode* pO
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a map generator.
  */
-XN_C_API XnStatus xnRegisterToMapOutputModeChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
+XN_C_API XnStatus XN_C_DECL xnRegisterToMapOutputModeChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
 /**
@@ -854,7 +858,7 @@ XN_C_API XnStatus xnRegisterToMapOutputModeChange(XnNodeHandle hInstance, XnStat
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToMapOutputModeChange.
  */
-XN_C_API void xnUnregisterFromMapOutputModeChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterFromMapOutputModeChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /**
  * @brief Gets the number of bytes per pixel for this map generator.
@@ -863,7 +867,7 @@ XN_C_API void xnUnregisterFromMapOutputModeChange(XnNodeHandle hInstance, XnCall
  *
  * @returns	(XnUInt32)-1 if this production node is not a map generator.
  */
-XN_C_API XnUInt32 xnGetBytesPerPixel(XnNodeHandle hInstance);
+XN_C_API XnUInt32 XN_C_DECL xnGetBytesPerPixel(XnNodeHandle hInstance);
 
 /** @} */
 
@@ -892,7 +896,7 @@ XN_C_API XnUInt32 xnGetBytesPerPixel(XnNodeHandle hInstance);
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the Cropping capability.
  */
-XN_C_API XnStatus xnSetCropping(XnNodeHandle hInstance, const XnCropping* pCropping);
+XN_C_API XnStatus XN_C_DECL xnSetCropping(XnNodeHandle hInstance, const XnCropping* pCropping);
 
 /** 
  * @brief Gets current cropping configuration.
@@ -902,7 +906,7 @@ XN_C_API XnStatus xnSetCropping(XnNodeHandle hInstance, const XnCropping* pCropp
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the Cropping capability.
  */
-XN_C_API XnStatus xnGetCropping(XnNodeHandle hInstance, XnCropping* pCropping);
+XN_C_API XnStatus XN_C_DECL xnGetCropping(XnNodeHandle hInstance, XnCropping* pCropping);
 
 /**
  * @brief Registers a callback function to cropping changes.
@@ -912,7 +916,7 @@ XN_C_API XnStatus xnGetCropping(XnNodeHandle hInstance, XnCropping* pCropping);
  * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
  * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromCroppingChange().
  */
-XN_C_API XnStatus xnRegisterToCroppingChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
+XN_C_API XnStatus XN_C_DECL xnRegisterToCroppingChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
 /**
@@ -921,7 +925,7 @@ XN_C_API XnStatus xnRegisterToCroppingChange(XnNodeHandle hInstance, XnStateChan
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from xnRegisterToCroppingChange().
  */
-XN_C_API void xnUnregisterFromCroppingChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterFromCroppingChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /** @} */
 
@@ -943,7 +947,7 @@ XN_C_API void xnUnregisterFromCroppingChange(XnNodeHandle hInstance, XnCallbackH
  * @param	hGenerator	[in]	A handle to the instance.
  * @param	nFrequency	[in]	The frequency to be used.
  */
-XN_C_API XnStatus xnSetPowerLineFrequency(XnNodeHandle hGenerator, XnPowerLineFrequency nFrequency);
+XN_C_API XnStatus XN_C_DECL xnSetPowerLineFrequency(XnNodeHandle hGenerator, XnPowerLineFrequency nFrequency);
 
 /** 
  * @brief Gets the power line frequency.
@@ -951,7 +955,7 @@ XN_C_API XnStatus xnSetPowerLineFrequency(XnNodeHandle hGenerator, XnPowerLineFr
  * @param	hGenerator	[in]	A handle to the instance.
  * @returns (XnUInt32)-1 if node does not support this capability
  */
-XN_C_API XnPowerLineFrequency xnGetPowerLineFrequency(XnNodeHandle hGenerator);
+XN_C_API XnPowerLineFrequency XN_C_DECL xnGetPowerLineFrequency(XnNodeHandle hGenerator);
 
 /**
  * @brief Registers a callback function to power line frequency changes.
@@ -961,7 +965,7 @@ XN_C_API XnPowerLineFrequency xnGetPowerLineFrequency(XnNodeHandle hGenerator);
  * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
  * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromPowerLineFrequencyChange().
  */
-XN_C_API XnStatus xnRegisterToPowerLineFrequencyChange
+XN_C_API XnStatus XN_C_DECL xnRegisterToPowerLineFrequencyChange
 	(XnNodeHandle hGenerator, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
@@ -971,7 +975,7 @@ XN_C_API XnStatus xnRegisterToPowerLineFrequencyChange
  * @param	hGenerator	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToPowerLineFrequencyChange().
  */
-XN_C_API void xnUnregisterFromPowerLineFrequencyChange
+XN_C_API void XN_C_DECL xnUnregisterFromPowerLineFrequencyChange
 	(XnNodeHandle hGenerator, XnCallbackHandle hCallback);
 
 /** @} */
@@ -996,7 +1000,7 @@ XN_C_API void xnUnregisterFromPowerLineFrequencyChange
  * @param	pQuery				[in]	Optional. Can be used to select which depth generator to create. If not specified, this function may create any depth generator that is available.
  * @param	pErrors				[in]	Optional. If provided, will be filled with information about depth generators that could not be created.
  */
-XN_C_API XnStatus xnCreateDepthGenerator(
+XN_C_API XnStatus XN_C_DECL xnCreateDepthGenerator(
 	XnContext* pContext,
 	XnNodeHandle* phDepthGenerator,
 	XnNodeQuery* pQuery, 
@@ -1009,7 +1013,7 @@ XN_C_API XnStatus xnCreateDepthGenerator(
  *
  * @returns	-1 if this production node is not a depth generator.
  */
-XN_C_API XnDepthPixel xnGetDeviceMaxDepth(XnNodeHandle hInstance);
+XN_C_API XnDepthPixel XN_C_DECL xnGetDeviceMaxDepth(XnNodeHandle hInstance);
 
 /** 
  * @brief Gets the Field-Of-View of the depth generator, in radians.
@@ -1019,7 +1023,7 @@ XN_C_API XnDepthPixel xnGetDeviceMaxDepth(XnNodeHandle hInstance);
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a depth generator.
  */
-XN_C_API XnStatus xnGetDepthFieldOfView(XnNodeHandle hInstance, XnFieldOfView* pFOV);
+XN_C_API XnStatus XN_C_DECL xnGetDepthFieldOfView(XnNodeHandle hInstance, XnFieldOfView* pFOV);
 
 /**
  * @brief Registers a callback function to field of view changes.
@@ -1031,7 +1035,7 @@ XN_C_API XnStatus xnGetDepthFieldOfView(XnNodeHandle hInstance, XnFieldOfView* p
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the User Position capability.
  */
-XN_C_API XnStatus xnRegisterToDepthFieldOfViewChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
+XN_C_API XnStatus XN_C_DECL xnRegisterToDepthFieldOfViewChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
 /**
@@ -1040,7 +1044,7 @@ XN_C_API XnStatus xnRegisterToDepthFieldOfViewChange(XnNodeHandle hInstance, XnS
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToDepthFieldOfViewChange.
  */
-XN_C_API void xnUnregisterFromDepthFieldOfViewChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterFromDepthFieldOfViewChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /**
  * @brief Converts a list of points from projective coordinates to real world coordinates.
@@ -1052,7 +1056,7 @@ XN_C_API void xnUnregisterFromDepthFieldOfViewChange(XnNodeHandle hInstance, XnC
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a depth generator.
  */
-XN_C_API XnStatus xnConvertProjectiveToRealWorld(
+XN_C_API XnStatus XN_C_DECL xnConvertProjectiveToRealWorld(
 	XnNodeHandle hInstance, XnUInt32 nCount, const XnPoint3D* aProjective, XnPoint3D* aRealWorld);
 
 /**
@@ -1065,7 +1069,7 @@ XN_C_API XnStatus xnConvertProjectiveToRealWorld(
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a depth generator.
  */
-XN_C_API XnStatus xnConvertRealWorldToProjective(
+XN_C_API XnStatus XN_C_DECL xnConvertRealWorldToProjective(
 	XnNodeHandle hInstance, XnUInt32 nCount, const XnPoint3D* aRealWorld, XnPoint3D* aProjective);
 
 /** 
@@ -1075,7 +1079,7 @@ XN_C_API XnStatus xnConvertRealWorldToProjective(
  *
  * @returns	NULL if this production node is not a depth generator.
  */
-XN_C_API XnDepthPixel* xnGetDepthMap(XnNodeHandle hInstance);
+XN_C_API XnDepthPixel* XN_C_DECL xnGetDepthMap(XnNodeHandle hInstance);
 
 /**
  * @brief Gets the current depth-map meta data.
@@ -1083,7 +1087,7 @@ XN_C_API XnDepthPixel* xnGetDepthMap(XnNodeHandle hInstance);
  * @param	hInstance	[in]		A handle to the instance.
  * @param	pMetaData	[in]		The struct to be filled.
  */
-XN_C_API void xnGetDepthMetaData(XnNodeHandle hInstance, XnDepthMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnGetDepthMetaData(XnNodeHandle hInstance, XnDepthMetaData* pMetaData);
 
 /** @} */
 
@@ -1106,7 +1110,7 @@ XN_C_API void xnGetDepthMetaData(XnNodeHandle hInstance, XnDepthMetaData* pMetaD
  *
  * @returns	0 if this production node does not support the User Position capability.
  */
-XN_C_API XnUInt32 xnGetSupportedUserPositionsCount(XnNodeHandle hInstance);
+XN_C_API XnUInt32 XN_C_DECL xnGetSupportedUserPositionsCount(XnNodeHandle hInstance);
 
 /** 
  * @brief Sets the current user position. 
@@ -1117,7 +1121,7 @@ XN_C_API XnUInt32 xnGetSupportedUserPositionsCount(XnNodeHandle hInstance);
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the User Position capability.
  */
-XN_C_API XnStatus xnSetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, const XnBoundingBox3D* pPosition);
+XN_C_API XnStatus XN_C_DECL xnSetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, const XnBoundingBox3D* pPosition);
 
 /** 
  * @brief Gets the current user position. 
@@ -1128,7 +1132,7 @@ XN_C_API XnStatus xnSetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, con
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the User Position capability.
  */
-XN_C_API XnStatus xnGetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, XnBoundingBox3D* pPosition);
+XN_C_API XnStatus XN_C_DECL xnGetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, XnBoundingBox3D* pPosition);
 
 /**
  * @brief Registers a callback function to user position changes.
@@ -1140,7 +1144,7 @@ XN_C_API XnStatus xnGetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, XnB
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the User Position capability.
  */
-XN_C_API XnStatus xnRegisterToUserPositionChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
+XN_C_API XnStatus XN_C_DECL xnRegisterToUserPositionChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
 /**
@@ -1149,7 +1153,7 @@ XN_C_API XnStatus xnRegisterToUserPositionChange(XnNodeHandle hInstance, XnState
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToUserPositionChange.
  */
-XN_C_API void xnUnregisterFromUserPositionChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterFromUserPositionChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /** @} */
 
@@ -1174,7 +1178,7 @@ XN_C_API void xnUnregisterFromUserPositionChange(XnNodeHandle hInstance, XnCallb
  * @param	pQuery				[in]	Optional. Can be used to select which image generator to create. If not specified, this function may create any image generator that is available.
  * @param	pErrors				[in]	Optional. If provided, will be filled with information about image generators that could not be created.
  */
-XN_C_API XnStatus xnCreateImageGenerator(
+XN_C_API XnStatus XN_C_DECL xnCreateImageGenerator(
 	XnContext* pContext,
 	XnNodeHandle* phImageGenerator,
 	XnNodeQuery* pQuery, 
@@ -1189,7 +1193,7 @@ XN_C_API XnStatus xnCreateImageGenerator(
  *
  * @returns	NULL if this production node is not an image generator.
  */
-XN_C_API XnRGB24Pixel* xnGetRGB24ImageMap(XnNodeHandle hInstance);
+XN_C_API XnRGB24Pixel* XN_C_DECL xnGetRGB24ImageMap(XnNodeHandle hInstance);
 
 /** 
  * @brief Gets the current YUV422 image-map. 
@@ -1199,7 +1203,7 @@ XN_C_API XnRGB24Pixel* xnGetRGB24ImageMap(XnNodeHandle hInstance);
  *
  * @returns	NULL if this production node is not an image generator.
  */
-XN_C_API XnYUV422DoublePixel* xnGetYUV422ImageMap(XnNodeHandle hInstance);
+XN_C_API XnYUV422DoublePixel* XN_C_DECL xnGetYUV422ImageMap(XnNodeHandle hInstance);
 
 /** 
  * @brief Gets the current Grayscale8 image-map. 
@@ -1209,7 +1213,7 @@ XN_C_API XnYUV422DoublePixel* xnGetYUV422ImageMap(XnNodeHandle hInstance);
  *
  * @returns	NULL if this production node is not an image generator.
  */
-XN_C_API XnGrayscale8Pixel* xnGetGrayscale8ImageMap(XnNodeHandle hInstance);
+XN_C_API XnGrayscale8Pixel* XN_C_DECL xnGetGrayscale8ImageMap(XnNodeHandle hInstance);
 
 /** 
  * @brief Gets the current Grayscale16 image-map. 
@@ -1219,7 +1223,7 @@ XN_C_API XnGrayscale8Pixel* xnGetGrayscale8ImageMap(XnNodeHandle hInstance);
  *
  * @returns	NULL if this production node is not an image generator.
  */
-XN_C_API XnGrayscale16Pixel* xnGetGrayscale16ImageMap(XnNodeHandle hInstance);
+XN_C_API XnGrayscale16Pixel* XN_C_DECL xnGetGrayscale16ImageMap(XnNodeHandle hInstance);
 
 /** 
  * @brief Gets the current image-map as a byte buffer. 
@@ -1233,7 +1237,7 @@ XN_C_API XnGrayscale16Pixel* xnGetGrayscale16ImageMap(XnNodeHandle hInstance);
  *
  * @returns	NULL if this production node is not an image generator.
  */
-XN_C_API XnUInt8* xnGetImageMap(XnNodeHandle hInstance);
+XN_C_API XnUInt8* XN_C_DECL xnGetImageMap(XnNodeHandle hInstance);
 
 /**
  * @brief Checks if a specific pixel format is supported.
@@ -1241,7 +1245,7 @@ XN_C_API XnUInt8* xnGetImageMap(XnNodeHandle hInstance);
  * @param	hInstance	[in]		A handle to the instance.
  * @param	Format		[in]		The format to check for.
  */
-XN_C_API XnBool xnIsPixelFormatSupported(XnNodeHandle hInstance, XnPixelFormat Format);
+XN_C_API XnBool XN_C_DECL xnIsPixelFormatSupported(XnNodeHandle hInstance, XnPixelFormat Format);
 
 /**
  * @brief Sets the pixel format of the image map.
@@ -1251,7 +1255,7 @@ XN_C_API XnBool xnIsPixelFormatSupported(XnNodeHandle hInstance, XnPixelFormat F
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node is not an image generator.
  */
-XN_C_API XnStatus xnSetPixelFormat(XnNodeHandle hInstance, XnPixelFormat Format);
+XN_C_API XnStatus XN_C_DECL xnSetPixelFormat(XnNodeHandle hInstance, XnPixelFormat Format);
 
 /**
  * @brief Gets current pixel format.
@@ -1260,7 +1264,7 @@ XN_C_API XnStatus xnSetPixelFormat(XnNodeHandle hInstance, XnPixelFormat Format)
  *
  * @returns	-1 if this production node is not an image generator.
  */
-XN_C_API XnPixelFormat xnGetPixelFormat(XnNodeHandle hInstance);
+XN_C_API XnPixelFormat XN_C_DECL xnGetPixelFormat(XnNodeHandle hInstance);
 
 /**
  * @brief Registers a callback function to pixel format changes.
@@ -1272,7 +1276,7 @@ XN_C_API XnPixelFormat xnGetPixelFormat(XnNodeHandle hInstance);
  *
  * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the User Position capability.
  */
-XN_C_API XnStatus xnRegisterToPixelFormatChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
+XN_C_API XnStatus XN_C_DECL xnRegisterToPixelFormatChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
 /**
@@ -1281,7 +1285,7 @@ XN_C_API XnStatus xnRegisterToPixelFormatChange(XnNodeHandle hInstance, XnStateC
  * @param	hInstance	[in]	A handle to the instance.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToPixelFormatChange.
  */
-XN_C_API void xnUnregisterFromPixelFormatChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterFromPixelFormatChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /**
  * @brief Gets the current image-map meta data.
@@ -1289,7 +1293,7 @@ XN_C_API void xnUnregisterFromPixelFormatChange(XnNodeHandle hInstance, XnCallba
  * @param	hInstance	[in]		A handle to the instance.
  * @param	pMetaData	[in]		The struct to be filled.
  */
-XN_C_API void xnGetImageMetaData(XnNodeHandle hInstance, XnImageMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnGetImageMetaData(XnNodeHandle hInstance, XnImageMetaData* pMetaData);
 
 /** @} */
 
@@ -1313,7 +1317,7 @@ XN_C_API void xnGetImageMetaData(XnNodeHandle hInstance, XnImageMetaData* pMetaD
  * @param	pQuery				[in]	Optional. Can be used to select which IR generator to create. If not specified, this function may create any IR generator that is available.
  * @param	pErrors				[in]	Optional. If provided, will be filled with information about IR generators that could not be created.
  */
-XN_C_API XnStatus xnCreateIRGenerator(
+XN_C_API XnStatus XN_C_DECL xnCreateIRGenerator(
 	XnContext* pContext,
 	XnNodeHandle* phIRGenerator,
 	XnNodeQuery* pQuery, 
@@ -1327,7 +1331,7 @@ XN_C_API XnStatus xnCreateIRGenerator(
  *
  * @returns	NULL if this production node is not an IR generator.
  */
-XN_C_API XnIRPixel* xnGetIRMap(XnNodeHandle hInstance);
+XN_C_API XnIRPixel* XN_C_DECL xnGetIRMap(XnNodeHandle hInstance);
 
 /**
  * @brief Gets the current IR-map meta data.
@@ -1335,7 +1339,7 @@ XN_C_API XnIRPixel* xnGetIRMap(XnNodeHandle hInstance);
  * @param	hInstance	[in]		A handle to the instance.
  * @param	pMetaData	[in]		The struct to be filled.
  */
-XN_C_API void xnGetIRMetaData(XnNodeHandle hInstance, XnIRMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnGetIRMetaData(XnNodeHandle hInstance, XnIRMetaData* pMetaData);
 
 /** @} */
 
@@ -1359,7 +1363,7 @@ XN_C_API void xnGetIRMetaData(XnNodeHandle hInstance, XnIRMetaData* pMetaData);
  * @param	pQuery					[in]	Optional. Can be used to select which Gesture node to create. If not specified, this function may create any gesture node that is available.
  * @param	pErrors					[in]	Optional. If provided, will be filled with information about gesture nodes that could not be created.
  */
-XN_C_API XnStatus xnCreateGestureGenerator(
+XN_C_API XnStatus XN_C_DECL xnCreateGestureGenerator(
 	XnContext* pContext,
 	XnNodeHandle* phGestureGenerator,
 	XnNodeQuery* pQuery, 
@@ -1373,14 +1377,14 @@ XN_C_API XnStatus xnCreateGestureGenerator(
  * @param	strGesture	[in]		The name of the gesture to look for
  * @param	pArea		[in]		The area in which to look for the gesture (in Real-World coordinates)
  */
-XN_C_API XnStatus xnAddGesture(XnNodeHandle hInstance, const XnChar* strGesture, XnBoundingBox3D* pArea);
+XN_C_API XnStatus XN_C_DECL xnAddGesture(XnNodeHandle hInstance, const XnChar* strGesture, XnBoundingBox3D* pArea);
 /**
  * @brief Turn off gesture.  The generator will no longer look for this gesture
  *
  * @param	hInstance	[in]		A handle to the instance
  * @param	strGesture	[in]		The name of the gesture to not look for anymore
  */
-XN_C_API XnStatus xnRemoveGesture(XnNodeHandle hInstance, const XnChar* strGesture);
+XN_C_API XnStatus XN_C_DECL xnRemoveGesture(XnNodeHandle hInstance, const XnChar* strGesture);
 /**
  * @brief Get the names of the gestures that are currently active
  * 
@@ -1388,15 +1392,16 @@ XN_C_API XnStatus xnRemoveGesture(XnNodeHandle hInstance, const XnChar* strGestu
  * @param	pstrGestures	[out]		Preallocated memory, for the gesture names
  * @param	nGestures		[in,out]	The size of the preallocated memory. Changed to number of gestures
  */
-XN_C_API XnStatus xnGetActiveGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt16* nGestures);
+XN_C_API XnStatus XN_C_DECL xnGetActiveGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt16* nGestures);
 /**
  * @brief Get the names of the gestures that are currently active
  * 
  * @param	hInstance		[in]		A handle to the instance
  * @param	pstrGestures	[out]		Preallocated memory, for the gesture names
+ * @param	nNameLength		[in]		Memory size for each gesture name
  * @param	nGestures		[in,out]	The size of the preallocated memory. Changed to number of gestures
  */
-XN_C_API XnStatus xnGetAllActiveGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* nGestures);
+XN_C_API XnStatus XN_C_DECL xnGetAllActiveGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* nGestures);
 /**
  * @brief Get the names of all gestures available
  * 
@@ -1404,29 +1409,40 @@ XN_C_API XnStatus xnGetAllActiveGestures(XnNodeHandle hInstance, XnChar** pstrGe
  * @param	pstrGestures	[out]		Preallocated memory, for the gesture names
  * @param	nGestures		[in,out]	The size of the preallocated memory. Changed to number of gestures
  */
-XN_C_API XnStatus xnEnumerateGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt16* nGestures);
+XN_C_API XnStatus XN_C_DECL xnEnumerateGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt16* nGestures);
 /**
  * @brief Get the names of all gestures available
  * 
  * @param	hInstance		[in]		A handle to the instance
  * @param	pstrGestures	[out]		Preallocated memory, for the gesture names
+ * @param	nNameLength		[in]		Memory size for each gesture name
  * @param	nGestures		[in,out]	The size of the preallocated memory. Changed to number of gestures
  */
-XN_C_API XnStatus xnEnumerateAllGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* nGestures);
+XN_C_API XnStatus XN_C_DECL xnEnumerateAllGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* nGestures);
+
+/**
+ * @brief Get the number of all gestures available
+ * 
+ * @param	hInstance		[in]		A handle to the instance
+ * @return the number of gestures available
+ */
+XN_C_API XnUInt16 XN_C_DECL xnGetNumberOfAvailableGestures(XnNodeHandle hInstance);
+
+
 /**
  * @brief Check if a specific gesture is available in this generator
  * 
  * @param	hInstance	[in]		A handle to the instance
  * @param	strGesture	[in]		Name of the gesture to check
  */
-XN_C_API XnBool xnIsGestureAvailable(XnNodeHandle hInstance, const XnChar* strGesture);
+XN_C_API XnBool XN_C_DECL xnIsGestureAvailable(XnNodeHandle hInstance, const XnChar* strGesture);
 /**
  * @brief Check if the specific gesture supports 'in progress' callbacks
  * 
  * @param	hInstance	[in]		A handle to the instance
  * @param	strGesture	[in]		Name of the gesture to check
  */
-XN_C_API XnBool xnIsGestureProgressSupported(XnNodeHandle hInstance, const XnChar* strGesture);
+XN_C_API XnBool XN_C_DECL xnIsGestureProgressSupported(XnNodeHandle hInstance, const XnChar* strGesture);
 /**
  * @brief Register to all gesture callbacks.
  * 
@@ -1436,14 +1452,14 @@ XN_C_API XnBool xnIsGestureProgressSupported(XnNodeHandle hInstance, const XnCha
  * @param	pCookie			[in]	User's cookie, to be delivered to the callbacks
  * @param	phCallback		[out]	The handle to these callbacks, to allow unregistration
  */
-XN_C_API XnStatus xnRegisterGestureCallbacks(XnNodeHandle hInstance, XnGestureRecognized RecognizedCB, XnGestureProgress ProgressCB, void* pCookie, XnCallbackHandle* phCallback);
+XN_C_API XnStatus XN_C_DECL xnRegisterGestureCallbacks(XnNodeHandle hInstance, XnGestureRecognized RecognizedCB, XnGestureProgress ProgressCB, void* pCookie, XnCallbackHandle* phCallback);
 /**
  * @brief Unregister from gesture callbacks
  * 
  * @param	hInstance	[in]		A handle to the instance
  * @param	hCallback	[in]		The handle received from registration
  */
-XN_C_API void xnUnregisterGestureCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterGestureCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 /**
  * @brief Register to when gestures are added or removed
  * 
@@ -1452,15 +1468,47 @@ XN_C_API void xnUnregisterGestureCallbacks(XnNodeHandle hInstance, XnCallbackHan
  * @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
  * @param	phCallback	[out]		The handle to these callbacks, to allow unregistration
  */
-XN_C_API XnStatus xnRegisterToGestureChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
+XN_C_API XnStatus XN_C_DECL xnRegisterToGestureChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
 /**
  * @brief Unregister from when gestures are added or removed
  * 
  * @param	hInstance	[in]		A handle to the instance
  * @param	hCallback	[in]		The handle received from registration
  */
-XN_C_API void xnUnregisterFromGestureChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterFromGestureChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
+/**
+ * @brief Register to when a gesture is in progress
+ *
+ * @param	hInstance	[in]		A handle to the instance
+ * @param	handler		[in]		The callback to be called when the gesture is in progress
+ * @param	pCookie		[in]		User's cookie, to be delivered to the callback
+ * @param	phCallback	[out]		The handle to the callback, to allow unregistration
+ */
+XN_C_API XnStatus XN_C_DECL xnRegisterToGestureIntermediateStageCompleted(XnNodeHandle hInstance, XnGestureIntermediateStageCompleted handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+ * @brief Unregister from when a gesture is in progress
+ * 
+ * @param	hInstance	[in]		A handle to the instance
+ * @param	hCallback	[in]		The handle received from registration
+ */
+XN_C_API void XN_C_DECL xnUnregisterFromGestureIntermediateStageCompleted(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+/**
+ * @brief Register to when a gesture is ready for its next stage (specific to the gesture)
+ *
+ * @param	hInstance	[in]		A handle to the instance
+ * @param	handler		[in]		The callback to be called when the gesture is ready for its next stage
+ * @param	pCookie		[in]		User's cookie, to be delivered to the callback
+ * @param	phCallback	[out]		The handle to this callback, to allow unregistration
+ */
+XN_C_API XnStatus XN_C_DECL xnRegisterToGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, XnGestureReadyForNextIntermediateStage handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+ * @brief Unregister from when a gesture is ready for its next stage
+ * 
+ * @param	hInstance	[in]		A handle to the instance
+ * @param	hCallback	[in]		The handle received from registration
+ */
+XN_C_API void XN_C_DECL xnUnregisterFromGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 /** @} */
 
 //---------------------------------------------------------------------------
@@ -1483,7 +1531,7 @@ XN_C_API void xnUnregisterFromGestureChange(XnNodeHandle hInstance, XnCallbackHa
  * @param	pQuery				[in]	Optional. Can be used to select which scene analyzer to create. If not specified, this function may create any scene analyzer that is available.
  * @param	pErrors				[in]	Optional. If provided, will be filled with information about scene analyzers that could not be created.
  */
-XN_C_API XnStatus xnCreateSceneAnalyzer(
+XN_C_API XnStatus XN_C_DECL xnCreateSceneAnalyzer(
 	XnContext* pContext,
 	XnNodeHandle* phSceneAnalyzer,
 	XnNodeQuery* pQuery, 
@@ -1495,14 +1543,14 @@ XN_C_API XnStatus xnCreateSceneAnalyzer(
  * 
  * @param	hInstance	[in]		A handle to the instance
  */
-XN_C_API const XnLabel* xnGetLabelMap(XnNodeHandle hInstance);
+XN_C_API const XnLabel* XN_C_DECL xnGetLabelMap(XnNodeHandle hInstance);
 /**
  * @brief Gets a description of the floor, if it was found.
  * 
  * @param	hInstance	[in]		A handle to the instance
  * @param	pPlane		[out]		A description of the floor
  */
-XN_C_API XnStatus xnGetFloor(XnNodeHandle hInstance, XnPlane3D* pPlane);
+XN_C_API XnStatus XN_C_DECL xnGetFloor(XnNodeHandle hInstance, XnPlane3D* pPlane);
 
 /**
  * @brief Gets the current scene meta data.
@@ -1510,7 +1558,7 @@ XN_C_API XnStatus xnGetFloor(XnNodeHandle hInstance, XnPlane3D* pPlane);
  * @param	hInstance	[in]		A handle to the instance.
  * @param	pMetaData	[in]		The struct to be filled.
  */
-XN_C_API void xnGetSceneMetaData(XnNodeHandle hInstance, XnSceneMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnGetSceneMetaData(XnNodeHandle hInstance, XnSceneMetaData* pMetaData);
 
 /** @} */
 
@@ -1534,7 +1582,7 @@ XN_C_API void xnGetSceneMetaData(XnNodeHandle hInstance, XnSceneMetaData* pMetaD
  * @param	pQuery				[in]	Optional. Can be used to select which user generator to create. If not specified, this function may create any user generator that is available.
  * @param	pErrors				[in]	Optional. If provided, will be filled with information about user generators that could not be created.
  */
-XN_C_API XnStatus xnCreateUserGenerator(
+XN_C_API XnStatus XN_C_DECL xnCreateUserGenerator(
 	XnContext* pContext,
 	XnNodeHandle* phUserGenerator,
 	XnNodeQuery* pQuery, 
@@ -1546,7 +1594,7 @@ XN_C_API XnStatus xnCreateUserGenerator(
  *
  * @param	hInstance	[in]		A handle to the instance
  */
-XN_C_API XnUInt16 xnGetNumberOfUsers(XnNodeHandle hInstance);
+XN_C_API XnUInt16 XN_C_DECL xnGetNumberOfUsers(XnNodeHandle hInstance);
 /**
  * @brief Get the current users
  *
@@ -1554,7 +1602,7 @@ XN_C_API XnUInt16 xnGetNumberOfUsers(XnNodeHandle hInstance);
  * @param	pUsers		[out]		Preallocated memory for the users
  * @param	pnUsers		[in,out]	The size of the preallocated memory. Changes to the number of users
  */
-XN_C_API XnStatus xnGetUsers(XnNodeHandle hInstance, XnUserID* pUsers, XnUInt16* pnUsers);
+XN_C_API XnStatus XN_C_DECL xnGetUsers(XnNodeHandle hInstance, XnUserID* pUsers, XnUInt16* pnUsers);
 /**
  * @brief Get the center of mass of a user
  *
@@ -1562,7 +1610,7 @@ XN_C_API XnStatus xnGetUsers(XnNodeHandle hInstance, XnUserID* pUsers, XnUInt16*
  * @param	user		[in]		The user for which to get the center of mass
  * @param	pCoM		[out]		The center of mass
  */
-XN_C_API XnStatus xnGetUserCoM(XnNodeHandle hInstance, XnUserID user, XnPoint3D* pCoM);
+XN_C_API XnStatus XN_C_DECL xnGetUserCoM(XnNodeHandle hInstance, XnUserID user, XnPoint3D* pCoM);
 /**
  * @brief Get the pixels that belong to a user.
  *
@@ -1575,7 +1623,7 @@ XN_C_API XnStatus xnGetUserCoM(XnNodeHandle hInstance, XnUserID user, XnPoint3D*
  * @param	user		[in]		The user for which to get the pixels
  * @param	pScene		[out]		XnSceneMetaData object, that holds the pixels of the user
  */
-XN_C_API XnStatus xnGetUserPixels(XnNodeHandle hInstance, XnUserID user, XnSceneMetaData* pScene);
+XN_C_API XnStatus XN_C_DECL xnGetUserPixels(XnNodeHandle hInstance, XnUserID user, XnSceneMetaData* pScene);
 /**
  * @brief Register to user callbacks
  *
@@ -1585,15 +1633,47 @@ XN_C_API XnStatus xnGetUserPixels(XnNodeHandle hInstance, XnUserID user, XnScene
  * @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
  * @param	phCallback	[out]		The handle to these callbacks, to allow unregistration
  */
-XN_C_API XnStatus xnRegisterUserCallbacks(XnNodeHandle hInstance, XnUserHandler NewUserCB, XnUserHandler LostUserCB, void* pCookie, XnCallbackHandle* phCallback);
+XN_C_API XnStatus XN_C_DECL xnRegisterUserCallbacks(XnNodeHandle hInstance, XnUserHandler NewUserCB, XnUserHandler LostUserCB, void* pCookie, XnCallbackHandle* phCallback);
 /**
  * @brief Unregister from user callbacks
  *
  * @param	hInstance	[in]		A handle to the instance
  * @param	hCallback	[in]		The handle received from registration
  */
-XN_C_API void xnUnregisterUserCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterUserCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
+/**
+ * @brief Register to when the user exits the scene (but not lost yet)
+ *
+ * @param	hInstance	[in]		A handle to the instance
+ * @param	handler		[in]		Callback to be called when a user leaves the scene
+ * @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
+ * @param	phCallback	[out]		The handle to this callback, to allow unregistration
+ */
+XN_C_API XnStatus XN_C_DECL xnRegisterToUserExit(XnNodeHandle hInstance, XnUserHandler handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+ * @brief Unregister from when a user exits the scene
+ *
+ * @param	hInstance	[in]		A handle to the instance
+ * @param	hCallback	[in]		The handle received from registration
+ */
+XN_C_API void XN_C_DECL xnUnregisterFromUserExit(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+/**
+ * @brief Register to when a user re-enters the scene after exiting
+ *
+ * @param	hInstance	[in]		A handle to the instance
+ * @param	handler		[in]		Callback to be called when a user leaves the scene
+ * @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
+ * @param	phCallback	[out]		The handle to this callback, to allow unregistration
+ */
+XN_C_API XnStatus XN_C_DECL xnRegisterToUserReEnter(XnNodeHandle hInstance, XnUserHandler handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+ * @brief Unregister from when a user re-enters the scene
+ *
+ * @param	hInstance	[in]		A handle to the instance
+ * @param	hCallback	[in]		The handle received from registration
+ */
+XN_C_API void XN_C_DECL xnUnregisterFromUserReEnter(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 /** @} */
 
 //---------------------------------------------------------------------------
@@ -1614,21 +1694,21 @@ XN_C_API void xnUnregisterUserCallbacks(XnNodeHandle hInstance, XnCallbackHandle
  * @param	hInstance	[in]		A handle to the instance
  * @param	eJoint		[in]		The joint to check
  */
-XN_C_API XnBool xnIsJointAvailable(XnNodeHandle hInstance, XnSkeletonJoint eJoint);
+XN_C_API XnBool XN_C_DECL xnIsJointAvailable(XnNodeHandle hInstance, XnSkeletonJoint eJoint);
 /**
 * @brief Check if generator supports a specific profile.
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	eProfile	[in]		The profile to check
 */
-XN_C_API XnBool xnIsProfileAvailable(XnNodeHandle hInstance, XnSkeletonProfile eProfile);
+XN_C_API XnBool XN_C_DECL xnIsProfileAvailable(XnNodeHandle hInstance, XnSkeletonProfile eProfile);
 /**
 * @brief Set the profile. this will set some joints to be active, and others to be inactive.
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	eProfile	[in]		The profile to set
 */
-XN_C_API XnStatus xnSetSkeletonProfile(XnNodeHandle hInstance, XnSkeletonProfile eProfile);
+XN_C_API XnStatus XN_C_DECL xnSetSkeletonProfile(XnNodeHandle hInstance, XnSkeletonProfile eProfile);
 /**
 * @brief Change the state of a specific joint, to be active or inactive
 *
@@ -1636,14 +1716,14 @@ XN_C_API XnStatus xnSetSkeletonProfile(XnNodeHandle hInstance, XnSkeletonProfile
 * @param	eJoint		[in]		The joint
 * @param	bState		[in]		The new state
 */
-XN_C_API XnStatus xnSetJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint, XnBool bState);
+XN_C_API XnStatus XN_C_DECL xnSetJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint, XnBool bState);
 /**
 * @brief Check if joint is currently active
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	eJoint		[in]		The joint to check
 */
-XN_C_API XnBool xnIsJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint);
+XN_C_API XnBool XN_C_DECL xnIsJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint);
 /**
 * @brief Register to joint configuration changes - when joints are activated and deactivated
 *
@@ -1652,14 +1732,14 @@ XN_C_API XnBool xnIsJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint);
 * @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
 * @param	phCallback	[out]		The handle to these callbacks, to allow unregistration
 */
-XN_C_API XnStatus xnRegisterToJointConfigurationChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
+XN_C_API XnStatus XN_C_DECL xnRegisterToJointConfigurationChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
 /**
 * @brief Unregister from joint configuration changes
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
-XN_C_API void xnUnregisterFromJointConfigurationChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterFromJointConfigurationChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 /**
 * @brief Get all active joints
 *
@@ -1667,7 +1747,7 @@ XN_C_API void xnUnregisterFromJointConfigurationChange(XnNodeHandle hInstance, X
 * @param	pJoints		[out]		Preallocated memory for the joints
 * @param	pnJoints	[in,out]	The size of the preallocated memory. Changed to the number of the active joints.
 */
-XN_C_API XnStatus xnEnumerateActiveJoints(XnNodeHandle hInstance, XnSkeletonJoint* pJoints, XnUInt16* pnJoints);
+XN_C_API XnStatus XN_C_DECL xnEnumerateActiveJoints(XnNodeHandle hInstance, XnSkeletonJoint* pJoints, XnUInt16* pnJoints);
 /**
 * @brief Get a specific joint's full information
 *
@@ -1676,7 +1756,7 @@ XN_C_API XnStatus xnEnumerateActiveJoints(XnNodeHandle hInstance, XnSkeletonJoin
 * @param	eJoint		[in]		The interesting joint
 * @param	pJoint		[out]		The joint's full information
 */
-XN_C_API XnStatus xnGetSkeletonJoint(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointTransformation* pJoint);
+XN_C_API XnStatus XN_C_DECL xnGetSkeletonJoint(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointTransformation* pJoint);
 /**
 * @brief Get a specific joint's position
 *
@@ -1685,7 +1765,7 @@ XN_C_API XnStatus xnGetSkeletonJoint(XnNodeHandle hInstance, XnUserID user, XnSk
 * @param	eJoint		[in]		The interesting joint
 * @param	pJoint		[out]		The joint's current position
 */
-XN_C_API XnStatus xnGetSkeletonJointPosition(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointPosition* pJoint);
+XN_C_API XnStatus XN_C_DECL xnGetSkeletonJointPosition(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointPosition* pJoint);
 /**
 * @brief Get a specific joint's orientation
 *
@@ -1694,28 +1774,28 @@ XN_C_API XnStatus xnGetSkeletonJointPosition(XnNodeHandle hInstance, XnUserID us
 * @param	eJoint		[in]		The interesting joint
 * @param	pJoint		[out]		The joint's current orientation
 */
-XN_C_API XnStatus xnGetSkeletonJointOrientation(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointOrientation* pJoint);
+XN_C_API XnStatus XN_C_DECL xnGetSkeletonJointOrientation(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointOrientation* pJoint);
 /**
  * @brief Check if skeleton is being tracked
  *
  * @param	hInstance	[in]		A handle to the instance
  * @param	user		[in]		Id of the user to check
  */
-XN_C_API XnBool xnIsSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
+XN_C_API XnBool XN_C_DECL xnIsSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
 /**
 * @brief Check if skeleton is being calibrated
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		Id of the user to check
 */
-XN_C_API XnBool xnIsSkeletonCalibrated(XnNodeHandle hInstance, XnUserID user);
+XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrated(XnNodeHandle hInstance, XnUserID user);
 /**
 * @brief Check if skeleton is being calibrated
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		Id of the user to check
 */
-XN_C_API XnBool xnIsSkeletonCalibrating(XnNodeHandle hInstance, XnUserID user);
+XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrating(XnNodeHandle hInstance, XnUserID user);
 /**
 * @brief Request calibration when possible
 *
@@ -1723,14 +1803,14 @@ XN_C_API XnBool xnIsSkeletonCalibrating(XnNodeHandle hInstance, XnUserID user);
 * @param	user		[in]		Id of the user to check
 * @param	bForce		[in]		Disregard previous calibration
 */
-XN_C_API XnStatus xnRequestSkeletonCalibration(XnNodeHandle hInstance, XnUserID user, XnBool bForce);
+XN_C_API XnStatus XN_C_DECL xnRequestSkeletonCalibration(XnNodeHandle hInstance, XnUserID user, XnBool bForce);
 /**
 * @brief stop calibration
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		Id of the user to check
 */
-XN_C_API XnStatus xnAbortSkeletonCalibration(XnNodeHandle hInstance, XnUserID user);
+XN_C_API XnStatus XN_C_DECL xnAbortSkeletonCalibration(XnNodeHandle hInstance, XnUserID user);
 /**
 * @brief Save the calibration data to file
 *
@@ -1738,7 +1818,7 @@ XN_C_API XnStatus xnAbortSkeletonCalibration(XnNodeHandle hInstance, XnUserID us
 * @param	user		[in]	the user for which the calibration is saved
 * @param	strFileName	[in]	The file to which to save the calibration data
 */
-XN_C_API XnStatus xnSaveSkeletonCalibrationDataToFile(XnNodeHandle hInstance, XnUserID user, const XnChar* strFileName);
+XN_C_API XnStatus XN_C_DECL xnSaveSkeletonCalibrationDataToFile(XnNodeHandle hInstance, XnUserID user, const XnChar* strFileName);
 /**
 * @brief Load previously saved calibration data from file
 *
@@ -1746,7 +1826,7 @@ XN_C_API XnStatus xnSaveSkeletonCalibrationDataToFile(XnNodeHandle hInstance, Xn
 * @param	user		[in]	the user to be assigned the calibration data
 * @param	strFileName	[in]	The file from which to load the calibration data.
 */
-XN_C_API XnStatus xnLoadSkeletonCalibrationDataFromFile(XnNodeHandle hInstance, XnUserID user, const XnChar* strFileName);
+XN_C_API XnStatus XN_C_DECL xnLoadSkeletonCalibrationDataFromFile(XnNodeHandle hInstance, XnUserID user, const XnChar* strFileName);
 /**
  * @brief Save the calibration data
  *
@@ -1754,7 +1834,7 @@ XN_C_API XnStatus xnLoadSkeletonCalibrationDataFromFile(XnNodeHandle hInstance,
  * @param	user		[in]	the user for which the calibration is saved
  * @param	nSlot		[in]	The slot to use for saving the calibration data
  */
-XN_C_API XnStatus xnSaveSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot);
+XN_C_API XnStatus XN_C_DECL xnSaveSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot);
 /**
 * @brief Load previously saved calibration data.
 *
@@ -1762,62 +1842,62 @@ XN_C_API XnStatus xnSaveSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID
 * @param	user		[in]	the user to be assigned the calibration data
 * @param	nSlot		[in]	The slot to use for saving the calibration data.
 */
-XN_C_API XnStatus xnLoadSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot);
+XN_C_API XnStatus XN_C_DECL xnLoadSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot);
 /**
 * @brief Clear the requested slot from any saved calibration data.
 *
 * @param	hInstance	[in]	A handle to the instance
 * @param	nSlot		[in]	The slot to clear
 */
-XN_C_API XnStatus xnClearSkeletonCalibrationData(XnNodeHandle hInstance, XnUInt32 nSlot);
+XN_C_API XnStatus XN_C_DECL xnClearSkeletonCalibrationData(XnNodeHandle hInstance, XnUInt32 nSlot);
 /**
 * @brief Check if a specific slot already holds calibration data
 *
 * @param	hInstance	[in]	A handle to the instance
 * @param	nSlot		[in]	The slot to check
 */
-XN_C_API XnBool xnIsSkeletonCalibrationData(XnNodeHandle hInstance, XnUInt32 nSlot);
+XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrationData(XnNodeHandle hInstance, XnUInt32 nSlot);
 /**
 * @brief Start tracking a skeleton
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		Id of the user to check
 */
-XN_C_API XnStatus xnStartSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
+XN_C_API XnStatus XN_C_DECL xnStartSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
 /**
 * @brief Stop tracking a skeleton
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		Id of the user to check
 */
-XN_C_API XnStatus xnStopSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
+XN_C_API XnStatus XN_C_DECL xnStopSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
 /**
 * @brief Reset the skeleton - discard calibration
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		Id of the user to check
 */
-XN_C_API XnStatus xnResetSkeleton(XnNodeHandle hInstance, XnUserID user);
+XN_C_API XnStatus XN_C_DECL xnResetSkeleton(XnNodeHandle hInstance, XnUserID user);
 /**
 * @brief Check if a specific pose is required for calibration
 *
 * @param	hInstance	[in]		A handle to the instance
 */
-XN_C_API XnBool xnNeedPoseForSkeletonCalibration(XnNodeHandle hInstance);
+XN_C_API XnBool XN_C_DECL xnNeedPoseForSkeletonCalibration(XnNodeHandle hInstance);
 /**
 * @brief Get the pose that is required for calibration
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	strPose		[in]		Name of the required pose
 */
-XN_C_API XnStatus xnGetSkeletonCalibrationPose(XnNodeHandle hInstance, XnChar* strPose);
+XN_C_API XnStatus XN_C_DECL xnGetSkeletonCalibrationPose(XnNodeHandle hInstance, XnChar* strPose);
 /**
 * @brief Set the skeleton's smoothing factor
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	fFactor		[in]		The smoothing factor
 */
-XN_C_API XnStatus xnSetSkeletonSmoothing(XnNodeHandle hInstance, XnFloat fFactor);
+XN_C_API XnStatus XN_C_DECL xnSetSkeletonSmoothing(XnNodeHandle hInstance, XnFloat fFactor);
 /**
 * @brief Register to calibration callbacks.
 *
@@ -1827,15 +1907,63 @@ XN_C_API XnStatus xnSetSkeletonSmoothing(XnNodeHandle hInstance, XnFloat fFactor
 * @param	pCookie				[in]		User's cookie, to be delivered to the callbacks
 * @param	phCallback			[out]		The handle to these callbacks, to allow unregistration
 */
-XN_C_API XnStatus xnRegisterCalibrationCallbacks(XnNodeHandle hInstance, XnCalibrationStart CalibrationStartCB, XnCalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle* phCallback);
+XN_C_API XnStatus XN_API_DEPRECATED("Please use RegisterToCalibrationStart/Complete") XN_C_DECL xnRegisterCalibrationCallbacks(XnNodeHandle hInstance, XnCalibrationStart CalibrationStartCB, XnCalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle* phCallback);
 /**
 * @brief Unregister from calibration callbacks
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
-XN_C_API void xnUnregisterCalibrationCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_API_DEPRECATED("Please use UnregisterFromCalibrationStart/Complete") XN_C_DECL xnUnregisterCalibrationCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+/**
+* @brief Register to calibration start callback
+*
+* @param	hInstance	[in]	A handle to the instance
+* @param	handler		[in]	Callback to be called when calibration starts
+* @param	pCookie		[in]	User's cookie, to be delivered to the callback
+* @param	phCallback	[out]	the handle to this callback, to allow unregistration
+*/
+XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationStart(XnNodeHandle hInstance, XnCalibrationStart handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+* @brief Unregister from calibration start callback
+*
+* @param	[in]	hInstance	A handle to the instance
+* @param	[in]	hCallback	The handle received from registration
+*/
+XN_C_API void XN_C_DECL xnUnregisterFromCalibrationStart(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
+/**
+* @brief Register to calibration status while calibration is in progress
+*
+* @param	hInstance			[in]		A handle to the instance
+* @param	handler				[in]		Callback to be called when calibration is in progress
+* @param	pCookie				[in]		User's cookie, to be delivered to the callbacks
+* @param	phCallback			[out]		The handle to this callback, to allow unregistration
+*/
+XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationInProgress(XnNodeHandle hInstance, XnCalibrationInProgress handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+* @brief Unregister from calibration status while in progress
+*
+* @param	hInstance	[in]		A handle to the instance
+* @param	hCallback	[in]		The handle received from registration
+*/
+XN_C_API void XN_C_DECL xnUnregisterFromCalibrationInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+/**
+* @brief Register to when calibration is complete, with status
+*
+* @param	hInstance			[in]		A handle to the instance
+* @param	handler				[in]		Callback to be called when calibration is complete
+* @param	pCookie				[in]		User's cookie, to be delivered to the callbacks
+* @param	phCallback			[out]		The handle to this callback, to allow unregistration
+*/
+XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationComplete(XnNodeHandle hInstance, XnCalibrationComplete handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+* @brief Unregister from calibration complete with status
+*
+* @param	hInstance	[in]		A handle to the instance
+* @param	hCallback	[in]		The handle received from registration
+*/
+XN_C_API void XN_C_DECL xnUnregisterFromCalibrationComplete(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 /** @} */
 
 //---------------------------------------------------------------------------
@@ -1855,7 +1983,7 @@ XN_C_API void xnUnregisterCalibrationCallbacks(XnNodeHandle hInstance, XnCallbac
 *
 * @param	hInstance	[in]		A handle to the instance
 */
-XN_C_API XnUInt32 xnGetNumberOfPoses(XnNodeHandle hInstance);
+XN_C_API XnUInt32 XN_C_DECL xnGetNumberOfPoses(XnNodeHandle hInstance);
 /**
 * @brief Get the names of the supported poses
 *
@@ -1863,15 +1991,40 @@ XN_C_API XnUInt32 xnGetNumberOfPoses(XnNodeHandle hInstance);
 * @param	pstrPoses	[out]		Pre-allocated memory for the names of the supported poses
 * @param	pnPoses		[in,out]	In input - size of the preallocated memory, in output - the number of pose names
 */
-XN_C_API XnStatus xnGetAvailablePoses(XnNodeHandle hInstance, XnChar** pstrPoses, XnUInt32* pnPoses);
+XN_C_API XnStatus XN_C_DECL xnGetAvailablePoses(XnNodeHandle hInstance, XnChar** pstrPoses, XnUInt32* pnPoses);
 /**
 * @brief Get the names of the supported poses
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	pstrPoses	[out]		Pre-allocated memory for the names of the supported poses
+* @param	nNameLength	[in]		Memory size for each pose name
 * @param	pnPoses		[in,out]	In input - size of the preallocated memory, in output - the number of pose names
 */
-XN_C_API XnStatus xnGetAllAvailablePoses(XnNodeHandle hInstance, XnChar** pstrPoses, XnUInt32 nNameLength, XnUInt32* pnPoses);
+XN_C_API XnStatus XN_C_DECL xnGetAllAvailablePoses(XnNodeHandle hInstance, XnChar** pstrPoses, XnUInt32 nNameLength, XnUInt32* pnPoses);
+
+/**
+* @brief Tests if a pose is supported
+*
+* @param	hInstance	[in]		A handle to the instance
+* @param	strPose 	[in]		The pose string to test
+* @return   True if the pose is supported and False otherwise.
+*/
+XN_C_API XnBool XN_C_DECL xnIsPoseSupported(XnNodeHandle hInstance, const XnChar* strPose);
+
+/** 
+* @brief Gets the current pose status
+*
+* @param	hInstance	[in]	A handle to the instance
+* @param    userID      [in]    The user whose pose status we are interested in.
+* @param    poseName    [in]    The pose we want to get a status on.
+* @param    poseTime    [out]   The time stamp in which the user entered into the pose (0 if not in pose). 
+* @param    eStatus     [out]   The status of the user's pose, i.e. the progress error for getting into 
+*                               pose (XnPoseDetectionStatus, the same as received from the in progress
+*                               callback. See @ref xnRegisterToPoseDetectionInProgress).
+* @param    eState      [out]   The state of the user pose (i.e. in pose, out of pose).
+* @return   The success status. The data is invalid if failed.
+*/
+XN_C_API XnStatus xnGetPoseStatus(XnNodeHandle hInstance, XnUserID userID, const XnChar* poseName, XnUInt64* poseTime, XnPoseDetectionStatus* eStatus, XnPoseDetectionState* eState);
 /**
 * @brief Start detection of a specific pose for a specific user
 *
@@ -1879,14 +2032,22 @@ XN_C_API XnStatus xnGetAllAvailablePoses(XnNodeHandle hInstance, XnChar** pstrPo
 * @param	strPose		[in]		Name of requested pose
 * @param	user		[in]		Id of user
 */
-XN_C_API XnStatus xnStartPoseDetection(XnNodeHandle hInstance,const  XnChar* strPose, XnUserID user);
+XN_C_API XnStatus XN_C_DECL xnStartPoseDetection(XnNodeHandle hInstance,const  XnChar* strPose, XnUserID user);
 /**
 * @brief Stop detection of poses for a specific user
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		Id of user
 */
-XN_C_API XnStatus xnStopPoseDetection(XnNodeHandle hInstance, XnUserID user);
+XN_C_API XnStatus XN_C_DECL xnStopPoseDetection(XnNodeHandle hInstance, XnUserID user);
+/**
+* @brief Stop detection of a specific pose for a specific user
+*
+* @param	hInstance	[in]		A handle to the instance
+* @param	user		[in]		Id of user
+* @param	strPose		[in]		Name of the pose
+*/
+XN_C_API XnStatus XN_C_DECL xnStopSinglePoseDetection(XnNodeHandle hInstance, XnUserID user, const XnChar* strPose);
 /**
 * @brief Register to callbacks for pose events
 *
@@ -1896,14 +2057,65 @@ XN_C_API XnStatus xnStopPoseDetection(XnNodeHandle hInstance, XnUserID user);
 * @param	pCookie					[in]	User's cookie, to be delivered to the callbacks
 * @param	phCallback				[out]	The handle to these callbacks, to allow unregistration
 */
-XN_C_API XnStatus xnRegisterToPoseCallbacks(XnNodeHandle hInstance, XnPoseDetectionCallback PoseDetectionStartCB, XnPoseDetectionCallback PoseDetectionEndCB, void* pCookie, XnCallbackHandle* phCallback);
+XN_C_API XnStatus XN_API_DEPRECATED("Please use PoseDetected and/or OutOfPose callbacks") XN_C_DECL xnRegisterToPoseCallbacks(XnNodeHandle hInstance, XnPoseDetectionCallback PoseDetectionStartCB, XnPoseDetectionCallback PoseDetectionEndCB, void* pCookie, XnCallbackHandle* phCallback);
 /**
 * @brief Unregister from pose events
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
-XN_C_API void xnUnregisterFromPoseCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_API_DEPRECATED("Please use PoseDetected and/or OutOfPose callbacks") XN_C_DECL xnUnregisterFromPoseCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+
+/**
+* @brief Register to callback when a user is in pose
+*
+* @param	hInstance	[in]	A handle to the instance
+* @param	handler		[in]	Callback to be called when the pose is detected
+* @param	pCookie		[in]	User's cookie, to be delivered to the callback
+* @param	phCallback	[out]	the handle to this callback, to allow unregistration
+*/
+XN_C_API XnStatus xnRegisterToPoseDetected(XnNodeHandle hInstance, XnPoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+* @brief Unregister from pose detected callback
+*
+* @param	[in]	hInstance	A handle to the instance
+* @param	[in]	hCallback	The handle received from registration
+*/
+XN_C_API void xnUnregisterFromPoseDetected(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+
+/**
+* @brief Register to callback when a use is no longer in pose
+*
+* @param	hInstance	[in]	A handle to the instance
+* @param	handler		[in]	Callback to be called when user isn't in pose anymore
+* @param	pCookie		[in]	User's cookie, to be delivered to the callback
+* @param	phCallback	[out]	the handle to this callback, to allow unregistration
+*/
+XN_C_API XnStatus xnRegisterToOutOfPose(XnNodeHandle hInstance, XnPoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+* @brief Unregister from out of pose callback
+*
+* @param	[in]	hInstance	A handle to the instance
+* @param	[in]	hCallback	The handle received from registration
+*/
+XN_C_API void xnUnregisterFromOutOfPose(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+
+/**
+* @brief Register to callback for status when pose is detected
+*
+* @param	hInstance				[in]	A handle to the instance
+* @param	handler					[in]	Function to be called when pose detection is in progress
+* @param	pCookie					[in]	User's cookie, to be delivered to the callbacks
+* @param	phCallback				[out]	The handle to these callbacks, to allow unregistration
+*/
+XN_C_API XnStatus XN_C_DECL xnRegisterToPoseDetectionInProgress(XnNodeHandle hInstance, XnPoseDetectionInProgress handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+* @brief Unregister from pose status callback
+*
+* @param	hInstance	[in]		A handle to the instance
+* @param	hCallback	[in]		The handle received from registration
+*/
+XN_C_API void XN_C_DECL xnUnregisterFromPoseDetectionInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /** @} */
 
@@ -1927,7 +2139,7 @@ XN_C_API void xnUnregisterFromPoseCallbacks(XnNodeHandle hInstance, XnCallbackHa
  * @param	pQuery					[in]	Optional. Can be used to select which hands generator to create. If not specified, this function may create any hands generator that is available.
  * @param	pErrors					[in]	Optional. If provided, will be filled with information about hands generators that could not be created.
  */
-XN_C_API XnStatus xnCreateHandsGenerator(
+XN_C_API XnStatus XN_C_DECL xnCreateHandsGenerator(
 	XnContext* pContext,
 	XnNodeHandle* phHandsGenerator,
 	XnNodeQuery* pQuery, 
@@ -1944,42 +2156,70 @@ XN_C_API XnStatus xnCreateHandsGenerator(
 * @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
 * @param	phCallback	[out]		The handle to these callbacks, to allow unregistration
 */
-XN_C_API XnStatus xnRegisterHandCallbacks(XnNodeHandle hInstance, XnHandCreate CreateCB, XnHandUpdate UpdateCB, XnHandDestroy DestroyCB, void* pCookie, XnCallbackHandle* phCallback);
+XN_C_API XnStatus XN_C_DECL xnRegisterHandCallbacks(XnNodeHandle hInstance, XnHandCreate CreateCB, XnHandUpdate UpdateCB, XnHandDestroy DestroyCB, void* pCookie, XnCallbackHandle* phCallback);
 /**
 * @brief Unregister from hands callbacks
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
-XN_C_API void xnUnregisterHandCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API void XN_C_DECL xnUnregisterHandCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 /**
 * @brief Stop tracking a specific hand
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		The hand to stop tracking
 */
-XN_C_API XnStatus xnStopTracking(XnNodeHandle hInstance, XnUserID user);
+XN_C_API XnStatus XN_C_DECL xnStopTracking(XnNodeHandle hInstance, XnUserID user);
 /**
 * @brief Stop tracking all hands
 *
 * @param	hInstance	[in]		A handle to the instance
 */
-XN_C_API XnStatus xnStopTrackingAll(XnNodeHandle hInstance);
+XN_C_API XnStatus XN_C_DECL xnStopTrackingAll(XnNodeHandle hInstance);
 /**
 * @brief Start tracking at a specific position
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	pPosition	[in]		The position at which there is a new hand
 */
-XN_C_API XnStatus xnStartTracking(XnNodeHandle hInstance, const XnPoint3D* pPosition);
+XN_C_API XnStatus XN_C_DECL xnStartTracking(XnNodeHandle hInstance, const XnPoint3D* pPosition);
 /**
 * @brief Change smoothing factor
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	fFactor		[in]		Smoothing factor, in the range 0..1. 0 Means no smoothing, 1 means infinite smoothing. Inside the range is generator dependent.
 */
-XN_C_API XnStatus xnSetTrackingSmoothing(XnNodeHandle hInstance, XnFloat fFactor);
+XN_C_API XnStatus XN_C_DECL xnSetTrackingSmoothing(XnNodeHandle hInstance, XnFloat fFactor);
+/** @} */
+
+//---------------------------------------------------------------------------
+// Hand Touching FOV Edge Capability
+//---------------------------------------------------------------------------
+
+/** 
+* @ingroup user
+* @defgroup touchingEdge Hand Touching FOV Edge Capability
+* The Touching FOV Edge capability (@ref XN_CAPABILITY_HAND_TOUCHING_FOV_EDGE) allows callbacks when a hand (from hands generator) is touching the edge of the FOV
+* @{
+*/
 
+/**
+* @brief Register to when a hand is approaching the edge of the FOV
+*
+* @param	hInstance	[in]		A handle to the instance
+* @param	handler		[in]		Callback to be called when a hand is approaching the FOV
+* @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
+* @param	phCallback	[out]		The handle to these callbacks, to allow unregistration
+*/
+XN_C_API XnStatus XN_C_DECL xnRegisterToHandTouchingFOVEdge(XnNodeHandle hInstance, XnHandTouchingFOVEdge handler, void* pCookie, XnCallbackHandle* phCallback);
+/**
+* @brief Unregister from hand approaching the edge of the FOV
+*
+* @param	hInstance	[in]		A handle to the instance
+* @param	hCallback	[in]		The handle received from registration
+*/
+XN_C_API void XN_C_DECL xnUnregisterFromHandTouchingFOVEdge(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 /** @} */
 
 //---------------------------------------------------------------------------
@@ -2002,20 +2242,20 @@ XN_C_API XnStatus xnSetTrackingSmoothing(XnNodeHandle hInstance, XnFloat fFactor
  * @param	pQuery					[in]	Optional. Can be used to select which audio generator to create. If not specified, this function may create any audio generator that is available.
  * @param	pErrors					[in]	Optional. If provided, will be filled with information about audio generators that could not be created.
  */
-XN_C_API XnStatus xnCreateAudioGenerator(
+XN_C_API XnStatus XN_C_DECL xnCreateAudioGenerator(
 	XnContext* pContext,
 	XnNodeHandle* phAudioGenerator,
 	XnNodeQuery* pQuery, 
 	XnEnumerationErrors* pErrors
 	);
 
-XN_C_API XnUChar* xnGetAudioBuffer(XnNodeHandle hInstance);
-XN_C_API XnUInt32 xnGetSupportedWaveOutputModesCount(XnNodeHandle hInstance);
-XN_C_API XnStatus xnGetSupportedWaveOutputModes(XnNodeHandle hInstance, XnWaveOutputMode* aSupportedModes, XnUInt32* pnCount);
-XN_C_API XnStatus xnSetWaveOutputMode(XnNodeHandle hInstance, const XnWaveOutputMode* OutputMode);
-XN_C_API XnStatus xnGetWaveOutputMode(XnNodeHandle hInstance, XnWaveOutputMode* OutputMode);
-XN_C_API XnStatus xnRegisterToWaveOutputModeChanges(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
-XN_C_API void xnUnregisterFromWaveOutputModeChanges(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+XN_C_API XnUChar* XN_C_DECL xnGetAudioBuffer(XnNodeHandle hInstance);
+XN_C_API XnUInt32 XN_C_DECL xnGetSupportedWaveOutputModesCount(XnNodeHandle hInstance);
+XN_C_API XnStatus XN_C_DECL xnGetSupportedWaveOutputModes(XnNodeHandle hInstance, XnWaveOutputMode* aSupportedModes, XnUInt32* pnCount);
+XN_C_API XnStatus XN_C_DECL xnSetWaveOutputMode(XnNodeHandle hInstance, const XnWaveOutputMode* OutputMode);
+XN_C_API XnStatus XN_C_DECL xnGetWaveOutputMode(XnNodeHandle hInstance, XnWaveOutputMode* OutputMode);
+XN_C_API XnStatus XN_C_DECL xnRegisterToWaveOutputModeChanges(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
+XN_C_API void XN_C_DECL xnUnregisterFromWaveOutputModeChanges(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /**
  * @brief Gets the current audio meta data.
@@ -2023,7 +2263,7 @@ XN_C_API void xnUnregisterFromWaveOutputModeChanges(XnNodeHandle hInstance, XnCa
  * @param	hInstance	[in]		A handle to the instance.
  * @param	pMetaData	[in]		The struct to be filled.
  */
-XN_C_API void xnGetAudioMetaData(XnNodeHandle hInstance, XnAudioMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnGetAudioMetaData(XnNodeHandle hInstance, XnAudioMetaData* pMetaData);
 
 /** @} */
 
@@ -2037,11 +2277,11 @@ XN_C_API void xnGetAudioMetaData(XnNodeHandle hInstance, XnAudioMetaData* pMetaD
  * @{
  */
 
-XN_C_API XnStatus xnMockDepthSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnDepthPixel* pData);
-XN_C_API XnStatus xnMockImageSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pData);
-XN_C_API XnStatus xnMockIRSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnIRPixel* pData);
-XN_C_API XnStatus xnMockAudioSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pData);
-XN_C_API XnStatus xnMockRawSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const void* pData);
+XN_C_API XnStatus XN_C_DECL xnMockDepthSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnDepthPixel* pData);
+XN_C_API XnStatus XN_C_DECL xnMockImageSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pData);
+XN_C_API XnStatus XN_C_DECL xnMockIRSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnIRPixel* pData);
+XN_C_API XnStatus XN_C_DECL xnMockAudioSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pData);
+XN_C_API XnStatus XN_C_DECL xnMockRawSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const void* pData);
 
 /** @} */
 
@@ -2057,11 +2297,11 @@ XN_C_API XnStatus xnMockRawSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, Xn
  * @{
  */
 
-XN_C_API XnStatus xnCreateCodec(XnContext* pContext, XnCodecID codecID, XnNodeHandle hInitializerNode, XnNodeHandle* phCodec);
-XN_C_API XnCodecID xnGetCodecID(XnNodeHandle hCodec);
-XN_C_API XnStatus xnEncodeData(XnNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, 
+XN_C_API XnStatus XN_C_DECL xnCreateCodec(XnContext* pContext, XnCodecID codecID, XnNodeHandle hInitializerNode, XnNodeHandle* phCodec);
+XN_C_API XnCodecID XN_C_DECL xnGetCodecID(XnNodeHandle hCodec);
+XN_C_API XnStatus XN_C_DECL xnEncodeData(XnNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, 
 							   void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten);
-XN_C_API XnStatus xnDecodeData(XnNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, 
+XN_C_API XnStatus XN_C_DECL xnDecodeData(XnNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, 
 							   void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten);
 
 /** @} */
@@ -2084,7 +2324,7 @@ XN_C_API XnStatus xnDecodeData(XnNodeHandle hCodec, const void* pSrc, XnUInt32 n
  * @param	strFormatName	[in]	Optional. The name of the format the recorded file will be in. If NULL, file will be in ONI format.
  * @param	phRecorder		[out]	A pointer to the created recorder handle.
  */
-XN_C_API XnStatus xnCreateRecorder(XnContext* pContext, const XnChar* strFormatName, XnNodeHandle* phRecorder);
+XN_C_API XnStatus XN_C_DECL xnCreateRecorder(XnContext* pContext, const XnChar* strFormatName, XnNodeHandle* phRecorder);
 
 /**
  * @brief Tells the recorder where to record.
@@ -2093,7 +2333,17 @@ XN_C_API XnStatus xnCreateRecorder(XnContext* pContext, const XnChar* strFormatN
  * @param	destType	[in]	The type of medium to record to. Currently only XN_RECORD_MEDIUM_FILE is supported.
  * @param	strDest		[in]	Recording destination. If destType is XN_RECORD_MEDIUM_FILE, this specifies a file name.
  */
-XN_C_API XnStatus xnSetRecorderDestination(XnNodeHandle hRecorder, XnRecordMedium destType, const XnChar* strDest);
+XN_C_API XnStatus XN_C_DECL xnSetRecorderDestination(XnNodeHandle hRecorder, XnRecordMedium destType, const XnChar* strDest);
+
+/**
+ * @brief Returns the recoder's destination
+ *
+ * @param	hRecorder	[in]	A handle to the recorder
+ * @param	pDestType	[out]	The type of medium the recorder is set to record.
+ * @param	strDest		[out]	Recording destination. If destType is XN_RECORD_MEDIUM_FILE, this specifies a file name.
+ * @param	nBufSize	[in]	The size of the strDest buffer.
+ */
+XN_C_API XnStatus XN_C_DECL xnGetRecorderDestination(XnNodeHandle hRecorder, XnRecordMedium* pDestType, XnChar* strDest, XnUInt32 nBufSize);
 
 /**
  * @brief Adds a node to recording and start recording it. This function must be called on each node that is to be 
@@ -2105,7 +2355,7 @@ XN_C_API XnStatus xnSetRecorderDestination(XnNodeHandle hRecorder, XnRecordMediu
  *								(See @ref XnCodecIDs.h). If XN_CODEC_NULL is specified, a default compression 
  *								will be chosen according to the node type.
  */
-XN_C_API XnStatus xnAddNodeToRecording(XnNodeHandle hRecorder, XnNodeHandle hNode, XnCodecID compression);
+XN_C_API XnStatus XN_C_DECL xnAddNodeToRecording(XnNodeHandle hRecorder, XnNodeHandle hNode, XnCodecID compression);
 
 /**
  * @brief Removes node from recording and stop recording it. This function can be called on a node that was added to 
@@ -2114,21 +2364,21 @@ XN_C_API XnStatus xnAddNodeToRecording(XnNodeHandle hRecorder, XnNodeHandle hNod
  * @param	hRecorder	[in]	A handle to the recorder.
  * @param	hNode		[in]	The node to remove from recording.
  */
-XN_C_API XnStatus xnRemoveNodeFromRecording(XnNodeHandle hRecorder, XnNodeHandle hNode);
+XN_C_API XnStatus XN_C_DECL xnRemoveNodeFromRecording(XnNodeHandle hRecorder, XnNodeHandle hNode);
 
 /**
  * @brief Records one frame of data from each node that was added to the recorder with @ref xnAddNodeToRecording.
  *
  * @param	hRecorder	[in]	A handle to the recorder.
  */
-XN_C_API XnStatus xnRecord(XnNodeHandle hRecorder);
+XN_C_API XnStatus XN_C_DECL xnRecord(XnNodeHandle hRecorder);
 
 /**
  * @brief Gets a string representation of the recording format.
  *
  * @param	hRecorder	[in]	A handle to the recorder.
  */
-XN_C_API const XnChar* xnGetRecorderFormat(XnNodeHandle hRecorder);
+XN_C_API const XnChar* XN_C_DECL xnGetRecorderFormat(XnNodeHandle hRecorder);
 
 /** @} */
 
@@ -2151,7 +2401,7 @@ XN_C_API const XnChar* xnGetRecorderFormat(XnNodeHandle hRecorder);
  * @param	strFormatName	[in]	The name of the recording format that the created player should play.
  * @param	phPlayer		[out]	Pointer to the created player handle.
  */
-XN_C_API XnStatus xnCreatePlayer(XnContext* pContext, const XnChar* strFormatName, XnNodeHandle* phPlayer);
+XN_C_API XnStatus XN_C_DECL xnCreatePlayer(XnContext* pContext, const XnChar* strFormatName, XnNodeHandle* phPlayer);
 
 /**
  * @brief Determines whether the player will automatically rewind to the beginning of the recording when reaching the end.
@@ -2162,7 +2412,7 @@ XN_C_API XnStatus xnCreatePlayer(XnContext* pContext, const XnChar* strFormatNam
  * @remark If bRepeat is set to TRUE, the player will automatically rewind when reaching the end.
  * @remark If bRepeat is set to FALSE, the player will stop playing when reaching the end, and will raise the event that was registered with @ref xnRegisterToEndOfFileReached(). In this state, @ref xnIsPlayerAtEOF() returns TRUE.
  */
-XN_C_API XnStatus xnSetPlayerRepeat(XnNodeHandle hPlayer, XnBool bRepeat);
+XN_C_API XnStatus XN_C_DECL xnSetPlayerRepeat(XnNodeHandle hPlayer, XnBool bRepeat);
 
 /**
  * @brief Sets the source for the player, i.e. where the played events will come from. 
@@ -2175,7 +2425,7 @@ XN_C_API XnStatus xnSetPlayerRepeat(XnNodeHandle hPlayer, XnBool bRepeat);
  *
  * @sa xnGetPlayerSource()
  */
-XN_C_API XnStatus xnSetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium sourceType, const XnChar* strSource);
+XN_C_API XnStatus XN_C_DECL xnSetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium sourceType, const XnChar* strSource);
 
 /**
  * @brief Gets the player's source, i.e where the played events come from.
@@ -2187,7 +2437,7 @@ XN_C_API XnStatus xnSetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium sourceT
  *
  * @sa xnSetPlayerSource()
  */
-XN_C_API XnStatus xnGetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium* pSourceType, XnChar* strSource, XnUInt32 nBufSize);
+XN_C_API XnStatus XN_C_DECL xnGetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium* pSourceType, XnChar* strSource, XnUInt32 nBufSize);
 
 /**
  * @brief Reads the next data element from the player. 
@@ -2196,7 +2446,7 @@ XN_C_API XnStatus xnGetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium* pSourc
  *
  * @param	hPlayer	[in]	A handle to the player.
  */
-XN_C_API XnStatus xnPlayerReadNext(XnNodeHandle hPlayer);
+XN_C_API XnStatus XN_C_DECL xnPlayerReadNext(XnNodeHandle hPlayer);
 
 /**
  * @brief Seeks the player to a specific timestamp, so that playing will continue from that point onwards.
@@ -2215,7 +2465,7 @@ XN_C_API XnStatus xnPlayerReadNext(XnNodeHandle hPlayer);
  *		<tr><td>XN_PLAYER_SEEK_END</td><td>nTimeOffset specifies a period of time to move, relative to the end of the recording. This must be a negative value.</td></tr>
  *	</table>
  */
-XN_C_API XnStatus xnSeekPlayerToTimeStamp(XnNodeHandle hPlayer, XnInt64 nTimeOffset, XnPlayerSeekOrigin origin);
+XN_C_API XnStatus XN_C_DECL xnSeekPlayerToTimeStamp(XnNodeHandle hPlayer, XnInt64 nTimeOffset, XnPlayerSeekOrigin origin);
 
 /**
  * @brief Seeks the player to a specific frame of a specific played node, so that playing will continue from that frame onwards.
@@ -2236,7 +2486,7 @@ XN_C_API XnStatus xnSeekPlayerToTimeStamp(XnNodeHandle hPlayer, XnInt64 nTimeOff
  *
  * @note You can get different results using this function for different values of strNodeName, because the frame numbers of different nodes are not necessarily in sync.
  */
-XN_C_API XnStatus xnSeekPlayerToFrame(XnNodeHandle hPlayer, const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin);
+XN_C_API XnStatus XN_C_DECL xnSeekPlayerToFrame(XnNodeHandle hPlayer, const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin);
 
 /**
  * @brief Reports the current timestamp of a player, i.e. the amount of time passed since the beginning of the recording.
@@ -2244,7 +2494,7 @@ XN_C_API XnStatus xnSeekPlayerToFrame(XnNodeHandle hPlayer, const XnChar* strNod
  * @param	hPlayer		[in]	A handle to the player.
  * @param	pnTimestamp	[out]	A pointer to the retrieved timestamp in microseconds.
  */
-XN_C_API XnStatus xnTellPlayerTimestamp(XnNodeHandle hPlayer, XnUInt64* pnTimestamp);
+XN_C_API XnStatus XN_C_DECL xnTellPlayerTimestamp(XnNodeHandle hPlayer, XnUInt64* pnTimestamp);
 
 /**
  * @brief Reports the current frame number of a specific node played by a player.
@@ -2255,7 +2505,7 @@ XN_C_API XnStatus xnTellPlayerTimestamp(XnNodeHandle hPlayer, XnUInt64* pnTimest
  *
  * @remark Different nodes that belong to the player can have different frame numbers, because the nodes are not necessarily in sync.
  */
-XN_C_API XnStatus xnTellPlayerFrame(XnNodeHandle hPlayer, const XnChar* strNodeName, XnUInt32* pnFrame);
+XN_C_API XnStatus XN_C_DECL xnTellPlayerFrame(XnNodeHandle hPlayer, const XnChar* strNodeName, XnUInt32* pnFrame);
 
 /**
  * @brief Retrieves the number of frames of a specific node played by a player.
@@ -2264,7 +2514,7 @@ XN_C_API XnStatus xnTellPlayerFrame(XnNodeHandle hPlayer, const XnChar* strNodeN
  * @param	strNodeName	[in]	The name of the node for which to retrieve the number of frames.
  * @param	pnFrames	[out]	A pointer to the retrieved number of frames.
  */
-XN_C_API XnStatus xnGetPlayerNumFrames(XnNodeHandle hPlayer, const XnChar* strNodeName, XnUInt32* pnFrames);
+XN_C_API XnStatus XN_C_DECL xnGetPlayerNumFrames(XnNodeHandle hPlayer, const XnChar* strNodeName, XnUInt32* pnFrames);
 
 /**
  * @brief Gets the name of the format supported by a player.
@@ -2272,7 +2522,7 @@ XN_C_API XnStatus xnGetPlayerNumFrames(XnNodeHandle hPlayer, const XnChar* strNo
  * @param	hPlayer	[in]	A handle to the player.
  * @returns	The name of the format supported by the player, or NULL if hPlayer is NULL.
  */
-XN_C_API const XnChar* xnGetPlayerSupportedFormat(XnNodeHandle hPlayer);
+XN_C_API const XnChar* XN_C_DECL xnGetPlayerSupportedFormat(XnNodeHandle hPlayer);
 
 /**
  * @brief Retrieves a list of the nodes played by a player.
@@ -2283,7 +2533,7 @@ XN_C_API const XnChar* xnGetPlayerSupportedFormat(XnNodeHandle hPlayer);
  * @remark This function fills the pointer that is pointed to by ppList with a newly allocated node info list
  * of the played nodes. This list must later be freed by the caller with @ref xnNodeInfoListFree().
  */
-XN_C_API XnStatus xnEnumeratePlayerNodes(XnNodeHandle hPlayer, XnNodeInfoList** ppList);
+XN_C_API XnStatus XN_C_DECL xnEnumeratePlayerNodes(XnNodeHandle hPlayer, XnNodeInfoList** ppList);
 
 /**
  * @brief Checks whether the player is at the end-of-file marker.
@@ -2293,7 +2543,7 @@ XN_C_API XnStatus xnEnumeratePlayerNodes(XnNodeHandle hPlayer, XnNodeInfoList**
  *
  * @sa xnSetPlayerRepeat()
  */
-XN_C_API XnBool xnIsPlayerAtEOF(XnNodeHandle hPlayer);
+XN_C_API XnBool XN_C_DECL xnIsPlayerAtEOF(XnNodeHandle hPlayer);
 
 /**
  * @brief Registers a callback function to be called when end-of-file is reached.
@@ -2305,7 +2555,7 @@ XN_C_API XnBool xnIsPlayerAtEOF(XnNodeHandle hPlayer);
  *
  * @sa xnSetPlayerRepeat()
  */
-XN_C_API XnStatus xnRegisterToEndOfFileReached
+XN_C_API XnStatus XN_C_DECL xnRegisterToEndOfFileReached
 	(XnNodeHandle hPlayer, XnStateChangedHandler handler,
 	void* pCookie, XnCallbackHandle* phCallback);
 
@@ -2315,7 +2565,7 @@ XN_C_API XnStatus xnRegisterToEndOfFileReached
  * @param	hInstance	[in]	A handle to the player.
  * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToEndOfFileReached().
  */
-XN_C_API void xnUnregisterFromEndOfFileReached
+XN_C_API void XN_C_DECL xnUnregisterFromEndOfFileReached
 	(XnNodeHandle hInstance, XnCallbackHandle hCallback);
 
 /**
@@ -2329,7 +2579,7 @@ XN_C_API void xnUnregisterFromEndOfFileReached
  * @param	hInstance	[in]	A handle to the player.
  * @param	dSpeed		[in]	The speed ratio (see function description).
  */
-XN_C_API XnStatus xnSetPlaybackSpeed(XnNodeHandle hInstance, XnDouble dSpeed);
+XN_C_API XnStatus XN_C_DECL xnSetPlaybackSpeed(XnNodeHandle hInstance, XnDouble dSpeed);
 
 /**
  * @brief Gets the playback speed. see @ref xnSetPlaybackSpeed() for more details.
@@ -2337,7 +2587,27 @@ XN_C_API XnStatus xnSetPlaybackSpeed(XnNodeHandle hInstance, XnDouble dSpeed);
  * @param	hInstance	[in]	A handle to the player.
  * @returns speed ratio, or -1.0 if this node is not a player.
  */
-XN_C_API XnDouble xnGetPlaybackSpeed(XnNodeHandle hInstance);
+XN_C_API XnDouble XN_C_DECL xnGetPlaybackSpeed(XnNodeHandle hInstance);
+
+/** @} */
+
+//---------------------------------------------------------------------------
+// ScriptNode
+//---------------------------------------------------------------------------
+
+/**
+ * @ingroup prd_node
+ * @defgroup script_node Script Node
+ * A Script node is a @ref node that allows running scripts, and acts as a lifetime manager for nodes created
+ * by that script.
+ * @{
+ */
+
+XN_C_API XnStatus XN_C_DECL xnCreateScriptNode(XnContext* pContext, const XnChar* strFormat, XnNodeHandle* phScript);
+XN_C_API const XnChar* XN_C_DECL xnScriptNodeGetSupportedFormat(XnNodeHandle hScript);
+XN_C_API XnStatus XN_C_DECL xnLoadScriptFromFile(XnNodeHandle hScript, const XnChar* strFileName);
+XN_C_API XnStatus XN_C_DECL xnLoadScriptFromString(XnNodeHandle hScript, const XnChar* strScript);
+XN_C_API XnStatus XN_C_DECL xnScriptNodeRun(XnNodeHandle hScript, XnEnumerationErrors* pErrors);
 
 /** @} */
 
diff --git a/Include/XnPrdNodeInfo.h b/Include/XnPrdNodeInfo.h
index 98b3407..7e0d8d0 100644
--- a/Include/XnPrdNodeInfo.h
+++ b/Include/XnPrdNodeInfo.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -38,6 +38,26 @@
 //---------------------------------------------------------------------------
 // Functions
 //---------------------------------------------------------------------------
+
+
+
+/**
+ * Allocates a node info object, and sets its details.
+ *
+ * @param	pDescription	[in]	The description for the new node info object.
+ * @param	strCreationInfo	[in]	The creation info for the new node info object.
+ * @param	pNeededNodes	[in]	A list of node info's that are needed by the new node info.
+ * @param	ppNodeInfo		[out]	A pointer to pointer to the new node info object.
+ */
+XN_C_API XnStatus XN_C_DECL xnNodeInfoAllocate(const XnProductionNodeDescription* pDescription, const XnChar* strCreationInfo, XnNodeInfoList* pNeededNodes, XnNodeInfo** ppNodeInfo);
+
+/**
+ * Frees a node info object
+ *
+ * @param	pNodeInfo	[in]	The node info object to free.
+ */
+XN_C_API void XN_C_DECL xnNodeInfoFree(XnNodeInfo* pNodeInfo);
+
 /**
  * Sets the instance name of the node info object. The name can only be set BEFORE the instance is
  * created.
@@ -45,14 +65,14 @@
  * @param	pNodeInfo		[in]	A production node info object.
  * @param	strInstanceName	[in]	The name to give to this instance.
  */
-XN_C_API XnStatus xnNodeInfoSetInstanceName(XnNodeInfo* pNodeInfo, const XnChar* strInstanceName);
+XN_C_API XnStatus XN_C_DECL xnNodeInfoSetInstanceName(XnNodeInfo* pNodeInfo, const XnChar* strInstanceName);
 
 /**
  * Gets the description of the production node.
  *
  * @param	pNodeInfo		[in]	A production node info object.
  */
-XN_C_API const XnProductionNodeDescription* xnNodeInfoGetDescription(XnNodeInfo* pNodeInfo);
+XN_C_API const XnProductionNodeDescription* XN_C_DECL xnNodeInfoGetDescription(XnNodeInfo* pNodeInfo);
 
 /**
  * Creates a printable representation of the production tree.
@@ -61,42 +81,45 @@ XN_C_API const XnProductionNodeDescription* xnNodeInfoGetDescription(XnNodeInfo*
  * @param	csResult		[in]	A buffer to be filled with the printable representation.
  * @param	nSize			[in]	Size of the buffer.
  */
-XN_C_API XnStatus xnNodeInfoGetTreeStringRepresentation(XnNodeInfo* pNodeInfo, XnChar* csResult, XnUInt32 nSize);
+XN_C_API XnStatus XN_C_DECL xnNodeInfoGetTreeStringRepresentation(XnNodeInfo* pNodeInfo, XnChar* csResult, XnUInt32 nSize);
 
 /**
  * Gets the instance name of the production node.
  *
  * @param	pNodeInfo		[in]	A production node info object.
  */
-XN_C_API const XnChar* xnNodeInfoGetInstanceName(XnNodeInfo* pNodeInfo);
+XN_C_API const XnChar* XN_C_DECL xnNodeInfoGetInstanceName(XnNodeInfo* pNodeInfo);
 
 /**
  * Gets the creation info of the production node.
  *
  * @param	pNodeInfo		[in]	A production node info object.
  */
-XN_C_API const XnChar* xnNodeInfoGetCreationInfo(XnNodeInfo* pNodeInfo);
+XN_C_API const XnChar* XN_C_DECL xnNodeInfoGetCreationInfo(XnNodeInfo* pNodeInfo);
 
 /**
  * Gets the list of needed nodes of the production node.
  *
  * @param	pNodeInfo		[in]	A production node info object.
  */
-XN_C_API XnNodeInfoList* xnNodeInfoGetNeededNodes(XnNodeInfo* pNodeInfo);
+XN_C_API XnNodeInfoList* XN_C_DECL xnNodeInfoGetNeededNodes(XnNodeInfo* pNodeInfo);
 
 /**
  * Gets the handle of the production node. For nodes that weren't created yet, NULL is returned.
+ * If a handle is returned, it should be released when no longer used by calling @ref xnProductionNodeRelease().
  *
  * @param	pNodeInfo		[in]	A production node info object.
  */
-XN_C_API XnNodeHandle xnNodeInfoGetHandle(XnNodeInfo* pNodeInfo);
+XN_C_API XnNodeHandle XN_C_DECL xnNodeInfoGetRefHandle(XnNodeInfo* pNodeInfo);
+
+XN_C_API XnNodeHandle XN_API_DEPRECATED("Please use xnNodeInfoGetRefHandle() instead") XN_C_DECL xnNodeInfoGetHandle(XnNodeInfo* pNodeInfo);
 
 /**
  * Gets the additional data object attached to the node info object. 
  *
  * @param	pNodeInfo		[in]	A production node info object.
  */
-XN_C_API const void* xnNodeInfoGetAdditionalData(XnNodeInfo* pNodeInfo);
+XN_C_API const void* XN_C_DECL xnNodeInfoGetAdditionalData(XnNodeInfo* pNodeInfo);
 
 /** @} */
 
diff --git a/Include/XnPrdNodeInfoList.h b/Include/XnPrdNodeInfoList.h
index dd06b32..50ecfa1 100644
--- a/Include/XnPrdNodeInfoList.h
+++ b/Include/XnPrdNodeInfoList.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -89,14 +89,14 @@ for (XnNodeInfoListIterator it = xnNodeInfoListGetLast(pList);
  *
  * @param	ppList				[out]		The list.
  */
-XN_C_API XnStatus xnNodeInfoListAllocate(XnNodeInfoList** ppList);
+XN_C_API XnStatus XN_C_DECL xnNodeInfoListAllocate(XnNodeInfoList** ppList);
 
 /**
  * Frees a @ref XnNodeInfoList object previously allocated with @ref xnNodeInfoListAllocate().
  *
  * @param	pList				[out]		The list.
  */
-XN_C_API void xnNodeInfoListFree(XnNodeInfoList* pList);
+XN_C_API void XN_C_DECL xnNodeInfoListFree(XnNodeInfoList* pList);
 
 /**
  * Creates and adds a single @ref XnNodeInfo object to the list. See also @ref xnNodeInfoListAddEx().
@@ -106,7 +106,7 @@ XN_C_API void xnNodeInfoListFree(XnNodeInfoList* pList);
  * @param	strCreationInfo		[in]		Optional. Additional needed information for instantiation.
  * @param	pNeededNodes		[in]		Optional. A list of needed nodes.
  */
-XN_C_API XnStatus xnNodeInfoListAdd(XnNodeInfoList* pList, const XnProductionNodeDescription* pDescription, const XnChar* strCreationInfo, XnNodeInfoList* pNeededNodes);
+XN_C_API XnStatus XN_C_DECL xnNodeInfoListAdd(XnNodeInfoList* pList, const XnProductionNodeDescription* pDescription, const XnChar* strCreationInfo, XnNodeInfoList* pNeededNodes);
 
 /**
  * Creates and adds a single @ref XnNodeInfo object to the list, with additional data. This data can be later
@@ -120,7 +120,7 @@ XN_C_API XnStatus xnNodeInfoListAdd(XnNodeInfoList* pList, const XnProductionNod
  * @param	pAdditionalData		[in]		Additional data, which is specific to this node.
  * @param	pFreeHandler		[in]		Optional. A callback function for freeing the additional data.
  */
-XN_C_API XnStatus xnNodeInfoListAddEx(XnNodeInfoList* pList, const XnProductionNodeDescription* pDescription, const XnChar* strCreationInfo, XnNodeInfoList* pNeededNodes, const void* pAdditionalData, XnFreeHandler pFreeHandler);
+XN_C_API XnStatus XN_C_DECL xnNodeInfoListAddEx(XnNodeInfoList* pList, const XnProductionNodeDescription* pDescription, const XnChar* strCreationInfo, XnNodeInfoList* pNeededNodes, const void* pAdditionalData, XnFreeHandler pFreeHandler);
 
 /**
  * Adds a single @ref XnNodeInfo object to the list.
@@ -128,7 +128,7 @@ XN_C_API XnStatus xnNodeInfoListAddEx(XnNodeInfoList* pList, const XnProductionN
  * @param	pList				[in]		The list.
  * @param	pNode				[in]		The node to add.
  */
-XN_C_API XnStatus xnNodeInfoListAddNode(XnNodeInfoList* pList, XnNodeInfo* pNode);
+XN_C_API XnStatus XN_C_DECL xnNodeInfoListAddNode(XnNodeInfoList* pList, XnNodeInfo* pNode);
 
 /**
  * Adds a node from another list to this list (the node is not removed from the other list).
@@ -136,7 +136,7 @@ XN_C_API XnStatus xnNodeInfoListAddNode(XnNodeInfoList* pList, XnNodeInfo* pNode
  * @param	pList				[in]		The list.
  * @param	otherListIt			[in]		An iterator obtained from another list.
  */
-XN_C_API XnStatus xnNodeInfoListAddNodeFromList(XnNodeInfoList* pList, XnNodeInfoListIterator otherListIt);
+XN_C_API XnStatus XN_C_DECL xnNodeInfoListAddNodeFromList(XnNodeInfoList* pList, XnNodeInfoListIterator otherListIt);
 
 /**
  * Removes an element from the list, and frees it.
@@ -144,14 +144,14 @@ XN_C_API XnStatus xnNodeInfoListAddNodeFromList(XnNodeInfoList* pList, XnNodeInf
  * @param	pList	[in]		The list.
  * @param	it		[in]		Iterator to the element that should be removed.
  */
-XN_C_API XnStatus xnNodeInfoListRemove(XnNodeInfoList* pList, XnNodeInfoListIterator it);
+XN_C_API XnStatus XN_C_DECL xnNodeInfoListRemove(XnNodeInfoList* pList, XnNodeInfoListIterator it);
 
 /**
  * Clears a node info list, freeing all the elements in it.
  *
  * @param	pList	[in]	The list to be freed.
  */
-XN_C_API XnStatus xnNodeInfoListClear(XnNodeInfoList* pList);
+XN_C_API XnStatus XN_C_DECL xnNodeInfoListClear(XnNodeInfoList* pList);
 
 /**
  * Appends another list at the end of this list. Note that the other list becomes empty,
@@ -160,14 +160,14 @@ XN_C_API XnStatus xnNodeInfoListClear(XnNodeInfoList* pList);
  * @param	pList		[in]		A list.
  * @param	pOther		[in]		The list to be appended.
  */
-XN_C_API XnStatus xnNodeInfoListAppend(XnNodeInfoList* pList, XnNodeInfoList* pOther);
+XN_C_API XnStatus XN_C_DECL xnNodeInfoListAppend(XnNodeInfoList* pList, XnNodeInfoList* pOther);
 
 /**
 * Checks if the given list is empty
 *
 * @param	pList		[in]		A list.
 */
-XN_C_API XnBool xnNodeInfoListIsEmpty(XnNodeInfoList* pList);
+XN_C_API XnBool XN_C_DECL xnNodeInfoListIsEmpty(XnNodeInfoList* pList);
 
 /**
  * Gets the first element of the list.
@@ -176,7 +176,7 @@ XN_C_API XnBool xnNodeInfoListIsEmpty(XnNodeInfoList* pList);
  *
  * @returns an iterator to the first element of the list, or NULL if the list is empty.
  */
-XN_C_API XnNodeInfoListIterator xnNodeInfoListGetFirst(XnNodeInfoList* pList);
+XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetFirst(XnNodeInfoList* pList);
 
 /**
  * Gets the last element of the list.
@@ -185,14 +185,14 @@ XN_C_API XnNodeInfoListIterator xnNodeInfoListGetFirst(XnNodeInfoList* pList);
  *
  * @returns an iterator to the last element of the list, or NULL if the list is empty.
  */
-XN_C_API XnNodeInfoListIterator xnNodeInfoListGetLast(XnNodeInfoList* pList);
+XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetLast(XnNodeInfoList* pList);
 
 /**
  * Checks if the current iterator points to a valid location.
  *
  * @param	it		[in]	An iterator.
  */
-XN_C_API XnBool xnNodeInfoListIteratorIsValid(XnNodeInfoListIterator it);
+XN_C_API XnBool XN_C_DECL xnNodeInfoListIteratorIsValid(XnNodeInfoListIterator it);
 
 /**
  * Gets current element from an iterator. 
@@ -201,7 +201,7 @@ XN_C_API XnBool xnNodeInfoListIteratorIsValid(XnNodeInfoListIterator it);
  * 
  * @returns an @ref XnNodeInfo pointer.
  */
-XN_C_API XnNodeInfo* xnNodeInfoListGetCurrent(XnNodeInfoListIterator it);
+XN_C_API XnNodeInfo* XN_C_DECL xnNodeInfoListGetCurrent(XnNodeInfoListIterator it);
 
 /**
  * Gets an iterator to the next element from a current iterator.
@@ -210,7 +210,7 @@ XN_C_API XnNodeInfo* xnNodeInfoListGetCurrent(XnNodeInfoListIterator it);
  * 
  * @returns an iterator to the next element.
  */
-XN_C_API XnNodeInfoListIterator xnNodeInfoListGetNext(XnNodeInfoListIterator it);
+XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetNext(XnNodeInfoListIterator it);
 
 /**
  * Gets an iterator to the previous element from a current iterator.
@@ -219,7 +219,7 @@ XN_C_API XnNodeInfoListIterator xnNodeInfoListGetNext(XnNodeInfoListIterator it)
  * 
  * @returns an iterator to the previous element.
  */
-XN_C_API XnNodeInfoListIterator xnNodeInfoListGetPrevious(XnNodeInfoListIterator it);
+XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetPrevious(XnNodeInfoListIterator it);
 
 /** @} */
 
diff --git a/Include/XnProfiling.h b/Include/XnProfiling.h
index 8a8a7a8..fb034b4 100644
--- a/Include/XnProfiling.h
+++ b/Include/XnProfiling.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -47,7 +47,7 @@ typedef XnInt32 XnProfilingHandle;
 * @param	nProfilingInterval	[in]	The number of milliseconds between profiler printings. A value
 *										of zero means profiling is off.
 */
-XN_C_API XnStatus xnProfilingInit(XnUInt32 nProfilingInterval = 0);
+XN_C_API XnStatus XN_C_DECL xnProfilingInit(XnUInt32 nProfilingInterval = 0);
 
 /**
 * Initializes using INI file.
@@ -55,17 +55,17 @@ XN_C_API XnStatus xnProfilingInit(XnUInt32 nProfilingInterval = 0);
 * @param	cpINIFileName	[in]	Name of INI file.
 * @param	cpSectionName	[in]	Name of section in INI file.
 */
-XN_C_API XnStatus xnProfilingInitFromINI(const XnChar* cpINIFileName, const XnChar* cpSectionName);
+XN_C_API XnStatus XN_C_DECL xnProfilingInitFromINI(const XnChar* cpINIFileName, const XnChar* cpSectionName);
 
 /**
 * Shuts down profiling.
 */
-XN_C_API XnStatus xnProfilingShutdown();
+XN_C_API XnStatus XN_C_DECL xnProfilingShutdown();
 
 /**
 * Returns TRUE if profiling is active, or FALSE otherwise.
 */
-XN_C_API XnBool xnProfilingIsActive();
+XN_C_API XnBool XN_C_DECL xnProfilingIsActive();
 
 /**
 * Start a profiled section. This function is not meant to be used directly. Please use the 
@@ -75,7 +75,7 @@ XN_C_API XnBool xnProfilingIsActive();
 * @param	bMT				[in]		TRUE if this section is multi-threaded, FALSE otherwise.
 * @param	pHandle			[out]		A handle to be used each time this section executes again.
 */
-XN_C_API XnStatus xnProfilingSectionStart(const char* csSectionName, XnBool bMT, XnProfilingHandle* pHandle);
+XN_C_API XnStatus XN_C_DECL xnProfilingSectionStart(const char* csSectionName, XnBool bMT, XnProfilingHandle* pHandle);
 
 /**
 * Ends a profiled section. This function is not meant to be used directly. Please use the 
@@ -83,7 +83,7 @@ XN_C_API XnStatus xnProfilingSectionStart(const char* csSectionName, XnBool bMT,
 *
 * @param	pHandle		[in]	A handle returned from xnProfilingSectionStart.
 */
-XN_C_API XnStatus xnProfilingSectionEnd(XnProfilingHandle* pHandle);
+XN_C_API XnStatus XN_C_DECL xnProfilingSectionEnd(XnProfilingHandle* pHandle);
 
 
 /**
diff --git a/Include/XnPropNames.h b/Include/XnPropNames.h
index 597db40..6f18dc6 100644
--- a/Include/XnPropNames.h
+++ b/Include/XnPropNames.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnQueries.h b/Include/XnQueries.h
index 48f1e56..78cd3e5 100644
--- a/Include/XnQueries.h
+++ b/Include/XnQueries.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -43,14 +43,14 @@
  *
  * @param	ppQuery		[out]	Created query object.
  */
-XN_C_API XnStatus xnNodeQueryAllocate(XnNodeQuery** ppQuery);
+XN_C_API XnStatus XN_C_DECL xnNodeQueryAllocate(XnNodeQuery** ppQuery);
 
 /**
  * Frees a query object previously created using @ref xnNodeQueryAllocate().
  *
  * @param	pQuery		[in]	Query object.
  */
-XN_C_API void xnNodeQueryFree(XnNodeQuery* pQuery);
+XN_C_API void XN_C_DECL xnNodeQueryFree(XnNodeQuery* pQuery);
 
 /**
  * Sets the requested vendor.
@@ -58,7 +58,7 @@ XN_C_API void xnNodeQueryFree(XnNodeQuery* pQuery);
  * @param	pQuery		[in]	Query object.
  * @param	strVendor	[in]	Vendor Name.
  */
-XN_C_API XnStatus xnNodeQuerySetVendor(XnNodeQuery* pQuery, const XnChar* strVendor);
+XN_C_API XnStatus XN_C_DECL xnNodeQuerySetVendor(XnNodeQuery* pQuery, const XnChar* strVendor);
 
 /**
  * Sets the requested name.
@@ -66,7 +66,7 @@ XN_C_API XnStatus xnNodeQuerySetVendor(XnNodeQuery* pQuery, const XnChar* strVen
  * @param	pQuery		[in]	Query object.
  * @param	strName		[in]	Product Name.
  */
-XN_C_API XnStatus xnNodeQuerySetName(XnNodeQuery* pQuery, const XnChar* strName);
+XN_C_API XnStatus XN_C_DECL xnNodeQuerySetName(XnNodeQuery* pQuery, const XnChar* strName);
 
 /**
  * Sets the minimum required version.
@@ -74,7 +74,7 @@ XN_C_API XnStatus xnNodeQuerySetName(XnNodeQuery* pQuery, const XnChar* strName)
  * @param	pQuery		[in]	Query object.
  * @param	pMinVersion	[in]	Min Version. 
  */
-XN_C_API XnStatus xnNodeQuerySetMinVersion(XnNodeQuery* pQuery, const XnVersion* pMinVersion);
+XN_C_API XnStatus XN_C_DECL xnNodeQuerySetMinVersion(XnNodeQuery* pQuery, const XnVersion* pMinVersion);
 
 /**
  * Sets the maximum required version. 
@@ -82,7 +82,7 @@ XN_C_API XnStatus xnNodeQuerySetMinVersion(XnNodeQuery* pQuery, const XnVersion*
  * @param	pQuery		[in]	Query object.
  * @param	pMaxVersion	[in]	Max Version. 
  */
-XN_C_API XnStatus xnNodeQuerySetMaxVersion(XnNodeQuery* pQuery, const XnVersion* pMaxVersion);
+XN_C_API XnStatus XN_C_DECL xnNodeQuerySetMaxVersion(XnNodeQuery* pQuery, const XnVersion* pMaxVersion);
 
 /**
  * Adds a capability that the node must support. Note that for checking if a capability is supported, 
@@ -91,7 +91,7 @@ XN_C_API XnStatus xnNodeQuerySetMaxVersion(XnNodeQuery* pQuery, const XnVersion*
  * @param	pQuery				[in]	Query object.
  * @param	strNeededCapability	[in]	A needed capability name.
  */
-XN_C_API XnStatus xnNodeQueryAddSupportedCapability(XnNodeQuery* pQuery, const XnChar* strNeededCapability);
+XN_C_API XnStatus XN_C_DECL xnNodeQueryAddSupportedCapability(XnNodeQuery* pQuery, const XnChar* strNeededCapability);
 
 /**
  * Adds a MapOutputMode that the node must support. Note that for checking if a capability is supported, 
@@ -101,7 +101,7 @@ XN_C_API XnStatus xnNodeQueryAddSupportedCapability(XnNodeQuery* pQuery, const X
  * @param	pMapOutputMode	[in]	A map output mode. Each field of the mode can be set to (-1), meaning 
  * results will not be filtered by this field. 
  */
-XN_C_API XnStatus xnNodeQueryAddSupportedMapOutputMode(XnNodeQuery* pQuery, const XnMapOutputMode* pMapOutputMode);
+XN_C_API XnStatus XN_C_DECL xnNodeQueryAddSupportedMapOutputMode(XnNodeQuery* pQuery, const XnMapOutputMode* pMapOutputMode);
 
 /**
  * Sets the minimum required user positions this node supports. Note that for checking if a capability is supported, 
@@ -110,7 +110,7 @@ XN_C_API XnStatus xnNodeQueryAddSupportedMapOutputMode(XnNodeQuery* pQuery, cons
  * @param	pQuery		[in]	Query object.
  * @param	nCount		[in]	The number of required positions.
  */
-XN_C_API XnStatus xnNodeQuerySetSupportedMinUserPositions(XnNodeQuery* pQuery, const XnUInt32 nCount);
+XN_C_API XnStatus XN_C_DECL xnNodeQuerySetSupportedMinUserPositions(XnNodeQuery* pQuery, const XnUInt32 nCount);
 
 /**
  * Filter results so that only existing nodes will be returned.
@@ -118,7 +118,15 @@ XN_C_API XnStatus xnNodeQuerySetSupportedMinUserPositions(XnNodeQuery* pQuery, c
  * @param	pQuery			[in]	Query object.
  * @param	bExistingNode	[in]	TRUE to return only existing ones, FALSE otherwise.
  */
-XN_C_API XnStatus xnNodeQuerySetExistingNodeOnly(XnNodeQuery* pQuery, XnBool bExistingNode);
+XN_C_API XnStatus XN_C_DECL xnNodeQuerySetExistingNodeOnly(XnNodeQuery* pQuery, XnBool bExistingNode);
+
+/**
+ * Filter results so that only non-existing nodes will be returned.
+ *
+ * @param	pQuery			 [in]	Query object.
+ * @param	bNonExistingNode [in]	TRUE to return only non-existing ones, FALSE otherwise.
+ */
+XN_C_API XnStatus XN_C_DECL xnNodeQuerySetNonExistingNodeOnly(XnNodeQuery* pQuery, XnBool bNonExistingNode);
 
 /**
  * Adds a needed node.
@@ -126,7 +134,7 @@ XN_C_API XnStatus xnNodeQuerySetExistingNodeOnly(XnNodeQuery* pQuery, XnBool bEx
  * @param	pQuery			[in]	Query object.
  * @param	strInstanceName	[in]	The name of the needed instance.
  */
-XN_C_API XnStatus xnNodeQueryAddNeededNode(XnNodeQuery* pQuery, const XnChar* strInstanceName);
+XN_C_API XnStatus XN_C_DECL xnNodeQueryAddNeededNode(XnNodeQuery* pQuery, const XnChar* strInstanceName);
 
 /**
  * Sets the creation info field of a query object.
@@ -134,7 +142,7 @@ XN_C_API XnStatus xnNodeQueryAddNeededNode(XnNodeQuery* pQuery, const XnChar* st
  * @param	pQuery			[in]	Query object.
  * @param	strCreationInfo	[in]	The creation info to set in the query.
  */
-XN_C_API XnStatus xnNodeQuerySetCreationInfo(XnNodeQuery* pQuery, const XnChar* strCreationInfo);
+XN_C_API XnStatus XN_C_DECL xnNodeQuerySetCreationInfo(XnNodeQuery* pQuery, const XnChar* strCreationInfo);
 
 /**
  * Filters a list of nodes according to query. The list will contain only nodes that match all query terms.
@@ -144,7 +152,7 @@ XN_C_API XnStatus xnNodeQuerySetCreationInfo(XnNodeQuery* pQuery, const XnChar*
  * @param	pQuery		[in]		Query object.
  * @param	pList		[in]		The list to be filtered.
  */
-XN_C_API XnStatus xnNodeQueryFilterList(XnContext* pContext, const XnNodeQuery* pQuery, XnNodeInfoList* pList);
+XN_C_API XnStatus XN_C_DECL xnNodeQueryFilterList(XnContext* pContext, const XnNodeQuery* pQuery, XnNodeInfoList* pList);
 
 /** @} */
 
diff --git a/Include/XnQueue.h b/Include/XnQueue.h
index d016378..ae00eb3 100644
--- a/Include/XnQueue.h
+++ b/Include/XnQueue.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -161,6 +161,7 @@ private:
 			XnStatus nRetVal = base::Pop(val);											\
 			if (nRetVal != XN_STATUS_OK) return (nRetVal);								\
 			value = Translator::GetFromValue(val);										\
+			Translator::FreeValue(val);													\
 			return XN_STATUS_OK;														\
 		}																				\
 		inline Type const& Top() const { return Translator::GetFromValue(base::Top()); }\
diff --git a/Include/XnScheduler.h b/Include/XnScheduler.h
index 3940857..605ceec 100644
--- a/Include/XnScheduler.h
+++ b/Include/XnScheduler.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -52,14 +52,14 @@ typedef void (XN_CALLBACK_TYPE* XnTaskCallbackFuncPtr)(void* pCallbackArg);
 *
 * @param	ppScheduler		[out]	Upon successful return, holds a handle to created scheduler.
 */
-XN_C_API XnStatus xnSchedulerStart(XnScheduler** ppScheduler);
+XN_C_API XnStatus XN_C_DECL xnSchedulerStart(XnScheduler** ppScheduler);
 
 /**
 * Shuts down a scheduler thread. All timers on that scheduler will be stopped.
 *
 * @param	ppScheduler		[in/out]	A pointer to the scheduler to be shut down.
 */
-XN_C_API XnStatus xnSchedulerShutdown(XnScheduler** ppScheduler);
+XN_C_API XnStatus XN_C_DECL xnSchedulerShutdown(XnScheduler** ppScheduler);
 
 /**
 * Adds a task to the scheduler.
@@ -70,7 +70,7 @@ XN_C_API XnStatus xnSchedulerShutdown(XnScheduler** ppScheduler);
 * @param	pCallbackArg	[in]	The argument that will be passed to the callback method.
 * @param	ppTask			[out]	Upon successful return, holds a handle to the started task.
 */
-XN_C_API XnStatus xnSchedulerAddTask(XnScheduler* pScheduler, XnUInt64 nInterval, XnTaskCallbackFuncPtr pCallback, void* pCallbackArg, XnScheduledTask** ppTask);
+XN_C_API XnStatus XN_C_DECL xnSchedulerAddTask(XnScheduler* pScheduler, XnUInt64 nInterval, XnTaskCallbackFuncPtr pCallback, void* pCallbackArg, XnScheduledTask** ppTask);
 
 /**
 * Removes a task from the scheduler.
@@ -78,7 +78,7 @@ XN_C_API XnStatus xnSchedulerAddTask(XnScheduler* pScheduler, XnUInt64 nInterval
 * @param	pScheduler	[in]		The scheduler this task is registered to.
 * @param	ppTask		[in/out]	The task to be removed from the scheduler.
 */
-XN_C_API XnStatus xnSchedulerRemoveTask(XnScheduler* pScheduler, XnScheduledTask** ppTask);
+XN_C_API XnStatus XN_C_DECL xnSchedulerRemoveTask(XnScheduler* pScheduler, XnScheduledTask** ppTask);
 
 /**
 * Changes scheduling of a specific task.
@@ -87,6 +87,6 @@ XN_C_API XnStatus xnSchedulerRemoveTask(XnScheduler* pScheduler, XnScheduledTask
 * @param	pTask		[in]	The task to be removed from the scheduler.
 * @param	nInterval	[in]	The new interval to be used.
 */
-XN_C_API XnStatus xnSchedulerRescheduleTask(XnScheduler* pScheduler, XnScheduledTask* pTask, XnUInt64 nInterval);
+XN_C_API XnStatus XN_C_DECL xnSchedulerRescheduleTask(XnScheduler* pScheduler, XnScheduledTask* pTask, XnUInt64 nInterval);
 
 #endif //_XN_SCHEDULER_H_
diff --git a/Include/XnStack.h b/Include/XnStack.h
index 68acbca..348288b 100644
--- a/Include/XnStack.h
+++ b/Include/XnStack.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Include/XnStatus.h b/Include/XnStatus.h
index 1a48fea..7a86bfd 100644
--- a/Include/XnStatus.h
+++ b/Include/XnStatus.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -47,7 +47,7 @@ typedef XnUInt32 XnStatus;
  *
  * @return A string representation of the Xiron status.
  */
-XN_C_API const XnChar* xnGetStatusString(const XnStatus Status);
+XN_C_API const XnChar* XN_C_DECL xnGetStatusString(const XnStatus Status);
 
 /**
 * Gets the name of a Xiron Status as a string.
@@ -56,7 +56,7 @@ XN_C_API const XnChar* xnGetStatusString(const XnStatus Status);
 *
 * @return A string representation of the Xiron status name.
 */
-XN_C_API const XnChar* xnGetStatusName(const XnStatus Status);
+XN_C_API const XnChar* XN_C_DECL xnGetStatusName(const XnStatus Status);
 
 /**
 * Prints a user message with a description of the error.
@@ -65,7 +65,7 @@ XN_C_API const XnChar* xnGetStatusName(const XnStatus Status);
 * @param	csUserMessage	[in]	A user message.
 *
 */
-XN_C_API void xnPrintError(const XnStatus Status, const XnChar* csUserMessage);
+XN_C_API void XN_C_DECL xnPrintError(const XnStatus Status, const XnChar* csUserMessage);
 
 //---------------------------------------------------------------------------
 // Enums
@@ -82,10 +82,10 @@ typedef enum XnErrorGroup
 #define XN_STATUS_MAKE(group, code)		((group << 16) | code)
 
 /** Returns the group of the status. */
-#define XN_STATUS_GROUP(status)			(status >> 16)
+#define XN_STATUS_GROUP(status)			XnUInt16(status >> 16)
 
 /** Returns the code of the status. */
-#define XN_STATUS_CODE(status)			(status & 0x0000FFFF)
+#define XN_STATUS_CODE(status)			XnUInt16(status & 0x0000FFFF)
 
 /** Marks the beginning of a message map of a specific module. */ 
 #define XN_STATUS_MESSAGE_MAP_START_FROM(group, first)		\
diff --git a/Include/XnStatusCodes.h b/Include/XnStatusCodes.h
index 0f25a2d..68cbb13 100644
--- a/Include/XnStatusCodes.h
+++ b/Include/XnStatusCodes.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -68,6 +68,14 @@ XN_STATUS_MESSAGE(XN_STATUS_DEVICE_NOT_CONNECTED, "The device is not connected!"
 XN_STATUS_MESSAGE(XN_STATUS_NO_LICENSE, "No license to use this module!")
 XN_STATUS_MESSAGE(XN_STATUS_NO_SUCH_PROPERTY, "There is no such property")
 XN_STATUS_MESSAGE(XN_STATUS_NODE_ALREADY_RECORDED, "This node is already recorded!")
+XN_STATUS_MESSAGE(XN_STATUS_PROTO_BAD_INTERFACE, "Bad protocol interface")
+XN_STATUS_MESSAGE(XN_STATUS_PROTO_BAD_MSG_TYPE, "Bad protocol message type")
+XN_STATUS_MESSAGE(XN_STATUS_PROTO_BAD_CID, "Bad protocol CID")
+XN_STATUS_MESSAGE(XN_STATUS_PROTO_BAD_NODE_ID, "Bad protocol node ID")
+XN_STATUS_MESSAGE(XN_STATUS_PROTO_BAD_MSG_SIZE, "Bad protocol message size")
+XN_STATUS_MESSAGE(XN_STATUS_NO_SUCH_USER, "User could not be found")
+XN_STATUS_MESSAGE(XN_STATUS_USER_IS_NOT_BEING_TRACKED, "User is not being tracked")
+XN_STATUS_MESSAGE(XN_STATUS_JOINT_IS_NOT_ACTIVE, "Joint is not active")
 XN_STATUS_MESSAGE_MAP_END(XN_ERROR_GROUP_NI)
 
 #endif // __XN_STATUS_CODES_H__
diff --git a/Include/XnStatusRegister.h b/Include/XnStatusRegister.h
index c7d5cb0..f5f722a 100644
--- a/Include/XnStatusRegister.h
+++ b/Include/XnStatusRegister.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -51,7 +51,7 @@ typedef struct XnErrorCodeData
 * @param	nCount			[in]	The number of status messages to register.
 * @param	pErrorCodeData	[in]	An array of status messages.
 */
-XN_C_API XnStatus xnRegisterErrorCodeMessages(XnUInt16 nGroup, XnUInt16 nFirst, XnUInt16 nCount, XnErrorCodeData* pErrorCodeData);
+XN_C_API XnStatus XN_C_DECL xnRegisterErrorCodeMessages(XnUInt16 nGroup, XnUInt16 nFirst, XnUInt16 nCount, XnErrorCodeData* pErrorCodeData);
 
 //---------------------------------------------------------------------------
 // Macros
diff --git a/Include/XnStringsHash.h b/Include/XnStringsHash.h
index b647553..ba0a77f 100644
--- a/Include/XnStringsHash.h
+++ b/Include/XnStringsHash.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -109,16 +109,8 @@ public:
 * Declares a hash table from strings to @a ValueType that's named @a ClassName and uses default translator
 * to translate values.
 */
-#if XN_PLATFORM == XN_PLATFORM_WIN32
-#define XN_DECLARE_STRINGS_HASH(ValueType, ClassName)				\
-	__pragma(warning(push)) \
-	__pragma(warning(disable: 4127)) \
-	XN_DECLARE_STRINGS_HASH_DECL(, ValueType, ClassName) \
-	__pragma(warning(pop))
-#else
-#define XN_DECLARE_STRINGS_HASH(ValueType, ClassName)				\
+#define XN_DECLARE_STRINGS_HASH(ValueType, ClassName)		\
 	XN_DECLARE_STRINGS_HASH_DECL(, ValueType, ClassName)
-#endif
 
 XN_DECLARE_STRINGS_HASH(XnValue, XnStringsHash)
 
diff --git a/Include/XnThreadSafeQueue.h b/Include/XnThreadSafeQueue.h
index a3caba1..6de235a 100644
--- a/Include/XnThreadSafeQueue.h
+++ b/Include/XnThreadSafeQueue.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -126,6 +126,7 @@ private:
 			XnStatus nRetVal = XnThreadSafeQueue::Pop(val);								\
 			if (nRetVal != XN_STATUS_OK) return (nRetVal);								\
 			value = Translator::GetFromValue(val);										\
+			Translator::FreeValue(val);													\
 			return XN_STATUS_OK;														\
 		}																				\
 	};
diff --git a/Include/XnTypes.h b/Include/XnTypes.h
index 6799901..340e5c0 100644
--- a/Include/XnTypes.h
+++ b/Include/XnTypes.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -49,6 +49,9 @@
 /** The name of the OpenNI recording format. **/
 #define XN_FORMAT_NAME_ONI	"oni"
 
+/** The name of the OpenNI XML script format. **/
+#define XN_SCRIPT_FORMAT_XML	"xml"
+
 /** represents playback speed which does not consider file timestamps. **/
 #define XN_PLAYBACK_SPEED_FASTEST	0.0
 
@@ -83,11 +86,14 @@ typedef struct XnInternalNodeData* XnNodeHandle;
  */
 typedef XnUInt32 XnLockHandle;
 
-
-typedef XnInt32 XnProductionNodeType;
 /**
  * Type of the production node.
  */
+typedef XnInt32 XnProductionNodeType;
+
+/**
+ * Predefined types of production nodes.
+ */
 typedef enum XnPredefinedProductionNodeType
 {
 	/** An invalid node type **/
@@ -133,6 +139,7 @@ typedef enum XnPredefinedProductionNodeType
 	XN_NODE_TYPE_PRODUCTION_NODE = 13,
 	XN_NODE_TYPE_GENERATOR = 14,
 	XN_NODE_TYPE_MAP_GENERATOR = 15,
+	XN_NODE_TYPE_SCRIPT = 16,
 
 	XN_NODE_TYPE_FIRST_EXTENSION,
 
@@ -234,6 +241,8 @@ typedef void (XN_CALLBACK_TYPE* XnErrorStateChangedHandler)(XnStatus errorState,
  **/
 typedef void (XN_CALLBACK_TYPE* XnFreeHandler)(const void* pData);
 
+typedef void (XN_CALLBACK_TYPE* XnContextShuttingDownHandler)(XnContext* pContext, void* pCookie);
+
 /** Handle to a registered callback function. **/
 typedef void* XnCallbackHandle;
 
@@ -309,9 +318,15 @@ typedef XnUInt16 XnLabel;
 #define XN_CAPABILITY_FOCUS						"Focus"
 #define XN_CAPABILITY_LOW_LIGHT_COMPENSATION	"LowLightCompensation"
 #define XN_CAPABILITY_ANTI_FLICKER				"AntiFlicker"
+#define XN_CAPABILITY_HAND_TOUCHING_FOV_EDGE	"Hands::HandTouchingFOVEdge"
+
+// Backwards compatibility - typo was fixed
 #define XN_CAPABILITY_ANTI_FILCKER				XN_CAPABILITY_ANTI_FLICKER
 
+// deprecated pragma is only supported in Visual Studio
+#if (XN_PLATFORM == XN_PLATFORM_WIN32)
 #pragma deprecated("XN_CAPABILITY_ANTI_FILCKER")
+#endif
 
 //---------------------------------------------------------------------------
 // Generators API Structs
@@ -468,7 +483,7 @@ typedef struct XnFieldOfView
 {
 	/** Horizontal Field Of View, in radians. */
 	XnDouble fHFOV;
-	/** Horizontal Field Of View, in radians. */
+	/** Vertical Field Of View, in radians. */
 	XnDouble fVFOV;
 } XnFieldOfView;
 
@@ -623,6 +638,53 @@ typedef enum XnSkeletonProfile
 	XN_SKEL_PROFILE_HEAD_HANDS	= 5,
 } XnSkeletonProfile;
 
+/** Possible statuses for pose detection */
+typedef enum XnPoseDetectionStatus
+{
+	XN_POSE_DETECTION_STATUS_OK			= 0,
+	XN_POSE_DETECTION_STATUS_NO_USER	= 1,
+	XN_POSE_DETECTION_STATUS_TOP_FOV	= 2,
+	XN_POSE_DETECTION_STATUS_SIDE_FOV	= 3,
+	XN_POSE_DETECTION_STATUS_ERROR		= 4,
+    XN_POSE_DETECTION_STATUS_NO_TRACKING = 5
+} XnPoseDetectionStatus;
+
+
+/** Possible pose detection states */
+typedef enum XnPoseDetectionState
+{
+    XN_POSE_DETECTION_STATE_IN_POSE     =0,
+    XN_POSE_DETECTION_STATE_OUT_OF_POSE =1,
+    XN_POSE_DETECTION_STATE_UNDEFINED   =2
+} XnPoseDetectionState;
+/** Possible statuses for calibration */
+typedef enum XnCalibrationStatus
+{
+	XN_CALIBRATION_STATUS_OK		    = 0,
+	XN_CALIBRATION_STATUS_NO_USER	    = 1,
+	XN_CALIBRATION_STATUS_ARM		    = 2,
+	XN_CALIBRATION_STATUS_LEG		    = 3,
+	XN_CALIBRATION_STATUS_HEAD		    = 4,
+	XN_CALIBRATION_STATUS_TORSO		    = 5,
+	XN_CALIBRATION_STATUS_TOP_FOV	    = 6,
+	XN_CALIBRATION_STATUS_SIDE_FOV	    = 7,
+	XN_CALIBRATION_STATUS_POSE		    = 8,
+    XN_CALIBRATION_STATUS_MANUAL_ABORT  = 9,
+    XN_CALIBRATION_STATUS_MANUAL_RESET  = 10,
+    XN_CALIBRATION_STATUS_TIMEOUT_FAIL = 11
+} XnCalibrationStatus;
+
+typedef enum XnDirection
+{
+	XN_DIRECTION_ILLEGAL	= 0,
+	XN_DIRECTION_LEFT		= 1,
+	XN_DIRECTION_RIGHT		= 2,
+	XN_DIRECTION_UP			= 3,
+	XN_DIRECTION_DOWN		= 4,
+	XN_DIRECTION_FORWARD	= 5,
+	XN_DIRECTION_BACKWARD	= 6,
+} XnDirection;
+
 // User
 /**
  * Callback for a general user-related event. It is used for either creation or destruction of users.
@@ -666,6 +728,17 @@ typedef void (XN_CALLBACK_TYPE* XnHandUpdate)(XnNodeHandle hNode, XnUserID user,
  */
 typedef void (XN_CALLBACK_TYPE* XnHandDestroy)(XnNodeHandle hNode, XnUserID user, XnFloat fTime, void* pCookie);
 
+/**
+ * Callback for when a hand reaches the edge of the FOV
+ *
+ * @param	hNode		[in]	A handle to the hand generator that raised this event.
+ * @param	user		[in]	The id of the hand that reached FOV
+ * @param	pPosition	[in]	The current position of the hand
+ * @param	fTime		[in]	Timestamp, in seconds
+ * @param	eDir		[in]	The direction of the edge that is being reached
+ * @param	pCookie		[in]	A user-provided cookie that was given when reigstering to this event
+ */
+typedef void (XN_CALLBACK_TYPE* XnHandTouchingFOVEdge)(XnNodeHandle hNode, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, XnDirection eDir, void* pCookie);
 // Gesture Module
 /**
  * Callback for the recognition of a gesture
@@ -688,6 +761,9 @@ typedef void (XN_CALLBACK_TYPE* XnGestureRecognized)(XnNodeHandle hNode, const X
  */
 typedef void (XN_CALLBACK_TYPE* XnGestureProgress)(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, XnFloat fProgress, void* pCookie);
 
+typedef void (XN_CALLBACK_TYPE* XnGestureIntermediateStageCompleted)(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie);
+typedef void (XN_CALLBACK_TYPE* XnGestureReadyForNextIntermediateStage)(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie);
+
 // Skeleton
 /**
  * Callback for indication that a specific user's skeleton is now starting the calibration process
@@ -707,6 +783,9 @@ typedef void (XN_CALLBACK_TYPE* XnCalibrationStart)(XnNodeHandle hNode, XnUserID
  */
 typedef void (XN_CALLBACK_TYPE* XnCalibrationEnd)(XnNodeHandle hNode, XnUserID user, XnBool bSuccess, void* pCookie);
 
+typedef void (XN_CALLBACK_TYPE* XnCalibrationInProgress)(XnNodeHandle hNode, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie);
+typedef void (XN_CALLBACK_TYPE* XnCalibrationComplete)(XnNodeHandle hNode, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie);
+
 // Pose Detection
 /**
  * Callback for indication that a specific user has entered a pose, or left it.
@@ -718,6 +797,8 @@ typedef void (XN_CALLBACK_TYPE* XnCalibrationEnd)(XnNodeHandle hNode, XnUserID u
  */
 typedef void (XN_CALLBACK_TYPE* XnPoseDetectionCallback)(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie);
 
+typedef void (XN_CALLBACK_TYPE* XnPoseDetectionInProgress)(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, XnPoseDetectionStatus poseDetectionError, void* pCookie);
+
 //---------------------------------------------------------------------------
 // Recorder Types
 //---------------------------------------------------------------------------
@@ -771,7 +852,7 @@ typedef struct XnRecorderOutputStreamInterface
 	 * @param	seekType	 [in]	Specifies how to seek - according to current position, end or beginning.
 	 * @param	nOffset		 [in]	Specifies how many bytes to move
 	 */
-	XnStatus (XN_CALLBACK_TYPE* Seek)(void* pCookie, XnOSSeekType seekType, const XnUInt32 nOffset);
+	XnStatus (XN_CALLBACK_TYPE* Seek)(void* pCookie, XnOSSeekType seekType, const XnInt32 nOffset);
 
 	/**
 	 * Tells the current position in the stream.
@@ -789,6 +870,26 @@ typedef struct XnRecorderOutputStreamInterface
 	 * @param	pCookie		[in]	A token that was received with this interface.
 	 */
 	void (XN_CALLBACK_TYPE* Close)(void* pCookie);
+
+	/**
+	 * Sets the stream's pointer to the specified position. (64bit version, for large files)
+	 *
+	 * @param	pCookie		 [in]	A cookie that was received with this interface.
+	 * @param	seekType	 [in]	Specifies how to seek - according to current position, end or beginning.
+	 * @param	nOffset		 [in]	Specifies how many bytes to move
+	 */
+	XnStatus (XN_CALLBACK_TYPE* Seek64)(void* pCookie, XnOSSeekType seekType, const XnInt64 nOffset);
+
+	/**
+	 * Tells the current position in the stream. (64bit version, for large files)
+	 *
+	 * @param	pCookie		[in]	A cookie that was received with this interface.
+	 * @param	pPos		[out]	The position of the stream.
+	 *
+	 * @returns (XnUInt64)-1 on error.
+	 */
+	XnUInt64 (XN_CALLBACK_TYPE* Tell64)(void* pCookie);
+
 } XnRecorderOutputStreamInterface;
 
 /** 
@@ -840,6 +941,26 @@ typedef struct XnPlayerInputStreamInterface
 	 * @param	pCookie		 [in]	A cookie that was received with this interface.
 	 */
 	void (XN_CALLBACK_TYPE* Close)(void* pCookie);
+
+	/**
+	 * Sets the stream's pointer to the specified position. (64bit version, for large files)
+	 *
+	 * @param	pCookie		 [in]	A cookie that was received with this interface.
+	 * @param	seekType	 [in]	Specifies how to seek - according to current position, end or beginning.
+	 * @param	nOffset		 [in]	Specifies how many bytes to move
+	 */
+	XnStatus (XN_CALLBACK_TYPE* Seek64)(void* pCookie, XnOSSeekType seekType, const XnInt64 nOffset);
+
+	/**
+	 * Tells the current position in the stream. (64bit version, for large files)
+	 *
+	 * @param	pCookie		[in]	A cookie that was received with this interface.
+	 * @param	pPos		[out]	The position of the stream.
+	 *
+	 * @returns (XnUInt64)-1 on error.
+	 */
+	XnUInt64 (XN_CALLBACK_TYPE* Tell64)(void* pCookie);
+
 } XnPlayerInputStreamInterface;
 
 /** 
diff --git a/Include/XnUSB.h b/Include/XnUSB.h
index ad5cd90..0cfbab2 100644
--- a/Include/XnUSB.h
+++ b/Include/XnUSB.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -72,46 +72,46 @@ typedef XnBool (XN_CALLBACK_TYPE* XnUSBEventCallbackFunctionPtr)(XnUSBEventType
 //---------------------------------------------------------------------------
 // Exported Function Declaration
 //---------------------------------------------------------------------------
-XN_C_API XnStatus xnUSBInit();
-XN_C_API XnStatus xnUSBShutdown();
+XN_C_API XnStatus XN_C_DECL xnUSBInit();
+XN_C_API XnStatus XN_C_DECL xnUSBShutdown();
 
-XN_C_API XnStatus XN_API_DEPRECATED("Use xnUSBEnumerateDevices() instead") xnUSBIsDevicePresent(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, XnBool* pbDevicePresent);
+XN_C_API XnStatus XN_API_DEPRECATED("Use xnUSBEnumerateDevices() instead") XN_C_DECL xnUSBIsDevicePresent(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, XnBool* pbDevicePresent);
 
-XN_C_API XnStatus xnUSBEnumerateDevices(XnUInt16 nVendorID, XnUInt16 nProductID, const XnUSBConnectionString** pastrDevicePaths, XnUInt32* pnCount);
-XN_C_API void xnUSBFreeDevicesList(const XnUSBConnectionString* astrDevicePaths);
+XN_C_API XnStatus XN_C_DECL xnUSBEnumerateDevices(XnUInt16 nVendorID, XnUInt16 nProductID, const XnUSBConnectionString** pastrDevicePaths, XnUInt32* pnCount);
+XN_C_API void XN_C_DECL xnUSBFreeDevicesList(const XnUSBConnectionString* astrDevicePaths);
 
-XN_C_API XnStatus XN_API_DEPRECATED("Use xnUSBOpenDeviceByPath() instead") xnUSBOpenDevice(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, void* pExtraParam2, XN_USB_DEV_HANDLE* pDevHandlePtr);
-XN_C_API XnStatus xnUSBOpenDeviceByPath(const XnUSBConnectionString strDevicePath, XN_USB_DEV_HANDLE* pDevHandlePtr);
-XN_C_API XnStatus xnUSBCloseDevice(XN_USB_DEV_HANDLE pDevHandle);
+XN_C_API XnStatus XN_API_DEPRECATED("Use xnUSBOpenDeviceByPath() instead") XN_C_DECL xnUSBOpenDevice(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, void* pExtraParam2, XN_USB_DEV_HANDLE* pDevHandlePtr);
+XN_C_API XnStatus XN_C_DECL xnUSBOpenDeviceByPath(const XnUSBConnectionString strDevicePath, XN_USB_DEV_HANDLE* pDevHandlePtr);
+XN_C_API XnStatus XN_C_DECL xnUSBCloseDevice(XN_USB_DEV_HANDLE pDevHandle);
 
-XN_C_API XnStatus xnUSBGetDeviceSpeed(XN_USB_DEV_HANDLE pDevHandle, XnUSBDeviceSpeed* pDevSpeed);
+XN_C_API XnStatus XN_C_DECL xnUSBGetDeviceSpeed(XN_USB_DEV_HANDLE pDevHandle, XnUSBDeviceSpeed* pDevSpeed);
 
-XN_C_API XnStatus xnUSBSetConfig(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 nConfig);
-XN_C_API XnStatus xnUSBGetConfig(XN_USB_DEV_HANDLE pDevHandle, XnUInt8* pnConfig);
+XN_C_API XnStatus XN_C_DECL xnUSBSetConfig(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 nConfig);
+XN_C_API XnStatus XN_C_DECL xnUSBGetConfig(XN_USB_DEV_HANDLE pDevHandle, XnUInt8* pnConfig);
 
-XN_C_API XnStatus xnUSBSetInterface(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 nInterface, XnUInt8 nAltInterface);
-XN_C_API XnStatus xnUSBGetInterface(XN_USB_DEV_HANDLE pDevHandle, XnUInt8* pnInterface, XnUInt8* pnAltInterface);
+XN_C_API XnStatus XN_C_DECL xnUSBSetInterface(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 nInterface, XnUInt8 nAltInterface);
+XN_C_API XnStatus XN_C_DECL xnUSBGetInterface(XN_USB_DEV_HANDLE pDevHandle, XnUInt8* pnInterface, XnUInt8* pnAltInterface);
 
-XN_C_API XnStatus xnUSBOpenEndPoint(XN_USB_DEV_HANDLE pDevHandle, XnUInt16 nEndPointID, XnUSBEndPointType nEPType, XnUSBDirectionType nDirType, XN_USB_EP_HANDLE* pEPHandlePtr);
-XN_C_API XnStatus xnUSBCloseEndPoint(XN_USB_EP_HANDLE pEPHandle);
-XN_C_API XnStatus xnUSBGetEndPointMaxPacketSize(XN_USB_EP_HANDLE pEPHandle, XnUInt32* pnMaxPacketSize);
+XN_C_API XnStatus XN_C_DECL xnUSBOpenEndPoint(XN_USB_DEV_HANDLE pDevHandle, XnUInt16 nEndPointID, XnUSBEndPointType nEPType, XnUSBDirectionType nDirType, XN_USB_EP_HANDLE* pEPHandlePtr);
+XN_C_API XnStatus XN_C_DECL xnUSBCloseEndPoint(XN_USB_EP_HANDLE pEPHandle);
+XN_C_API XnStatus XN_C_DECL xnUSBGetEndPointMaxPacketSize(XN_USB_EP_HANDLE pEPHandle, XnUInt32* pnMaxPacketSize);
 
-XN_C_API XnStatus xnUSBAbortEndPoint(XN_USB_EP_HANDLE pEPHandle);
-XN_C_API XnStatus xnUSBFlushEndPoint(XN_USB_EP_HANDLE pEPHandle);
-XN_C_API XnStatus xnUSBResetEndPoint(XN_USB_EP_HANDLE pEPHandle);
+XN_C_API XnStatus XN_C_DECL xnUSBAbortEndPoint(XN_USB_EP_HANDLE pEPHandle);
+XN_C_API XnStatus XN_C_DECL xnUSBFlushEndPoint(XN_USB_EP_HANDLE pEPHandle);
+XN_C_API XnStatus XN_C_DECL xnUSBResetEndPoint(XN_USB_EP_HANDLE pEPHandle);
 
-XN_C_API XnStatus xnUSBSendControl(XN_USB_DEV_HANDLE pDevHandle, XnUSBControlType nType, XnUInt8 nRequest, XnUInt16 nValue, XnUInt16 nIndex, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut);
-XN_C_API XnStatus xnUSBReceiveControl(XN_USB_DEV_HANDLE pDevHandle, XnUSBControlType nType, XnUInt8 nRequest, XnUInt16 nValue, XnUInt16 nIndex, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut);
+XN_C_API XnStatus XN_C_DECL xnUSBSendControl(XN_USB_DEV_HANDLE pDevHandle, XnUSBControlType nType, XnUInt8 nRequest, XnUInt16 nValue, XnUInt16 nIndex, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut);
+XN_C_API XnStatus XN_C_DECL xnUSBReceiveControl(XN_USB_DEV_HANDLE pDevHandle, XnUSBControlType nType, XnUInt8 nRequest, XnUInt16 nValue, XnUInt16 nIndex, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut);
 
-XN_C_API XnStatus xnUSBReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut);
-XN_C_API XnStatus xnUSBWriteEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut);
+XN_C_API XnStatus XN_C_DECL xnUSBReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut);
+XN_C_API XnStatus XN_C_DECL xnUSBWriteEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut);
 
-XN_C_API XnStatus xnUSBQueueReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut);
-XN_C_API XnStatus xnUSBFinishReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut);
+XN_C_API XnStatus XN_C_DECL xnUSBQueueReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut);
+XN_C_API XnStatus XN_C_DECL xnUSBFinishReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut);
 
-XN_C_API XnStatus xnUSBInitReadThread(XN_USB_EP_HANDLE pEPHandle, XnUInt32 nBufferSize, XnUInt32 nNumBuffers, XnUInt32 nTimeOut, XnUSBReadCallbackFunctionPtr pCallbackFunction, void* pCallbackData);
-XN_C_API XnStatus xnUSBShutdownReadThread(XN_USB_EP_HANDLE pEPHandle);
+XN_C_API XnStatus XN_C_DECL xnUSBInitReadThread(XN_USB_EP_HANDLE pEPHandle, XnUInt32 nBufferSize, XnUInt32 nNumBuffers, XnUInt32 nTimeOut, XnUSBReadCallbackFunctionPtr pCallbackFunction, void* pCallbackData);
+XN_C_API XnStatus XN_C_DECL xnUSBShutdownReadThread(XN_USB_EP_HANDLE pEPHandle);
 
-XN_C_API XnStatus xnUSBSetCallbackHandler(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, XnUSBEventCallbackFunctionPtr pCallbackFunction, void* pCallbackData);
+XN_C_API XnStatus XN_C_DECL xnUSBSetCallbackHandler(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, XnUSBEventCallbackFunctionPtr pCallbackFunction, void* pCallbackData);
 
 #endif //_XN_USB_H_
diff --git a/Include/XnUSBDevice.h b/Include/XnUSBDevice.h
new file mode 100644
index 0000000..b0d64a4
--- /dev/null
+++ b/Include/XnUSBDevice.h
@@ -0,0 +1,108 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef _XN_USB_DEVICE_H_
+#define _XN_USB_DEVICE_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnPlatform.h"
+#include "XnStatus.h"
+
+#if (XN_PLATFORM == XN_PLATFORM_WIN32)
+
+	#include <Win32/usb100.h>
+	typedef USB_ENDPOINT_DESCRIPTOR XnUSBEndpointDescriptor;
+	typedef USB_INTERFACE_DESCRIPTOR XnUSBInterfaceDescriptor;
+	typedef USB_CONFIGURATION_DESCRIPTOR XnUSBConfigDescriptor;
+	typedef USB_DEVICE_DESCRIPTOR XnUSBDeviceDescriptor;
+
+	#define USB_DT_CONFIG_SIZE 0
+	#define USB_DT_CONFIG 0
+	#define USB_CONFIG_ATT_ONE 0
+	#define USB_DT_ENDPOINT_SIZE 0
+	#define USB_DT_ENDPOINT 0
+	#define USB_ENDPOINT_XFER_BULK 0
+	#define USB_DT_INTERFACE_SIZE 0
+	#define USB_DT_INTERFACE 0
+	#define USB_CLASS_VENDOR_SPEC 0
+	#define USB_DT_DEVICE_SIZE 0
+	#define USB_DT_DEVICE 0
+
+#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM)
+	#include <linux/usb/ch9.h>
+	typedef struct usb_endpoint_descriptor XnUSBEndpointDescriptor;
+	typedef struct usb_interface_descriptor XnUSBInterfaceDescriptor;
+	typedef struct usb_config_descriptor XnUSBConfigDescriptor;
+	typedef struct usb_device_descriptor XnUSBDeviceDescriptor;
+#else
+	#error "Unsupported Platform!"
+#endif
+
+//---------------------------------------------------------------------------
+// Structures & Enums
+//---------------------------------------------------------------------------
+typedef struct XnUSBStringDescriptor
+{
+	XnUInt8 nID;
+	const XnChar* strString;
+} XnUSBStringDescriptor;
+
+typedef struct XnUSBInterfaceDescriptorHolder
+{
+	XnUSBInterfaceDescriptor descriptor;
+	XnUSBEndpointDescriptor** aEndpoints;	
+} XnUSBInterfaceDescriptorHolder;
+
+typedef struct XnUSBConfigDescriptorHolder
+{
+	XnUSBConfigDescriptor descriptor;
+	XnUSBInterfaceDescriptorHolder** aInterfaces;
+} XnUSBConfigDescriptorHolder;
+
+typedef struct XnUSBDeviceDescriptorHolder
+{
+	XnUSBDeviceDescriptor descriptor;
+	XnUSBConfigDescriptorHolder** aConfigurations;
+	XnUSBStringDescriptor* aStrings;
+	XnUInt8 nStrings;
+} XnUSBDeviceDescriptorHolder;
+
+struct XnUSBDevice;
+typedef struct XnUSBDevice XnUSBDevice;
+
+typedef void (*XnUSBDeviceNewControlRequestCallback)(XnUSBDevice* pDevice, void* pCookie);
+
+//---------------------------------------------------------------------------
+// API
+//---------------------------------------------------------------------------
+XN_C_API XnStatus XN_C_DECL xnUSBDeviceInit(const XnUSBDeviceDescriptorHolder* pDeviceDescriptor, XnUInt32 nControlMessageMaxSize, XnUSBDevice** ppDevice);
+XN_C_API void XN_C_DECL xnUSBDeviceShutdown(XnUSBDevice* pDevice);
+XN_C_API XnBool XN_C_DECL xnUSBDeviceIsControlRequestPending(XnUSBDevice* pDevice);
+
+//pnRequestSize is max size on input, actual size on output
+XN_C_API XnStatus XN_C_DECL xnUSBDeviceReceiveControlRequest(XnUSBDevice* pDevice, XnUChar* pBuffer, XnUInt32* pnRequestSize);
+XN_C_API XnStatus XN_C_DECL xnUSBDeviceSendControlReply(XnUSBDevice* pDevice, const XnUChar* pBuffer, XnUInt32 nReplySize);
+XN_C_API XnStatus XN_C_DECL xnUSBDeviceSetNewControlRequestCallback(XnUSBDevice* pDevice, XnUSBDeviceNewControlRequestCallback pFunc, void* pCookie);
+XN_C_API XnStatus XN_C_DECL xnUSBDeviceWriteEndpoint(XnUSBDevice* pDevice, XnUInt8 nAddress, const XnUChar* pData, XnUInt32 nDataSize);
+
+#endif
\ No newline at end of file
diff --git a/Include/XnUtils.h b/Include/XnUtils.h
index 7f76b53..4e96fa4 100644
--- a/Include/XnUtils.h
+++ b/Include/XnUtils.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -49,7 +49,7 @@
  *
  * @param	pVersion	[out]	Current DLL version
  */
-XN_C_API XnStatus xnGetVersion(XnVersion* pVersion);
+XN_C_API XnStatus XN_C_DECL xnGetVersion(XnVersion* pVersion);
 
 /// @}
 
@@ -63,7 +63,7 @@ XN_C_API XnStatus xnGetVersion(XnVersion* pVersion);
  *
  * @param	Type	[in]	The type of the production node.
  */
-XN_C_API const XnChar* xnProductionNodeTypeToString(XnProductionNodeType Type);
+XN_C_API const XnChar* XN_C_DECL xnProductionNodeTypeToString(XnProductionNodeType Type);
 
 /**
  * Gets a type from its string representation.
@@ -71,14 +71,14 @@ XN_C_API const XnChar* xnProductionNodeTypeToString(XnProductionNodeType Type);
  * @param	strType	[in]	The string representation of the type.
  * @param	pType	[out]	The type of the production node.
  */
-XN_C_API XnStatus xnProductionNodeTypeFromString(const XnChar* strType, XnProductionNodeType* pType);
+XN_C_API XnStatus XN_C_DECL xnProductionNodeTypeFromString(const XnChar* strType, XnProductionNodeType* pType);
 
 /**
  * @brief Checks if a certain production node type is a generator or not
  *
  * @param	type	[in]	The type to check
  */
-XN_C_API XnBool xnIsTypeGenerator(XnProductionNodeType type);
+XN_C_API XnBool XN_C_DECL xnIsTypeGenerator(XnProductionNodeType type);
 
 /**
  * @brief Checks if a certain production node type is a derived of another type
@@ -86,7 +86,7 @@ XN_C_API XnBool xnIsTypeGenerator(XnProductionNodeType type);
  * @param	type	[in]	The type to check
  * @param	base	[in]	The base type to check against
  */
-XN_C_API XnBool xnIsTypeDerivedFrom(XnProductionNodeType type, XnProductionNodeType base);
+XN_C_API XnBool XN_C_DECL xnIsTypeDerivedFrom(XnProductionNodeType type, XnProductionNodeType base);
 
 /// @}
 
@@ -100,7 +100,7 @@ XN_C_API XnBool xnIsTypeDerivedFrom(XnProductionNodeType type, XnProductionNodeT
  *
  * @param	format [in]	Pixel Format
  */
-XN_C_API const XnChar* xnPixelFormatToString(XnPixelFormat format);
+XN_C_API const XnChar* XN_C_DECL xnPixelFormatToString(XnPixelFormat format);
 
 /**
  * Gets pixel format by its name.
@@ -108,14 +108,14 @@ XN_C_API const XnChar* xnPixelFormatToString(XnPixelFormat format);
  * @param	strName	[in]	Name of the pixel format.
  * @param	pFormat	[out]	Pixel format.
  */
-XN_C_API XnStatus xnPixelFormatFromString(const XnChar* strName, XnPixelFormat* pFormat);
+XN_C_API XnStatus XN_C_DECL xnPixelFormatFromString(const XnChar* strName, XnPixelFormat* pFormat);
 
 /**
  * Gets the bytes per pixel of a pixel format.
  *
  * @param	format	[in]	The pixel format.
  */
-XN_C_API XnUInt32 xnGetBytesPerPixelForPixelFormat(XnPixelFormat format);
+XN_C_API XnUInt32 XN_C_DECL xnGetBytesPerPixelForPixelFormat(XnPixelFormat format);
 
 /// @}
 
@@ -129,14 +129,14 @@ XN_C_API XnUInt32 xnGetBytesPerPixelForPixelFormat(XnPixelFormat format);
  *
  * @param	resolution	[in]	The resolution to translate.
  */
-XN_C_API XnUInt32 xnResolutionGetXRes(XnResolution resolution);
+XN_C_API XnUInt32 XN_C_DECL xnResolutionGetXRes(XnResolution resolution);
 
 /**
  * Gets the number of pixels in a column for given resolution.
  *
  * @param	resolution	[in]	The resolution to translate.
  */
-XN_C_API XnUInt32 xnResolutionGetYRes(XnResolution resolution);
+XN_C_API XnUInt32 XN_C_DECL xnResolutionGetYRes(XnResolution resolution);
 
 /**
  * Gets the resolution from the number of pixels in every row and column.
@@ -144,21 +144,21 @@ XN_C_API XnUInt32 xnResolutionGetYRes(XnResolution resolution);
  * @param	xRes	[in]	Number of pixels in a row.
  * @param	yRes	[in]	Number of pixels in a column.
  */
-XN_C_API XnResolution xnResolutionGetFromXYRes(XnUInt32 xRes, XnUInt32 yRes);
+XN_C_API XnResolution XN_C_DECL xnResolutionGetFromXYRes(XnUInt32 xRes, XnUInt32 yRes);
 
 /**
  * Gets resolution by its name. If resolution is unknown, XN_RESOLUTION_CUSTOM is returned.
  *
  * @param	strName	[in]	Name of the resolution.
  */
-XN_C_API XnResolution xnResolutionGetFromName(const XnChar* strName);
+XN_C_API XnResolution XN_C_DECL xnResolutionGetFromName(const XnChar* strName);
 
 /**
  * Get the name of the resolution.
  *
  * @param	resolution [in]	Resolution.
  */
-XN_C_API const XnChar* xnResolutionGetName(XnResolution resolution);
+XN_C_API const XnChar* XN_C_DECL xnResolutionGetName(XnResolution resolution);
 
 /// @}
 
@@ -175,9 +175,9 @@ XN_C_API const XnChar* xnResolutionGetName(XnResolution resolution);
  *
  * @returns <0 if first is smaller than second, 0 if same, >0 if first is greater than second.
  */
-XN_C_API XnInt32 xnVersionCompare(const XnVersion* pVersion1, const XnVersion* pVersion2);
+XN_C_API XnInt32 XN_C_DECL xnVersionCompare(const XnVersion* pVersion1, const XnVersion* pVersion2);
 
-XN_C_API XnStatus xnVersionToString(const XnVersion* pVersion, XnChar* csResult, XnUInt32 nSize);
+XN_C_API XnStatus XN_C_DECL xnVersionToString(const XnVersion* pVersion, XnChar* csResult, XnUInt32 nSize);
 
 /// @}
 
@@ -186,7 +186,7 @@ XN_C_API XnStatus xnVersionToString(const XnVersion* pVersion, XnChar* csResult,
  * @{
  */
 
-XN_C_API XnStatus xnProductionNodeDescriptionToString(const XnProductionNodeDescription* pDescription, XnChar* csResult, XnUInt32 nSize);
+XN_C_API XnStatus XN_C_DECL xnProductionNodeDescriptionToString(const XnProductionNodeDescription* pDescription, XnChar* csResult, XnUInt32 nSize);
 
 /// @}
 
@@ -195,8 +195,8 @@ XN_C_API XnStatus xnProductionNodeDescriptionToString(const XnProductionNodeDesc
  * @{
  */
 
-XN_C_API XnPoint3D xnCreatePoint3D(XnFloat x, XnFloat y, XnFloat z);
-XN_C_API XnPlane3D xnCreatePlane3D(XnPoint3D ptPoint, XnVector3D vNormal);
+XN_C_API XnPoint3D XN_C_DECL xnCreatePoint3D(XnFloat x, XnFloat y, XnFloat z);
+XN_C_API XnPlane3D XN_C_DECL xnCreatePlane3D(XnPoint3D ptPoint, XnVector3D vNormal);
 
 /// @}
 
@@ -205,9 +205,9 @@ XN_C_API XnPlane3D xnCreatePlane3D(XnPoint3D ptPoint, XnVector3D vNormal);
  * @{
  */
 
-XN_C_API XnStatus xnRegisterModule(const XnChar* strModule, const XnChar* strConfigDir);
-XN_C_API XnStatus xnUnregisterModule(const XnChar* strModule);
-XN_C_API XnStatus xnPrintRegisteredModules();
+XN_C_API XnStatus XN_C_DECL xnRegisterModule(const XnChar* strModule, const XnChar* strConfigDir);
+XN_C_API XnStatus XN_C_DECL xnUnregisterModule(const XnChar* strModule);
+XN_C_API XnStatus XN_C_DECL xnPrintRegisteredModules();
 
 /// @}
 
@@ -216,9 +216,9 @@ XN_C_API XnStatus xnPrintRegisteredModules();
  * @{
  */
 
-XN_C_API XnStatus xnRegisterGlobalLicense(XnLicense* pLicense);
-XN_C_API XnStatus xnUnregisterGlobalLicense(XnLicense* pLicense);
-XN_C_API XnStatus xnPrintRegisteredLicenses();
+XN_C_API XnStatus XN_C_DECL xnRegisterGlobalLicense(XnLicense* pLicense);
+XN_C_API XnStatus XN_C_DECL xnUnregisterGlobalLicense(XnLicense* pLicense);
+XN_C_API XnStatus XN_C_DECL xnPrintRegisteredLicenses();
 
 /// @}
 
@@ -232,53 +232,53 @@ XN_C_API XnStatus xnPrintRegisteredLicenses();
  * by calling @ref xnFreeOutputMetaData().
  * @returns NULL if allocation failed.
  */
-XN_C_API XnOutputMetaData* xnAllocateOutputMetaData();
+XN_C_API XnOutputMetaData* XN_C_DECL xnAllocateOutputMetaData();
 /**
  * Frees a previously allocated @ref XnOutputMetaData object.
  *
  * @param	pMetaData		[in]	object to be freed.
  */
-XN_C_API void xnFreeOutputMetaData(const XnOutputMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnFreeOutputMetaData(const XnOutputMetaData* pMetaData);
 /**
  * @brief Shallow-Copies an Output Meta Data object.
  *
  * @param	pDestination	[in]	Destination object.
  * @param	pSource			[in]	Source object.
  */
-XN_C_API XnStatus xnCopyOutputMetaData(XnOutputMetaData* pDestination, const XnOutputMetaData* pSource);
+XN_C_API XnStatus XN_C_DECL xnCopyOutputMetaData(XnOutputMetaData* pDestination, const XnOutputMetaData* pSource);
 
 /**
  * Allocates and returns an @ref XnMapMetaData object. When no longer needed, this object should be freed
  * by calling @ref xnFreeMapMetaData().
  * @returns NULL if allocation failed.
  */
-XN_C_API XnMapMetaData* xnAllocateMapMetaData();
+XN_C_API XnMapMetaData* XN_C_DECL xnAllocateMapMetaData();
 /**
  * Frees a previously allocated @ref XnMapMetaData object.
  *
  * @param	pMetaData		[in]	object to be freed.
  */
-XN_C_API void xnFreeMapMetaData(const XnMapMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnFreeMapMetaData(const XnMapMetaData* pMetaData);
 /**
  * @brief Shallow-Copies a Map Meta Data object.
  *
  * @param	pDestination	[in]	Destination object.
  * @param	pSource			[in]	Source object.
  */
-XN_C_API XnStatus xnCopyMapMetaData(XnMapMetaData* pDestination, const XnMapMetaData* pSource);
+XN_C_API XnStatus XN_C_DECL xnCopyMapMetaData(XnMapMetaData* pDestination, const XnMapMetaData* pSource);
 
 /**
  * Allocates and returns an @ref XnDepthMetaData object. When no longer needed, this object should be freed
  * by calling @ref xnFreeDepthMetaData().
  * @returns NULL if allocation failed.
  */
-XN_C_API XnDepthMetaData* xnAllocateDepthMetaData();
+XN_C_API XnDepthMetaData* XN_C_DECL xnAllocateDepthMetaData();
 /**
  * Frees a previously allocated @ref XnDepthMetaData object.
  *
  * @param	pMetaData		[in]	object to be freed.
  */
-XN_C_API void xnFreeDepthMetaData(const XnDepthMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnFreeDepthMetaData(const XnDepthMetaData* pMetaData);
 /**
  * @brief Shallow-Copies a Depth Meta Data object. Note that the data buffer is not copied, and that both
  * object will point to the same buffer.
@@ -286,20 +286,20 @@ XN_C_API void xnFreeDepthMetaData(const XnDepthMetaData* pMetaData);
  * @param	pDestination	[in]	Destination object.
  * @param	pSource			[in]	Source object.
  */
-XN_C_API XnStatus xnCopyDepthMetaData(XnDepthMetaData* pDestination, const XnDepthMetaData* pSource);
+XN_C_API XnStatus XN_C_DECL xnCopyDepthMetaData(XnDepthMetaData* pDestination, const XnDepthMetaData* pSource);
 
 /**
  * Allocates and returns an @ref XnImageMetaData object. When no longer needed, this object should be freed
  * by calling @ref xnFreeImageMetaData().
  * @returns NULL if allocation failed.
  */
-XN_C_API XnImageMetaData* xnAllocateImageMetaData();
+XN_C_API XnImageMetaData* XN_C_DECL xnAllocateImageMetaData();
 /**
  * Frees a previously allocated @ref XnImageMetaData object.
  *
  * @param	pMetaData		[in]	object to be freed.
  */
-XN_C_API void xnFreeImageMetaData(const XnImageMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnFreeImageMetaData(const XnImageMetaData* pMetaData);
 /**
  * @brief Shallow-Copies an Image Meta Data object. Note that the data buffer is not copied, and that both
  * object will point to the same buffer.
@@ -307,20 +307,20 @@ XN_C_API void xnFreeImageMetaData(const XnImageMetaData* pMetaData);
  * @param	pDestination	[in]	Destination object.
  * @param	pSource			[in]	Source object.
  */
-XN_C_API XnStatus xnCopyImageMetaData(XnImageMetaData* pDestination, const XnImageMetaData* pSource);
+XN_C_API XnStatus XN_C_DECL xnCopyImageMetaData(XnImageMetaData* pDestination, const XnImageMetaData* pSource);
 
 /**
  * Allocates and returns an @ref XnIRMetaData object. When no longer needed, this object should be freed
  * by calling @ref xnFreeIRMetaData().
  * @returns NULL if allocation failed.
  */
-XN_C_API XnIRMetaData* xnAllocateIRMetaData();
+XN_C_API XnIRMetaData* XN_C_DECL xnAllocateIRMetaData();
 /**
  * Frees a previously allocated @ref XnIRMetaData object.
  *
  * @param	pMetaData		[in]	object to be freed.
  */
-XN_C_API void xnFreeIRMetaData(const XnIRMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnFreeIRMetaData(const XnIRMetaData* pMetaData);
 /**
  * @brief Shallow-Copies an IR Meta Data object. Note that the data buffer is not copied, and that both
  * object will point to the same buffer.
@@ -328,20 +328,20 @@ XN_C_API void xnFreeIRMetaData(const XnIRMetaData* pMetaData);
  * @param	pDestination	[in]	Destination object.
  * @param	pSource			[in]	Source object.
  */
-XN_C_API XnStatus xnCopyIRMetaData(XnIRMetaData* pDestination, const XnIRMetaData* pSource);
+XN_C_API XnStatus XN_C_DECL xnCopyIRMetaData(XnIRMetaData* pDestination, const XnIRMetaData* pSource);
 
 /**
  * Allocates and returns an @ref XnAudioMetaData object. When no longer needed, this object should be freed
  * by calling @ref xnFreeAudioMetaData().
  * @returns NULL if allocation failed.
  */
-XN_C_API XnAudioMetaData* xnAllocateAudioMetaData();
+XN_C_API XnAudioMetaData* XN_C_DECL xnAllocateAudioMetaData();
 /**
  * Frees a previously allocated @ref XnAudioMetaData object.
  *
  * @param	pMetaData		[in]	object to be freed.
  */
-XN_C_API void xnFreeAudioMetaData(const XnAudioMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnFreeAudioMetaData(const XnAudioMetaData* pMetaData);
 /**
  * @brief Shallow-Copies an Audio Meta Data object. Note that the data buffer is not copied, and that both
  * object will point to the same buffer.
@@ -349,20 +349,20 @@ XN_C_API void xnFreeAudioMetaData(const XnAudioMetaData* pMetaData);
  * @param	pDestination	[in]	Destination object.
  * @param	pSource			[in]	Source object.
  */
-XN_C_API XnStatus xnCopyAudioMetaData(XnAudioMetaData* pDestination, const XnAudioMetaData* pSource);
+XN_C_API XnStatus XN_C_DECL xnCopyAudioMetaData(XnAudioMetaData* pDestination, const XnAudioMetaData* pSource);
 
 /**
  * Allocates and returns an @ref XnSceneMetaData object. When no longer needed, this object should be freed
  * by calling @ref xnFreeSceneMetaData().
  * @returns NULL if allocation failed.
  */
-XN_C_API XnSceneMetaData* xnAllocateSceneMetaData();
+XN_C_API XnSceneMetaData* XN_C_DECL xnAllocateSceneMetaData();
 /**
  * Frees a previously allocated @ref XnSceneMetaData object.
  *
  * @param	pMetaData		[in]	object to be freed.
  */
-XN_C_API void xnFreeSceneMetaData(const XnSceneMetaData* pMetaData);
+XN_C_API void XN_C_DECL xnFreeSceneMetaData(const XnSceneMetaData* pMetaData);
 /**
  * @brief Shallow-Copies a Scene Meta Data object. Note that the data buffer is not copied, and that both
  * object will point to the same buffer.
@@ -370,7 +370,7 @@ XN_C_API void xnFreeSceneMetaData(const XnSceneMetaData* pMetaData);
  * @param	pDestination	[in]	Destination object.
  * @param	pSource			[in]	Source object.
  */
-XN_C_API XnStatus xnCopySceneMetaData(XnSceneMetaData* pDestination, const XnSceneMetaData* pSource);
+XN_C_API XnStatus XN_C_DECL xnCopySceneMetaData(XnSceneMetaData* pDestination, const XnSceneMetaData* pSource);
 
 /// @}
 
@@ -391,7 +391,7 @@ XN_C_API XnStatus xnCopySceneMetaData(XnSceneMetaData* pDestination, const XnSce
  * @param	pErrors			[in]	The errors object passed to Enumerate method.
  * @param	pQuery			[in]	[Optional] A filter to be used for finding the appropriate input.
  */
-XN_C_API XnStatus xnAutoEnumerateOverSingleInput(XnContext* pContext, XnNodeInfoList* pList, XnProductionNodeDescription* pDescription, const XnChar* strCreationInfo, XnProductionNodeType InputType, XnEnumerationErrors* pErrors, XnNodeQuery* pQuery);
+XN_C_API XnStatus XN_C_DECL xnAutoEnumerateOverSingleInput(XnContext* pContext, XnNodeInfoList* pList, XnProductionNodeDescription* pDescription, const XnChar* strCreationInfo, XnProductionNodeType InputType, XnEnumerationErrors* pErrors, XnNodeQuery* pQuery);
 
 /**
  * Registers an extension node with OpenNI. An extension node is a node of type not defined by OpenNI.
@@ -400,14 +400,14 @@ XN_C_API XnStatus xnAutoEnumerateOverSingleInput(XnContext* pContext, XnNodeInfo
  * @param	baseType		[in]	Type of the direct base for this extension.
  * @param	pTypeID			[out]	The new ID registered with OpenNI.
  */
-XN_C_API XnStatus xnRegisterExtensionNode(const XnChar* strTypeName, XnProductionNodeType baseType, XnProductionNodeType* pTypeID);
+XN_C_API XnStatus XN_C_DECL xnRegisterExtensionNode(const XnChar* strTypeName, XnProductionNodeType baseType, XnProductionNodeType* pTypeID);
 
 /**
  * Gets the module node handle of a node. This is useful for extension implementors.
  *
  * @param	hNode			[in]	The node to get its module node handle.
  */
-XN_C_API XnModuleNodeHandle xnGetModuleNodeHandle(XnNodeHandle hNode);
+XN_C_API XnModuleNodeHandle XN_C_DECL xnGetModuleNodeHandle(XnNodeHandle hNode);
 
 #if !XN_PLATFORM_SUPPORTS_DYNAMIC_LIBS
 /**
@@ -417,7 +417,7 @@ XN_C_API XnModuleNodeHandle xnGetModuleNodeHandle(XnNodeHandle hNode);
  * @param	strConfigDir	[in]	The module configuration directory.
  * @param	strName			[in]	Name of this module.
  */
-XN_C_API XnStatus xnRegisterModuleWithOpenNI(XnOpenNIModuleInterface* pInterface, const XnChar* strConfigDir, const XnChar* strName);
+XN_C_API XnStatus XN_C_DECL xnRegisterModuleWithOpenNI(XnOpenNIModuleInterface* pInterface, const XnChar* strConfigDir, const XnChar* strName);
 #endif
 
 /// @}
diff --git a/Include/XnVersion.h b/Include/XnVersion.h
index ece797e..d93c5aa 100644
--- a/Include/XnVersion.h
+++ b/Include/XnVersion.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -33,11 +33,11 @@
 /** OpenNI major version. */ 
 #define XN_MAJOR_VERSION 1
 /** OpenNI minor version. */ 
-#define XN_MINOR_VERSION 1
+#define XN_MINOR_VERSION 5
 /** OpenNI maintenance version. */ 
-#define XN_MAINTENANCE_VERSION 0
+#define XN_MAINTENANCE_VERSION 2
 /** OpenNI build version. */ 
-#define XN_BUILD_VERSION 41
+#define XN_BUILD_VERSION 23
 
 /** OpenNI version (in brief string format): "Major.Minor.Maintenance (Build)" */ 
 #define XN_BRIEF_VERSION_STRING \
diff --git a/Platform/Android/Samples/SamplesAssistant/AndroidManifest.xml b/Platform/Android/Samples/SamplesAssistant/AndroidManifest.xml
new file mode 100644
index 0000000..494342f
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/AndroidManifest.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="org.OpenNI.Samples.Assistant"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <uses-sdk android:minSdkVersion="10"/>
+
+    <application android:icon="@drawable/icon" android:label="@string/app_name">
+        <activity android:name=".OpenNIBaseActivity"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+</manifest>
\ No newline at end of file
diff --git a/Platform/Android/Samples/SamplesAssistant/default.properties b/Platform/Android/Samples/SamplesAssistant/default.properties
new file mode 100644
index 0000000..2ba8b4c
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/default.properties
@@ -0,0 +1,12 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-11
+android.library=true
diff --git a/Platform/Android/Samples/SamplesAssistant/jni/Android.mk b/Platform/Android/Samples/SamplesAssistant/jni/Android.mk
new file mode 100644
index 0000000..e4b980d
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/jni/Android.mk
@@ -0,0 +1,39 @@
+# OpenNISamplesAssistant.jni Android makefile.
+# libOpenNISamplesAssistant.jni.so
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS) 
+
+# set path to source
+MY_PREFIX := $(LOCAL_PATH)/
+OPENNI_DIR := $(LOCAL_PATH)/../../../../..
+
+# list all source files
+MY_SRC_FILES := \
+	$(MY_PREFIX)*.cpp
+
+# expand the wildcards
+MY_SRC_FILE_EXPANDED := $(wildcard $(MY_SRC_FILES))
+
+# make those paths relative to here
+LOCAL_SRC_FILES := $(MY_SRC_FILE_EXPANDED:$(LOCAL_PATH)/%=%)
+
+LOCAL_C_INCLUDES := \
+	$(MY_PREFIX) \
+	$(OPENNI_DIR)/Include/
+
+LOCAL_CFLAGS:= -fvisibility=hidden -DXN_EXPORTS
+
+LOCAL_LDFLAGS += -Wl,--export-dynamic --dynamic-linker
+
+LOCAL_LDLIBS := -llog
+LOCAL_LDLIBS += $(OPENNI_DIR)/Platform/Android/libs/armeabi-v7a/libOpenNI.so
+
+#LOCAL_SHARED_LIBRARIES := OpenNI
+
+LOCAL_PREBUILT_LIBS := libc 
+
+LOCAL_MODULE:= OpenNISamplesAssistant.jni
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/Platform/Android/Samples/SamplesAssistant/jni/Application.mk b/Platform/Android/Samples/SamplesAssistant/jni/Application.mk
new file mode 100644
index 0000000..53ae0ca
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/jni/Application.mk
@@ -0,0 +1,33 @@
+###################
+#      NOTE       #
+###################
+# if you change the flags here, you might want/need to change them in the libOpenNI.so as well.
+
+APP_STL := gnustl_static
+
+# Android >= v2.3
+APP_PLATFORM := android-9
+
+# Build ARMv7-A machine code.
+APP_ABI := armeabi-v7a
+APP_CFLAGS := -O3 -ftree-vectorize -ffast-math -funroll-loops
+
+APP_CFLAGS += -fPIC
+
+ifeq ($(APP_ABI),armeabi-v7a)
+	APP_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mtune=cortex-a9 -mfp=vfpv3-d16 -mfpu=vfp
+
+# optionally add NEON to compilation flags.
+# to activate, run: "ndk-build USE_NEON=1"
+ifdef USE_NEON
+$(call __ndk_info,Building everything with NEON support!)
+	APP_CFLAGS += -mfpu=neon -DHAVE_NEON=1 -flax-vector-conversions
+endif
+endif
+
+APP_CPPFLAGS += -frtti
+
+#$(call __ndk_info,APP_CFLAGS=$(APP_CFLAGS))
+#$(call __ndk_info,APP_CPPFLAGS=$(APP_CPPFLAGS))
+
+#-fsingle-precision-constant
diff --git a/Platform/Android/Samples/SamplesAssistant/jni/jni.h b/Platform/Android/Samples/SamplesAssistant/jni/jni.h
new file mode 100644
index 0000000..8ed7366
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/jni/jni.h
@@ -0,0 +1,1944 @@
+/*
+ * %W% %E%
+ *
+ * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * ORACLE PROPRIETARY/CONFIDENTIAL.  Use is subject to license terms.
+ */
+
+/*
+ * We used part of Netscape's Java Runtime Interface (JRI) as the starting
+ * point of our design and implementation.
+ */
+
+/******************************************************************************
+ * Java Runtime Interface
+ * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
+ *****************************************************************************/
+
+#ifndef _JAVASOFT_JNI_H_
+#define _JAVASOFT_JNI_H_
+
+#include <stdio.h>
+#include <stdarg.h>
+
+/* jni_md.h contains the machine-dependent typedefs for jbyte, jint
+   and jlong */
+
+#include "jni_md.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * JNI Types
+ */
+
+#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
+
+typedef unsigned char	jboolean;
+typedef unsigned short	jchar;
+typedef short		jshort;
+typedef float		jfloat;
+typedef double		jdouble;
+
+typedef jint            jsize;
+
+#ifdef __cplusplus
+
+class _jobject {};
+class _jclass : public _jobject {};
+class _jthrowable : public _jobject {};
+class _jstring : public _jobject {};
+class _jarray : public _jobject {};
+class _jbooleanArray : public _jarray {};
+class _jbyteArray : public _jarray {};
+class _jcharArray : public _jarray {};
+class _jshortArray : public _jarray {};
+class _jintArray : public _jarray {};
+class _jlongArray : public _jarray {};
+class _jfloatArray : public _jarray {};
+class _jdoubleArray : public _jarray {};
+class _jobjectArray : public _jarray {};
+
+typedef _jobject *jobject;
+typedef _jclass *jclass;
+typedef _jthrowable *jthrowable;
+typedef _jstring *jstring;
+typedef _jarray *jarray;
+typedef _jbooleanArray *jbooleanArray;
+typedef _jbyteArray *jbyteArray;
+typedef _jcharArray *jcharArray;
+typedef _jshortArray *jshortArray;
+typedef _jintArray *jintArray;
+typedef _jlongArray *jlongArray;
+typedef _jfloatArray *jfloatArray;
+typedef _jdoubleArray *jdoubleArray;
+typedef _jobjectArray *jobjectArray;
+
+#else
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+
+#endif
+
+typedef jobject jweak;
+
+typedef union jvalue {
+    jboolean z;
+    jbyte    b;
+    jchar    c;
+    jshort   s;
+    jint     i;
+    jlong    j;
+    jfloat   f;
+    jdouble  d;
+    jobject  l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/* Return values from jobjectRefType */
+typedef enum _jobjectType {
+     JNIInvalidRefType    = 0,
+     JNILocalRefType      = 1,
+     JNIGlobalRefType     = 2,
+     JNIWeakGlobalRefType = 3 
+} jobjectRefType;
+
+
+#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK           0                 /* success */
+#define JNI_ERR          (-1)              /* unknown error */
+#define JNI_EDETACHED    (-2)              /* thread detached from the VM */
+#define JNI_EVERSION     (-3)              /* JNI version error */
+#define JNI_ENOMEM       (-4)              /* not enough memory */
+#define JNI_EEXIST       (-5)              /* VM already created */
+#define JNI_EINVAL       (-6)              /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
+
+/*
+ * used in RegisterNatives to describe native method name, signature,
+ * and function pointer.
+ */
+
+typedef struct {
+    char *name;
+    char *signature;
+    void *fnPtr;
+} JNINativeMethod;
+
+/*
+ * JNI Native Method Interface.
+ */
+
+struct JNINativeInterface_;
+
+struct JNIEnv_;
+
+#ifdef __cplusplus
+typedef JNIEnv_ JNIEnv;
+#else
+typedef const struct JNINativeInterface_ *JNIEnv;
+#endif
+
+/*
+ * JNI Invocation Interface.
+ */
+
+struct JNIInvokeInterface_;
+
+struct JavaVM_;
+
+#ifdef __cplusplus
+typedef JavaVM_ JavaVM;
+#else
+typedef const struct JNIInvokeInterface_ *JavaVM;
+#endif
+
+struct JNINativeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    void *reserved3;
+    jint (JNICALL *GetVersion)(JNIEnv *env);
+
+    jclass (JNICALL *DefineClass)
+      (JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
+       jsize len);
+    jclass (JNICALL *FindClass)
+      (JNIEnv *env, const char *name);
+
+    jmethodID (JNICALL *FromReflectedMethod)
+      (JNIEnv *env, jobject method);
+    jfieldID (JNICALL *FromReflectedField)
+      (JNIEnv *env, jobject field);
+
+    jobject (JNICALL *ToReflectedMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
+
+    jclass (JNICALL *GetSuperclass)
+      (JNIEnv *env, jclass sub);
+    jboolean (JNICALL *IsAssignableFrom)
+      (JNIEnv *env, jclass sub, jclass sup);
+
+    jobject (JNICALL *ToReflectedField)
+      (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
+
+    jint (JNICALL *Throw)
+      (JNIEnv *env, jthrowable obj);
+    jint (JNICALL *ThrowNew)
+      (JNIEnv *env, jclass clazz, const char *msg);
+    jthrowable (JNICALL *ExceptionOccurred)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionDescribe)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionClear)
+      (JNIEnv *env);
+    void (JNICALL *FatalError)
+      (JNIEnv *env, const char *msg);
+
+    jint (JNICALL *PushLocalFrame)
+      (JNIEnv *env, jint capacity);
+    jobject (JNICALL *PopLocalFrame)
+      (JNIEnv *env, jobject result);
+
+    jobject (JNICALL *NewGlobalRef)
+      (JNIEnv *env, jobject lobj);
+    void (JNICALL *DeleteGlobalRef)
+      (JNIEnv *env, jobject gref);
+    void (JNICALL *DeleteLocalRef)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsSameObject)
+      (JNIEnv *env, jobject obj1, jobject obj2);
+    jobject (JNICALL *NewLocalRef)
+      (JNIEnv *env, jobject ref);
+    jint (JNICALL *EnsureLocalCapacity)
+      (JNIEnv *env, jint capacity);
+
+    jobject (JNICALL *AllocObject)
+      (JNIEnv *env, jclass clazz);
+    jobject (JNICALL *NewObject)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *NewObjectV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *NewObjectA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jclass (JNICALL *GetObjectClass)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsInstanceOf)
+      (JNIEnv *env, jobject obj, jclass clazz);
+
+    jmethodID (JNICALL *GetMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallObjectMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jobject (JNICALL *CallObjectMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallObjectMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jboolean (JNICALL *CallBooleanMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jboolean (JNICALL *CallBooleanMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallBooleanMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jbyte (JNICALL *CallByteMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jbyte (JNICALL *CallByteMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallByteMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallCharMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jchar (JNICALL *CallCharMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallCharMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallShortMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jshort (JNICALL *CallShortMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallShortMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallIntMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jint (JNICALL *CallIntMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jint (JNICALL *CallIntMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallLongMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jlong (JNICALL *CallLongMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallLongMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallFloatMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jfloat (JNICALL *CallFloatMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallFloatMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallDoubleMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jdouble (JNICALL *CallDoubleMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallDoubleMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallVoidMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    void (JNICALL *CallVoidMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    void (JNICALL *CallVoidMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jobject (JNICALL *CallNonvirtualObjectMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallNonvirtualObjectMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jobject (JNICALL *CallNonvirtualObjectMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jboolean (JNICALL *CallNonvirtualBooleanMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jbyte (JNICALL *CallNonvirtualByteMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallNonvirtualByteMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jbyte (JNICALL *CallNonvirtualByteMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jchar (JNICALL *CallNonvirtualCharMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallNonvirtualCharMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jchar (JNICALL *CallNonvirtualCharMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jshort (JNICALL *CallNonvirtualShortMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallNonvirtualShortMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jshort (JNICALL *CallNonvirtualShortMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jint (JNICALL *CallNonvirtualIntMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallNonvirtualIntMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jint (JNICALL *CallNonvirtualIntMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jlong (JNICALL *CallNonvirtualLongMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallNonvirtualLongMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jlong (JNICALL *CallNonvirtualLongMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jfloat (JNICALL *CallNonvirtualFloatMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallNonvirtualFloatMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jfloat (JNICALL *CallNonvirtualFloatMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jdouble (JNICALL *CallNonvirtualDoubleMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    void (JNICALL *CallNonvirtualVoidMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    void (JNICALL *CallNonvirtualVoidMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    void (JNICALL *CallNonvirtualVoidMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jfieldID (JNICALL *GetFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *GetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jboolean (JNICALL *GetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jbyte (JNICALL *GetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jchar (JNICALL *GetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jshort (JNICALL *GetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jint (JNICALL *GetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jlong (JNICALL *GetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jfloat (JNICALL *GetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jdouble (JNICALL *GetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+
+    void (JNICALL *SetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
+    void (JNICALL *SetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
+    void (JNICALL *SetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
+    void (JNICALL *SetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
+    void (JNICALL *SetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
+    void (JNICALL *SetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
+    void (JNICALL *SetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
+    void (JNICALL *SetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
+    void (JNICALL *SetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
+
+    jmethodID (JNICALL *GetStaticMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallStaticObjectMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallStaticObjectMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallStaticObjectMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jboolean (JNICALL *CallStaticBooleanMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallStaticBooleanMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallStaticBooleanMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jbyte (JNICALL *CallStaticByteMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallStaticByteMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallStaticByteMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallStaticCharMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallStaticCharMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallStaticCharMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallStaticShortMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallStaticShortMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallStaticShortMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallStaticIntMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallStaticIntMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jint (JNICALL *CallStaticIntMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallStaticLongMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallStaticLongMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallStaticLongMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallStaticFloatMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallStaticFloatMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallStaticFloatMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallStaticDoubleMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallStaticDoubleMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallStaticDoubleMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallStaticVoidMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, ...);
+    void (JNICALL *CallStaticVoidMethodV)
+      (JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
+    void (JNICALL *CallStaticVoidMethodA)
+      (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);
+
+    jfieldID (JNICALL *GetStaticFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+    jobject (JNICALL *GetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jboolean (JNICALL *GetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jbyte (JNICALL *GetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jchar (JNICALL *GetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jshort (JNICALL *GetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jint (JNICALL *GetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jlong (JNICALL *GetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jfloat (JNICALL *GetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jdouble (JNICALL *GetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+
+    void (JNICALL *SetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);
+    void (JNICALL *SetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);
+    void (JNICALL *SetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);
+    void (JNICALL *SetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);
+    void (JNICALL *SetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);
+    void (JNICALL *SetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);
+    void (JNICALL *SetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);
+    void (JNICALL *SetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);
+    void (JNICALL *SetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);
+
+    jstring (JNICALL *NewString)
+      (JNIEnv *env, const jchar *unicode, jsize len);
+    jsize (JNICALL *GetStringLength)
+      (JNIEnv *env, jstring str);
+    const jchar *(JNICALL *GetStringChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringChars)
+      (JNIEnv *env, jstring str, const jchar *chars);
+
+    jstring (JNICALL *NewStringUTF)
+      (JNIEnv *env, const char *utf);
+    jsize (JNICALL *GetStringUTFLength)
+      (JNIEnv *env, jstring str);
+    const char* (JNICALL *GetStringUTFChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringUTFChars)
+      (JNIEnv *env, jstring str, const char* chars);
+
+
+    jsize (JNICALL *GetArrayLength)
+      (JNIEnv *env, jarray array);
+
+    jobjectArray (JNICALL *NewObjectArray)
+      (JNIEnv *env, jsize len, jclass clazz, jobject init);
+    jobject (JNICALL *GetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index);
+    void (JNICALL *SetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index, jobject val);
+
+    jbooleanArray (JNICALL *NewBooleanArray)
+      (JNIEnv *env, jsize len);
+    jbyteArray (JNICALL *NewByteArray)
+      (JNIEnv *env, jsize len);
+    jcharArray (JNICALL *NewCharArray)
+      (JNIEnv *env, jsize len);
+    jshortArray (JNICALL *NewShortArray)
+      (JNIEnv *env, jsize len);
+    jintArray (JNICALL *NewIntArray)
+      (JNIEnv *env, jsize len);
+    jlongArray (JNICALL *NewLongArray)
+      (JNIEnv *env, jsize len);
+    jfloatArray (JNICALL *NewFloatArray)
+      (JNIEnv *env, jsize len);
+    jdoubleArray (JNICALL *NewDoubleArray)
+      (JNIEnv *env, jsize len);
+
+    jboolean * (JNICALL *GetBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *isCopy);
+    jbyte * (JNICALL *GetByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jboolean *isCopy);
+    jchar * (JNICALL *GetCharArrayElements)
+      (JNIEnv *env, jcharArray array, jboolean *isCopy);
+    jshort * (JNICALL *GetShortArrayElements)
+      (JNIEnv *env, jshortArray array, jboolean *isCopy);
+    jint * (JNICALL *GetIntArrayElements)
+      (JNIEnv *env, jintArray array, jboolean *isCopy);
+    jlong * (JNICALL *GetLongArrayElements)
+      (JNIEnv *env, jlongArray array, jboolean *isCopy);
+    jfloat * (JNICALL *GetFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jboolean *isCopy);
+    jdouble * (JNICALL *GetDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jboolean *isCopy);
+
+    void (JNICALL *ReleaseBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);
+    void (JNICALL *ReleaseByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);
+    void (JNICALL *ReleaseCharArrayElements)
+      (JNIEnv *env, jcharArray array, jchar *elems, jint mode);
+    void (JNICALL *ReleaseShortArrayElements)
+      (JNIEnv *env, jshortArray array, jshort *elems, jint mode);
+    void (JNICALL *ReleaseIntArrayElements)
+      (JNIEnv *env, jintArray array, jint *elems, jint mode);
+    void (JNICALL *ReleaseLongArrayElements)
+      (JNIEnv *env, jlongArray array, jlong *elems, jint mode);
+    void (JNICALL *ReleaseFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);
+    void (JNICALL *ReleaseDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);
+
+    void (JNICALL *GetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);
+    void (JNICALL *GetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);
+    void (JNICALL *GetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);
+    void (JNICALL *GetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);
+    void (JNICALL *GetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);
+    void (JNICALL *GetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);
+    void (JNICALL *GetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);
+
+    void (JNICALL *SetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);
+    void (JNICALL *SetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);
+    void (JNICALL *SetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);
+    void (JNICALL *SetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);
+    void (JNICALL *SetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);
+    void (JNICALL *SetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);
+    void (JNICALL *SetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);
+    void (JNICALL *SetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);
+
+    jint (JNICALL *RegisterNatives)
+      (JNIEnv *env, jclass clazz, const JNINativeMethod *methods,
+       jint nMethods);
+    jint (JNICALL *UnregisterNatives)
+      (JNIEnv *env, jclass clazz);
+
+    jint (JNICALL *MonitorEnter)
+      (JNIEnv *env, jobject obj);
+    jint (JNICALL *MonitorExit)
+      (JNIEnv *env, jobject obj);
+
+    jint (JNICALL *GetJavaVM)
+      (JNIEnv *env, JavaVM **vm);
+
+    void (JNICALL *GetStringRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetStringUTFRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
+
+    void * (JNICALL *GetPrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, jboolean *isCopy);
+    void (JNICALL *ReleasePrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, void *carray, jint mode);
+
+    const jchar * (JNICALL *GetStringCritical)
+      (JNIEnv *env, jstring string, jboolean *isCopy);
+    void (JNICALL *ReleaseStringCritical)
+      (JNIEnv *env, jstring string, const jchar *cstring);
+
+    jweak (JNICALL *NewWeakGlobalRef)
+       (JNIEnv *env, jobject obj);
+    void (JNICALL *DeleteWeakGlobalRef)
+       (JNIEnv *env, jweak ref);
+
+    jboolean (JNICALL *ExceptionCheck)
+       (JNIEnv *env);
+
+    jobject (JNICALL *NewDirectByteBuffer)
+       (JNIEnv* env, void* address, jlong capacity);
+    void* (JNICALL *GetDirectBufferAddress)
+       (JNIEnv* env, jobject buf);
+    jlong (JNICALL *GetDirectBufferCapacity)
+       (JNIEnv* env, jobject buf);
+
+    /* New JNI 1.6 Features */
+
+    jobjectRefType (JNICALL *GetObjectRefType)
+        (JNIEnv* env, jobject obj);
+};
+
+/*
+ * We use inlined functions for C++ so that programmers can write:
+ *
+ *    env->FindClass("java/lang/String")
+ *
+ * in C++ rather than:
+ *
+ *    (*env)->FindClass(env, "java/lang/String")
+ *
+ * in C.
+ */
+
+struct JNIEnv_ {
+    const struct JNINativeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint GetVersion() {
+        return functions->GetVersion(this);
+    }
+    jclass DefineClass(const char *name, jobject loader, const jbyte *buf,
+		       jsize len) {
+        return functions->DefineClass(this, name, loader, buf, len);
+    }
+    jclass FindClass(const char *name) {
+        return functions->FindClass(this, name);
+    }
+    jmethodID FromReflectedMethod(jobject method) {
+        return functions->FromReflectedMethod(this,method);
+    }
+    jfieldID FromReflectedField(jobject field) {
+        return functions->FromReflectedField(this,field);
+    }
+
+    jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) {
+        return functions->ToReflectedMethod(this, cls, methodID, isStatic);
+    }
+
+    jclass GetSuperclass(jclass sub) {
+        return functions->GetSuperclass(this, sub);
+    }
+    jboolean IsAssignableFrom(jclass sub, jclass sup) {
+        return functions->IsAssignableFrom(this, sub, sup);
+    }
+
+    jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) {
+        return functions->ToReflectedField(this,cls,fieldID,isStatic);
+    }
+
+    jint Throw(jthrowable obj) {
+        return functions->Throw(this, obj);
+    }
+    jint ThrowNew(jclass clazz, const char *msg) {
+        return functions->ThrowNew(this, clazz, msg);
+    }
+    jthrowable ExceptionOccurred() {
+        return functions->ExceptionOccurred(this);
+    }
+    void ExceptionDescribe() {
+        functions->ExceptionDescribe(this);
+    }
+    void ExceptionClear() {
+        functions->ExceptionClear(this);
+    }
+    void FatalError(const char *msg) {
+        functions->FatalError(this, msg);
+    }
+
+    jint PushLocalFrame(jint capacity) {
+        return functions->PushLocalFrame(this,capacity);
+    }
+    jobject PopLocalFrame(jobject result) {
+        return functions->PopLocalFrame(this,result);
+    }
+
+    jobject NewGlobalRef(jobject lobj) {
+        return functions->NewGlobalRef(this,lobj);
+    }
+    void DeleteGlobalRef(jobject gref) {
+        functions->DeleteGlobalRef(this,gref);
+    }
+    void DeleteLocalRef(jobject obj) {
+        functions->DeleteLocalRef(this, obj);
+    }
+
+    jboolean IsSameObject(jobject obj1, jobject obj2) {
+        return functions->IsSameObject(this,obj1,obj2);
+    }
+
+    jobject NewLocalRef(jobject ref) {
+        return functions->NewLocalRef(this,ref);
+    }
+    jint EnsureLocalCapacity(jint capacity) {
+        return functions->EnsureLocalCapacity(this,capacity);
+    }
+
+    jobject AllocObject(jclass clazz) {
+        return functions->AllocObject(this,clazz);
+    }
+    jobject NewObject(jclass clazz, jmethodID methodID, ...) {
+        va_list args;
+	jobject result;
+	va_start(args, methodID);
+        result = functions->NewObjectV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jobject NewObjectV(jclass clazz, jmethodID methodID,
+		       va_list args) {
+        return functions->NewObjectV(this,clazz,methodID,args);
+    }
+    jobject NewObjectA(jclass clazz, jmethodID methodID,
+		       const jvalue *args) {
+        return functions->NewObjectA(this,clazz,methodID,args);
+    }
+
+    jclass GetObjectClass(jobject obj) {
+        return functions->GetObjectClass(this,obj);
+    }
+    jboolean IsInstanceOf(jobject obj, jclass clazz) {
+        return functions->IsInstanceOf(this,obj,clazz);
+    }
+
+    jmethodID GetMethodID(jclass clazz, const char *name,
+			  const char *sig) {
+        return functions->GetMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jobject result;
+	va_start(args,methodID);
+	result = functions->CallObjectMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jobject CallObjectMethodV(jobject obj, jmethodID methodID,
+			va_list args) {
+        return functions->CallObjectMethodV(this,obj,methodID,args);
+    }
+    jobject CallObjectMethodA(jobject obj, jmethodID methodID,
+			const jvalue * args) {
+        return functions->CallObjectMethodA(this,obj,methodID,args);
+    }
+
+    jboolean CallBooleanMethod(jobject obj,
+			       jmethodID methodID, ...) {
+        va_list args;
+	jboolean result;
+	va_start(args,methodID);
+	result = functions->CallBooleanMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jboolean CallBooleanMethodV(jobject obj, jmethodID methodID,
+				va_list args) {
+        return functions->CallBooleanMethodV(this,obj,methodID,args);
+    }
+    jboolean CallBooleanMethodA(jobject obj, jmethodID methodID,
+				const jvalue * args) {
+        return functions->CallBooleanMethodA(this,obj,methodID, args);
+    }
+
+    jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jbyte result;
+	va_start(args,methodID);
+	result = functions->CallByteMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jbyte CallByteMethodV(jobject obj, jmethodID methodID,
+			  va_list args) {
+        return functions->CallByteMethodV(this,obj,methodID,args);
+    }
+    jbyte CallByteMethodA(jobject obj, jmethodID methodID,
+			  const jvalue * args) {
+        return functions->CallByteMethodA(this,obj,methodID,args);
+    }
+
+    jchar CallCharMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jchar result;
+	va_start(args,methodID);
+	result = functions->CallCharMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jchar CallCharMethodV(jobject obj, jmethodID methodID,
+			  va_list args) {
+        return functions->CallCharMethodV(this,obj,methodID,args);
+    }
+    jchar CallCharMethodA(jobject obj, jmethodID methodID,
+			  const jvalue * args) {
+        return functions->CallCharMethodA(this,obj,methodID,args);
+    }
+
+    jshort CallShortMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jshort result;
+	va_start(args,methodID);
+	result = functions->CallShortMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jshort CallShortMethodV(jobject obj, jmethodID methodID,
+			    va_list args) {
+        return functions->CallShortMethodV(this,obj,methodID,args);
+    }
+    jshort CallShortMethodA(jobject obj, jmethodID methodID,
+			    const jvalue * args) {
+        return functions->CallShortMethodA(this,obj,methodID,args);
+    }
+
+    jint CallIntMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jint result;
+	va_start(args,methodID);
+	result = functions->CallIntMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jint CallIntMethodV(jobject obj, jmethodID methodID,
+			va_list args) {
+        return functions->CallIntMethodV(this,obj,methodID,args);
+    }
+    jint CallIntMethodA(jobject obj, jmethodID methodID,
+			const jvalue * args) {
+        return functions->CallIntMethodA(this,obj,methodID,args);
+    }
+
+    jlong CallLongMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jlong result;
+	va_start(args,methodID);
+	result = functions->CallLongMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jlong CallLongMethodV(jobject obj, jmethodID methodID,
+			  va_list args) {
+        return functions->CallLongMethodV(this,obj,methodID,args);
+    }
+    jlong CallLongMethodA(jobject obj, jmethodID methodID,
+			  const jvalue * args) {
+        return functions->CallLongMethodA(this,obj,methodID,args);
+    }
+
+    jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jfloat result;
+	va_start(args,methodID);
+	result = functions->CallFloatMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jfloat CallFloatMethodV(jobject obj, jmethodID methodID,
+			    va_list args) {
+        return functions->CallFloatMethodV(this,obj,methodID,args);
+    }
+    jfloat CallFloatMethodA(jobject obj, jmethodID methodID,
+			    const jvalue * args) {
+        return functions->CallFloatMethodA(this,obj,methodID,args);
+    }
+
+    jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jdouble result;
+	va_start(args,methodID);
+	result = functions->CallDoubleMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jdouble CallDoubleMethodV(jobject obj, jmethodID methodID,
+			va_list args) {
+        return functions->CallDoubleMethodV(this,obj,methodID,args);
+    }
+    jdouble CallDoubleMethodA(jobject obj, jmethodID methodID,
+			const jvalue * args) {
+        return functions->CallDoubleMethodA(this,obj,methodID,args);
+    }
+
+    void CallVoidMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	va_start(args,methodID);
+	functions->CallVoidMethodV(this,obj,methodID,args);
+	va_end(args);
+    }
+    void CallVoidMethodV(jobject obj, jmethodID methodID,
+			 va_list args) {
+        functions->CallVoidMethodV(this,obj,methodID,args);
+    }
+    void CallVoidMethodA(jobject obj, jmethodID methodID,
+			 const jvalue * args) {
+        functions->CallVoidMethodA(this,obj,methodID,args);
+    }
+
+    jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz,
+				       jmethodID methodID, ...) {
+        va_list args;
+	jobject result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+							methodID,args);
+	va_end(args);
+	return result;
+    }
+    jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz,
+					jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+						      methodID,args);
+    }
+    jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz,
+					jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualObjectMethodA(this,obj,clazz,
+						      methodID,args);
+    }
+
+    jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz,
+					 jmethodID methodID, ...) {
+        va_list args;
+	jboolean result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+							 methodID,args);
+	va_end(args);
+	return result;
+    }
+    jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz,
+					  jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+						       methodID,args);
+    }
+    jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz,
+					  jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualBooleanMethodA(this,obj,clazz,
+						       methodID, args);
+    }
+
+    jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz,
+				   jmethodID methodID, ...) {
+        va_list args;
+	jbyte result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualByteMethodV(this,obj,clazz,
+						      methodID,args);
+	va_end(args);
+	return result;
+    }
+    jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz,
+				    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualByteMethodV(this,obj,clazz,
+						    methodID,args);
+    }
+    jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz,
+				    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualByteMethodA(this,obj,clazz,
+						    methodID,args);
+    }
+
+    jchar CallNonvirtualCharMethod(jobject obj, jclass clazz,
+				   jmethodID methodID, ...) {
+        va_list args;
+	jchar result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualCharMethodV(this,obj,clazz,
+						      methodID,args);
+	va_end(args);
+	return result;
+    }
+    jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz,
+				    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualCharMethodV(this,obj,clazz,
+						    methodID,args);
+    }
+    jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz,
+				    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualCharMethodA(this,obj,clazz,
+						    methodID,args);
+    }
+
+    jshort CallNonvirtualShortMethod(jobject obj, jclass clazz,
+				     jmethodID methodID, ...) {
+        va_list args;
+	jshort result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualShortMethodV(this,obj,clazz,
+						       methodID,args);
+	va_end(args);
+	return result;
+    }
+    jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz,
+				      jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualShortMethodV(this,obj,clazz,
+						     methodID,args);
+    }
+    jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz,
+				      jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualShortMethodA(this,obj,clazz,
+						     methodID,args);
+    }
+
+    jint CallNonvirtualIntMethod(jobject obj, jclass clazz,
+				 jmethodID methodID, ...) {
+        va_list args;
+	jint result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualIntMethodV(this,obj,clazz,
+						     methodID,args);
+	va_end(args);
+	return result;
+    }
+    jint CallNonvirtualIntMethodV(jobject obj, jclass clazz,
+				  jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualIntMethodV(this,obj,clazz,
+						   methodID,args);
+    }
+    jint CallNonvirtualIntMethodA(jobject obj, jclass clazz,
+				  jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualIntMethodA(this,obj,clazz,
+						   methodID,args);
+    }
+
+    jlong CallNonvirtualLongMethod(jobject obj, jclass clazz,
+				   jmethodID methodID, ...) {
+        va_list args;
+	jlong result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualLongMethodV(this,obj,clazz,
+						      methodID,args);
+	va_end(args);
+	return result;
+    }
+    jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz,
+				    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualLongMethodV(this,obj,clazz,
+						    methodID,args);
+    }
+    jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz,
+				    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualLongMethodA(this,obj,clazz,
+						    methodID,args);
+    }
+
+    jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz,
+				     jmethodID methodID, ...) {
+        va_list args;
+	jfloat result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+						       methodID,args);
+	va_end(args);
+	return result;
+    }
+    jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz,
+				      jmethodID methodID,
+				      va_list args) {
+        return functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+						     methodID,args);
+    }
+    jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz,
+				      jmethodID methodID,
+				      const jvalue * args) {
+        return functions->CallNonvirtualFloatMethodA(this,obj,clazz,
+						     methodID,args);
+    }
+
+    jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz,
+				       jmethodID methodID, ...) {
+        va_list args;
+	jdouble result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+							methodID,args);
+	va_end(args);
+	return result;
+    }
+    jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz,
+					jmethodID methodID,
+					va_list args) {
+        return functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+						      methodID,args);
+    }
+    jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz,
+					jmethodID methodID,
+					const jvalue * args) {
+        return functions->CallNonvirtualDoubleMethodA(this,obj,clazz,
+						      methodID,args);
+    }
+
+    void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
+				  jmethodID methodID, ...) {
+        va_list args;
+	va_start(args,methodID);
+	functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+	va_end(args);
+    }
+    void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
+				   jmethodID methodID,
+				   va_list args) {
+        functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+    }
+    void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
+				   jmethodID methodID,
+				   const jvalue * args) {
+        functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args);
+    }
+
+    jfieldID GetFieldID(jclass clazz, const char *name,
+			const char *sig) {
+        return functions->GetFieldID(this,clazz,name,sig);
+    }
+
+    jobject GetObjectField(jobject obj, jfieldID fieldID) {
+        return functions->GetObjectField(this,obj,fieldID);
+    }
+    jboolean GetBooleanField(jobject obj, jfieldID fieldID) {
+        return functions->GetBooleanField(this,obj,fieldID);
+    }
+    jbyte GetByteField(jobject obj, jfieldID fieldID) {
+        return functions->GetByteField(this,obj,fieldID);
+    }
+    jchar GetCharField(jobject obj, jfieldID fieldID) {
+        return functions->GetCharField(this,obj,fieldID);
+    }
+    jshort GetShortField(jobject obj, jfieldID fieldID) {
+        return functions->GetShortField(this,obj,fieldID);
+    }
+    jint GetIntField(jobject obj, jfieldID fieldID) {
+        return functions->GetIntField(this,obj,fieldID);
+    }
+    jlong GetLongField(jobject obj, jfieldID fieldID) {
+        return functions->GetLongField(this,obj,fieldID);
+    }
+    jfloat GetFloatField(jobject obj, jfieldID fieldID) {
+        return functions->GetFloatField(this,obj,fieldID);
+    }
+    jdouble GetDoubleField(jobject obj, jfieldID fieldID) {
+        return functions->GetDoubleField(this,obj,fieldID);
+    }
+
+    void SetObjectField(jobject obj, jfieldID fieldID, jobject val) {
+        functions->SetObjectField(this,obj,fieldID,val);
+    }
+    void SetBooleanField(jobject obj, jfieldID fieldID,
+			 jboolean val) {
+        functions->SetBooleanField(this,obj,fieldID,val);
+    }
+    void SetByteField(jobject obj, jfieldID fieldID,
+		      jbyte val) {
+        functions->SetByteField(this,obj,fieldID,val);
+    }
+    void SetCharField(jobject obj, jfieldID fieldID,
+		      jchar val) {
+        functions->SetCharField(this,obj,fieldID,val);
+    }
+    void SetShortField(jobject obj, jfieldID fieldID,
+		       jshort val) {
+        functions->SetShortField(this,obj,fieldID,val);
+    }
+    void SetIntField(jobject obj, jfieldID fieldID,
+		     jint val) {
+        functions->SetIntField(this,obj,fieldID,val);
+    }
+    void SetLongField(jobject obj, jfieldID fieldID,
+		      jlong val) {
+        functions->SetLongField(this,obj,fieldID,val);
+    }
+    void SetFloatField(jobject obj, jfieldID fieldID,
+		       jfloat val) {
+        functions->SetFloatField(this,obj,fieldID,val);
+    }
+    void SetDoubleField(jobject obj, jfieldID fieldID,
+			jdouble val) {
+        functions->SetDoubleField(this,obj,fieldID,val);
+    }
+
+    jmethodID GetStaticMethodID(jclass clazz, const char *name,
+				const char *sig) {
+        return functions->GetStaticMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID,
+			     ...) {
+        va_list args;
+	jobject result;
+	va_start(args,methodID);
+	result = functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID,
+			      va_list args) {
+        return functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+    }
+    jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID,
+			      const jvalue *args) {
+        return functions->CallStaticObjectMethodA(this,clazz,methodID,args);
+    }
+
+    jboolean CallStaticBooleanMethod(jclass clazz,
+				     jmethodID methodID, ...) {
+        va_list args;
+	jboolean result;
+	va_start(args,methodID);
+	result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jboolean CallStaticBooleanMethodV(jclass clazz,
+				      jmethodID methodID, va_list args) {
+        return functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+    }
+    jboolean CallStaticBooleanMethodA(jclass clazz,
+				      jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticBooleanMethodA(this,clazz,methodID,args);
+    }
+
+    jbyte CallStaticByteMethod(jclass clazz,
+			       jmethodID methodID, ...) {
+        va_list args;
+	jbyte result;
+	va_start(args,methodID);
+	result = functions->CallStaticByteMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jbyte CallStaticByteMethodV(jclass clazz,
+				jmethodID methodID, va_list args) {
+        return functions->CallStaticByteMethodV(this,clazz,methodID,args);
+    }
+    jbyte CallStaticByteMethodA(jclass clazz,
+				jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticByteMethodA(this,clazz,methodID,args);
+    }
+
+    jchar CallStaticCharMethod(jclass clazz,
+			       jmethodID methodID, ...) {
+        va_list args;
+	jchar result;
+	va_start(args,methodID);
+	result = functions->CallStaticCharMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jchar CallStaticCharMethodV(jclass clazz,
+				jmethodID methodID, va_list args) {
+        return functions->CallStaticCharMethodV(this,clazz,methodID,args);
+    }
+    jchar CallStaticCharMethodA(jclass clazz,
+				jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticCharMethodA(this,clazz,methodID,args);
+    }
+
+    jshort CallStaticShortMethod(jclass clazz,
+				 jmethodID methodID, ...) {
+        va_list args;
+	jshort result;
+	va_start(args,methodID);
+	result = functions->CallStaticShortMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jshort CallStaticShortMethodV(jclass clazz,
+				  jmethodID methodID, va_list args) {
+        return functions->CallStaticShortMethodV(this,clazz,methodID,args);
+    }
+    jshort CallStaticShortMethodA(jclass clazz,
+				  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticShortMethodA(this,clazz,methodID,args);
+    }
+
+    jint CallStaticIntMethod(jclass clazz,
+			     jmethodID methodID, ...) {
+        va_list args;
+	jint result;
+	va_start(args,methodID);
+	result = functions->CallStaticIntMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jint CallStaticIntMethodV(jclass clazz,
+			      jmethodID methodID, va_list args) {
+        return functions->CallStaticIntMethodV(this,clazz,methodID,args);
+    }
+    jint CallStaticIntMethodA(jclass clazz,
+			      jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticIntMethodA(this,clazz,methodID,args);
+    }
+
+    jlong CallStaticLongMethod(jclass clazz,
+			       jmethodID methodID, ...) {
+        va_list args;
+	jlong result;
+	va_start(args,methodID);
+	result = functions->CallStaticLongMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jlong CallStaticLongMethodV(jclass clazz,
+				jmethodID methodID, va_list args) {
+        return functions->CallStaticLongMethodV(this,clazz,methodID,args);
+    }
+    jlong CallStaticLongMethodA(jclass clazz,
+				jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticLongMethodA(this,clazz,methodID,args);
+    }
+
+    jfloat CallStaticFloatMethod(jclass clazz,
+				 jmethodID methodID, ...) {
+        va_list args;
+	jfloat result;
+	va_start(args,methodID);
+	result = functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jfloat CallStaticFloatMethodV(jclass clazz,
+				  jmethodID methodID, va_list args) {
+        return functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+    }
+    jfloat CallStaticFloatMethodA(jclass clazz,
+				  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticFloatMethodA(this,clazz,methodID,args);
+    }
+
+    jdouble CallStaticDoubleMethod(jclass clazz,
+				   jmethodID methodID, ...) {
+        va_list args;
+	jdouble result;
+	va_start(args,methodID);
+	result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jdouble CallStaticDoubleMethodV(jclass clazz,
+				    jmethodID methodID, va_list args) {
+        return functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+    }
+    jdouble CallStaticDoubleMethodA(jclass clazz,
+				    jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticDoubleMethodA(this,clazz,methodID,args);
+    }
+
+    void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
+        va_list args;
+	va_start(args,methodID);
+	functions->CallStaticVoidMethodV(this,cls,methodID,args);
+	va_end(args);
+    }
+    void CallStaticVoidMethodV(jclass cls, jmethodID methodID,
+			       va_list args) {
+        functions->CallStaticVoidMethodV(this,cls,methodID,args);
+    }
+    void CallStaticVoidMethodA(jclass cls, jmethodID methodID,
+			       const jvalue * args) {
+        functions->CallStaticVoidMethodA(this,cls,methodID,args);
+    }
+
+    jfieldID GetStaticFieldID(jclass clazz, const char *name,
+			      const char *sig) {
+        return functions->GetStaticFieldID(this,clazz,name,sig);
+    }
+    jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticObjectField(this,clazz,fieldID);
+    }
+    jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticBooleanField(this,clazz,fieldID);
+    }
+    jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticByteField(this,clazz,fieldID);
+    }
+    jchar GetStaticCharField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticCharField(this,clazz,fieldID);
+    }
+    jshort GetStaticShortField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticShortField(this,clazz,fieldID);
+    }
+    jint GetStaticIntField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticIntField(this,clazz,fieldID);
+    }
+    jlong GetStaticLongField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticLongField(this,clazz,fieldID);
+    }
+    jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticFloatField(this,clazz,fieldID);
+    }
+    jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticDoubleField(this,clazz,fieldID);
+    }
+
+    void SetStaticObjectField(jclass clazz, jfieldID fieldID,
+			jobject value) {
+      functions->SetStaticObjectField(this,clazz,fieldID,value);
+    }
+    void SetStaticBooleanField(jclass clazz, jfieldID fieldID,
+			jboolean value) {
+      functions->SetStaticBooleanField(this,clazz,fieldID,value);
+    }
+    void SetStaticByteField(jclass clazz, jfieldID fieldID,
+			jbyte value) {
+      functions->SetStaticByteField(this,clazz,fieldID,value);
+    }
+    void SetStaticCharField(jclass clazz, jfieldID fieldID,
+			jchar value) {
+      functions->SetStaticCharField(this,clazz,fieldID,value);
+    }
+    void SetStaticShortField(jclass clazz, jfieldID fieldID,
+			jshort value) {
+      functions->SetStaticShortField(this,clazz,fieldID,value);
+    }
+    void SetStaticIntField(jclass clazz, jfieldID fieldID,
+			jint value) {
+      functions->SetStaticIntField(this,clazz,fieldID,value);
+    }
+    void SetStaticLongField(jclass clazz, jfieldID fieldID,
+			jlong value) {
+      functions->SetStaticLongField(this,clazz,fieldID,value);
+    }
+    void SetStaticFloatField(jclass clazz, jfieldID fieldID,
+			jfloat value) {
+      functions->SetStaticFloatField(this,clazz,fieldID,value);
+    }
+    void SetStaticDoubleField(jclass clazz, jfieldID fieldID,
+			jdouble value) {
+      functions->SetStaticDoubleField(this,clazz,fieldID,value);
+    }
+
+    jstring NewString(const jchar *unicode, jsize len) {
+        return functions->NewString(this,unicode,len);
+    }
+    jsize GetStringLength(jstring str) {
+        return functions->GetStringLength(this,str);
+    }
+    const jchar *GetStringChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringChars(this,str,isCopy);
+    }
+    void ReleaseStringChars(jstring str, const jchar *chars) {
+        functions->ReleaseStringChars(this,str,chars);
+    }
+
+    jstring NewStringUTF(const char *utf) {
+        return functions->NewStringUTF(this,utf);
+    }
+    jsize GetStringUTFLength(jstring str) {
+        return functions->GetStringUTFLength(this,str);
+    }
+    const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringUTFChars(this,str,isCopy);
+    }
+    void ReleaseStringUTFChars(jstring str, const char* chars) {
+        functions->ReleaseStringUTFChars(this,str,chars);
+    }
+
+    jsize GetArrayLength(jarray array) {
+        return functions->GetArrayLength(this,array);
+    }
+
+    jobjectArray NewObjectArray(jsize len, jclass clazz,
+				jobject init) {
+        return functions->NewObjectArray(this,len,clazz,init);
+    }
+    jobject GetObjectArrayElement(jobjectArray array, jsize index) {
+        return functions->GetObjectArrayElement(this,array,index);
+    }
+    void SetObjectArrayElement(jobjectArray array, jsize index,
+			       jobject val) {
+        functions->SetObjectArrayElement(this,array,index,val);
+    }
+
+    jbooleanArray NewBooleanArray(jsize len) {
+        return functions->NewBooleanArray(this,len);
+    }
+    jbyteArray NewByteArray(jsize len) {
+        return functions->NewByteArray(this,len);
+    }
+    jcharArray NewCharArray(jsize len) {
+        return functions->NewCharArray(this,len);
+    }
+    jshortArray NewShortArray(jsize len) {
+        return functions->NewShortArray(this,len);
+    }
+    jintArray NewIntArray(jsize len) {
+        return functions->NewIntArray(this,len);
+    }
+    jlongArray NewLongArray(jsize len) {
+        return functions->NewLongArray(this,len);
+    }
+    jfloatArray NewFloatArray(jsize len) {
+        return functions->NewFloatArray(this,len);
+    }
+    jdoubleArray NewDoubleArray(jsize len) {
+        return functions->NewDoubleArray(this,len);
+    }
+
+    jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) {
+        return functions->GetBooleanArrayElements(this,array,isCopy);
+    }
+    jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) {
+        return functions->GetByteArrayElements(this,array,isCopy);
+    }
+    jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) {
+        return functions->GetCharArrayElements(this,array,isCopy);
+    }
+    jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) {
+        return functions->GetShortArrayElements(this,array,isCopy);
+    }
+    jint * GetIntArrayElements(jintArray array, jboolean *isCopy) {
+        return functions->GetIntArrayElements(this,array,isCopy);
+    }
+    jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) {
+        return functions->GetLongArrayElements(this,array,isCopy);
+    }
+    jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) {
+        return functions->GetFloatArrayElements(this,array,isCopy);
+    }
+    jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) {
+        return functions->GetDoubleArrayElements(this,array,isCopy);
+    }
+
+    void ReleaseBooleanArrayElements(jbooleanArray array,
+				     jboolean *elems,
+				     jint mode) {
+        functions->ReleaseBooleanArrayElements(this,array,elems,mode);
+    }
+    void ReleaseByteArrayElements(jbyteArray array,
+				  jbyte *elems,
+				  jint mode) {
+        functions->ReleaseByteArrayElements(this,array,elems,mode);
+    }
+    void ReleaseCharArrayElements(jcharArray array,
+				  jchar *elems,
+				  jint mode) {
+        functions->ReleaseCharArrayElements(this,array,elems,mode);
+    }
+    void ReleaseShortArrayElements(jshortArray array,
+				   jshort *elems,
+				   jint mode) {
+        functions->ReleaseShortArrayElements(this,array,elems,mode);
+    }
+    void ReleaseIntArrayElements(jintArray array,
+				 jint *elems,
+				 jint mode) {
+        functions->ReleaseIntArrayElements(this,array,elems,mode);
+    }
+    void ReleaseLongArrayElements(jlongArray array,
+				  jlong *elems,
+				  jint mode) {
+        functions->ReleaseLongArrayElements(this,array,elems,mode);
+    }
+    void ReleaseFloatArrayElements(jfloatArray array,
+				   jfloat *elems,
+				   jint mode) {
+        functions->ReleaseFloatArrayElements(this,array,elems,mode);
+    }
+    void ReleaseDoubleArrayElements(jdoubleArray array,
+				    jdouble *elems,
+				    jint mode) {
+        functions->ReleaseDoubleArrayElements(this,array,elems,mode);
+    }
+
+    void GetBooleanArrayRegion(jbooleanArray array,
+			       jsize start, jsize len, jboolean *buf) {
+        functions->GetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void GetByteArrayRegion(jbyteArray array,
+			    jsize start, jsize len, jbyte *buf) {
+        functions->GetByteArrayRegion(this,array,start,len,buf);
+    }
+    void GetCharArrayRegion(jcharArray array,
+			    jsize start, jsize len, jchar *buf) {
+        functions->GetCharArrayRegion(this,array,start,len,buf);
+    }
+    void GetShortArrayRegion(jshortArray array,
+			     jsize start, jsize len, jshort *buf) {
+        functions->GetShortArrayRegion(this,array,start,len,buf);
+    }
+    void GetIntArrayRegion(jintArray array,
+			   jsize start, jsize len, jint *buf) {
+        functions->GetIntArrayRegion(this,array,start,len,buf);
+    }
+    void GetLongArrayRegion(jlongArray array,
+			    jsize start, jsize len, jlong *buf) {
+        functions->GetLongArrayRegion(this,array,start,len,buf);
+    }
+    void GetFloatArrayRegion(jfloatArray array,
+			     jsize start, jsize len, jfloat *buf) {
+        functions->GetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void GetDoubleArrayRegion(jdoubleArray array,
+			      jsize start, jsize len, jdouble *buf) {
+        functions->GetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
+			       const jboolean *buf) {
+        functions->SetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
+			    const jbyte *buf) {
+        functions->SetByteArrayRegion(this,array,start,len,buf);
+    }
+    void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
+			    const jchar *buf) {
+        functions->SetCharArrayRegion(this,array,start,len,buf);
+    }
+    void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
+			     const jshort *buf) {
+        functions->SetShortArrayRegion(this,array,start,len,buf);
+    }
+    void SetIntArrayRegion(jintArray array, jsize start, jsize len,
+			   const jint *buf) {
+        functions->SetIntArrayRegion(this,array,start,len,buf);
+    }
+    void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
+			    const jlong *buf) {
+        functions->SetLongArrayRegion(this,array,start,len,buf);
+    }
+    void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
+			     const jfloat *buf) {
+        functions->SetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
+			      const jdouble *buf) {
+        functions->SetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    jint RegisterNatives(jclass clazz, const JNINativeMethod *methods,
+			 jint nMethods) {
+        return functions->RegisterNatives(this,clazz,methods,nMethods);
+    }
+    jint UnregisterNatives(jclass clazz) {
+        return functions->UnregisterNatives(this,clazz);
+    }
+
+    jint MonitorEnter(jobject obj) {
+        return functions->MonitorEnter(this,obj);
+    }
+    jint MonitorExit(jobject obj) {
+        return functions->MonitorExit(this,obj);
+    }
+
+    jint GetJavaVM(JavaVM **vm) {
+        return functions->GetJavaVM(this,vm);
+    }
+
+    void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) {
+        functions->GetStringRegion(this,str,start,len,buf);
+    }
+    void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) {
+        functions->GetStringUTFRegion(this,str,start,len,buf);
+    }
+
+    void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) {
+        return functions->GetPrimitiveArrayCritical(this,array,isCopy);
+    }
+    void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) {
+        functions->ReleasePrimitiveArrayCritical(this,array,carray,mode);
+    }
+
+    const jchar * GetStringCritical(jstring string, jboolean *isCopy) {
+        return functions->GetStringCritical(this,string,isCopy);
+    }
+    void ReleaseStringCritical(jstring string, const jchar *cstring) {
+        functions->ReleaseStringCritical(this,string,cstring);
+    }
+
+    jweak NewWeakGlobalRef(jobject obj) {
+        return functions->NewWeakGlobalRef(this,obj);
+    }
+    void DeleteWeakGlobalRef(jweak ref) {
+        functions->DeleteWeakGlobalRef(this,ref);
+    }
+
+    jboolean ExceptionCheck() {
+	return functions->ExceptionCheck(this);
+    }
+
+    jobject NewDirectByteBuffer(void* address, jlong capacity) {
+        return functions->NewDirectByteBuffer(this, address, capacity);
+    }
+    void* GetDirectBufferAddress(jobject buf) {
+        return functions->GetDirectBufferAddress(this, buf);
+    }
+    jlong GetDirectBufferCapacity(jobject buf) {
+        return functions->GetDirectBufferCapacity(this, buf);
+    }
+    jobjectRefType GetObjectRefType(jobject obj) {
+        return functions->GetObjectRefType(this, obj);
+    }
+
+#endif /* __cplusplus */
+};
+
+typedef struct JavaVMOption {
+    char *optionString;
+    void *extraInfo;
+} JavaVMOption;
+
+typedef struct JavaVMInitArgs {
+    jint version;
+
+    jint nOptions;
+    JavaVMOption *options;
+    jboolean ignoreUnrecognized;
+} JavaVMInitArgs;
+
+typedef struct JavaVMAttachArgs {
+    jint version;
+
+    char *name;
+    jobject group;
+} JavaVMAttachArgs;
+
+/* These will be VM-specific. */
+
+#define JDK1_2
+#define JDK1_4
+
+/* End VM-specific. */
+
+struct JNIInvokeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    jint (JNICALL *DestroyJavaVM)(JavaVM *vm);
+
+    jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args);
+
+    jint (JNICALL *DetachCurrentThread)(JavaVM *vm);
+
+    jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version);
+
+    jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args);
+};
+
+struct JavaVM_ {
+    const struct JNIInvokeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint DestroyJavaVM() {
+        return functions->DestroyJavaVM(this);
+    }
+    jint AttachCurrentThread(void **penv, void *args) {
+        return functions->AttachCurrentThread(this, penv, args);
+    }
+    jint DetachCurrentThread() {
+        return functions->DetachCurrentThread(this);
+    }
+
+    jint GetEnv(void **penv, jint version) {
+        return functions->GetEnv(this, penv, version);
+    }
+    jint AttachCurrentThreadAsDaemon(void **penv, void *args) {
+        return functions->AttachCurrentThreadAsDaemon(this, penv, args);
+    }
+#endif
+};
+
+#ifdef _JNI_IMPLEMENTATION_
+#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
+#else
+#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
+#endif
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetDefaultJavaVMInitArgs(void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
+
+/* Defined by native libraries. */
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved);
+
+JNIEXPORT void JNICALL
+JNI_OnUnload(JavaVM *vm, void *reserved);
+
+#define JNI_VERSION_1_1 0x00010001
+#define JNI_VERSION_1_2 0x00010002
+#define JNI_VERSION_1_4 0x00010004
+#define JNI_VERSION_1_6 0x00010006
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* !_JAVASOFT_JNI_H_ */
+
+
+
diff --git a/Platform/Android/Samples/SamplesAssistant/jni/jni_md.h b/Platform/Android/Samples/SamplesAssistant/jni/jni_md.h
new file mode 100644
index 0000000..3e8a343
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/jni/jni_md.h
@@ -0,0 +1,14 @@
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#include <XnPlatform.h>
+
+#define JNIEXPORT XN_API_EXPORT
+#define JNIIMPORT XN_API_IMPORT
+#define JNICALL XN_CALLBACK_TYPE
+
+typedef XnInt32 jint;
+typedef XnInt64 jlong;
+typedef XnInt8 jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
diff --git a/Platform/Android/Samples/SamplesAssistant/jni/org_OpenNI_Samples_Assistant_NativeMethods.cpp b/Platform/Android/Samples/SamplesAssistant/jni/org_OpenNI_Samples_Assistant_NativeMethods.cpp
new file mode 100644
index 0000000..1699f8a
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/jni/org_OpenNI_Samples_Assistant_NativeMethods.cpp
@@ -0,0 +1,515 @@
+#include "org_OpenNI_Samples_Assistant_NativeMethods.h"
+
+#define DEBUG 1
+
+#if DEBUG && defined(ANDROID)
+#include <android/log.h>
+#  define  LOGD(x...)  __android_log_print(ANDROID_LOG_INFO,"OpenNI.Assistant-JNI",x)
+#  define  LOGE(x...)  __android_log_print(ANDROID_LOG_ERROR,"OpenNI.Assistant-JNI",x)
+#else
+#  define  LOGD(...)  do {} while (0)
+#  define  LOGE(...)  do {} while (0)
+#endif
+
+#include <XnOpenNI.h>
+#include <XnCppWrapper.h>
+#include <stdio.h>
+
+using namespace xn;
+ 
+//---------------------------------------------------------------------------
+// Marshaling
+//---------------------------------------------------------------------------
+JNIEXPORT jbyte JNICALL 
+Java_org_OpenNI_NativeMethods_readByte(JNIEnv *, jclass, jlong ptr)
+{
+	return *(jbyte*)ptr;
+}
+
+JNIEXPORT jshort JNICALL 
+Java_org_OpenNI_NativeMethods_readShort(JNIEnv *, jclass, jlong ptr)
+{
+	return *(jshort*)ptr;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_readInt(JNIEnv *, jclass, jlong ptr)
+{
+	return *(jint*)ptr;
+}
+
+JNIEXPORT jlong JNICALL 
+Java_org_OpenNI_NativeMethods_readLong(JNIEnv *, jclass, jlong ptr)
+{
+	return *(jlong*)ptr;
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_copyToBuffer(JNIEnv *env, jclass, jobject buffer, jlong ptr, jint size)
+{
+	void* pDest = env->GetDirectBufferAddress(buffer);
+	memcpy(pDest, (const void*)ptr, size);
+}
+
+//---------------------------------------------------------------------------
+// Helpers
+//---------------------------------------------------------------------------
+
+void SetOutArgObjectValue(JNIEnv* env, jobject p, jobject value)
+{
+	jclass cls = env->GetObjectClass(p);
+	jfieldID fieldID = env->GetFieldID(cls, "value", "Ljava/lang/Object;");
+	env->SetObjectField(p, fieldID, value);
+}
+
+void SetOutArgDoubleValue(JNIEnv* env, jobject p, double value)
+{
+	jclass cls = env->FindClass("java/lang/Double");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(D)V");
+	SetOutArgObjectValue(env, p, env->NewObject(cls, ctor, value));
+}
+
+void SetOutArgLongValue(JNIEnv* env, jobject p, XnUInt64 value)
+{
+	jclass cls = env->FindClass("java/lang/Long");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(J)V");
+	SetOutArgObjectValue(env, p, env->NewObject(cls, ctor, value));
+}
+
+void SetOutArgPointerValue(JNIEnv* env, jobject p, const void* value)
+{
+	SetOutArgLongValue(env, p, (jlong)value);
+}
+
+void SetOutArgIntValue(JNIEnv* env, jobject p, int value)
+{
+	jclass cls = env->FindClass("java/lang/Integer");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(I)V");
+	SetOutArgObjectValue(env, p, env->NewObject(cls, ctor, value));
+}
+
+void SetOutArgShortValue(JNIEnv* env, jobject p, short value)
+{
+	jclass cls = env->FindClass("java/lang/Short");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(S)V");
+	SetOutArgObjectValue(env, p, env->NewObject(cls, ctor, value));
+}
+
+void SetOutArgByteValue(JNIEnv* env, jobject p, XnUInt8 value)
+{
+	jclass cls = env->FindClass("java/lang/Byte");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(B)V");
+	SetOutArgObjectValue(env, p, env->NewObject(cls, ctor, value));
+}
+
+void SetOutArgStringValue(JNIEnv* env, jobject p, const XnChar* value)
+{
+	SetOutArgObjectValue(env, p, env->NewStringUTF(value));
+}
+
+//---------------------------------------------------------------------------
+// SamplesAssistant
+//---------------------------------------------------------------------------
+Context *mContext = 0;
+
+DepthGenerator mDepthGen;
+UserGenerator mUserGen;
+char hasDepthGen = 0;
+char hasUserGen = 0;
+
+DepthMetaData depthMD;
+SceneMetaData sceneMD;
+
+// local functions
+XnStatus initGraphics();
+void disposeGraphics();
+XnStatus generateBitmapLocal(char useScene, char useDepth, char useHistogram, int **localPtr);
+XnStatus generateBitmapRemote(char useScene, char useDepth, char useHistogram, int *remoteBuf, int buflen);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    initFromContext
+ * Signature: (JZZ)I
+ */
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_Samples_Assistant_NativeMethods_initFromContext
+  (JNIEnv *env, jclass cls, jlong pContext, jboolean _hasUserGen, jboolean _hasDepthGen)
+{
+	LOGD("init_start");
+	hasUserGen =  _hasUserGen;
+	hasDepthGen = _hasDepthGen;
+
+	mContext = new Context((XnContext*) pContext);
+	
+	if (!(hasUserGen || hasDepthGen))
+		return XN_STATUS_BAD_PARAM;
+	
+	int rc;
+	if (hasUserGen)
+	{
+		rc = mContext->FindExistingNode(XN_NODE_TYPE_USER, mUserGen);
+		if (rc != XN_STATUS_OK)
+		{
+//TODO log&retval
+			printf("No user node exists!");
+			return 1;
+		}
+
+		mUserGen.GetUserPixels(0, sceneMD);
+	}
+
+	if (hasDepthGen)
+	{
+		rc = mContext->FindExistingNode(XN_NODE_TYPE_DEPTH, mDepthGen);
+		if (rc != XN_STATUS_OK)
+		{
+//TODO log&retval
+			printf("No depth node exists! Check your XML.");
+			return 1;
+		}
+
+		mDepthGen.GetMetaData(depthMD);
+	}
+
+	initGraphics();
+
+	LOGD("init_end");
+	return XN_STATUS_OK;
+}
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    dispose
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_Samples_Assistant_NativeMethods_dispose (JNIEnv *, jclass)
+{
+LOGD("dispose_start");
+
+disposeGraphics();
+
+mUserGen.Release();
+hasUserGen = 0;
+mDepthGen.Release();
+hasDepthGen = 0;
+
+mContext->Release();
+delete mContext;
+mContext = 0;
+
+LOGD("dispose_end");
+return XN_STATUS_OK;
+}
+
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    getMapOutputMode
+ * Signature: (Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_Samples_Assistant_NativeMethods_getMapOutputMode
+  (JNIEnv * env, jclass cls, jobject outXRes, jobject outYRes, jobject outFPS)
+{
+	XnMapOutputMode mode;
+	XnNodeHandle hNode = 0;
+	
+	if(mDepthGen)
+		hNode = (XnNodeHandle)mDepthGen;
+	else
+		hNode = (XnNodeHandle)mUserGen;
+
+	XnStatus nRetVal = xnGetMapOutputMode((XnNodeHandle)hNode, &mode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	SetOutArgIntValue(env, outXRes, mode.nXRes);
+	SetOutArgIntValue(env, outYRes, mode.nYRes);
+	SetOutArgIntValue(env, outFPS, mode.nFPS);
+
+	return XN_STATUS_OK;
+}
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    generateBitmapLocalBuffer
+ * Signature: (ZZZLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_generateBitmapLocalBuffer
+  (JNIEnv *env, jclass cls, jboolean useScene, jboolean useDepth, jboolean useHistogram, jobject outPtr)
+{
+	int *bitmap = 0;
+	
+	XnStatus nRetVal = generateBitmapLocal(hasUserGen && useScene, hasDepthGen && useDepth, useHistogram, &bitmap);
+	SetOutArgPointerValue(env, outPtr, bitmap);
+
+	XN_IS_STATUS_OK(nRetVal);
+
+
+	return XN_STATUS_OK;
+}
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    generateBitmapJavaBuffer
+ * Signature: (ZZZ[I)I
+ */
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_Samples_Assistant_NativeMethods_generateBitmapJavaBuffer
+  (JNIEnv *env, jclass cls, jboolean useScene, jboolean useDepth, jboolean useHistogram, jintArray array)
+{
+	jboolean isCopy;
+
+	jint* buffer = env->GetIntArrayElements(array, &isCopy);
+	jsize length = env->GetArrayLength(array);
+
+	
+	// do something with the buffer here, replace with something meaningful
+	// PAY ATTENTION TO BUFFER OVERFLOW, DO NOT WRITE BEYOND BUFFER LENGTH
+
+	if(isCopy) LOGD("isCopy!");
+	XnStatus nRetVal = generateBitmapRemote(hasUserGen && useScene, hasDepthGen && useDepth, useHistogram, buffer, length);
+
+	// here it is important to use 0 so that JNI takes care of copying
+	// the data back to the Java side in case GetByteArrayElements returned a copy
+	env->ReleaseIntArrayElements(array, buffer, 0);
+
+
+	XN_IS_STATUS_OK(nRetVal);
+	return XN_STATUS_OK;
+}
+
+int *frameBuffer = 0;
+size_t BUFSIZE  = sizeof(XnUInt32) * 640 * 480;
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    readLocalBitmap2JavaBuffer
+ * Signature: (J[I)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_readLocalBitmap2JavaBuffer
+  (JNIEnv *env, jclass cls, jlong localPtr, jintArray array)
+{
+//TODO: ignoring localPtr for now. reserved for future use (more than one framebuffer?)
+	jboolean isCopy;
+
+	jint* buffer = env->GetIntArrayElements(array, &isCopy);
+	jsize length = env->GetArrayLength(array);
+
+	// do something with the buffer here, replace with something meaningful
+	// PAY ATTENTION TO BUFFER OVERFLOW, DO NOT WRITE BEYOND BUFFER LENGTH
+	if(isCopy) LOGD("isCopy!");
+	jsize min = length * sizeof(jint); if (min > BUFSIZE) min = BUFSIZE;
+	memcpy(buffer, frameBuffer, min);
+
+	// here it is important to use 0 so that JNI takes care of copying
+	// the data back to the Java side in case GetByteArrayElements returned a copy
+	env->ReleaseIntArrayElements(array, buffer, 0);
+
+}
+
+
+//---------------------------------------------------------------------------
+// Graphics
+//---------------------------------------------------------------------------
+
+size_t MAX_DEPTH = 10000;
+size_t HISTSIZE = MAX_DEPTH * sizeof(float);
+
+float *pHistogram = 0;
+
+XnStatus initGraphics()
+{
+	frameBuffer = (int *)   malloc(BUFSIZE);
+	pHistogram =  (float *) malloc(HISTSIZE);
+	if (!frameBuffer || !pHistogram)
+		return XN_STATUS_ERROR;
+	memset(frameBuffer, 0, BUFSIZE);
+	memset(pHistogram,  0, HISTSIZE);
+
+	return XN_STATUS_OK;
+}
+
+void disposeGraphics()
+{
+	free(frameBuffer);
+	free(pHistogram);
+}
+
+const XnDepthPixel* 	pDepth;
+const XnLabel*		pLabels;
+
+XnUInt16 nXRes;
+XnUInt16 nYRes;
+
+void calcHist()
+{
+	unsigned int nValue = 0;
+	unsigned int nIndex = 0;
+	unsigned int nX = 0;
+	unsigned int nY = 0;
+	unsigned int nNumberOfPoints = 0;
+
+	// Calculate the accumulative histogram
+	memset(pHistogram, 0, HISTSIZE);
+	for (nY=0; nY<nYRes; nY++)
+	{
+		for (nX=0; nX<nXRes; nX++)
+		{
+			nValue = *pDepth;
+
+			if (nValue != 0)
+			{
+				pHistogram[nValue]++;
+				nNumberOfPoints++;
+			}
+
+			pDepth++;
+		}
+	}
+
+	for (nIndex=1; nIndex<MAX_DEPTH; nIndex++)
+	{
+		pHistogram[nIndex] += pHistogram[nIndex-1];
+	}
+	if (nNumberOfPoints)
+	{
+		for (nIndex=1; nIndex<MAX_DEPTH; nIndex++)
+		{
+			pHistogram[nIndex] = (unsigned int)(256 * (1.0f - (pHistogram[nIndex] / nNumberOfPoints)));
+		}
+	}
+}
+
+XnFloat Colors[][3] =
+{
+//	{R,G,B}
+	{0,1,0},
+	{1,0,0},
+	{1,1,0},
+	{0,1,1},
+	{0,0,1},
+	{1,.5,0},
+	{.5,1,0},
+	{0,.5,1},
+	{.5,0,1},
+	{1,1,.5},
+	{1,1,1}
+};
+XnUInt32 nColors = 10;
+
+void fillBitmap(int *dstBuf, char useScene, char useDepth, char useHistogram, char drawBackground)
+{
+	unsigned int nValue = 0;
+	float nHistValue = 0;
+	unsigned int nIndex = 0;
+	XnUInt32 nColorID;
+
+	unsigned char *pDestImage = (unsigned char *)dstBuf;
+	// Prepare the texture map
+	for (nIndex=0; nIndex < nXRes * nYRes; ++nIndex)
+	{
+		pDestImage[0] = 0;   //B
+		pDestImage[1] = 0;   //G
+		pDestImage[2] = 0;   //R
+		pDestImage[3] = 255; //A
+
+		if (drawBackground || !useScene || (useScene && *pLabels != 0))
+		{
+			if(useDepth)
+				nValue = *pDepth;
+			else
+				nValue = 4000;
+
+			if(useScene)
+			{
+				XnLabel label = *pLabels;
+				if (label == 0) {
+					nColorID = nColors;
+				} else {
+					nColorID = ((label-1) % nColors);
+				}
+			} else {
+				nColorID = nColors;
+			}
+
+			if (nValue != 0)
+			{
+				if(useDepth)
+				{
+					if(useHistogram)
+						nHistValue = pHistogram[nValue];
+					else
+						nHistValue = nValue * 255.0 / 4000;
+				} else {
+					nHistValue = 255;
+				}
+
+				pDestImage[2] = nHistValue * Colors[nColorID][0]; 
+				pDestImage[1] = nHistValue * Colors[nColorID][1];
+				pDestImage[0] = nHistValue * Colors[nColorID][2];
+			}
+		}
+
+		pDepth++;
+		pLabels++;
+		pDestImage += 4;
+	}
+}
+
+XnStatus prepare(char useScene, char useDepth, char useHistogram)
+{
+//TODO handle possible failures!
+	if (useDepth)
+	{
+		mDepthGen.GetMetaData(depthMD);
+		nXRes = depthMD.XRes();
+		nYRes = depthMD.YRes();
+
+		pDepth = depthMD.Data();
+
+		if (useHistogram)
+		{
+			calcHist();
+
+			// rewind the pointer
+			pDepth = depthMD.Data();
+		}
+	}
+	if (useScene) 
+	{
+		mUserGen.GetUserPixels(0, sceneMD);
+		nXRes = sceneMD.XRes();
+		nYRes = sceneMD.YRes();
+
+		pLabels = sceneMD.Data();
+	}
+}
+
+XnStatus generateBitmapLocal(char useScene, char useDepth, char useHistogram, int **localPtr)
+{
+	*localPtr = 0;
+
+	XnStatus rc = prepare(useScene, useDepth, useHistogram);
+	//TODO handle errors
+
+	fillBitmap(frameBuffer, useScene, useDepth, useHistogram, 1);
+
+	*localPtr = frameBuffer;
+	return XN_STATUS_OK;
+}
+
+XnStatus generateBitmapRemote(char useScene, char useDepth, char useHistogram, int *remoteBuf, int buflen)
+{
+	XnStatus rc = prepare(useScene, useDepth, useHistogram);
+	//TODO handle errors
+
+	if (buflen < nXRes * nYRes)
+	{
+		return XN_STATUS_INVALID_BUFFER_SIZE;
+	}
+
+	fillBitmap(remoteBuf, useScene, useDepth, useHistogram, 1);
+
+	return XN_STATUS_OK;
+}
+
diff --git a/Platform/Android/Samples/SamplesAssistant/jni/org_OpenNI_Samples_Assistant_NativeMethods.h b/Platform/Android/Samples/SamplesAssistant/jni/org_OpenNI_Samples_Assistant_NativeMethods.h
new file mode 100644
index 0000000..8986000
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/jni/org_OpenNI_Samples_Assistant_NativeMethods.h
@@ -0,0 +1,101 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_OpenNI_Samples_Assistant_NativeMethods */
+
+#ifndef _Included_org_OpenNI_Samples_Assistant_NativeMethods
+#define _Included_org_OpenNI_Samples_Assistant_NativeMethods
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    readByte
+ * Signature: (J)B
+ */
+JNIEXPORT jbyte JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_readByte
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    readShort
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_readShort
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    readInt
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_readInt
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    readLong
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_readLong
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    copyToBuffer
+ * Signature: (Ljava/nio/ByteBuffer;JI)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_copyToBuffer
+  (JNIEnv *, jclass, jobject, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    initFromContext
+ * Signature: (JZZ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_initFromContext
+  (JNIEnv *, jclass, jlong, jboolean, jboolean);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    dispose
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_dispose
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    getMapOutputMode
+ * Signature: (Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_getMapOutputMode
+  (JNIEnv *, jclass, jobject, jobject, jobject);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    generateBitmapLocalBuffer
+ * Signature: (ZZZLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_generateBitmapLocalBuffer
+  (JNIEnv *, jclass, jboolean, jboolean, jboolean, jobject);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    generateBitmapJavaBuffer
+ * Signature: (ZZZ[I)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_generateBitmapJavaBuffer
+  (JNIEnv *, jclass, jboolean, jboolean, jboolean, jintArray);
+
+/*
+ * Class:     org_OpenNI_Samples_Assistant_NativeMethods
+ * Method:    readLocalBitmap2JavaBuffer
+ * Signature: (J[I)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_Samples_Assistant_NativeMethods_readLocalBitmap2JavaBuffer
+  (JNIEnv *, jclass, jlong, jintArray);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/Platform/Android/Samples/SamplesAssistant/res/drawable-hdpi/icon.png b/Platform/Android/Samples/SamplesAssistant/res/drawable-hdpi/icon.png
new file mode 100644
index 0000000..8074c4c
Binary files /dev/null and b/Platform/Android/Samples/SamplesAssistant/res/drawable-hdpi/icon.png differ
diff --git a/Platform/Android/Samples/SamplesAssistant/res/drawable-ldpi/icon.png b/Platform/Android/Samples/SamplesAssistant/res/drawable-ldpi/icon.png
new file mode 100644
index 0000000..1095584
Binary files /dev/null and b/Platform/Android/Samples/SamplesAssistant/res/drawable-ldpi/icon.png differ
diff --git a/Platform/Android/Samples/SamplesAssistant/res/drawable-mdpi/icon.png b/Platform/Android/Samples/SamplesAssistant/res/drawable-mdpi/icon.png
new file mode 100644
index 0000000..a07c69f
Binary files /dev/null and b/Platform/Android/Samples/SamplesAssistant/res/drawable-mdpi/icon.png differ
diff --git a/Platform/Android/Samples/SamplesAssistant/res/drawable/android_skeleton.png b/Platform/Android/Samples/SamplesAssistant/res/drawable/android_skeleton.png
new file mode 100644
index 0000000..f48519f
Binary files /dev/null and b/Platform/Android/Samples/SamplesAssistant/res/drawable/android_skeleton.png differ
diff --git a/Platform/Android/Samples/SamplesAssistant/res/layout/main.xml b/Platform/Android/Samples/SamplesAssistant/res/layout/main.xml
new file mode 100644
index 0000000..3a5f117
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/res/layout/main.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    >
+<TextView  
+    android:layout_width="fill_parent" 
+    android:layout_height="wrap_content" 
+    android:text="@string/hello"
+    />
+</LinearLayout>
diff --git a/Platform/Android/Samples/SamplesAssistant/res/values/strings.xml b/Platform/Android/Samples/SamplesAssistant/res/values/strings.xml
new file mode 100644
index 0000000..81f91a5
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/res/values/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="hello">Hello World, OpenNIBaseActivity!</string>
+    <string name="app_name">SamplesAssistant</string>
+</resources>
diff --git a/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/BitmapGenerator.java b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/BitmapGenerator.java
new file mode 100644
index 0000000..13d71cb
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/BitmapGenerator.java
@@ -0,0 +1,165 @@
+package org.OpenNI.Samples.Assistant;
+
+import org.OpenNI.Context;
+import org.OpenNI.ImageMap;
+import org.OpenNI.MapOutputMode;
+import org.OpenNI.OutArg;
+import org.OpenNI.StatusException;
+import org.OpenNI.WrapperUtils;
+
+public class BitmapGenerator {
+
+	public BitmapGenerator(Context context, boolean hasUserGen, boolean hasDepthGen) throws StatusException {
+		int status = NativeMethods.initFromContext(context.toNative(), hasUserGen, hasDepthGen);
+		WrapperUtils.throwOnError(status);
+		
+		MapOutputMode mom = getMapOutputMode();
+		tempMaps = new MyMap[] { 
+		new MyMap(0, mom.getXRes(), mom.getYRes()),
+		new MyMap(0, mom.getXRes(), mom.getYRes())
+		};
+		writeIndex = 0;
+	}
+	
+	public void dispose() throws StatusException {
+		int status = NativeMethods.dispose();
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public MapOutputMode getMapOutputMode() throws StatusException
+	{
+		OutArg<Integer> xRes = new OutArg<Integer>();
+		OutArg<Integer> yRes = new OutArg<Integer>();
+		OutArg<Integer> FPS = new OutArg<Integer>();
+		int status = NativeMethods.getMapOutputMode(xRes, yRes, FPS);
+		WrapperUtils.throwOnError(status);
+		return new MapOutputMode(xRes.value, yRes.value, FPS.value);
+	}
+	
+	
+	public long[] generateBitmap(boolean useScene, boolean useDepth, boolean useHistogram) throws StatusException
+	{
+		MyMap curMap = tempMaps[writeIndex];
+//		MapOutputMode mom = getMapOutputMode();
+//		curMap.resetRes(mom.getXRes(), mom.getYRes());
+		
+		long t0 = System.currentTimeMillis();
+		
+		// Generate the Bitmap
+		OutArg<Long> outPtr = new OutArg<Long>();
+		int status = NativeMethods.generateBitmapLocalBuffer(useScene, useDepth, useHistogram, outPtr);
+		WrapperUtils.throwOnError(status);
+		
+		long t1 = System.currentTimeMillis();
+		
+		// Copy the Bitmap's data to the JVM
+		curMap.fetchPixels();		
+		long t2 = System.currentTimeMillis();
+		
+		
+		// Refresh the current bitmap, and notify possible waiters
+		swapMaps();
+		
+		//returns duration of the whole generating+fetching process, in millisecs.
+		return new long[]{t1-t0, t2-t1};
+	}
+	
+	public long[] generateBitmapDirect(boolean useScene, boolean useDepth, boolean useHistogram) throws StatusException
+	{
+		MyMap curMap = tempMaps[writeIndex];
+//		MapOutputMode mom = getMapOutputMode();
+//		curMap.resetRes(mom.getXRes(), mom.getYRes());
+		
+		long t0 = System.currentTimeMillis();
+		
+		int status = NativeMethods.generateBitmapJavaBuffer(useScene, useDepth, useHistogram, curMap.pixels);
+		WrapperUtils.throwOnError(status);
+		
+		swapMaps();
+		return new long[]{System.currentTimeMillis()-t0, 0};
+	}
+	
+	private void swapMaps()
+	{
+		// Refresh the current bitmap, and notify possible waiters
+		MyMap curMap = tempMaps[writeIndex];
+		synchronized (swapLock) {
+			hasFreshBitmap = true;
+			lastGeneratedBitmap = curMap;
+			writeIndex++; writeIndex %= 2;
+			swapLock.notify();
+		}
+	}
+	
+	public long[] generateBitmap() throws StatusException
+	{
+		return generateBitmap(true, true, true);
+	}
+	
+	public int[] getLastBitmap()
+	{
+		synchronized (swapLock) {
+			
+			while(!hasFreshBitmap)
+			{
+				try {
+					swapLock.wait();
+				} catch (InterruptedException e) {
+					return null;
+				}
+			}
+			
+			return lastGeneratedBitmap.pixels;
+		}
+	}
+	
+	private MyMap lastGeneratedBitmap;
+	private MyMap[] tempMaps;
+	private int writeIndex;
+	
+	private boolean hasFreshBitmap = false;
+	private Object swapLock = new Object();
+	
+	
+	class MyMap extends ImageMap
+	{
+		public MyMap(long ptr, int xRes, int yRes)
+		{
+			this.xRes = xRes;
+			this.yRes = yRes;
+			pixels = new int[xRes * yRes];
+			nativePtr = ptr;
+		}
+		protected MyMap(int xRes, int yRes)
+		{
+			this.xRes = xRes;
+			this.yRes = yRes;
+			pixels = new int[xRes * yRes];
+			nativePtr = 0;
+		}
+		
+		public void resetRes(int xRes, int yRes)
+		{
+			this.xRes = xRes;
+			this.yRes = yRes;
+		}
+		
+		public void fetchPixels()
+		{
+			NativeMethods.readLocalBitmap2JavaBuffer(nativePtr, pixels);
+		}
+		
+		public int[] pixels;
+		protected int xRes, yRes;
+		private long nativePtr;
+	}
+	class MyMap2 extends MyMap
+	{
+		public MyMap2(int xRes, int yRes)
+		{
+			super(xRes, yRes);
+			
+		}
+		public void fetchPixels() {} //irrelevant
+	}
+}
diff --git a/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/FPSCalculator.java b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/FPSCalculator.java
new file mode 100644
index 0000000..a73254a
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/FPSCalculator.java
@@ -0,0 +1,73 @@
+package org.OpenNI.Samples.Assistant;
+
+import java.util.*;
+
+public class FPSCalculator
+{
+	private long last_ts;
+	private long delta;
+	private long[] cyc;
+	private int p;
+    private List<Long> all;
+    
+    public FPSCalculator()
+    {
+    	init(System.currentTimeMillis());
+    }
+    
+    public void init(long ts)
+    {
+    	last_ts = ts;
+    	all = new ArrayList<Long>(1024);
+    	cyc = new long[15]; p=0;
+    }
+    
+    public void update(long ts)
+    {
+    	delta = ts - last_ts;
+    	last_ts = ts;
+    	cyc[p] = delta; p = (p+1) % cyc.length;
+    	
+    	all.add(delta);
+    }
+    
+    public void update()
+    {
+    	update(System.currentTimeMillis());
+    }
+    
+    public double calcAvgFPS()
+    {
+    	return (1000/calcAvgMillis());
+    }
+    
+	public double calcAvgMillis() {
+		double avg = 0; int i;
+    	for (i = 0; i < Math.min(cyc.length, all.size()); i++) {
+			avg += cyc[i];
+		}avg /= i;
+		
+		return avg;
+	}
+	
+	public double summaryAvgFPS()
+    {
+    	return (1000/summaryAvgMillis());
+    }
+    
+	public double summaryAvgMillis() {
+		double avg = 0;
+    	for (Long l : all) {
+			avg += l;
+		}avg /= all.size();
+		
+		return avg;
+	}
+	
+	public String toString()
+	{
+		return String.format("Summary of FPSCalculator:\nAvg fps: %.1f\nAvg deltaT: %.1f\n", 
+				summaryAvgFPS(),
+				summaryAvgMillis());
+	}
+}  
diff --git a/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/NativeMethods.java b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/NativeMethods.java
new file mode 100644
index 0000000..32fd9f1
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/NativeMethods.java
@@ -0,0 +1,57 @@
+package org.OpenNI.Samples.Assistant;
+
+import java.nio.ByteBuffer;
+
+import org.OpenNI.OutArg;
+
+class NativeMethods
+{
+	static 
+	{ 
+		String arch = System.getenv("PROCESSOR_ARCHITECTURE");
+		if ((arch != null) && ((arch.equals("AMD64")) || (arch.equals("IA64"))))
+			System.loadLibrary("OpenNISamplesAssistant.jni64"); 
+		else
+			System.loadLibrary("OpenNISamplesAssistant.jni");
+	}
+
+	// Marshaling
+	static native byte readByte(long ptr);
+	static native short readShort(long ptr);
+	static native int readInt(long ptr);
+	static native long readLong(long ptr);
+	static native void copyToBuffer(ByteBuffer buffer, long ptr, int size);
+
+	
+	
+	
+	static native int initFromContext(
+			long pContext, 
+			boolean hasUserGen, 
+			boolean hasDepthGen);
+	
+	static native int dispose();
+	
+	static native int getMapOutputMode(
+			OutArg<Integer> xRes,
+			OutArg<Integer> yRes, 
+			OutArg<Integer> fps
+			);
+	
+	static native int generateBitmapLocalBuffer(
+			boolean useScene, 
+			boolean useDepth,
+			boolean useHistogram,
+			OutArg<Long> outPtr);
+	
+	static native int generateBitmapJavaBuffer(
+			boolean useScene, 
+			boolean useDepth,
+			boolean useHistogram,
+			int[] buffer);
+	
+	static native int readLocalBitmap2JavaBuffer(
+			long nativePtr, 
+			int[] javaBuffer
+			);
+}
diff --git a/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/OpenNIBaseActivity.java b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/OpenNIBaseActivity.java
new file mode 100644
index 0000000..145166b
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/OpenNIBaseActivity.java
@@ -0,0 +1,235 @@
+package org.OpenNI.Samples.Assistant;
+
+import java.io.*;
+import java.util.Timer;
+import java.util.TimerTask;
+
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.util.Log;
+
+public abstract class OpenNIBaseActivity extends Activity {
+    
+	protected final String TAG = getClass().getSimpleName();
+	
+	private static Activity activity = null;
+	public static Activity getCurrentActivity() { return activity; }
+	
+	
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		Log.d(TAG, "OnCreate()");
+		activity = this;
+
+		/* 
+		 * As for now, we couldn't find a 100% solution for a reboot-persistent 
+		 * usb 666 permissions.
+		 * This code is made to ensure that /proc/bus/usb is mounted.
+		 * It will ask for 'su' permission only if it's not mounted.
+		 */
+		try {
+			enforceUSBMount();
+		} catch (Exception e) {
+			Log.e(TAG, "onCreate() Failed!", e);
+			return;
+		}
+
+		super.onCreate(savedInstanceState);
+	}
+    
+    @Override
+    protected void onDestroy() {
+    	Log.d(TAG, "OnDestroy()");
+    	// TODO Auto-generated method stub
+    	super.onDestroy();
+    }
+    
+    @Override
+    protected void onRestart() {
+    	Log.d(TAG, "OnRestart()");
+    	// TODO Auto-generated method stub
+    	super.onRestart();
+    }
+    
+    @Override
+    protected void onStart() {
+    	Log.i(TAG, "OnStart()");
+    	try {
+			openNIInit();
+		} catch (Exception e) {
+			Log.e(TAG,"Could not initialize Activity:", e);
+			return;
+		}
+
+        shouldRun = true;
+        mainLoopThread = new Thread() {
+        	public void run() {
+        		mainLoop();
+        	};
+        };
+        mainLoopThread.setName("OpenNI MainLoop Thread");
+        mainLoopThread.start();
+    	
+    	// TODO Auto-generated method stub
+    	super.onStart();
+    }
+    
+    @Override
+    protected void onStop() {
+    	Log.i(TAG, "OnStop()");
+    	killOnTimeout = false;
+    	
+    	openNITerminate(); // I'll be back...
+    	
+    	// TODO Auto-generated method stub
+    	super.onStop();
+    }
+    
+    @Override
+    protected void onResume() {
+    	Log.d(TAG, "OnResume()");
+    	killOnTimeout = false;
+    	// TODO Auto-generated method stub
+    	super.onResume();
+    }
+    
+    @Override
+    protected void onPause() {
+    	Log.d(TAG, "OnPause()");
+    	
+    	//we wanna make sure that he's not kidding. if he won't resume soon, we kill him.
+    	Timer timer = new Timer();
+    	killOnTimeout = true;
+    	timer.schedule(new TimerTask() {
+			
+			@Override
+			public void run() {
+				if(killOnTimeout)
+				{
+					Log.i(TAG,"onPause() without onStop() timed out (" + killOnTimeoutMillisec + "ms): It's time to DIE!");
+					openNITerminate();
+					Log.d(TAG, "triggering finish()...");
+					finish();				
+				}
+			}
+		}, killOnTimeoutMillisec);
+    	
+    	// TODO Auto-generated method stub
+    	super.onPause();
+    }
+    
+
+	///////////////////////////////////////////
+	
+	protected void retrieveXml(String filename) throws IOException
+	{
+		InputStream is = getAssets().open(filename);
+		
+		deleteFile(filename);
+		OutputStream os = openFileOutput(filename, MODE_WORLD_READABLE);
+		
+		byte[] buffer = new byte[is.available()];
+		is.read(buffer);
+		is.close();
+		os.write(buffer);
+		os.close();
+	}
+	
+	private void enforceUSBMount() throws Exception
+	{
+		String check = "mount";
+    	String output = runInShell("sh", check);
+    	
+		if (!output.contains("/proc/bus/usb")) {
+			Log.i(TAG, "Mounting usbfs on /proc/bus/usb ...");
+			
+			String mount = "mount -t usbfs -o devmode=0666 none /proc/bus/usb";
+			runInShell("su", mount);
+		}
+	}
+
+	private static String runInShell(String shell, String script)
+			throws Exception {
+		Process process = Runtime.getRuntime().exec(shell);
+		DataOutputStream os = new DataOutputStream(process.getOutputStream());
+		DataInputStream is = new DataInputStream(process.getInputStream());
+
+		os.writeBytes(script + "\n");
+
+		os.writeBytes("exit\n");
+		os.flush();
+		os.close();
+
+		process.waitFor();
+
+		byte[] arr = new byte[1000];
+		int nRead = is.read(arr);
+		if (nRead > 0)
+			return new String(arr, 0, nRead);
+		else
+			return "";
+	}
+	
+	
+    
+    private boolean isOpenNIInitialized = false;
+    private Thread mainLoopThread;
+    private boolean shouldRun = true;
+    private boolean killOnTimeout;
+    private int killOnTimeoutMillisec = 1000;
+
+    
+    private synchronized void openNIInit() throws Exception
+    {
+    	if(isOpenNIInitialized) {
+    		return;
+    	}
+    	myInitFunction();
+    	isOpenNIInitialized = true;
+    }
+    
+    private synchronized void openNITerminate()
+    {
+    	if(!isOpenNIInitialized) {
+    		return;
+    	}
+    	shouldRun = false;
+		while (mainLoopThread != null) {
+			try {
+				mainLoopThread.join();
+				mainLoopThread = null;
+				break;
+			} catch (InterruptedException e) { /* i don't care. */}
+		}
+		// now clean up!
+		isOpenNIInitialized = false;
+		myCleanupFunction();
+    }
+    
+    
+    
+    
+    protected abstract void myInitFunction() throws Exception;
+    protected abstract void myCleanupFunction(); 
+    // returns true only if the loop should continue running
+    protected abstract boolean myMainLoopContent();
+    
+    
+    
+    
+    private void mainLoop()
+    {
+    	while(shouldRun && myMainLoopContent());
+    	
+    	Log.i(TAG, "mainLoop() finished");
+    	
+    	if (!shouldRun) {
+			// killed from the outside
+    		return;
+		}
+    	Log.d(TAG, "triggering finish()...");
+		finish();
+    }
+ 
+}
\ No newline at end of file
diff --git a/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/OutArg.java b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/OutArg.java
new file mode 100644
index 0000000..94f6f26
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/OutArg.java
@@ -0,0 +1,6 @@
+package org.OpenNI.Samples.Assistant;
+
+public class OutArg<T> 
+{
+	public T value;
+}
diff --git a/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/Profiler.java b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/Profiler.java
new file mode 100644
index 0000000..113cfbe
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/Profiler.java
@@ -0,0 +1,69 @@
+package org.OpenNI.Samples.Assistant;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+public class Profiler {
+
+	private HashMap<String, List<Long>> dict;
+	private long prev;
+	
+	public Profiler() {
+		dict = new HashMap<String, List<Long>>();
+	}
+	
+	public void sampleNow(String id)
+	{
+		if (!dict.containsKey(id)) {
+			dict.put(id, new ArrayList<Long>(1024));
+		}
+		dict.get(id).add(getDelta());
+	}
+	
+	public void addManualSample(String id, long delta)
+	{
+		if (!dict.containsKey(id)) {
+			dict.put(id, new ArrayList<Long>(1024));
+		}
+		dict.get(id).add(delta);
+	}
+	
+	public String toString()
+	{
+		HashMap<Double, String> res = new HashMap<Double, String>();
+		for (String id : dict.keySet()) {
+			double avg = 0;
+			for (Long l : dict.get(id)) {
+				avg+=l;
+			}avg /= dict.get(id).size();
+			res.put(avg, id);
+		}
+		
+		StringBuilder sb = new StringBuilder("Profiler's summary:\n");
+		
+		List<Double> sorted = new ArrayList<Double>(res.keySet());
+		Collections.sort(sorted);
+		Collections.reverse(sorted);
+		for (Double avg : sorted) {
+			
+			sb.append(String.format("avg for '%s':\t%.2fms\n", res.get(avg), avg));
+		}
+		return sb.toString();
+	}
+	
+	public void reset()
+	{
+		prev = System.currentTimeMillis();
+	}
+	
+	private long getDelta()
+	{
+		long now, delta;
+		now = System.currentTimeMillis();
+		delta = now - prev;
+		prev = now;
+		return delta;
+	}
+}
diff --git a/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/Screen.java b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/Screen.java
new file mode 100644
index 0000000..fb895e0
--- /dev/null
+++ b/Platform/Android/Samples/SamplesAssistant/src/org/OpenNI/Samples/Assistant/Screen.java
@@ -0,0 +1,230 @@
+package org.OpenNI.Samples.Assistant;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.view.View;
+
+public class Screen extends View {
+
+	abstract class Shape
+	{
+		protected Paint paint;
+		public abstract void draw(Canvas canvas);
+	}
+
+	class Line extends Shape
+	{
+		public Line(int x0, int y0, int x1, int y1, int color) 
+		{
+			this.x0 = x0;
+			this.y0 = y0;
+			this.x1 = x1;
+			this.y1 = y1;
+			paint = new Paint();
+			paint.setStrokeWidth(4);
+			paint.setColor(color);
+		}
+		public void draw(Canvas canvas)
+		{
+			canvas.drawLine(x0*magRatio, y0*magRatio, x1*magRatio, y1*magRatio, paint);
+		}
+		
+		private int x0,y0,x1,y1;
+	}
+	
+	class Label extends Shape
+	{
+		public Label(String text, int x, int y, int color) 
+		{
+			this.x = x;
+			this.y = y;
+			this.text = text;
+			paint = new Paint();
+			paint.setTextSize(30);
+			paint.setColor(color);
+		}
+		public void draw(Canvas canvas)
+		{
+			canvas.drawText(text, x*magRatio, y*magRatio, paint);
+		}
+		
+		private int x, y;
+		private String text;
+	}
+	
+	class Circle extends Shape
+	{
+		public Circle(float x, float y, float radius, int color) 
+		{
+			this.x = x;
+			this.y = y;
+			this.radius = radius;
+			paint = new Paint();
+			paint.setColor(color);
+		}
+		public void draw(Canvas canvas)
+		{
+			canvas.drawCircle(x* magRatio, y* magRatio, radius* magRatio, paint);
+		}
+
+		private float x, y, radius;
+	}
+	
+	class Frame extends Shape
+	{
+		public Frame(float left, float top, float width, float height, int color) 
+		{
+			this.x0 = left;
+			this.y0 = top;
+			this.x1 = left + width;
+			this.y1 = top + height;
+					
+			paint = new Paint();
+			paint.setStrokeWidth(4);
+			paint.setColor(color);
+		}
+		public void draw(Canvas canvas)
+		{
+			float[] arr = {
+					x0,y0,x1,y0,
+					x1,y0,x1,y1,
+					x1,y1,x0,y1,
+					x0,y1,x0,y0,
+					};
+			canvas.drawLines(arr , 0, 16, paint);
+		}
+		
+		private float x0,y0,x1,y1;
+	}
+
+	private Object theLock = new Object();
+	private List<Shape> shapes2Draw;
+	private List<Shape> shapes2Prepare;
+	
+	private int curColor = Color.WHITE;
+	
+	private int inputWidth = 320, inputHeight = 240;
+	private float magRatio = 1;
+	
+	public boolean drawBorders = false;
+
+	
+	public Screen(Context context) {
+		super(context);
+		shapes2Draw = new ArrayList<Shape>();
+		shapes2Prepare = new ArrayList<Shape>();
+		
+		FPS = new FPSCalculator();
+		
+		bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.android_skeleton);
+	}
+	
+	public void setDimensions(int width, int height)
+	{
+		inputWidth = width;
+		inputHeight = height;
+	}
+	
+	@Override
+	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+		// TODO Auto-generated method stub
+		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+		int w,h;
+		w = View.MeasureSpec.getSize(widthMeasureSpec);
+		h = View.MeasureSpec.getSize(heightMeasureSpec);
+		magRatio = Math.min(w / inputWidth, h / inputHeight);
+	}
+	
+	@Override
+	protected void onDraw(Canvas canvas) 
+	{	
+		Matrix matrix = new Matrix();
+		matrix.setScale(magRatio, magRatio);
+		
+		if (bitmap != null) {
+			canvas.drawBitmap(bitmap,matrix, null);
+		}
+		
+		synchronized (theLock) {
+			for (Shape shape : shapes2Draw) {
+				shape.draw(canvas);
+			}
+		}
+		
+		if(drawBorders)
+		{
+			Frame frame = new Frame(0, 0, inputWidth * magRatio, inputHeight * magRatio, Color.YELLOW);
+			frame.draw(canvas);
+		}
+	}
+	
+	
+	public Bitmap getBitmap() {
+		return bitmap;
+	}
+
+	public void setBitmap(Bitmap bitmap) {
+		this.bitmap = bitmap;
+		this.postInvalidate();
+	}
+	
+	public void drawLine(int x0, int y0, int x1, int y1)
+	{
+		shapes2Prepare.add(new Line(x0, y0, x1, y1, curColor));
+	}
+	
+	public void drawLabel(String text, int x, int y)
+	{
+		shapes2Prepare.add(new Label(text, x, y, curColor));
+	}
+	
+	public void drawCircle(float x, float y, float radius)
+	{
+		shapes2Prepare.add(new Circle(x, y, radius, curColor));
+	}
+	
+	public void setColor(int color)
+	{
+		curColor = color;
+	}
+	
+	public void redraw()
+	{
+		FPS.update();
+		if(showFPS)
+		{
+			setColor(Color.WHITE);
+			drawLabel(String.format("%.1f FPS", FPS.calcAvgFPS()), 10, 10);
+			drawLabel(String.format("%.1f ms", FPS.calcAvgMillis()), 10, 20);
+		}
+        
+		synchronized (theLock) {
+			shapes2Draw.clear();
+			shapes2Draw.addAll(shapes2Prepare);
+			shapes2Prepare.clear();
+		}
+		this.postInvalidate();
+	}
+
+	
+	private Bitmap bitmap;
+
+	private FPSCalculator FPS;
+	private boolean showFPS = false;
+	
+	public FPSCalculator getFPSCalculator() {
+		return FPS;
+	}
+
+	public void showFPS(boolean show) {
+		showFPS = show;
+	}
+}
diff --git a/Platform/Android/Samples/SimpleViewer/AndroidManifest.xml b/Platform/Android/Samples/SimpleViewer/AndroidManifest.xml
new file mode 100644
index 0000000..b4a84c3
--- /dev/null
+++ b/Platform/Android/Samples/SimpleViewer/AndroidManifest.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="org.OpenNI.Samples.SimpleViewer"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <uses-sdk android:minSdkVersion="10"/>
+
+    <application android:icon="@drawable/icon" android:label="@string/app_name">
+        <activity android:name=".SimpleViewerActivity"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+</manifest>
\ No newline at end of file
diff --git a/Platform/Android/Samples/SimpleViewer/assets/SamplesConfig.xml b/Platform/Android/Samples/SimpleViewer/assets/SamplesConfig.xml
new file mode 100644
index 0000000..fa9ecc8
--- /dev/null
+++ b/Platform/Android/Samples/SimpleViewer/assets/SamplesConfig.xml
@@ -0,0 +1,32 @@
+<OpenNI>
+	<Licenses>
+		<!-- Add licenses here 
+		<License vendor="vendor" key="key"/>
+		-->
+	</Licenses>
+	<Log writeToConsole="true" writeToFile="false">
+		<!-- 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default) -->
+		<LogLevel value="0"/>
+		<Masks>
+			<Mask name="ALL" on="true"/>
+		</Masks>
+		<Dumps>
+		</Dumps>
+	</Log>
+	<ProductionNodes>
+		<!--Recording file="/data/amit/cap/Captured.oni"/-->
+		<Node type="Depth" name="Depth1">
+			<Configuration>
+				<Mirror on="true"/>
+			</Configuration>
+		</Node>
+<!--		<Node type="Image" name="Image1" stopOnError="false">
+			<Configuration>
+				<Mirror on="true"/>
+			</Configuration>
+		</Node>
+-->		<!--
+		<Node type="Audio" name="Audio1"/>
+		-->
+	</ProductionNodes>
+</OpenNI>
diff --git a/Platform/Android/Samples/SimpleViewer/default.properties b/Platform/Android/Samples/SimpleViewer/default.properties
new file mode 100644
index 0000000..05c40fd
--- /dev/null
+++ b/Platform/Android/Samples/SimpleViewer/default.properties
@@ -0,0 +1,12 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-11
+android.library.reference.1=../SamplesAssistant
diff --git a/Platform/Android/Samples/SimpleViewer/res/drawable-hdpi/icon.png b/Platform/Android/Samples/SimpleViewer/res/drawable-hdpi/icon.png
new file mode 100644
index 0000000..8074c4c
Binary files /dev/null and b/Platform/Android/Samples/SimpleViewer/res/drawable-hdpi/icon.png differ
diff --git a/Platform/Android/Samples/SimpleViewer/res/drawable-ldpi/icon.png b/Platform/Android/Samples/SimpleViewer/res/drawable-ldpi/icon.png
new file mode 100644
index 0000000..1095584
Binary files /dev/null and b/Platform/Android/Samples/SimpleViewer/res/drawable-ldpi/icon.png differ
diff --git a/Platform/Android/Samples/SimpleViewer/res/drawable-mdpi/icon.png b/Platform/Android/Samples/SimpleViewer/res/drawable-mdpi/icon.png
new file mode 100644
index 0000000..a07c69f
Binary files /dev/null and b/Platform/Android/Samples/SimpleViewer/res/drawable-mdpi/icon.png differ
diff --git a/Platform/Android/Samples/SimpleViewer/res/layout/main.xml b/Platform/Android/Samples/SimpleViewer/res/layout/main.xml
new file mode 100644
index 0000000..3a5f117
--- /dev/null
+++ b/Platform/Android/Samples/SimpleViewer/res/layout/main.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    >
+<TextView  
+    android:layout_width="fill_parent" 
+    android:layout_height="wrap_content" 
+    android:text="@string/hello"
+    />
+</LinearLayout>
diff --git a/Platform/Android/Samples/SimpleViewer/res/values/strings.xml b/Platform/Android/Samples/SimpleViewer/res/values/strings.xml
new file mode 100644
index 0000000..4774ff3
--- /dev/null
+++ b/Platform/Android/Samples/SimpleViewer/res/values/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="hello">Hello World, SimpleViewerActivity!</string>
+    <string name="app_name">SimpleViewer</string>
+</resources>
diff --git a/Platform/Android/Samples/SimpleViewer/src/org/OpenNI/Samples/SimpleViewer/SimpleViewer.java b/Platform/Android/Samples/SimpleViewer/src/org/OpenNI/Samples/SimpleViewer/SimpleViewer.java
new file mode 100644
index 0000000..f2e2a4e
--- /dev/null
+++ b/Platform/Android/Samples/SimpleViewer/src/org/OpenNI/Samples/SimpleViewer/SimpleViewer.java
@@ -0,0 +1,86 @@
+package org.OpenNI.Samples.SimpleViewer;
+
+import org.OpenNI.*;
+import org.OpenNI.Samples.Assistant.BitmapGenerator;
+
+import android.graphics.Bitmap;
+import android.graphics.Bitmap.Config;
+import android.util.Log;
+
+
+
+class SimpleViewer  {
+	private final String TAG = getClass().getSimpleName(); 
+	
+	private OutArg<ScriptNode> scriptNode;
+    private Context context;
+    private DepthGenerator depthGen;
+    private BitmapGenerator bitmapGenerator;
+    
+    private Bitmap bitmap;
+
+    public int width, height;
+    private int[] pixels;
+    
+
+    public static final String SAMPLE_XML_FILE = "SamplesConfig.xml";    
+    public SimpleViewer() {
+
+        try {
+            scriptNode = new OutArg<ScriptNode>();
+            String xmlName = SimpleViewerActivity.getCurrentActivity().getFilesDir() +"/"+ SAMPLE_XML_FILE;
+            context = Context.createFromXmlFile(xmlName, scriptNode);
+            depthGen = DepthGenerator.create(context);
+            
+            bitmapGenerator = new BitmapGenerator(context, false, true);
+            MapOutputMode mapOutputMode = bitmapGenerator.getMapOutputMode();
+            width  = mapOutputMode.getXRes();
+            height = mapOutputMode.getYRes();
+            bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
+
+        } catch (GeneralException e) {
+            Log.e(TAG, e.toString());
+            System.exit(1);
+        }
+    }
+    
+    public void Cleanup()
+    {
+    	Log.e(TAG, "Cleanup");
+    	
+    	scriptNode.value.dispose();
+    	scriptNode = null;
+    	
+    	depthGen.dispose();
+    	depthGen = null;
+    	
+    	try {
+			bitmapGenerator.dispose();
+		} catch (StatusException e) {
+			Log.e(TAG, e.toString());
+		}
+    	
+    	context.dispose();
+    	context = null;
+
+    	Log.e(TAG, "Cleanup Done");
+    }
+    
+
+	void updateDepth() throws StatusException {
+		context.waitAnyUpdateAll();
+		bitmapGenerator.generateBitmap();
+	}
+
+   
+    public Bitmap drawBitmap()
+    {
+    	pixels = bitmapGenerator.getLastBitmap();
+    	bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
+        return bitmap;
+    }
+    
+ 
+}
+
+
diff --git a/Platform/Android/Samples/SimpleViewer/src/org/OpenNI/Samples/SimpleViewer/SimpleViewerActivity.java b/Platform/Android/Samples/SimpleViewer/src/org/OpenNI/Samples/SimpleViewer/SimpleViewerActivity.java
new file mode 100644
index 0000000..2b0873f
--- /dev/null
+++ b/Platform/Android/Samples/SimpleViewer/src/org/OpenNI/Samples/SimpleViewer/SimpleViewerActivity.java
@@ -0,0 +1,71 @@
+package org.OpenNI.Samples.SimpleViewer;
+
+import java.io.IOException;
+
+import org.OpenNI.Samples.Assistant.OpenNIBaseActivity;
+import org.OpenNI.Samples.Assistant.Screen;
+
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.util.Log;
+
+public class SimpleViewerActivity extends OpenNIBaseActivity {
+	private SimpleViewer simpleViewer;
+
+	private Screen theScreen;
+
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		try {
+			retrieveXml(SimpleViewer.SAMPLE_XML_FILE);
+		} catch (IOException e) {
+			Log.e(TAG, "onCreate() Failed!", e);
+			return;
+		}
+		Log.d(TAG, "create done");
+	}
+
+	private void initScreen(int width, int height) {
+		theScreen = new Screen(this);
+		theScreen.setDimensions(width, height);
+		theScreen.showFPS(true);
+		setContentView(theScreen);
+	}
+
+	public void draw(Bitmap bmp) {
+		theScreen.setBitmap(bmp);
+		theScreen.redraw();
+	}
+
+	@Override
+	protected void myInitFunction() {
+		// TODO Auto-generated method stub
+		Log.d(TAG, "init");
+		
+		simpleViewer = new SimpleViewer();
+		initScreen(simpleViewer.width, simpleViewer.height);
+
+		Log.d(TAG, "init done");
+	}
+
+	@Override
+	protected void myCleanupFunction() {
+		// TODO Auto-generated method stub
+		simpleViewer.Cleanup();
+	}
+
+	@Override
+	protected boolean myMainLoopContent() {
+		try {
+			simpleViewer.updateDepth();
+			draw(simpleViewer.drawBitmap());
+		} 
+		catch (Exception e) {
+			Log.e(TAG, "An exception was caught during mainLoop:", e);
+			return false;
+		}
+
+		return true;
+	}
+}
diff --git a/Platform/Android/Samples/UserTracker/AndroidManifest.xml b/Platform/Android/Samples/UserTracker/AndroidManifest.xml
new file mode 100644
index 0000000..102d9d9
--- /dev/null
+++ b/Platform/Android/Samples/UserTracker/AndroidManifest.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="org.OpenNI.Samples.UserTracker"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <uses-sdk android:minSdkVersion="10"/>
+
+    <application android:icon="@drawable/icon" android:label="@string/app_name">
+        <activity android:name=".UserTrackerActivity"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+</manifest>
\ No newline at end of file
diff --git a/Platform/Android/Samples/UserTracker/assets/SamplesConfig.xml b/Platform/Android/Samples/UserTracker/assets/SamplesConfig.xml
new file mode 100644
index 0000000..fa9ecc8
--- /dev/null
+++ b/Platform/Android/Samples/UserTracker/assets/SamplesConfig.xml
@@ -0,0 +1,32 @@
+<OpenNI>
+	<Licenses>
+		<!-- Add licenses here 
+		<License vendor="vendor" key="key"/>
+		-->
+	</Licenses>
+	<Log writeToConsole="true" writeToFile="false">
+		<!-- 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default) -->
+		<LogLevel value="0"/>
+		<Masks>
+			<Mask name="ALL" on="true"/>
+		</Masks>
+		<Dumps>
+		</Dumps>
+	</Log>
+	<ProductionNodes>
+		<!--Recording file="/data/amit/cap/Captured.oni"/-->
+		<Node type="Depth" name="Depth1">
+			<Configuration>
+				<Mirror on="true"/>
+			</Configuration>
+		</Node>
+<!--		<Node type="Image" name="Image1" stopOnError="false">
+			<Configuration>
+				<Mirror on="true"/>
+			</Configuration>
+		</Node>
+-->		<!--
+		<Node type="Audio" name="Audio1"/>
+		-->
+	</ProductionNodes>
+</OpenNI>
diff --git a/Platform/Android/Samples/UserTracker/default.properties b/Platform/Android/Samples/UserTracker/default.properties
new file mode 100644
index 0000000..05c40fd
--- /dev/null
+++ b/Platform/Android/Samples/UserTracker/default.properties
@@ -0,0 +1,12 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-11
+android.library.reference.1=../SamplesAssistant
diff --git a/Platform/Android/Samples/UserTracker/res/drawable-hdpi/icon.png b/Platform/Android/Samples/UserTracker/res/drawable-hdpi/icon.png
new file mode 100644
index 0000000..8074c4c
Binary files /dev/null and b/Platform/Android/Samples/UserTracker/res/drawable-hdpi/icon.png differ
diff --git a/Platform/Android/Samples/UserTracker/res/drawable-ldpi/icon.png b/Platform/Android/Samples/UserTracker/res/drawable-ldpi/icon.png
new file mode 100644
index 0000000..1095584
Binary files /dev/null and b/Platform/Android/Samples/UserTracker/res/drawable-ldpi/icon.png differ
diff --git a/Platform/Android/Samples/UserTracker/res/drawable-mdpi/icon.png b/Platform/Android/Samples/UserTracker/res/drawable-mdpi/icon.png
new file mode 100644
index 0000000..a07c69f
Binary files /dev/null and b/Platform/Android/Samples/UserTracker/res/drawable-mdpi/icon.png differ
diff --git a/Platform/Android/Samples/UserTracker/res/layout/main.xml b/Platform/Android/Samples/UserTracker/res/layout/main.xml
new file mode 100644
index 0000000..3a5f117
--- /dev/null
+++ b/Platform/Android/Samples/UserTracker/res/layout/main.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    >
+<TextView  
+    android:layout_width="fill_parent" 
+    android:layout_height="wrap_content" 
+    android:text="@string/hello"
+    />
+</LinearLayout>
diff --git a/Platform/Android/Samples/UserTracker/res/values/strings.xml b/Platform/Android/Samples/UserTracker/res/values/strings.xml
new file mode 100644
index 0000000..07ccc87
--- /dev/null
+++ b/Platform/Android/Samples/UserTracker/res/values/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="hello">Hello World, UserTrackerActivity!</string>
+    <string name="app_name">UserTracker</string>
+</resources>
diff --git a/Platform/Android/Samples/UserTracker/src/org/OpenNI/Samples/UserTracker/UserTracker.java b/Platform/Android/Samples/UserTracker/src/org/OpenNI/Samples/UserTracker/UserTracker.java
new file mode 100644
index 0000000..025ed2e
--- /dev/null
+++ b/Platform/Android/Samples/UserTracker/src/org/OpenNI/Samples/UserTracker/UserTracker.java
@@ -0,0 +1,548 @@
+package org.OpenNI.Samples.UserTracker;
+
+import org.OpenNI.*;
+import org.OpenNI.Samples.Assistant.BitmapGenerator;
+import org.OpenNI.Samples.Assistant.Screen;
+
+import android.graphics.Bitmap;
+import android.graphics.Bitmap.Config;
+import android.graphics.Color;
+import android.util.Log;
+
+import java.nio.ShortBuffer;
+import java.util.HashMap;
+
+
+public class UserTracker
+{
+	private final String TAG = getClass().getSimpleName();
+	public static final String SAMPLE_XML_FILE = "SamplesConfig.xml";
+	
+	class NewUserObserver implements IObserver<UserEventArgs>
+	{
+		@Override
+		public void update(IObservable<UserEventArgs> observable,
+				UserEventArgs args)
+		{
+			Log.i(TAG,"New user " + args.getId());
+			try
+			{
+				if (skeletonCap.needPoseForCalibration())
+				{
+					poseDetectionCap.startPoseDetection(calibPose, args.getId());
+				}
+				else
+				{
+					skeletonCap.requestSkeletonCalibration(args.getId(), true);
+				}
+			} catch (StatusException e)
+			{
+				Log.e(TAG, "Exception!", e);
+			}
+		}
+	}
+	class LostUserObserver implements IObserver<UserEventArgs>
+	{
+		@Override
+		public void update(IObservable<UserEventArgs> observable,
+				UserEventArgs args)
+		{
+			Log.i(TAG,"Lost user " + args.getId());
+			joints.remove(args.getId());
+		}
+	}
+	
+	class CalibrationCompleteObserver implements IObserver<CalibrationProgressEventArgs>
+	{
+		@Override
+		public void update(IObservable<CalibrationProgressEventArgs> observable,
+				CalibrationProgressEventArgs args)
+		{
+			Log.i(TAG,"Calibraion complete: " + args.getStatus());
+			try
+			{
+			if (args.getStatus() == CalibrationProgressStatus.OK)
+			{
+				Log.i(TAG,"starting tracking "  +args.getUser());
+				skeletonCap.startTracking(args.getUser());
+				joints.put(new Integer(args.getUser()), new HashMap<SkeletonJoint, SkeletonJointPosition>());
+			}
+			else
+			{
+				if (skeletonCap.needPoseForCalibration())
+				{
+					poseDetectionCap.startPoseDetection(calibPose, args.getUser());
+				}
+				else
+				{
+					skeletonCap.requestSkeletonCalibration(args.getUser(), true);
+				}
+			}
+			} catch (StatusException e)
+			{
+				Log.e(TAG, "Exception!", e);
+			}
+		}
+	}
+	class PoseDetectedObserver implements IObserver<PoseDetectionEventArgs>
+	{
+		@Override
+		public void update(IObservable<PoseDetectionEventArgs> observable,
+				PoseDetectionEventArgs args)
+		{
+			Log.i(TAG,"Pose " + args.getPose() + " detected for " + args.getUser());
+			try
+			{
+				poseDetectionCap.stopPoseDetection(args.getUser());
+				skeletonCap.requestSkeletonCalibration(args.getUser(), true);
+			} catch (StatusException e)
+			{
+				Log.e(TAG, "Exception!", e);
+			}
+		}
+	}
+	
+	
+	public boolean shouldDie = false;
+
+	private OutArg<ScriptNode> scriptNode;
+	private Context context;
+	private DepthGenerator depthGen;
+	private UserGenerator userGen;
+	private SkeletonCapability skeletonCap;
+	private PoseDetectionCapability poseDetectionCap;
+	private byte[] imgbytes;
+	private float histogram[];
+	String calibPose = null;
+	HashMap<Integer, HashMap<SkeletonJoint, SkeletonJointPosition>> joints;
+	
+	private BitmapGenerator bitmapGenerator;
+	
+	private CrossWatcher crossDetector;
+
+	private boolean drawBackground = true;
+	private boolean drawPixels = true;
+	private boolean drawSkeleton = true;
+	private boolean drawHead = false;
+	private boolean printID = true;
+	private boolean printState = true;
+	private boolean useJNI = true;
+	
+	int width, height;
+	
+	
+	public UserTracker() throws GeneralException
+	{
+		crossDetector = new CrossWatcher(new Runnable() {
+			@Override
+			public void run() {
+				shouldDie = true;
+			}
+		}, 2);
+		
+		try {
+			scriptNode = new OutArg<ScriptNode>();
+			String xmlName = UserTrackerActivity.getCurrentActivity().getFilesDir() +"/"+ SAMPLE_XML_FILE;
+			context = Context.createFromXmlFile(xmlName, scriptNode);
+			depthGen = DepthGenerator.create(context);
+
+			DepthMetaData depthMD = depthGen.getMetaData();
+
+			histogram = new float[10000];
+			width = depthMD.getFullXRes();
+			height = depthMD.getFullYRes();
+			bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
+			
+			imgbytes = new byte[width*height*3];
+
+			userGen = UserGenerator.create(context);
+
+			bitmapGenerator = new BitmapGenerator(context, true, true);
+			
+			skeletonCap = userGen.getSkeletonCapability();
+			poseDetectionCap = userGen.getPoseDetectionCapability();
+			userGen.getNewUserEvent().addObserver(new NewUserObserver());
+			userGen.getLostUserEvent().addObserver(new LostUserObserver());
+			skeletonCap.getCalibrationCompleteEvent().addObserver(new CalibrationCompleteObserver());
+			poseDetectionCap.getPoseDetectedEvent().addObserver(new PoseDetectedObserver());
+			
+			calibPose = skeletonCap.getSkeletonCalibrationPose();
+			joints = new HashMap<Integer, HashMap<SkeletonJoint,SkeletonJointPosition>>();
+			
+			skeletonCap.setSkeletonProfile(SkeletonProfile.ALL);
+			
+			context.startGeneratingAll();
+
+		} catch (GeneralException e) {
+			e.fillInStackTrace();
+			Log.e(TAG, e.toString());
+			throw e;
+		}
+	}
+	
+	public void Cleanup()
+	{
+		Log.i(TAG, "Cleanup!");
+		scriptNode.value.dispose();
+		scriptNode = null;
+		
+		skeletonCap.dispose();
+		skeletonCap = null;
+		poseDetectionCap.dispose();
+		poseDetectionCap = null;
+		
+		depthGen.dispose();
+		depthGen = null;
+		userGen.dispose();
+		userGen = null;
+		
+		try {
+			bitmapGenerator.dispose();
+		} catch (StatusException e) {
+			Log.e(TAG, "Exception!", e);
+		}
+		bitmapGenerator = null;
+		
+		context.dispose();
+		context = null;
+		Log.i(TAG, "Cleanup done.");
+	}
+	
+	
+	private void calcHist(ShortBuffer depth)
+	{
+		// reset
+		for (int i = 0; i < histogram.length; ++i)
+			histogram[i] = 0;
+		
+		depth.rewind();
+
+		int points = 0;
+		while(depth.remaining() > 0)
+		{
+			short depthVal = depth.get();
+			if (depthVal != 0)
+			{
+				histogram[depthVal]++;
+				points++;
+			}
+		}
+		
+		for (int i = 1; i < histogram.length; i++)
+		{
+			histogram[i] += histogram[i-1];
+		}
+
+		if (points > 0)
+		{
+			for (int i = 1; i < histogram.length; i++)
+			{
+				histogram[i] = 1.0f - (histogram[i] / (float)points);
+			}
+		}
+	}
+
+	void updateDepth_java() throws StatusException {
+		context.waitAnyUpdateAll();
+
+		DepthMetaData depthMD = depthGen.getMetaData();
+		SceneMetaData sceneMD = userGen.getUserPixels(0);
+
+		ShortBuffer scene = sceneMD.getData().createShortBuffer();
+		ShortBuffer depth = depthMD.getData().createShortBuffer();
+		calcHist(depth);
+		depth.rewind();
+
+		while (depth.remaining() > 0) {
+			int pos = depth.position();
+			short pixel = depth.get();
+			short user = scene.get();
+
+			imgbytes[3 * pos] = 0;
+			imgbytes[3 * pos + 1] = 0;
+			imgbytes[3 * pos + 2] = 0;
+
+			if (drawBackground || pixel != 0) {
+				int colorID = user % (colors.length - 1);
+				if (user == 0) {
+					colorID = colors.length - 1;
+				}
+				if (pixel != 0) {
+					float histValue = histogram[pixel];
+					imgbytes[3 * pos] = (byte) (histValue * Color
+							.red(colors[colorID]));
+					imgbytes[3 * pos + 1] = (byte) (histValue * Color
+							.green(colors[colorID]));
+					imgbytes[3 * pos + 2] = (byte) (histValue * Color
+							.blue(colors[colorID]));
+				}
+			}
+		}
+	}
+
+	void updateDepth_jni() throws StatusException {
+		context.waitAnyUpdateAll();
+		bitmapGenerator.generateBitmap();
+	}
+	
+	void updateDepth() throws StatusException
+	{
+		if(useJNI)
+			updateDepth_jni();
+		else
+			updateDepth_java();
+	}
+
+	int colors[] = {Color.GREEN, Color.RED, Color.YELLOW, Color.CYAN, Color.BLUE, Color.rgb(255, 127, 0), Color.rgb(127, 255, 0), Color.LTGRAY };
+	
+	public void getJoint(int user, SkeletonJoint joint) throws StatusException
+	{
+		SkeletonJointPosition pos = skeletonCap.getSkeletonJointPosition(user, joint);
+		if (pos.getPosition().getZ() != 0)
+		{
+			joints.get(user).put(joint, new SkeletonJointPosition(depthGen.convertRealWorldToProjective(pos.getPosition()), pos.getConfidence()));
+		}
+		else
+		{
+			joints.get(user).put(joint, new SkeletonJointPosition(new Point3D(), 0));
+		}
+	}
+	public void getJoints(int user) throws StatusException
+	{
+		getJoint(user, SkeletonJoint.HEAD);
+		getJoint(user, SkeletonJoint.NECK);
+		
+		getJoint(user, SkeletonJoint.LEFT_SHOULDER);
+		getJoint(user, SkeletonJoint.LEFT_ELBOW);
+		getJoint(user, SkeletonJoint.LEFT_HAND);
+
+		getJoint(user, SkeletonJoint.RIGHT_SHOULDER);
+		getJoint(user, SkeletonJoint.RIGHT_ELBOW);
+		getJoint(user, SkeletonJoint.RIGHT_HAND);
+
+		getJoint(user, SkeletonJoint.TORSO);
+
+		getJoint(user, SkeletonJoint.LEFT_HIP);
+		getJoint(user, SkeletonJoint.LEFT_KNEE);
+		getJoint(user, SkeletonJoint.LEFT_FOOT);
+
+		getJoint(user, SkeletonJoint.RIGHT_HIP);
+		getJoint(user, SkeletonJoint.RIGHT_KNEE);
+		getJoint(user, SkeletonJoint.RIGHT_FOOT);
+
+	}
+	void drawLine(Screen g, HashMap<SkeletonJoint, SkeletonJointPosition> jointHash, SkeletonJoint joint1, SkeletonJoint joint2)
+	{
+		Point3D pos1 = jointHash.get(joint1).getPosition();
+		Point3D pos2 = jointHash.get(joint2).getPosition();
+
+		if (jointHash.get(joint1).getConfidence() == 0 || jointHash.get(joint1).getConfidence() == 0)
+			return;
+
+		g.drawLine((int)pos1.getX(), (int)pos1.getY(), (int)pos2.getX(), (int)pos2.getY());
+	}
+	void drawHead(Screen g, HashMap<SkeletonJoint, SkeletonJointPosition> jointHash)
+	{
+		SkeletonJointPosition h = jointHash.get(SkeletonJoint.HEAD); 
+//		SkeletonJointPosition l = jointHash.get(SkeletonJoint.LEFT_SHOULDER);
+//		SkeletonJointPosition r = jointHash.get(SkeletonJoint.RIGHT_SHOULDER);
+		Point3D ph =  h.getPosition();
+//		Point3D pl = l.getPosition();
+//		Point3D pr = r.getPosition();
+
+		if (h.getConfidence() == 0
+//				|| l.getConfidence() == 0 || r.getConfidence() == 0
+				)
+			return;
+		
+		float Z = ((4000 - ph.getZ())/4000)*30;
+		
+		g.drawCircle(ph.getX(), ph.getY(), Z);
+	}
+	public void drawSkeleton(Screen g, int user) throws StatusException
+	{
+		getJoints(user);
+		HashMap<SkeletonJoint, SkeletonJointPosition> dict = joints.get(new Integer(user));
+
+		if(drawHead)
+			drawHead(g, dict);
+		
+		drawLine(g, dict, SkeletonJoint.HEAD, SkeletonJoint.NECK);
+
+		drawLine(g, dict, SkeletonJoint.LEFT_SHOULDER, SkeletonJoint.TORSO);
+		drawLine(g, dict, SkeletonJoint.RIGHT_SHOULDER, SkeletonJoint.TORSO);
+
+		drawLine(g, dict, SkeletonJoint.NECK, SkeletonJoint.LEFT_SHOULDER);
+		drawLine(g, dict, SkeletonJoint.LEFT_SHOULDER, SkeletonJoint.LEFT_ELBOW);
+		drawLine(g, dict, SkeletonJoint.LEFT_ELBOW, SkeletonJoint.LEFT_HAND);
+
+		drawLine(g, dict, SkeletonJoint.NECK, SkeletonJoint.RIGHT_SHOULDER);
+		drawLine(g, dict, SkeletonJoint.RIGHT_SHOULDER, SkeletonJoint.RIGHT_ELBOW);
+		drawLine(g, dict, SkeletonJoint.RIGHT_ELBOW, SkeletonJoint.RIGHT_HAND);
+
+		drawLine(g, dict, SkeletonJoint.LEFT_HIP, SkeletonJoint.TORSO);
+		drawLine(g, dict, SkeletonJoint.RIGHT_HIP, SkeletonJoint.TORSO);
+		drawLine(g, dict, SkeletonJoint.LEFT_HIP, SkeletonJoint.RIGHT_HIP);
+
+		drawLine(g, dict, SkeletonJoint.LEFT_HIP, SkeletonJoint.LEFT_KNEE);
+		drawLine(g, dict, SkeletonJoint.LEFT_KNEE, SkeletonJoint.LEFT_FOOT);
+
+		drawLine(g, dict, SkeletonJoint.RIGHT_HIP, SkeletonJoint.RIGHT_KNEE);
+		drawLine(g, dict, SkeletonJoint.RIGHT_KNEE, SkeletonJoint.RIGHT_FOOT);
+		
+		Point3D pl = dict.get(SkeletonJoint.LEFT_HAND).getPosition();
+		Point3D pr = dict.get(SkeletonJoint.RIGHT_HAND).getPosition();
+		g.drawLabel("L", (int)pl.getX(), (int)pl.getY());
+		g.drawLabel("R", (int)pr.getX(), (int)pr.getY());
+
+	}
+	
+	private Bitmap bitmap;
+	private int[] pixels;
+	
+	public void paint(Screen screen) throws StatusException
+	{
+		screen.setDimensions(width, height);
+		
+		if (drawPixels)
+		{
+			if (useJNI) {
+				pixels = bitmapGenerator.getLastBitmap();
+			}
+			else
+			{
+				if(pixels == null)
+					pixels = new int[width*height];
+				for (int i = 0; i < pixels.length; i++) {
+					pixels[i] = Color.rgb(imgbytes[i*3], imgbytes[i*3+1], imgbytes[i*3+2]);
+				}
+			}
+			bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
+			screen.setBitmap(bitmap);
+		}
+		
+		int[] users = userGen.getUsers();
+		for (int i = 0; i < users.length; ++i) {
+			int c = colors[(users[i] - 1) % colors.length];
+			c = Color.rgb(255 - Color.red(c), 255 - Color.green(c),
+					255 - Color.blue(c));
+
+			screen.setColor(c);
+
+			if (drawSkeleton && skeletonCap.isSkeletonTracking(users[i])) {
+				drawSkeleton(screen, users[i]);
+			}
+
+			if (printID) {
+				Point3D com = depthGen.convertRealWorldToProjective(userGen.getUserCoM(users[i]));
+				String label = null;
+				if (!printState) {
+					label = new String("" + users[i]);
+				} else if (skeletonCap.isSkeletonTracking(users[i])) {
+					// Tracking
+					label = new String(users[i] + " - Tracking");
+				} else if (skeletonCap.isSkeletonCalibrating(users[i])) {
+					// Calibrating
+					label = new String(users[i] + " - Calibrating");
+				} else {
+					// Nothing
+					label = new String(users[i] + " - Looking for pose ("
+							+ calibPose + ")");
+				}
+
+				screen.drawLabel(label, (int) com.getX(), (int) com.getY());
+			}
+		}
+
+		// draw exit warning, if necessary.
+		Float time2Die = crossDetector.getSeconds2Callback();
+		screen.setColor(Color.WHITE);
+		if (time2Die != null)
+			screen.drawLabel(String.format("Terminating in %.1f Seconds", time2Die),
+					100, 10);
+	}
+	
+	public void doSmartThings() throws StatusException {
+		int[] users;
+		users = userGen.getUsers();
+
+		for (int i = 0; i < users.length; ++i) {
+			int user = users[i];
+
+			if (skeletonCap.isSkeletonTracking(user)) {
+				getJoints(user);
+				HashMap<SkeletonJoint, SkeletonJointPosition> dict = joints
+						.get(user);
+
+				Point3D posLE = dict.get(SkeletonJoint.LEFT_ELBOW)
+						.getPosition();
+				Point3D posRE = dict.get(SkeletonJoint.RIGHT_ELBOW)
+						.getPosition();
+				Point3D posLH = dict.get(SkeletonJoint.LEFT_HAND).getPosition();
+				Point3D posRH = dict.get(SkeletonJoint.RIGHT_HAND)
+						.getPosition();
+				if (((posLE.getX() - posRE.getX()) * (posLH.getX() - posRH
+						.getX())) < 0
+						&& (posLH.getY() < posRE.getY())
+						&& (posRH.getY() < posLE.getY())) {
+					crossDetector.reportCross(user, true);
+
+				} else {
+					crossDetector.reportCross(user, false);
+				}
+			}
+		}
+	}
+	
+	class CrossWatcher
+	{
+		public CrossWatcher(Runnable terminatorCallback, int seconds2Callback) {
+			dict = new HashMap<Integer, Long>();
+			terminator = terminatorCallback;
+			timeout = seconds2Callback * 1000;
+		}
+		
+		public void reportCross(int user, boolean isCrossing)
+		{
+			long now = System.currentTimeMillis();
+			if(isCrossing)
+			{
+				if (dict.containsKey(user))
+				{
+					if(now - dict.get(user) >= timeout)
+					{
+						terminator.run();
+					}
+				}
+				else
+				{
+					dict.put(user, now);
+				}
+			}
+			else
+			{
+				if (dict.containsKey(user))
+				{
+					dict.remove(user);
+				}
+			}
+		}
+		public Float getSeconds2Callback() {
+			float max = 0;
+			long now = System.currentTimeMillis();
+			for (Long l : dict.values()) {
+				max = Math.max((float)(now -l), max);
+			}
+			float left = timeout - max;
+			if (left == timeout || left < 0) return null;
+			return left / 1000;
+		}
+		
+		private Runnable terminator;
+		private int timeout;
+		private HashMap<Integer,Long> dict;
+		
+	}
+  
+}
+
diff --git a/Platform/Android/Samples/UserTracker/src/org/OpenNI/Samples/UserTracker/UserTrackerActivity.java b/Platform/Android/Samples/UserTracker/src/org/OpenNI/Samples/UserTracker/UserTrackerActivity.java
new file mode 100644
index 0000000..3b474fe
--- /dev/null
+++ b/Platform/Android/Samples/UserTracker/src/org/OpenNI/Samples/UserTracker/UserTrackerActivity.java
@@ -0,0 +1,74 @@
+package org.OpenNI.Samples.UserTracker;
+
+import java.io.*;
+
+import org.OpenNI.GeneralException;
+import org.OpenNI.Samples.Assistant.OpenNIBaseActivity;
+import org.OpenNI.Samples.Assistant.Screen;
+
+import android.graphics.Color;
+import android.os.Bundle;
+import android.util.Log;
+
+public class UserTrackerActivity extends OpenNIBaseActivity {
+	
+	
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		
+		
+		try {
+			retrieveXml(UserTracker.SAMPLE_XML_FILE);
+		} catch (IOException e) {
+			Log.e(TAG,"onCreate() Failed!", e);
+			return;
+		}
+		
+		super.onCreate(savedInstanceState);
+	}
+	
+	private UserTracker userTracker;
+	
+	private Screen theScreen;
+	
+
+	@Override
+	protected void myInitFunction() throws GeneralException {
+		// TODO Auto-generated method stub
+		theScreen = new Screen(this);
+		theScreen.setBackgroundColor(Color.BLACK);
+		theScreen.showFPS(true);
+		setContentView(theScreen);
+		userTracker = new UserTracker();
+	}
+	@Override
+	protected void myCleanupFunction() {
+		// TODO Auto-generated method stub
+		if (userTracker != null)
+		{
+			userTracker.Cleanup();
+			userTracker = null;
+		}
+
+		Log.i(TAG, theScreen.getFPSCalculator().toString());
+	}
+	@Override
+	protected boolean myMainLoopContent() {
+		// TODO Auto-generated method stub
+		if (userTracker.shouldDie)
+			return false;
+		
+		try {
+			userTracker.updateDepth();
+			userTracker.doSmartThings();
+			userTracker.paint(theScreen);
+			theScreen.redraw();
+		} catch (Exception e) {
+			Log.e(TAG, "An exception was caught during mainLoop:", e);
+			return false;
+		}
+		
+		return true;
+	}
+	
+}
diff --git a/Platform/Android/jni/Android.mk b/Platform/Android/jni/Android.mk
new file mode 100644
index 0000000..835b0ff
--- /dev/null
+++ b/Platform/Android/jni/Android.mk
@@ -0,0 +1,5 @@
+# OpenNI Android makefile.
+#
+
+include $(call all-subdir-makefiles)
+
diff --git a/Platform/Android/jni/Application.mk b/Platform/Android/jni/Application.mk
new file mode 100644
index 0000000..6d2da24
--- /dev/null
+++ b/Platform/Android/jni/Application.mk
@@ -0,0 +1,28 @@
+APP_STL := gnustl_static
+
+# Android >= v2.3
+APP_PLATFORM := android-9
+
+# Build ARMv7-A machine code.
+APP_ABI := armeabi-v7a
+APP_CFLAGS := -O3 -ftree-vectorize -ffast-math -funroll-loops
+
+APP_CFLAGS += -fPIC
+
+ifeq ($(APP_ABI),armeabi-v7a)
+	APP_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mtune=cortex-a9 -mfp=vfpv3-d16 -mfpu=vfp
+
+# optionally add NEON to compilation flags.
+# to activate, run: "ndk-build USE_NEON=1"
+ifdef USE_NEON
+$(call __ndk_info,Building everything with NEON support!)
+	APP_CFLAGS += -mfpu=neon -DHAVE_NEON=1 -flax-vector-conversions
+endif
+endif
+
+APP_CPPFLAGS += -frtti
+
+#$(call __ndk_info,APP_CFLAGS=$(APP_CFLAGS))
+#$(call __ndk_info,APP_CPPFLAGS=$(APP_CPPFLAGS))
+
+#-fsingle-precision-constant
diff --git a/Platform/Android/jni/External/Android.mk b/Platform/Android/jni/External/Android.mk
new file mode 100644
index 0000000..835b0ff
--- /dev/null
+++ b/Platform/Android/jni/External/Android.mk
@@ -0,0 +1,5 @@
+# OpenNI Android makefile.
+#
+
+include $(call all-subdir-makefiles)
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/AUTHORS b/Platform/Android/jni/External/libusb-1.0.8/AUTHORS
new file mode 100644
index 0000000..dc0e053
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/AUTHORS
@@ -0,0 +1,20 @@
+Copyright (C) 2007-2009 Daniel Drake <dsd at gentoo.org>
+Copyright (c) 2001 Johannes Erdfelt <johannes at erdfelt.com>
+Copyright (C) 2008-2010 Nathan Hjelm <hjelmn at users.sourceforge.net>
+
+Other contributors:
+Alex Vatchenko
+Artem Egorkine
+Aurelien Jarno
+Bastien Nocera
+David Engraf
+David Moore
+Felipe Balbi
+Hans Ulrich Niedermann
+Ludovic Rousseau
+Martin Koegler
+Mikhail Gusarov
+Rob Walker
+Toby Peterson
+Vasily Khoruzhick
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/Android.mk b/Platform/Android/jni/External/libusb-1.0.8/Android.mk
new file mode 100644
index 0000000..faf4ee1
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/Android.mk
@@ -0,0 +1,28 @@
+# OpenNI Android makefile.
+# libusb.so
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES:= \
+                  libusb/core.c \
+                  libusb/descriptor.c \
+                  libusb/io.c \
+                  libusb/sync.c \
+                  libusb/os/linux_usbfs.c
+
+
+LOCAL_C_INCLUDES += \
+                    $(LOCAL_PATH)/libusb/ \
+                    $(LOCAL_PATH)/libusb/os/ \
+
+LOCAL_PREBUILT_LIBS := libc
+
+LOCAL_CFLAGS := -fvisibility=default # just a reminder. if it's "hidden" - it doesn't link!
+
+LOCAL_MODULE := libusb
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/Platform/Android/jni/External/libusb-1.0.8/COPYING b/Platform/Android/jni/External/libusb-1.0.8/COPYING
new file mode 100644
index 0000000..5ab7695
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/COPYING
@@ -0,0 +1,504 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/ChangeLog b/Platform/Android/jni/External/libusb-1.0.8/ChangeLog
new file mode 100644
index 0000000..a438108
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/ChangeLog
@@ -0,0 +1,1853 @@
+commit a04cbb0095a78aeed3f65aaf06c46069d0ac184a
+Author: Daniel Drake <dan at reactivated.net>
+Date:   Tue May 4 19:01:59 2010 -0300
+
+    v1.0.8 release
+
+commit 53b47299531974fa8901b74a163f3c8ebae4eec9
+Author: Daniel Drake <dan at reactivated.net>
+Date:   Thu Apr 22 18:12:51 2010 -0300
+
+    Linux: don't set SHORT_NOT_OK on bulk out URBs (#20
+    
+    Setting this flag is illegal, and the behaviour we're looking for
+    is already in place for host-to-device transfers without this flag.
+
+commit 1519828b7ee1fce46d4c51fc097d52e01b8e0bb4
+Author: Daniel Drake <dan at reactivated.net>
+Date:   Tue Apr 20 20:14:09 2010 -0300
+
+    Linux: Handle failure to read active configuration during enumeration
+
+commit 45168627cc15aee3875192f34286110dbbd27095
+Author: Nathan Hjelm <hjelmn at me.com>
+Date:   Tue Apr 20 19:43:06 2010 -0300
+
+    Darwin: don't reuse cached descriptors during enumeration
+    
+    Descriptor reuse was causing scans to return invalid information when
+    the device at a location has changed.
+
+commit 3af329db6dcbfb96d24867c757f9e125e5b7b0e5
+Author: Daniel Drake <dan at reactivated.net>
+Date:   Mon Apr 19 19:36:55 2010 -0300
+
+    v1.0.7 release
+
+commit ceb8cacd6d2a4189de0db2ee46d45217511c69be
+Author: Daniel Drake <dan at reactivated.net>
+Date:   Mon Apr 19 19:31:12 2010 -0300
+
+    Document that fd set contents are an internal implementation detail (#36)
+
+commit 9bea500b5747bdeba7c8251d45608558e71a1db5
+Author: Martin Koegler <mkoegler at auto.tuwien.ac.at>
+Date:   Mon Apr 19 19:22:46 2010 -0300
+
+    Linux: correct config descriptor endianness fix
+    
+    The seek_to_next_config codepath deals with both sysfs and usbfs;
+    make sure we only convert values in the usbfs path.
+
+commit 02df59a309e813c50b8230de99e69fb4e1814279
+Author: Martin Koegler <mkoegler at auto.tuwien.ac.at>
+Date:   Mon Apr 5 17:11:32 2010 +0200
+
+    Linux: Fix endianness handling of usbfs config descriptors (#27)
+    
+    driver/usb/core/devio.c function usbdev_read translate the follwing files
+    to CPU endianess:
+    
+    le16_to_cpus(&temp_desc.bcdUSB);
+    le16_to_cpus(&temp_desc.idVendor);
+    le16_to_cpus(&temp_desc.idProduct);
+    le16_to_cpus(&temp_desc.bcdDevice);
+    
+    All other data is passed without any change.
+    
+    libusb/os/linux_usbfs.c calls usbi_parse_descriptor with host_endian=1
+    for config descriptors. According to the kernel code, they must be
+    processed with host_endian=0, as they are not translated by the kernel.
+    
+    Signed-off-by: Martin Koegler <mkoegler at auto.tuwien.ac.at>
+
+commit ec303b01a5d4e51c000a283853af65059fa62285
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Tue Mar 23 16:22:08 2010 -0600
+
+    Darwin: fix enumeration of devices with non-consecutive addresses (#23)
+
+commit cd809e2f7cee3874b7ae16b2c482a8b63a90e4a5
+Author: Bastien Nocera <hadess at hadess.net>
+Date:   Mon Mar 8 10:50:51 2010 +0000
+
+    Add more interface classes
+    
+    As used in bluez.
+
+commit 1ce4aa67d849f5cad8a21072dc1c7b42158ce817
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Thu Mar 18 11:32:32 2010 -0600
+
+    Darwin: Cleanup async callback code, catch request timeouts
+
+commit 68af9f8d731f700267335941a8214d34ab518cc8
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Thu Mar 18 11:31:46 2010 -0600
+
+    Darwin: fix endianness of control setup packet
+    
+    IOUSBLib expects the control request to be in host byte order.
+    Swap the request into host byte order.
+
+commit cfce4d127184f4e4f334976151a0f80594bb5e22
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Mon Feb 15 14:10:08 2010 -0600
+
+    Darwin: fix memory leak in process_device
+    
+    Credit to Mike Colagrosso for finding this bug.
+
+commit 161893cfbefefe315f657677705abe090fc526f2
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Mon Feb 15 14:09:19 2010 -0600
+
+    Darwin: use logging functions
+    
+    Use usbi_warn, usbi_err, and usbi_info instead of _usbi_log.
+
+commit 2a72f38548208044dc3aa62681419d006c35732d
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Mon Feb 15 14:07:44 2010 -0600
+
+    Darwin: support multiple calls to libusb_init
+    
+    Credit to Orin Eman for finding this bug.
+
+commit a4186794d87124503db2f5f51f51ce90bb95daa7
+Author: Daniel Drake <dan at reactivated.net>
+Date:   Sun Nov 22 17:20:53 2009 +0000
+
+    v1.0.6 release
+
+commit 8392ff22136fccaf1e15d186157609b8dd127bc5
+Author: Ludovic Rousseau <rousseau at debian.org>
+Date:   Sun Oct 25 10:06:41 2009 +0100
+
+    lsusb example: make print_devs() static
+    
+    lsusb.c:26: warning: no previous prototype for ‘print_devs’
+
+commit 9cc6bfaa15239bb6db1c1570b9beb6df2f848951
+Author: Ludovic Rousseau <rousseau at debian.org>
+Date:   Sun Oct 25 10:05:10 2009 +0100
+
+    Darwin: fix warning in darwin_error_str()
+    
+    os/darwin_usb.c:63: warning: return discards qualifiers from pointer
+    target type
+
+commit 4c706d2fb6b2c43b10d72ac5dff51cac4d939f1a
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Sat Nov 21 17:06:43 2009 +0000
+
+    Darwin: allow devices to be opened multiple times
+    
+    Allows libusb applications to access multiple interfaces of the same
+    device in the same application.
+    
+    Also fixes a set alt interface bug.
+
+commit 0232fc559cdacb9561f982dd6d28feb4435b3e4e
+Author: Daniel Drake <dan at reactivated.net>
+Date:   Sat Nov 21 17:01:32 2009 +0000
+
+    Increase libusb_handle_events() timeout to 60 seconds
+    
+    The internal timing seems to be working, this will be a better test of
+    it before we make this timeout unlimited.
+
+commit 0bd7ef5d8697973a026c36c15d6276177b4ec4ea
+Author: Daniel Drake <dan at reactivated.net>
+Date:   Sat Nov 21 16:57:25 2009 +0000
+
+    Refine timerfd header check (#18)
+    
+    Require glibc-2.9 for the working timerfd support.
+
+commit 90d8fcab9018b8e6887a7e0592d1e5f692117234
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Nov 15 12:17:13 2009 +0000
+
+    v1.0.5 release
+
+commit 11d591058e3f105b0e90c23bbf58b18de691e690
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Nov 7 10:43:59 2009 +0000
+
+    Update documentation about early completion caveats
+
+commit f796c9528a71aa55326b6f0c9c7c5ec073d2bf92
+Author: Ludovic Rousseau <rousseau at debian.org>
+Date:   Sun Oct 25 09:59:51 2009 +0100
+
+    Add libusb_get_max_iso_packet_size() to libusb.h
+    
+    core.c:777: warning: no previous prototype for 'libusb_get_max_iso_packet_size'
+
+commit 4783008b7e711de9cb31631e60dda995f44068de
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Oct 28 20:33:49 2009 +0545
+
+    Use timerfd for timeout handling
+    
+    Use a new file descriptor from the timerfd system calls to handle
+    timeouts. On supported systems, this means that there is less hassle
+    figuring out when the poll() timeout should be, since
+    libusb_get_next_timeout() will always return 0 and the timeout events will
+    be triggered as regular activity on the file descriptor set.
+    
+    Add API function libusb_pollfds_handle_timeouts() to detect whether
+    you're on a platform with the timing headache, and flesh out the
+    surrounding documentation.
+
+commit 9b120c2b3735566533c179aa8ca758fe45899a38
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Nov 7 10:03:07 2009 +0000
+
+    Use AM_SILENT_RULES for building
+
+commit ef6ea6c3ae38e4524f10e16e8cb88177d39c4826
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Nov 6 21:54:08 2009 +0000
+
+    v1.0.4 release
+
+commit 217f57617e0cff0d1bd6d726b243f04c6b179773
+Author: David Moore <dcm at acm.org>
+Date:   Fri Nov 6 21:37:25 2009 +0000
+
+    Linux: Add support for the new URB_BULK_CONTINUATION flag
+    
+    Add support for the new USBDEVFS_URB_BULK_CONTINUATION flag to libusb.
+    
+    This flag, which is expected to be available in usbfs starting with
+    kernel 2.6.32, allows the kernel to cancel multiple URBs upon receipt
+    of a short packet.  This capability allows libusb to preserve data
+    integrity of large bulk transfers that are split into multiple URBs.
+    Without this support, these URBs must be canceled in userspace upon
+    receipt of a short packet, a race condition against future transfers
+    which might partially fill these canceled URBs.
+    
+    This patch automatically detects whether a supported kernel is present
+    and enables the use of the flag when possible.
+    
+    [dsd: tweaks to supported kernel detection, and some inline
+     documentation of this mechanism]
+
+commit 69830057547396f893f0d7b3125a05d016313b10
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Oct 28 15:13:22 2009 +0545
+
+    Transfer locking
+    
+    At least on Linux, there were some possible races that could occur if
+    a transfer is cancelled from one thread while another thread is handling
+    an event for that transfer, or for if a transfer completes while it is
+    still being submitted from another thread, etc.
+    
+    On the global level, transfers could be submitted and cancelled at the
+    same time.
+    
+    Fix those issues with transfer-level locks.
+
+commit 98f1b30d24359cb3185051b8df9ebb663cc10369
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon Sep 14 08:01:24 2009 +0100
+
+    Clarify that timeout 0 means unlimited timeout
+
+commit 858684f0dd25921e09565034a88709dbf6f6c61b
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Sep 11 22:09:12 2009 +0100
+
+    Linux: more flexibility with monotonic clock
+    
+    Some users have reported that CLOCK_MONOTONIC does not work on their
+    systems - I suspect it is available on x86 but perhaps not some
+    of the more uncommon architectures. We should fall back on
+    CLOCK_REALTIME in these cases.
+    
+    Also, CLOCK_MONOTONIC_RAW seems even more monotonic, so we should use
+    that if it is available.
+    
+    We now test different clock IDs during initialization to find the
+    best one that works.
+
+commit fe0d8dce1ed704915d501e7da700440c78144211
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Fri Sep 11 18:00:29 2009 +0100
+
+    Darwin: handle overflows
+
+commit f46716f42040986203fa6e873bfdabe1be2900ec
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Aug 27 21:14:54 2009 +0545
+
+    v1.0.3 release
+
+commit 5b489b8b2a5aba7b8b804e5af6d2628735548238
+Author: Toby Peterson <toby at macports.org>
+Date:   Sun Aug 23 10:04:59 2009 +0545
+
+    Darwin: 64-bit type fixes
+
+commit ad8ae04d0b52009af0b1180e005f7554d2bbb26c
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Sun Aug 23 10:02:55 2009 +0545
+
+    Darwin: fix crash when reading descriptors after close
+    
+    Fix a crash which occurs if the user does the following sequence on a
+    device: open, close, get_configuration_descriptor.
+
+commit 45ae2aecf5512dcff059b2a416534e81c6a00c88
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Aug 1 13:55:15 2009 +0545
+
+    move bug info to bug tracker
+    
+    Protection needed: http://www.libusb.org/ticket/4
+    Losing data: fixed in previous commit
+
+commit 126129e174062c2a27423817a459e5113f777789
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Jul 9 22:09:04 2009 +0100
+
+    Linux: try harder not to lose any data
+    
+    We would previously lose any data that was present on a cancelled URB.
+    Work harder to make sure this doesn't happen.
+
+commit 0334ee642b47dfe1ca9db64b22e7702ea14b3f09
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Jun 28 19:49:10 2009 +0100
+
+    Add libusb_get_max_iso_packet_size()
+    
+    As pointed out by Dennis Muhlestein, libusb_get_max_packet_size()
+    doesn't really do what the documentation might suggest because it
+    does not consider the number of transaction opportunities per
+    microframe.
+    
+    Add a new function to do what is useful for isochronous I/O.
+
+commit 615f18e64e96ae4ecc8e43d0de00933059a5209a
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jun 20 22:33:21 2009 +0100
+
+    Linux: fix sending of zero length bulk packets
+    
+    Note that there are is a kernel bug preventing this from working
+    properly at the moment, even after this fix.
+
+commit 86f79fbf61c2018bdf009c7ebf92b38f3a16fd0c
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Fri Jun 19 22:18:44 2009 +0100
+
+    Darwin: Don't cancel transfers on timeout
+    
+    ...because the OS does this for us.
+
+commit d4bd9ed4de19a9c766f7a23eea8c852cdd61c18f
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Jun 14 19:23:21 2009 +0100
+
+    Don't terminate enums with commas
+    
+    g++ -pedantic doesn't like this
+    Reported by Eberhard Mattes
+
+commit 8be256082eb9bd8e243d89529f742926bb29a21b
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jun 13 17:19:07 2009 +0100
+
+    v1.0.2 release
+
+commit 060e006e663fd59c281be29b71eb197e02b210e8
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Jun 10 21:42:05 2009 +0100
+
+    Linux: fix config descriptor parsing on big-endian systems
+    
+    Multi-byte fields in the configuration descriptors that come back from
+    usbfs are always in bus endian format.
+    
+    Thanks to Joe Jezak for help investigating and fixing this.
+
+commit c4a905022f684da9a4a853eb9232a81a53df2652
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Sun Jun 7 22:29:35 2009 +0100
+
+    Darwin: improve handling of disconnected devices
+
+commit 6b69f54451762ef590b9c938ab000c07cf9099a3
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Sun Jun 7 22:26:37 2009 +0100
+
+    Darwin: fix parsing of config descriptors
+    
+    This was a confusion between configuration numbers and zero-based
+    configuration indexes.
+
+commit 2b3a9ffa776b383cb2dbc3c55e490e32e4c3c22b
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Jun 7 22:19:53 2009 +0100
+
+    Eliminate -Wsign-compare compiler warnings
+    
+    This was due to an API inconsistency which can be safely worked around.
+    Hopefully we'll remember to fix the API next time we come to break
+    things.
+
+commit cad5cb55c37137e94e35c74fdabfe42a5cbd229b
+Author: David Moore <dcm at acm.org>
+Date:   Wed May 27 23:15:54 2009 -0700
+
+    Make synchronous transfer APIs robust against signal interruption
+    
+    libusb_control_transfer and libusb_bulk_transfer are designed to be
+    synchronous such that control is not returned until the transfer
+    definitively succeeds or fails.  That assumption is violated if a signal
+    interrupts these functions because there is no way for the application
+    to continue waiting for the transfer without resubmitting it.  This
+    patch changes these synchronous APIs so they do not abort in the case of
+    a signal interruption.
+    
+    Signed-off-by: David Moore <dcm at acm.org>
+
+commit b501795985a23109f176d296e7b544b4c6354528
+Author: Alex Vatchenko <alex at fabulatech.com>
+Date:   Thu May 28 15:58:50 2009 -0400
+
+    pre-gcc-3.4 compatibility
+    
+    The -fvisibility and -Wno-pointer-sign options are not available on
+    old GCC versions.
+
+commit 00bb2805e994887f0a754a825c3ce03d22393386
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue May 26 15:53:26 2009 -0400
+
+    Fix memory leak in config descriptor parsing
+    
+    Pointed out by Martin Koegler.
+
+commit 068ff5b8a83fec0a9a91c80535a25b89a9ae64e8
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue May 12 19:20:51 2009 -0400
+
+    Update AUTHORS
+
+commit aa24c04e4043e39674b59ff0d302b2365cd0078f
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue May 12 19:03:37 2009 -0400
+
+    v1.0.1 release
+
+commit 44767677447fae4267131f99c591b14117486cac
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue May 12 19:01:44 2009 -0400
+
+    Add BUGS file
+    
+    Probably missed a couple of outstanding issues
+
+commit e0365a6f22e0e7f330ac931df031cf6f17f453d1
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Sun Mar 22 21:13:29 2009 -0400
+
+    Darwin: get_config_descriptor bugfixes
+
+commit 5fd0e8478240fece646a58a3c6114001a73be99f
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Feb 25 12:33:33 2009 -0300
+
+    Fix compilation of Darwin backend
+    
+    My fault. Reported by ihryamzik at gmail.com
+
+commit b49f6bf5c910d0fd694ecf165d7927673707bff9
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Mon Feb 16 21:39:29 2009 -0300
+
+    Darwin backend
+
+commit d859158581e9a3250f36cdeeb8ea67cda04053bd
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Mon Feb 16 21:30:49 2009 -0300
+
+    Make endianness macros endian-independent
+    
+    Implementation suggested by David Moore. Needed for proper universal
+    code support on Darwin.
+
+commit 9196f58bdc8b9e967261df39865215faa5d39cfa
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Mon Feb 16 21:25:18 2009 -0300
+
+    Abstract clock reading into OS layer
+    
+    This will differ on Linux and Darwin, at least.
+    
+    [dsd: minor style tweaks]
+
+commit e91207860cac09b3afaafc4c14221b78d585c59a
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon Feb 16 21:20:28 2009 -0300
+
+    Fix endianness in device descriptors
+    
+    Pointed out by Nathan Hjelm.
+
+commit ccf6d3d2f6acf9b9a1cb5e1f1b03f382ae509b17
+Author: Nathan Hjelm <hjelmn at mac.com>
+Date:   Mon Feb 16 21:13:52 2009 -0300
+
+    Only link with librt on Linux
+    
+    [dsd: tweak configure.ac change]
+
+commit 894539931e4b4bd85708fe98b956049243cd6fb0
+Author: Hans Ulrich Niedermann <hun at n-dimensional.de>
+Date:   Mon Jan 26 00:31:48 2009 +0100
+
+    API docs: describe libusb_transfer_cb_fn type
+    
+    Add some text describing the libusb_transfer_cb_fn function type
+    with the semantics I have gathered from reading other parts of
+    the API docs, referring to the proper section for more details.
+    
+    [dsd: tweaked the description slightly]
+
+commit abe34a2656f8f9f21e53603796c536585e6233ef
+Author: Hans Ulrich Niedermann <hun at n-dimensional.de>
+Date:   Sun Jan 25 18:21:59 2009 +0100
+
+    Make empty array in struct compatible with C99
+    
+    If the compiler is known to be running in C99 mode,
+    use "flexible array members" ("foo[]").
+    
+    If the compiler is running in any other mode, continue
+    using the non-standard but widely common "foo[0]" syntax.
+
+commit 620075c7400764d9bb539b5c02065c45c2e8251e
+Author: Hans Ulrich Niedermann <hun at n-dimensional.de>
+Date:   Sun Jan 25 18:20:45 2009 +0100
+
+    Avoid signedness errors in API docs example code
+
+commit c754ae294cfe96ec4738d6641137c9e6c56330c7
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jan 17 00:25:40 2009 +0000
+
+    Decrement poll() result when internal pipe has been handled
+    
+    When we receive data on the internal control pipe, we need to correctly
+    decrement the number of ready file descriptors before passing on the
+    remaining work to the OS implementation.
+
+commit b9ca960f2ba271d2b1a58e22b7c70464d69f6c8a
+Author: David Moore <dcm at acm.org>
+Date:   Sun Jan 11 21:46:17 2009 -0800
+
+    Prevent transfer from being submitted twice or improperly canceled
+    
+    This ensures that tpriv->urbs and tpriv->iso_urbs are always set to NULL
+    whenever a transfer is not submitted.  In this way, submit_*_transfer()
+    and cancel_*_transfer() can error check to ensure that the transfer is
+    in the correct state to be either submitted or canceled, preventing
+    potential memory leaks or double frees.
+    
+    Signed-off-by: David Moore <dcm at acm.org>
+
+commit d2a8ec2da8abcd8f4648ed118da16191011982dd
+Author: David Moore <dcm at acm.org>
+Date:   Wed Jan 7 22:31:09 2009 -0800
+
+    Linux: Fix race condition in cancel_bulk_transfer()
+    
+    This fixes a race condition in cancel_bulk_transfer().  In the old
+    version, awaiting_reap and awaiting_discard are incremented in
+    cancel_bulk_transfer() and decremented in handle_bulk_completion().
+    However, since these events may take place in two different threads,
+    these variables may reach zero before all URBs have been canceled,
+    triggered spurious callbacks and duplicate frees.
+    
+    This changes the logic to use a single variable "num_retired" to replace
+    both awaiting_reap and awaiting_discard.  num_retired is incremented
+    only in handle_bulk_completion() and thus there is no race.  The handler
+    will know that all URBs have been canceled when num_retired becomes
+    equal to num_urbs.
+    
+    This change also simplifies a great deal of the logic in both functions
+    and is a net reduction in the amount of code.
+    
+    Note that some variables such as "reap_action" probably need to still be
+    protected by a mutex, and this patch does not address that issue.
+    
+    Signed-off-by: David Moore <dcm at acm.org>
+
+commit 34b9eebe35d8167d43cffb6ad6175f6b2251b572
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Dec 13 20:06:49 2008 +0000
+
+    v1.0.0 release
+    
+    It's here!
+
+commit b1d636dde418dc8fe6a8f037dea0d800e57c6b94
+Author: Mikhail Gusarov <dottedmag at dottedmag.ent>
+Date:   Wed Dec 10 15:24:05 2008 +0600
+
+    EOL-whitespace fixes
+    
+    Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.ent>
+
+commit 4a9ac382ba5149ae5b3d0962d6a840b5e0dc13aa
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue Dec 9 21:43:37 2008 +0000
+
+    Linux: fix reading of active configuration
+    
+    Shannon Chuang pointed out that we only read 1 byte into an
+    uninitialized integer, and then return the whole thing.
+
+commit 81a7310d92461ba7b1d98aeff7c4c007fab07120
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue Dec 9 21:39:11 2008 +0000
+
+    Fix double free in descriptor parsing error path
+    
+    Pointed out by Shannon Chuang.
+
+commit 9b4b53453db56ba9c1d707a645bbe6c7a02a3c81
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Nov 21 13:28:32 2008 +0000
+
+    Improvements to multi-threaded I/O system
+    
+    Documentation brushed up, and I realised that another function is
+    needed for tight event handling loops -- they must be able to check
+    if an open/close operation is trying to interrupt it.
+
+commit 0e5b0fcb77a90b8bd95ad23669da472af31ef069
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Nov 21 11:00:47 2008 +0000
+
+    SourceForge website upload system changed
+
+commit a133875e6e2f52eff53ac03f505d59cbdd33e178
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Nov 21 10:54:57 2008 +0000
+
+    v0.9.4 release
+
+commit c32aa662769b676ff3247778664fccc71fc427ec
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Nov 20 15:31:10 2008 +0000
+
+    Pause event handling while opening and closing devices
+    
+    Ludovic Rousseau found that crashes often occur if you close a device
+    while another thread is doing event handling.
+    
+    Fix this by adding an internal control pipe, which the close routines
+    use to interrupt the event handler and obtain the event handling lock,
+    ensuring that no other thread is handling events while the device is
+    closed. After the close completes, it signals all the event handlers
+    to start up again using the usual mechanism.
+    
+    Also modified libusb_open() to do a similar thing, so that event
+    handlers are interrupted in order to realise that a new poll fd has
+    appeared.
+
+commit 1d7cf3d0fa8698eae25097cbda1870be90ff6f5e
+Author: Bastien Nocera <hadess at hadess.net>
+Date:   Thu Oct 30 14:35:23 2008 +0000
+
+    Add libusb_attach_kernel_driver()
+    
+    Add support for re-attaching a driver to a device under Linux.
+    
+    [dsd: fixed handling of return value, and added LIBUSB_ERROR_BUSY case]
+
+commit 914a4e70657c86b5094770aa2d898c978b1cdf41
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Nov 2 21:45:54 2008 +0000
+
+    Linux: handle low-level transfer errors
+    
+    Handle more URB error status codes, thanks to Lou and Alan Stern.
+
+commit d25b566b3b8febafdda4211de724b4727dd4b7e0
+Author: Aurelien Jarno <aurelien at aurel32.net>
+Date:   Thu Sep 4 13:50:49 2008 +0200
+
+    Support for out-of-tree building
+    
+    Contrary to libusb 0.1, libusb 1.0 does not support out-of-tree building
+    for the documentation part. This patch fixes that by using a
+    doxygen.cfg.in file, which contains @top_srcdir@ to refer to the
+    location of the libusb source code.
+
+commit 8674c67ef78e1cf89db1fa584a4304f7c5ddcc5f
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Nov 2 15:00:39 2008 +0000
+
+    Document the logging style
+    
+    Suggested by Lou.
+
+commit 94936cbcfe3f02eb65c8b91e29896604316259d8
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Aug 27 22:44:24 2008 -0500
+
+    Async I/O documentation touchups
+
+commit 2f8f1b1a900f5b9828e5e2ff93c2b26a44fd9de2
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Aug 27 21:23:10 2008 -0500
+
+    Doc: fix typo in events lock section
+
+commit 046e681e4ac6b697e40458ee0f5baf3cd8763bb0
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Aug 23 01:00:21 2008 -0500
+
+    v0.9.3 release
+
+commit fec6eaa4eecdf7e0b8299157a5dabef94417f193
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Aug 23 00:57:44 2008 -0500
+
+    Reset internal transfer flags on submit
+    
+    This fixes a problem pointed out by Lou, where resubmitting a transfer
+    that previously timed out never timed out again, as if the timeout had
+    been set to 0.
+
+commit 81627bd38900ec9701ab69c141aa51a9abea1f60
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Aug 10 17:09:48 2008 -0500
+
+    Add libusb_get_configuration prototype
+    
+    Pointed out by Lou
+
+commit 1631eaefcc7cdf7047c6b9225618a9aa1b3d87d1
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jul 19 17:51:28 2008 -0500
+
+    v0.9.2 release
+
+commit 0d9c40d7f3eee15ada624b5caab2cfb912144fdc
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Jul 16 09:22:12 2008 -0500
+
+    Linux: fix sysfs directory handling
+    
+    The length of the directory name varies, e.g. when you have nested hubs.
+    Use dynamic allocation to be able to deal with any length of name.
+
+commit 66c9847ad54b126ccafd4877292454ab57d0c115
+Author: David Engraf <dogge2k at gmx.de>
+Date:   Wed Jul 16 09:16:38 2008 -0500
+
+    Linux: correct usage of MAX_PATH
+    
+    Thanks to clarification from Artem Egorkine, MAX_PATH already includes
+    space for the trailing NULL.
+
+commit 6494f07a6d1b73ce786ae581c4ff691e39e61d19
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue Jul 8 21:15:54 2008 -0500
+
+    Linux: fix bulk/iso transfer double-cancellation
+    
+    Reset counters to 0 so that it's possible to cancel a transfer twice
+    without breaking things. Not sure that I want to support this properly,
+    but this makes it work at least.
+
+commit 9140f5b414e37a3714cde9c6d6c87c963338a83a
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jun 28 21:28:44 2008 -0500
+
+    v0.9.1 release
+
+commit 83a029062c1d2bfb584d7a6ee94915583d37464c
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jun 28 21:24:49 2008 -0500
+
+    Add missing GET_CONTEXT()
+
+commit fbad9a5426f0369394c88987355a8fb06a741ca1
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jun 28 21:18:41 2008 -0500
+
+    Linux: Compatibility with new sysfs descriptors file
+    
+    As of 2.6.26, the descriptors file now includes all descriptors, not
+    just the active one.
+
+commit 819e65f880ca43526036e56c65c415042c91f58f
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Jun 26 22:47:05 2008 -0500
+
+    Allow user data pointer to be passed through pollfd notification API
+
+commit 1df713d622ab4f0b03aad72d903ac7beb8fb3b90
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue Jun 24 23:01:51 2008 -0500
+
+    Introduce contexts to the API
+    
+    Suggested by David Zeuthen. This allows multiple libraries in the same
+    process to independently use libusb without interfering.
+
+commit 9818151c60a85aea6af24cb0996a92c3726c9864
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue Jun 24 21:31:13 2008 -0500
+
+    Revert "Temporary workaround for event handling serialization issue"
+    
+    This reverts commit 2d3a1111caff40ebb87983c861ff548cdc9e5946.
+    This was based on the assumption that dying threads would automatically
+    release mutexes, which is not the case.
+
+commit d5f82893fab3f1c13b1af4ba17aac72479bad7d5
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Jun 20 23:04:53 2008 -0500
+
+    Overflow handling
+
+commit 546dee211eefbdd280fd1fc9dee84a9b52105078
+Author: Artem Egorkine <arteme at gmail.com>
+Date:   Tue Jun 17 18:27:38 2008 -0500
+
+    a fix for SIGSEGV in handle_bulk_completion()
+    
+    We cannot dereference tpriv after calling
+    usbi_handle_transfer_cancellation() because that function may invoke
+    the user-supplied callback which may free the transfer.
+
+commit 947ba8056456a5215724fb502e3e09d50016f699
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon Jun 16 22:50:50 2008 -0500
+
+    Refine configuration selection again
+    
+    At Alan Stern's suggestion, just offer the bare "set configuration" and
+    "get configuration" functionality, and let applications worry about the
+    specific race conditions and unusual situations.
+
+commit e7a7a49d0331ee0e14145f6e7ec39763b36314ac
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Jun 15 15:29:38 2008 -0500
+
+    docs update
+    
+    Add a THANKS file, make copyright notices easily accessible, update TODO
+
+commit 217534e4b396081e038ee5f94c813d1668963673
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Jun 15 15:23:29 2008 -0500
+
+    round up poll timeout
+    
+    Pointed out by Richard Röjfors, otherwise we end up busy-looping with
+    a poll() timeout of 0.
+
+commit 5ad79b324bc5e11a75a585398a1e81c26f05e758
+Author: Felipe Balbi <me at felipebalbi.com>
+Date:   Sun Jun 8 12:34:48 2008 +0300
+
+    fix doc about libusb_open()
+    
+    libusb_open() returns int instead of libusb_device_handle.
+    
+    Signed-off-by: Felipe Balbi <me at felipebalbi.com>
+    [dsd: small correction]
+
+commit 2d3a1111caff40ebb87983c861ff548cdc9e5946
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu May 29 17:26:26 2008 +0100
+
+    Temporary workaround for event handling serialization issue
+    
+    Ludovic Rousseau pointed out that libusb_unlock_events() is not called
+    when a thread gets terminated with a signal, meaning that event waiters
+    will not be woken up in this case.
+    
+    Add a temporary hack to libusb_event_handler_active() so that at least
+    the other threads will realise on the next iteration of their event
+    handling loop.
+    
+    The real fix will likely involve reworking most of this.
+
+commit 514bb8790cfe8b93ccfff82bc17081b1030acce0
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu May 29 12:35:01 2008 +0100
+
+    Refine libusb_set_configuration() semantics
+    
+    Applications will generally want to set a configuration before claiming
+    interfaces. The problem is that the interface may already be set, and
+    someone else may have claimed an interface (meaning that all calls to
+    set_configuration will fail, even if it's for the same configuration).
+    
+    There are now 2 options:
+    1. Use the new libusb_get_configuration() to determine active
+       configuration before calling libusb_set_configuration()
+    2. Or just call libusb_set_configuration() as usual, which will do
+       nothing if that configuration is already active.
+
+commit d1292f8e7300051239a7ed2769d221dc7a6f9fca
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 25 23:42:42 2008 +0100
+
+    v0.9.0 release
+    
+    First libusb-1.0 beta release
+
+commit 4cd249388e4ed2ca03f1263984ab67df5030bb65
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 25 22:59:09 2008 +0100
+
+    Take lock before raising event waiters condition
+    
+    This avoids a race between the user checking for active event handler
+    and then blocking on the condition variable
+
+commit 7c525480ab3c4db9205bfe30bb0d2bef9096c444
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 23 15:57:07 2008 +0100
+
+    Implement serialization of event handlers
+    
+    Now offers a mechanism to wait for events while another thread is
+    doing the event handling. Complicates things for MT async apps, but
+    then again it's a bit of a tricky combination to start with.
+
+commit ff0660a415ecfd0879600eaad1c5899b6d93a30a
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 24 21:28:31 2008 +0100
+
+    allow LIBUSB_DEBUG env var to control message verbosity at runtime
+    
+    Based on ideas from Ludovic Rousseau
+
+commit 4d788967e3f8d75eaf3a1ac1ee8e2e8bed0601c1
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 23 15:58:11 2008 +0100
+
+    don't print messages by default
+    
+    Add libusb_set_debug() API to set message verbosity.
+    
+    Ludovic Rousseau pointed out that applications may close stdout/stderr
+    descriptors, which might then be reused.
+
+commit bef33bb9eba0da04ee7488d9cd5e6ab12bc61c0c
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 19 15:43:27 2008 +0100
+
+    Fix memory leak in libusb_control_transfer
+    
+    Pointed out by David Engraf: we weren't freeing the transfer buffer
+
+commit a345bacb6f07ebb2122402041a9e8092d4a20a4d
+Author: David Engraf <david.engraf at netcom.eu>
+Date:   Mon May 19 15:16:32 2008 +0100
+
+    Linux: fix handling of ioctl failure
+    
+    The return value of some ioctl commands in linux_usbfs.c are not
+    handeled correct. The ioctl function returns != 0 and errno is set with
+    the error code.
+
+commit e44396a458ecea9e5edd9a7577e617571c76860d
+Author: David Engraf <david.engraf at netcom.eu>
+Date:   Mon May 19 15:13:38 2008 +0100
+
+    critical memory leak in handle_events
+    
+    This patch closes a critical memory leak in handle_events. The fds
+    variable is malloced but never freed. When I'm calling
+    handle_events with a timeout of 0, my system runs out of memory after a
+    few seconds.
+
+commit eb25630f52bc9848b444e439632c899977d887b0
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 16 23:50:20 2008 +0100
+
+    More informative libusb_open() return code
+    
+    Hopefully one of the last API tweaks...
+
+commit 2b2e9c40b195261b09ac52ebdb93eef25c79de90
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 16 22:37:56 2008 +0100
+
+    Fix endianness with descriptor handling
+    
+    Alan Stern pointed out that usbfs gives host-endian data, but sysfs gives
+    bus-endian.
+
+commit 1298c51f516a7bf04ca9add1b7db14417cdc66f3
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 12 18:46:37 2008 +0100
+
+    Backend documentation for porting efforts
+    
+    Hopefully comprehensive enough for people to get started.
+
+commit ade26afc42c34ceb1c45afcadd2ea5e8240eaca4
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 12 15:43:30 2008 +0100
+
+    Linux: fix caching of guessed configuration
+    
+    Reported and tested by Xiaofan Chen
+
+commit e25d590a9198995b4f0b6afeb41ecae318715e7e
+Author: Rob Walker <rob at tenfoot.org.uk>
+Date:   Sun May 11 21:14:18 2008 +0100
+
+    Linux: fix bulk transfer early completion
+    
+    We were forgetting about the remaining urbs when a non-final urb
+    completed early.
+    
+    [dsd: some touchups and a warning message for a corner case that we don't handle]
+
+commit fec7c84163e25b8f811632828334d75da82bcb16
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 11 20:31:58 2008 +0100
+
+    Handle hot-unplugging
+    
+    This involved moving from select() to poll() because there is no way to
+    distinguish usbfs's POLLERR condition with select().
+
+commit aeb905fa5d78cdbba80a680aa7a2bb7338f27f65
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 11 16:04:35 2008 +0100
+
+    Documentation work
+
+commit ba5d9a45c06311204f51faef41d1ee215bb5b823
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 11 15:36:24 2008 +0100
+
+    Endianness of control setup packets
+    
+    Document behaviour where host-endian and bus-endian (little) should be
+    used respectively.
+    
+    Also remove packed attribute from libusb_control_setup as all fields
+    are naturally aligned.
+
+commit 7bedc3b2683f35ee1dd39a2ebe0ec05be0019f38
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 11 15:11:59 2008 +0100
+
+    Document that releasing interface causes SET_INTERFACE control request
+
+commit f2ede9876cd4f5cfa7751b975670fa449187fe3d
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 10 21:45:42 2008 +0100
+
+    Support unconfigured devices
+
+commit 8ebb4ccdfaf5f095a1c38787d909d280ea64405c
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 10 20:56:44 2008 +0100
+
+    Linux: fix caching of active configuration for non-sysfs
+
+commit c3844f7aeb2176636ce6e6ef697659fdb0b30048
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 10 14:42:43 2008 +0100
+
+    Fetch configurations by index (not value)
+    
+    Otherwise there is no way to know which values to look for.
+
+commit d77052c0d630e33737c38d601fd633155f6b2229
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 10 00:12:53 2008 +0100
+
+    Linux: comprehensive sysfs vs usbfs access
+    
+    Be more flexible when certain parts of sysfs are not available.
+
+commit 74bc842bac1a32a26323da6c3e8af2f66e1b5cfa
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 9 19:38:13 2008 +0100
+
+    Linux: no need to store usbfs node path
+    
+    This can be computed from bus number and device address
+
+commit fe4adcc99e30115204ab832ad3e0170c9aca7629
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 9 14:34:31 2008 +0100
+
+    Rework configuration handling
+    
+    libusb no longer caches descriptors in libusb_device but backends are
+    intended to be able to provide copies from memory. In the common linux
+    case we can use sysfs.
+
+commit 5741bfe01a2481b8c3830c80edc3637bf62a7e16
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 9 14:36:14 2008 +0100
+
+    libusb_get_device_list() can return negative error code
+
+commit 45413101b78298e9332b22a34bc6bc159000ad8a
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu May 8 23:09:21 2008 +0100
+
+    Linux: fix clear_halt implementation
+    
+    The ioctl expects an integer.
+    Bug found with the assistance of Soumen Mondal
+
+commit 10d4e427cc171dfd6ad7f43a33ce3cfebcd7aa04
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu May 8 23:04:52 2008 +0100
+
+    Documentation work
+    
+    Partially based on some libusb-devel discussions
+
+commit ded0a249322571a075e3ed3528021864247dfa55
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 5 22:57:48 2008 +0100
+
+    Linux: enumerate devices and descriptors from sysfs
+    
+    Suggested by Alan Stern. This avoids waking up any suspended USB devices.
+    sysfs is not available on all systems, so the usbfs mechanism is still
+    in place as a fallback.
+
+commit 885c2a5de69d6b7d8902bb55d6d83680a5a1a6e5
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 5 21:34:31 2008 +0100
+
+    documentation touchups
+
+commit 59c205d542b43d79fe28622dbe8f03a3a3300b6f
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 5 21:17:03 2008 +0100
+
+    more error code sanitization
+
+commit 88055d4b5913102a90ff666f75fd922c74860dc5
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 5 20:57:43 2008 +0100
+
+    Isochronous transfer helper functions
+
+commit a95c943ed301dcd20e92b0b3b255568899a4c42e
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 5 17:54:33 2008 +0100
+
+    free open devices on exit
+
+commit b27fff633843824744df7d334cb89ece329cafa6
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 5 17:47:49 2008 +0100
+
+    move descriptor parsing into main library
+    
+    OS modules now provide functionality for fetching device/config
+    descriptors
+
+commit a304eca71f22c6df7d70a901483b30f1b8e93378
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 5 16:22:33 2008 +0100
+
+    Detect endpoint halts and unsupported control requests
+
+commit 7da521954ba661d3f537440c31a84b66e974d56b
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon May 5 01:00:31 2008 +0100
+
+    Linux: fix logical URB allocation
+    
+    We were allocating the wrong number of URBs for transfers of size
+    multiples of 16k.
+
+commit 470b1bc42bf53373ce678fc76bab9160a54d6881
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 4 16:51:23 2008 +0100
+
+    add functionality for querying and detaching kernel driver
+
+commit 17ecfb0ecc833596c43755c80d461cddb9b3b0d7
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 4 16:20:46 2008 +0100
+
+    Descriptor reading functionality
+
+commit bdce367d1bd8691465844b2411c85215498f517d
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 4 14:22:16 2008 +0100
+
+    sanitized error returns from synchronous I/O functions
+
+commit bfe74e9cd9c17a40fff042ea0647326f51cfecae
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 4 14:10:19 2008 +0100
+
+    implement libusb_reset_device()
+
+commit c01f744ce07bbeccbe353e956479f0cc5a811a6f
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 4 13:46:41 2008 +0100
+
+    Add functionality to clear endpoint halt conditions
+
+commit 5878daa85e3364bb3885190425d4f9deaa2d8c36
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun May 4 00:51:59 2008 +0100
+
+    Fix libusb_get_device_list return value
+    
+    It was documented to return the list length, but was returning 0.
+
+commit a74106a9b48b88bae0e099be34a18d653a8f1238
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 3 16:50:58 2008 +0100
+
+    Well-defined error codes for some operations
+    
+    Also renamed set_interface_altsetting to set_interface_alt_setting for
+    better consistency
+
+commit 0f463fe671455670efcf4a93e526b2a9082b0afe
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 3 16:24:11 2008 +0100
+
+    Add libusb_set_configuration()
+
+commit e65608994f795f97e4d6adac20329ca08709db2d
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 3 15:40:23 2008 +0100
+
+    rename LIBUSB_ERROR_NOMEM to LIBUSB_ERROR_NO_MEM
+    improves consistency
+
+commit 5384bbf300779e7936eac9ebd33ee38f5b533f8e
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 3 14:34:54 2008 +0100
+
+    Linux: better EACCES handling
+
+commit 1936eeeba3f933a078df1005cc7c1533a8ec2bac
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 3 14:26:56 2008 +0100
+
+    Rename reference counting API
+    
+    This improves consistency with the naming style of other functions
+
+commit e2f822b4f17342f614ab2455179a80975fca6cb0
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat May 3 14:24:40 2008 +0100
+
+    Linux: use read-only access to enumerate devices and descriptors
+    
+    Write access is not needed until later.
+    Also fix handling of open() error code.
+
+commit 81204eed3d0a7744b89b68bd90d567b68d191a91
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 2 17:45:23 2008 +0100
+
+    document pollfd notifiers
+
+commit e20f8281fb7da32587f81b5eea5818af1eab0fe0
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 2 17:33:52 2008 +0100
+
+    Allow multiple interfaces to be claimed
+
+commit 66685ff25d81a1f1a2a3dbda882d407638d00672
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 2 16:55:36 2008 +0100
+
+    Documentation improvements
+
+commit 55bce39cbe0c9746a428b66751d1afe551d86381
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 2 12:55:34 2008 +0100
+
+    detect short descriptor reads
+
+commit f3f17846dcced6b2dc40f899ed6a2aba151c264b
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 2 12:32:46 2008 +0100
+
+    remove "references" and "referenced by" listings in documentation
+
+commit fbb017dd9a26ce449578482b95157b3c850fa446
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 2 12:32:08 2008 +0100
+
+    Use typedef ptr types in parameters and return types
+    
+    This is passed through to the docs
+
+commit 3675e978fb7a1042f8601931255658bcd14a2298
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri May 2 12:28:31 2008 +0100
+
+    Expose bus number and device address
+
+commit 2012898ffc492317cb428d97077bf5ee0e98e1da
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue Apr 29 15:26:46 2008 +0100
+
+    standardised error codes
+
+commit 0269c75ae3de7acb2dc555e45928750e35fdb320
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue Apr 29 13:34:26 2008 +0100
+
+    Fix descriptor handling memory leaks
+
+commit d3ab4e3bd4068cba41c1e12c4b175018dc3cb343
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Apr 27 23:50:01 2008 +0100
+
+    Rename endpoint_type to transfer_type
+    
+    Matches the USB specs more closely
+
+commit 379e90e0fdcef6f4db1849fa0a7fd524407cf564
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Apr 27 23:41:24 2008 +0100
+
+    Remove a FIXME comment
+    
+    it can't.
+
+commit 2ddf81420557d016bbcbf28dda0d8d1c64d16264
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Apr 27 23:30:34 2008 +0100
+
+    Fix unlocked flying_transfers list access
+
+commit 7ac0a405b4c57db42e88cbcba5f135697f03b646
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Apr 27 23:27:04 2008 +0100
+
+    Remove libusb_cancel_transfer_sync
+    
+    This wasn't a particularly nice API. Cancellation should be handled by
+    the completion handler.
+
+commit a5006fd7b9dae6f1db7969c8744086ba3a7c027b
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Apr 27 19:56:02 2008 +0100
+
+    remove extra timeout check
+    
+    If select() didn't timeout then don't check for more timeouts
+
+commit 3bdafaa359d9c65e1af360b5338e1f25528a8066
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Apr 27 19:53:51 2008 +0100
+
+    Documentation touchups
+    
+    Detail that interrupt polling interval is fixed to endpoint bInterval,
+    and that data may be transferred even on a timeout condition.
+
+commit e12618c79d520955b1abf80a277e881d91907162
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Apr 19 16:17:53 2008 +0100
+
+    add threaded example program
+
+commit 1fcdb0678b759569db7cd530457dbc0a5f86fb1d
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Apr 18 23:58:54 2008 +0100
+
+    libusb_device mutex protection
+
+commit 0efd2efa65d5513e5754d717d522b2c5c45332e2
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Apr 18 23:42:40 2008 +0100
+
+    mutex protection for device and handle lists
+
+commit d2ff2b14a15e5099ff0214502944de30f141a39c
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Apr 18 20:00:31 2008 +0100
+
+    lock flying_transfers during transfer removal
+
+commit 2569980762cb66804da31e54bef243702da8dfe9
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Apr 18 19:59:56 2008 +0100
+
+    pollfds mutex protection
+
+commit f5a33e08ec0da51ccb5e95a5adec50c5211a9bf5
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Apr 17 18:24:54 2008 +0100
+
+    flying_transfers mutex protection
+    
+    This marks the beginnings of thread safety
+
+commit 85e1994123545125ce0653415d122f9790f8d041
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Apr 17 17:44:28 2008 +0100
+
+    Linux: fix control transfer cancellation
+
+commit cf9b831f7bfd97ba88721c1d934aeda522f3692c
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon Apr 14 20:03:27 2008 +0100
+
+    set correct endpoint type for isochronous transfers
+    
+    Pointed out by Felix Domke
+
+commit ad6e2b712c5b54af44424e58a2776686314e26b7
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Apr 11 21:40:07 2008 +0100
+
+    Linux: fire multiple URBs at once for split transfers
+    
+    This results in a significant performance increase for bulk transfers
+    larger than 16kb, and fixes a bug where data would be spliced and mixed
+    between two simultaneously submitted transfers to the same endpoint.
+    
+    It also allows isochronous transfers larger than 16kb to be submitted.
+    
+    This commit also improves cancellation - the library now understands
+    what is going on.
+
+commit d9b2ce2894ed43d34de6850f2dac50ccabf1db55
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue Apr 1 23:28:32 2008 +0100
+
+    Constify some return data
+    
+    Make it clear that apps should not mess with these structures
+
+commit 8d809854e2b19c2b7c27ab05e5d76b34e2a5cead
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Mar 30 22:19:00 2008 +0100
+
+    Rename libusb_poll() to libusb_handle_events()
+
+commit 211f80c9f2a4a58cd2bbf5b7751f45089c8961e7
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue Mar 25 16:24:30 2008 +0000
+
+    Isochronous endpoint I/O
+    
+    Due to variable-sized structures, this involved changing allocation
+    mechanism. All transfers must now be allocated and freed through
+    libusb.
+    
+    A synchronous function is missing, and I could do with writing a few
+    more helper functions to simplify things.
+
+commit b1ade6fca668d8aa156d5b5bf3a933f116144dc2
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Mar 23 21:17:32 2008 +0000
+
+    distcheck fix for docs
+
+commit 62077b7fa5b222e1bb9dea3467585aed69d596e2
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Mar 23 21:13:14 2008 +0000
+
+    Support for changing altsetting
+    
+    Will probably be suject to later consideration w.r.t. claiming of endpoints
+
+commit 0499e9f418607b5786ac0c3e97bc46737a609ca3
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Mar 20 21:10:01 2008 +0000
+
+    it's called bmRequestType
+
+commit 88884ae4bbe721dac117d5190303cb67852fa5d3
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Mar 20 21:07:00 2008 +0000
+
+    Save transfer flags before invoking callback
+    
+    The callback may free the transfer, in which case we can't read the flags
+    after it has returned.
+
+commit ead09cde6895df0034a685516987ce253575e9a7
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Mar 15 16:35:12 2008 +0000
+
+    API documentation
+    
+    Hopefully mostly complete. Some constants were renamed and move into
+    enums.
+
+commit 285724cc14ea5f993e2c4c92fe0aaf6c335bc139
+Author: Vasily Khoruzhick <anarsoul at gmail.com>
+Date:   Sat Mar 15 13:50:53 2008 +0200
+
+    Fix get_device_list for realloc case
+    
+    get_device_list can modify pointer passed to it with realloc, but this
+    case wasn't handled and caused crash on my machine. Fixed
+    
+    Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
+
+commit c0c9432d38b22784070dce3a7874c62c31786a27
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Mar 13 12:36:56 2008 +0000
+
+    Beginnings of cross-platform abstraction
+    
+    This also includes a libusb_get_pollfds API change
+
+commit de4c5341d168697baa4c0901c406deb47e78aae7
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon Mar 10 18:38:15 2008 +0000
+
+    Add transfer flags
+
+commit aae05f688dc26a013166ab9436fd25018b49d76a
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon Mar 10 11:32:15 2008 +0000
+
+    Simplify libusb_fill_control_transfer()
+    
+    Transfer length can be inferred from the setup packet.
+
+commit 7c5ea95297c2f3f6afc42f60c1bf1bef777bb1fb
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon Mar 10 11:29:24 2008 +0000
+
+    get_device fixup
+    
+    Rename API away from "devh" and fix implementation to match header
+
+commit 9e89d1aa82cbe7e21672ee3e2e545238fffc5318
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Mar 9 16:27:06 2008 +0000
+
+    Rename descriptor-getting functions
+    
+    Based on feedback from Tim Roberts
+
+commit 283ae96c3ccbcee1c3950fce18ae47093ae8200e
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Mar 9 16:15:02 2008 +0000
+
+    Simplify cancellation API
+    
+    No need to provide the device here.
+
+commit ebad1c79688ba603ad017ed0fe2f3c0dc8edd1ad
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Mar 9 16:12:08 2008 +0000
+
+    Rename libusb_dev_handle to libusb_device_handle
+
+commit 1ac0a7d88f282b6f293c456fac8edb143cbaca3d
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Mar 9 01:01:57 2008 +0000
+
+    Move synchronous I/O implementation to its own file
+
+commit 66348c90ea4570bf999ac301089e006d0cce1926
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Mar 9 00:58:09 2008 +0000
+
+    Separate transfer allocation and submission
+    
+    Leads to some hefty API changes. Now we're much more similar to the
+    Linux kernel model.
+    
+    Problems with dealing with asynchronous control transfers are passed
+    on to the user, basically you must allocate a buffer, start with the
+    setup, and put the data after. This won't make much sense until
+    documented (soon...)
+
+commit d21ebe47ce578c93cd8969be1c933d503e32e5d4
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Mar 8 12:48:35 2008 +0000
+
+    Rework URB API naming
+    
+    Now refer to everything as "transfers" as consistent with the USB spec
+    libusb_transfer is now a kind of transfer handle. To reduce confusion
+    with libusb_bulk_transfer and libusb_control_transfer, those have been
+    renamed to libusb_{control,bulk}_transfer_request.
+
+commit fd6fb3cc093ad47271353a0e468d16547f991382
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Mar 8 11:53:33 2008 +0000
+
+    Add fallback on /proc/bus/usb
+    
+    /dev/bus/usb is a relatively new thing probably not present on every
+    system
+
+commit f3fdf447916289cd92b7190377681894e8ab611a
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Mar 8 00:10:16 2008 +0000
+
+    Persistent libusb_device storage
+    
+    Devices are now assigned a session ID (currently busnum:devaddr) which
+    is used to distinguish unique devices.
+    
+    Now multiple callers of libusb_get_device_list will get the same
+    libusb_device structure instances.
+
+commit 23f8fb8bafeeda93ce234cb40eb7219d2e36c19c
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Mar 6 23:43:57 2008 +0000
+
+    Add convenience function to find and open a device by USB VID+PID
+    
+    Lots of libusb apps I write are simple test apps not intended to be real
+    apps. Having a function available to quickly locate my device will be
+    handy in such situations.
+
+commit 9cfdb494fccac53a4277da7c8b6d15f1a72a4959
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Mar 6 23:25:20 2008 +0000
+
+    Rework device discovery API
+    
+    libusb_find_devices and libusb_get_devices are no more
+    
+    libusb_get_device_list obtains a list of libusb_device structures for all
+    known devices in the system.
+    
+    Each libusb_device now has a reference count, defaulting to 1 on
+    instantiation. The reference count of 1 refers to the fact that it is
+    present in the list in this scenario.
+    
+    Opening a device adds a pointer to the libusb_device structure in the
+    handle, so that also adds a reference. Closing the device removes that
+    reference.
+    
+    The function to free the device list can optionally unref all the devices
+    inside.
+    
+    In future we will make the libusb_device instances all "global" so that if
+    the app calls get_device_list twice it actually gets the same libusb_device
+    structure references back. This way we can start to track disconnects, and
+    we can investigate adding a unique "session ID" to each libusb_device, an
+    identifier guaranteed to be unique to that device until reboot.
+
+commit 77cea822788e024c848c7f554915f771a2dc1e0f
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Thu Mar 6 17:05:04 2008 +0000
+
+    Remove ctrl debug code
+    
+    This was unintentionally committed
+
+commit b873521a6f575628d535f89278bb67888004d0ca
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Tue Feb 26 22:11:34 2008 +0000
+
+    Notifications for changes to the fd set
+    
+    Applications can now be notified when they should start and stop polling
+    new file descriptors.
+
+commit ca66e16a370c828d08a5bc3f9f203db145c81a4c
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Feb 1 12:20:20 2008 +0000
+
+    Fix header installation path
+
+commit e583100a4086c411093eef5c450880b965df6b1b
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Jan 30 13:24:54 2008 +0000
+
+    TODO update
+
+commit 637a8d7ff8a11a23588925d9d3003a609bda8075
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Jan 30 13:19:10 2008 +0000
+
+    Remove timers and signalfd
+    
+    Instead of timers, add a mechanism for informing the parent app when the
+    next timeout is due to happen, so that it can call us at that time.
+    
+    As we no longer use signals, signalfd has also been removed.
+
+commit 8c56abe2e13ed4dd8c15737c21be7b6b1e5cf2ac
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jan 26 18:16:56 2008 +0000
+
+    Poll usbfs descriptors directly
+    
+    We don't need to use signalfd for this functionality because we can poll
+    the file descriptors for write events.
+
+commit e3ce855acec33d37dd833bca5dad5e8c3773003a
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jan 26 17:26:40 2008 +0000
+
+    Fix dpfp example compilation
+
+commit 1d41a5cda2fefe826877ee4445199af30aa188b7
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jan 26 17:22:53 2008 +0000
+
+    C++ header safety
+    
+    Pointed out by JF
+
+commit 37b7f9a112eb1441d352467f661205b8872d0553
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jan 26 14:03:43 2008 +0000
+
+    Only use -fgnu89-inline when supported
+    
+    J F pointed out that this option only works on gcc 4.3 and newer.
+
+commit e3a09ca0b9cb6f46d54a0130f678c6097240a2bd
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sat Jan 5 21:59:40 2008 +0000
+
+    Remove more fpusb remnants
+
+commit dcd5e0075fa84601d997d29bb60bc8370b97a375
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Jan 4 01:19:07 2008 +0000
+
+    TODO update
+    
+    Start listing the things I want to discuss/reconsider before 1.0 API
+    is final.
+
+commit de53d972ed9c1f21f86ffd585560520e986f212c
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Jan 4 01:17:06 2008 +0000
+
+    Rename some _devh_ functions
+    
+    Decided against naming functions in this style based on advice from
+    Tim Roberts. Still not really sure about devh naming in general.
+
+commit 132d84bf8ae34bd0892b3d8207a53d87cc0a9cba
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Jan 4 01:13:25 2008 +0000
+
+    Use "transfer" instead of "msg"
+    
+    Based on a discussion with Tim Roberts.
+
+commit ea6af58a8643137eb01eeb7d2f65404e390feb1b
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Jan 4 00:57:00 2008 +0000
+
+    Plural of bus is busses
+    
+    SF #1633043
+
+commit dbb3fd871e3972b4e670f3161e7cd2f58f357600
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Jan 4 00:54:57 2008 +0000
+
+    API renaming: remove fpi and usb_ stuff
+    
+    fpi changed to usbi.
+    
+    We should not expose structures with prefix "usb_" in the public
+    namespace as it is quite likely there will be some conflict somewhere.
+    Instead, using "libusb_" should be safer.
+
+commit e9364d72151ae1de9cce4175f330fe1529f02511
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Fri Jan 4 00:40:49 2008 +0000
+
+    Rename to libusb-1.0
+    
+    I've taken over the libusb project, and what was previously known as fpusb
+    will eventually be released as libusb-1.0.
+
+commit f4ed0b6a3e0a20555fdfc9e9b8be7e8a2c8ae192
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Dec 30 22:09:50 2007 +0000
+
+    Compiler flags update
+    
+    Also fix some warnings
+
+commit d3d671efe27491baf1d2ceadbfeeb4e7428d6f9a
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Dec 30 22:05:17 2007 +0000
+
+    Fix signalfd structure size on x86
+    
+    ptr is a 64-bit value
+
+commit dfac6756faad76071a92945e3e3a16b8a841a7ea
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Dec 12 23:32:54 2007 +0000
+
+    Don't pass ctrl_msg/bulk_msg structures through async paths
+    
+    These are easiest to construct on the stack, but in the async case it is
+    likely that the submitting function returns (hence stack is destroyed)
+    before URB completion.
+
+commit a8d2881eb7c273892acf2ff6e1f3f552631d1d11
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon Dec 3 23:29:22 2007 +0000
+
+    Add functionality to access device descriptors
+
+commit b5a7a411087b37a6bf56b4688a9e3290daaed153
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Mon Dec 3 22:27:21 2007 +0000
+
+    Rename fpusb_device_handle functions to devh
+    
+    Prevents confusion with functions that work on fpusb_dev structures.
+
+commit eacf4505a473df0f521d1b69d5b45448f0709e2d
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Sun Dec 2 23:16:57 2007 +0000
+
+    Add API to access poll fd
+    
+    Almost forgot... :)
+
+commit 852bba4754ec57679c823f33e8feba6e4a564cbe
+Author: Daniel Drake <dsd at gentoo.org>
+Date:   Wed Nov 28 13:48:45 2007 +0000
+
+    Initial commit
+    
+    Basic library structure which supports enumerating detected USB devices
diff --git a/Platform/Android/jni/External/libusb-1.0.8/INSTALL b/Platform/Android/jni/External/libusb-1.0.8/INSTALL
new file mode 100644
index 0000000..5458714
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/INSTALL
@@ -0,0 +1,234 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/Makefile.am b/Platform/Android/jni/External/libusb-1.0.8/Makefile.am
new file mode 100644
index 0000000..1b65a92
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/Makefile.am
@@ -0,0 +1,27 @@
+AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip
+ACLOCAL_AMFLAGS = -I m4
+DISTCLEANFILES = ChangeLog libusb-1.0.pc
+EXTRA_DIST = TODO PORTING
+SUBDIRS = libusb doc
+
+if BUILD_EXAMPLES
+SUBDIRS += examples
+endif
+
+pkgconfigdir=$(libdir)/pkgconfig
+pkgconfig_DATA=libusb-1.0.pc
+
+.PHONY: ChangeLog dist-up
+ChangeLog:
+	git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog
+
+dist-hook: ChangeLog
+
+reldir = .release/$(distdir)
+dist-up: dist
+	rm -rf $(reldir)
+	mkdir -p $(reldir)
+	cp $(distdir).tar.bz2 $(reldir)
+	rsync -rv $(reldir) dsd_,libusb at frs.sourceforge.net:/home/frs/project/l/li/libusb/libusb-1.0/
+	rm -rf $(reldir)
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/Makefile.in b/Platform/Android/jni/External/libusb-1.0.8/Makefile.in
new file mode 100644
index 0000000..172434e
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/Makefile.in
@@ -0,0 +1,802 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ at BUILD_EXAMPLES_TRUE@am__append_1 = examples
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
+	$(srcdir)/libusb-1.0.pc.in $(top_srcdir)/configure AUTHORS \
+	COPYING ChangeLog INSTALL NEWS THANKS TODO compile \
+	config.guess config.sub depcomp install-sh ltmain.sh missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = libusb-1.0.pc
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
+DATA = $(pkgconfig_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = libusb doc examples
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d "$(distdir)" \
+    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr "$(distdir)"; }; }
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+GZIP_ENV = --best
+DIST_ARCHIVES = $(distdir).tar.bz2
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_LDFLAGS = @AM_LDFLAGS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OS_DARWIN = @OS_DARWIN@
+OS_LINUX = @OS_LINUX@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+lt_age = @lt_age@
+lt_major = @lt_major@
+lt_revision = @lt_revision@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip
+ACLOCAL_AMFLAGS = -I m4
+DISTCLEANFILES = ChangeLog libusb-1.0.pc
+EXTRA_DIST = TODO PORTING
+SUBDIRS = libusb doc $(am__append_1)
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libusb-1.0.pc
+reldir = .release/$(distdir)
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+	else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in:  $(am__configure_deps) 
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+libusb-1.0.pc: $(top_builddir)/config.status $(srcdir)/libusb-1.0.pc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool config.lt
+install-pkgconfigDATA: $(pkgconfig_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
+	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
+	done
+
+uninstall-pkgconfigDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	test -d "$(distdir)" || mkdir "$(distdir)"
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	$(MAKE) $(AM_MAKEFLAGS) \
+	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
+	  dist-hook
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -755 \
+		-exec chmod u+rwx,go+rx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-lzma: distdir
+	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+	$(am__remove_distdir)
+
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lzma*) \
+	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+	@$(am__cd) '$(distuninstallcheck_dir)' \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pkgconfigDATA
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-pkgconfigDATA
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
+	ctags-recursive install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-generic \
+	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
+	dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+	dist-zip distcheck distclean distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags distcleancheck distdir \
+	distuninstallcheck dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-pkgconfigDATA install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-pkgconfigDATA
+
+
+.PHONY: ChangeLog dist-up
+ChangeLog:
+	git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog
+
+dist-hook: ChangeLog
+dist-up: dist
+	rm -rf $(reldir)
+	mkdir -p $(reldir)
+	cp $(distdir).tar.bz2 $(reldir)
+	rsync -rv $(reldir) dsd_,libusb at frs.sourceforge.net:/home/frs/project/l/li/libusb/libusb-1.0/
+	rm -rf $(reldir)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Platform/Android/jni/External/libusb-1.0.8/NEWS b/Platform/Android/jni/External/libusb-1.0.8/NEWS
new file mode 100644
index 0000000..42c232c
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/NEWS
@@ -0,0 +1,56 @@
+This file lists notable changes in each release. For the full history of all
+changes, see ChangeLog.
+
+2010-05-07: v1.0.8
+* Bug fixes
+
+2010-04-19: v1.0.7
+* Bug fixes and documentation tweaks
+* Add more interface class definitions
+
+2009-11-22: v1.0.6
+* Bug fixes
+* Increase libusb_handle_events() timeout to 60s for powersaving
+
+2009-11-15: v1.0.5
+ * Use timerfd when available for timer management
+ * Small fixes/updates
+
+2009-11-06: v1.0.4 release
+ * Bug fixes including transfer locking to fix some potential threading races
+ * More flexibility with clock types on Linux
+ * Use new bulk continuation tracking in Linux 2.6.32 for improved handling
+   of short/failed transfers
+
+2009-08-27: v1.0.3 release
+ * Bug fixes
+ * Add libusb_get_max_iso_packet_size()
+
+2009-06-13: v1.0.2 release
+ * Bug fixes
+
+2009-05-12: v1.0.1 release
+ * Bug fixes
+ * Darwin backend
+
+2008-12-13: v1.0.0 release
+ * Bug fixes
+
+2008-11-21: v0.9.4 release
+ * Bug fixes
+ * Add libusb_attach_kernel_driver()
+
+2008-08-23: v0.9.3 release
+ * Bug fixes
+
+2008-07-19: v0.9.2 release
+ * Bug fixes
+
+2008-06-28: v0.9.1 release
+ * Bug fixes
+ * Introduce contexts to the API
+ * Compatibility with new Linux kernel features
+
+2008-05-25: v0.9.0 release
+ * First libusb-1.0 beta release
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/PORTING b/Platform/Android/jni/External/libusb-1.0.8/PORTING
new file mode 100644
index 0000000..7070784
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/PORTING
@@ -0,0 +1,95 @@
+PORTING LIBUSB TO OTHER PLATFORMS
+
+Introduction
+============
+
+This document is aimed at developers wishing to port libusb to unsupported
+platforms. I believe the libusb API is OS-independent, so by supporting
+multiple operating systems we pave the way for cross-platform USB device
+drivers.
+
+Implementation-wise, the basic idea is that you provide an interface to
+libusb's internal "backend" API, which performs the appropriate operations on
+your target platform.
+
+In terms of USB I/O, your backend provides functionality to submit
+asynchronous transfers (synchronous transfers are implemented in the higher
+layers, based on the async interface). Your backend must also provide
+functionality to cancel those transfers.
+
+Your backend must also provide an event handling function to "reap" ongoing
+transfers and process their results.
+
+The backend must also provide standard functions for other USB operations,
+e.g. setting configuration, obtaining descriptors, etc.
+
+
+File descriptors for I/O polling
+================================
+
+For libusb to work, your event handling function obviously needs to be called
+at various points in time. Your backend must provide a set of file descriptors
+which libusb and its users can pass to poll() or select() to determine when
+it is time to call the event handling function.
+
+On Linux, this is easy: the usbfs kernel interface exposes a file descriptor
+which can be passed to poll(). If something similar is not true for your
+platform, you can emulate this using an internal library thread to reap I/O as
+necessary, and a pipe() with the main library to raise events. The file
+descriptor of the pipe can then be provided to libusb as an event source.
+
+
+Interface semantics and documentation
+=====================================
+
+Documentation of the backend interface can be found in libusbi.h inside the
+usbi_os_backend structure definition.
+
+Your implementations of these functions will need to call various internal
+libusb functions, prefixed with "usbi_". Documentation for these functions
+can be found in the .c files where they are implemented.
+
+You probably want to skim over *all* the documentation before starting your
+implementation. For example, you probably need to allocate and store private
+OS-specific data for device handles, but the documentation for the mechanism
+for doing so is probably not the first thing you will see.
+
+The Linux backend acts as a good example - view it as a reference
+implementation which you should try to match the behaviour of.
+
+
+Getting started
+===============
+
+1. Modify configure.ac to detect your platform appropriately (see the OS_LINUX
+stuff for an example).
+
+2. Implement your backend in the libusb/os/ directory, modifying
+libusb/os/Makefile.am appropriately.
+
+3. Add preprocessor logic to the top of libusb/core.c to statically assign the
+right usbi_backend for your platform.
+
+4. Produce and test your implementation.
+
+5. Send your implementation to libusb-devel mailing list.
+
+
+Implementation difficulties? Questions?
+=======================================
+
+If you encounter difficulties porting libusb to your platform, please raise
+these issues on the libusb-devel mailing list. Where possible and sensible, I
+am interested in solving problems preventing libusb from operating on other
+platforms.
+
+The libusb-devel mailing list is also a good place to ask questions and
+make suggestions about the internal API. Hopefully we can produce some
+better documentation based on your questions and other input.
+
+You are encouraged to get involved in the process; if the library needs
+some infrastructure additions/modifications to better support your platform,
+you are encouraged to make such changes (in cleanly distinct patch
+submissions). Even if you do not make such changes yourself, please do raise
+the issues on the mailing list at the very minimum.
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/README b/Platform/Android/jni/External/libusb-1.0.8/README
new file mode 100644
index 0000000..eefe5ee
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/README
@@ -0,0 +1,21 @@
+libusb
+======
+
+libusb is a library for USB device access from Linux userspace.
+It is written in C and licensed under the LGPL-2.1 (see COPYING).
+
+libusb is abstracted internally in such a way that it can hopefully
+be ported to other operating systems. See the PORTING file for some
+information, if you fancy a challenge :)
+
+libusb homepage:
+http://libusb.sourceforge.net
+
+Developers will wish to consult the API documentation:
+http://libusb.sourceforge.net/api-1.0/
+
+Use the mailing list for questions, comments, etc:
+https://sourceforge.net/mailarchive/forum.php?forum_name=libusb-devel
+
+- Daniel Drake <dsd at gentoo.org>
+(use the mailing list rather than mailing developers directly)
diff --git a/Platform/Android/jni/External/libusb-1.0.8/THANKS b/Platform/Android/jni/External/libusb-1.0.8/THANKS
new file mode 100644
index 0000000..d926126
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/THANKS
@@ -0,0 +1,8 @@
+Development contributors are listed in the AUTHORS file. Other community
+members who have made significant contributions in other areas are listed
+in this file:
+
+Alan Stern
+Ludovic Rousseau
+Tim Roberts
+Xiaofan Chen
diff --git a/Platform/Android/jni/External/libusb-1.0.8/TODO b/Platform/Android/jni/External/libusb-1.0.8/TODO
new file mode 100644
index 0000000..6c162a3
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/TODO
@@ -0,0 +1,9 @@
+for 1.1 or future
+==================
+optional timerfd support (runtime detection)
+notifications of hotplugged/unplugged devices
+offer API to create/destroy handle_events thread
+isochronous sync I/O?
+exposing of parent-child device relationships
+"usb primer" introduction docs
+more examples
diff --git a/Platform/Android/jni/External/libusb-1.0.8/aclocal.m4 b/Platform/Android/jni/External/libusb-1.0.8/aclocal.m4
new file mode 100644
index 0000000..a65a6c8
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/aclocal.m4
@@ -0,0 +1,8984 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 56 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+		   [m4_fatal([Libtool version $1 or higher is required],
+		             63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\	*)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+	[m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+	[tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+	   m4_quote(lt_decl_varnames),
+	m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+					   [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+	dnl If the libtool generation code has been placed in $CONFIG_LT,
+	dnl instead of duplicating it all over again into config.status,
+	dnl then we will have config.status run $CONFIG_LT later, so it
+	dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+  ;;
+esac
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+if test "$no_create" != yes; then
+  lt_cl_success=:
+  test "$silent" = yes &&
+    lt_config_lt_args="$lt_config_lt_args --quiet"
+  exec AS_MESSAGE_LOG_FD>/dev/null
+  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+  exec AS_MESSAGE_LOG_FD>>config.log
+  $lt_cl_success || AS_EXIT(1)
+fi
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_XSI_SHELLFNS
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],			[_LT_LANG(C)],
+  [C++],		[_LT_LANG(CXX)],
+  [Java],		[_LT_LANG(GCJ)],
+  [Fortran 77],		[_LT_LANG(F77)],
+  [Fortran],		[_LT_LANG(FC)],
+  [Windows Resource],	[_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi])
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+	[lt_cv_ld_exported_symbols_list=yes],
+	[lt_cv_ld_exported_symbols_list=no])
+	LDFLAGS="$save_LDFLAGS"
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=echo
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_SHELL_INIT
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $ECHO works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<_LT_EOF
+[$]*
+_LT_EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+  if test "X${echo_test_string+set}" != Xset; then
+    # find a string as large as possible, as long as the shell can cope with it
+    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+      then
+        break
+      fi
+    done
+  fi
+
+  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+     test "X$echo_testing_string" = "X$echo_test_string"; then
+    :
+  else
+    # The Solaris, AIX, and Digital Unix default echo programs unquote
+    # backslashes.  This makes it impossible to quote backslashes using
+    #   echo "$something" | sed 's/\\/\\\\/g'
+    #
+    # So, first we look for a working echo in the user's PATH.
+
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for dir in $PATH /usr/ucb; do
+      IFS="$lt_save_ifs"
+      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        ECHO="$dir/echo"
+        break
+      fi
+    done
+    IFS="$lt_save_ifs"
+
+    if test "X$ECHO" = Xecho; then
+      # We didn't find a better echo, so look for alternatives.
+      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        # This shell has a builtin print -r that does the trick.
+        ECHO='print -r'
+      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+	   test "X$CONFIG_SHELL" != X/bin/ksh; then
+        # If we have ksh, try running configure again with it.
+        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+        export ORIGINAL_CONFIG_SHELL
+        CONFIG_SHELL=/bin/ksh
+        export CONFIG_SHELL
+        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+      else
+        # Try using printf.
+        ECHO='printf %s\n'
+        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	  # Cool, printf works
+	  :
+        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	  export CONFIG_SHELL
+	  SHELL="$CONFIG_SHELL"
+	  export SHELL
+	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+        else
+	  # maybe with a smaller string...
+	  prev=:
+
+	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+	    then
+	      break
+	    fi
+	    prev="$cmd"
+	  done
+
+	  if test "$prev" != 'sed 50q "[$]0"'; then
+	    echo_test_string=`eval $prev`
+	    export echo_test_string
+	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+	  else
+	    # Oops.  We lost completely, so just stick with echo.
+	    ECHO=echo
+	  fi
+        fi
+      fi
+    fi
+  fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+    [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+	  [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen="dlopen"],
+	  [AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+	    [AC_CHECK_LIB([svld], [dlopen],
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+	      [AC_CHECK_LIB([dld], [dld_link],
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+	  lt_cv_dlopen_self_static, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+	 [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+	 [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+	 [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+	[Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+	[], [
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  # Handle Gentoo/FreeBSD as it was Linux
+  case $host_vendor in
+    gentoo)
+      version_type=linux ;;
+    *)
+      version_type=freebsd-$objformat ;;
+  esac
+
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+    linux)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+      soname_spec='${libname}${release}${shared_ext}$major'
+      need_lib_prefix=no
+      need_version=no
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix[[3-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # Some binutils ld are patched to set DT_RUNPATH
+  save_LDFLAGS=$LDFLAGS
+  save_libdir=$libdir
+  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+       [shlibpath_overrides_runpath=yes])])
+  LDFLAGS=$save_LDFLAGS
+  libdir=$save_libdir
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+	[Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  xlc* | xlC*)
+	    # IBM XL 8.0 on PPC
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl*)
+	# IBM XL C 8.0/Fortran 10.1 on PPC
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)
+	  # Sun C 5.9
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  ;;
+	*Sun\ F*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+	[How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+	[Additional compiler flags for building library objects])
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+	[Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw* | cegcc*)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+	  tmp_sharedflag='--shared' ;;
+	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 _LT_SYS_MODULE_PATH_AIX
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  # Exported symbols can be pulled into shared objects from archives
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	*)
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        AC_LINK_IFELSE(int foo(void) {},
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+        )
+        LDFLAGS="$save_LDFLAGS"
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	     ;;
+	   *)
+	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+      $RM conftest*
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+        _LT_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+        then
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $RM conftest*
+      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+    [[If ld is used when linking, flag to hardcode $libdir into a binary
+    during linking.  This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+    [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+m4_defun([_LT_PROG_CXX],
+[
+pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+AC_PROG_CXX
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_CXX
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_CXX], [])
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[AC_REQUIRE([_LT_PROG_CXX])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    _LT_SYS_MODULE_PATH_AIX
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	    # Exported symbols can be pulled into shared objects from archives
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+        # as there is no search path for DLLs.
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+        _LT_TAGVAR(always_export_symbols, $1)=no
+        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+          # If the export-symbols file already is a .def file (1st line
+          # is EXPORTS), use it as is; otherwise, prepend...
+          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    cp $export_symbols $output_objdir/$soname.def;
+          else
+	    echo EXPORTS > $output_objdir/$soname.def;
+	    cat $export_symbols >> $output_objdir/$soname.def;
+          fi~
+          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        else
+          _LT_TAGVAR(ld_shlibs, $1)=no
+        fi
+        ;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      freebsd[[12]]*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+	      fi
+	    fi
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+	    ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+		$RANLIB $oldlib'
+	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 will use weak symbols
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+	  xl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='echo'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+	;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=echo
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+		;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	    case $host_os in
+	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+	    output_verbose_link_cmd='echo'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      fi
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+		*)
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+	_LT_TAGVAR(link_all_deplibs, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	  *)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+	   _LT_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_F77],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+AC_PROG_F77
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_F77
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_F77], [])
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_REQUIRE([_LT_PROG_F77])dnl
+AC_LANG_PUSH(Fortran 77)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${F77-"f77"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_FC],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+AC_PROG_FC
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_FC
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_FC], [])
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${FC-"f95"}
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$[@]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]+=\$[2]"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+    ;;
+  esac
+])
+
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+		      [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+  		   [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+	[Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+	[Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+	 [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+		 [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+		 [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+		 [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+		 [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+		 [m4_define([_LTDL_TYPE], [convenience])])
+
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+	     [m4_foreach([_Lt_suffix],
+		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+		 [lt_append([$1], [$2], [$3])$4],
+		 [$5])],
+	  [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+	[$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
+
+# ltversion.m4 -- version numbers			-*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3017 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6b])
+m4_define([LT_PACKAGE_REVISION], [1.3017])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6b'
+macro_revision='1.3017'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
+
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 10
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+			     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+		  [_AM_DEPENDENCIES(CC)],
+		  [define([AC_PROG_CC],
+			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+		  [_AM_DEPENDENCIES(CXX)],
+		  [define([AC_PROG_CXX],
+			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+		  [_AM_DEPENDENCIES(OBJC)],
+		  [define([AC_PROG_OBJC],
+			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2009  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/compile b/Platform/Android/jni/External/libusb-1.0.8/compile
new file mode 100644
index 0000000..1b1d232
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/compile
@@ -0,0 +1,142 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as `compile cc -o foo foo.c'.
+	# So we strip `-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no `-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # `.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/Platform/Android/jni/External/libusb-1.0.8/config.guess b/Platform/Android/jni/External/libusb-1.0.8/config.guess
new file mode 100644
index 0000000..2313a17
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/config.guess
@@ -0,0 +1,1545 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2008-01-23'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per at bothner.com>.
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
+	eval $set_cc_for_build
+	cat << EOF > $dummy.c
+	#include <features.h>
+	#ifdef __UCLIBC__
+	# ifdef __UCLIBC_CONFIG_VERSION__
+	LIBC=uclibc __UCLIBC_CONFIG_VERSION__
+	# else
+	LIBC=uclibc
+	# endif
+	#else
+	LIBC=gnu
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
+fi
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep __ELF__ >/dev/null
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit ;;
+    *:AIX:*:[456])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep __LP64__ >/dev/null
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    *:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    *:Interix*:[3456]*)
+    	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    EM64T | authenticamd)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	    IA64)
+		echo ia64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    arm*:Linux:*:*)
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_EABI__
+	then
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	else
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+	fi
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-${LIBC}
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-${LIBC}
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-${LIBC}
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    mips:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^CPU/{
+		s: ::g
+		p
+	    }'`"
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+	;;
+    mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips64
+	#undef mips64el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mips64el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips64
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^CPU/{
+		s: ::g
+		p
+	    }'`"
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-${LIBC}
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-${LIBC}
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-${LIBC}
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+	  *)    echo hppa-unknown-linux-${LIBC} ;;
+	esac
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-${LIBC}
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-${LIBC}
+	exit ;;
+    xtensa*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    i*86:Linux:*:*)
+	# The BFD linker knows what the default object file format is, so
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	# Set LC_ALL=C to ensure ld outputs messages in English.
+	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
+				    s/[ 	][ 	]*/ /g
+				    s/.*supported targets: *//
+				    s/ .*//
+				    p'`
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
+		;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
+		exit ;;
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff"
+		exit ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
+		exit ;;
+	esac
+	# This should get integrated into the C code below, but now we hack
+	if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
+	#else
+	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^LIBC/{
+		s: ::g
+		p
+	    }'`"
+	test x"${LIBC}" != x && {
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+		exit
+	}
+	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+	echo i386-pc-msdosdjgpp
+        exit ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel at ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/Platform/Android/jni/External/libusb-1.0.8/config.h.in b/Platform/Android/jni/External/libusb-1.0.8/config.h.in
new file mode 100644
index 0000000..45e0db7
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/config.h.in
@@ -0,0 +1,98 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Default visibility */
+#undef API_EXPORTED
+
+/* Debug message logging */
+#undef ENABLE_DEBUG_LOGGING
+
+/* Message logging */
+#undef ENABLE_LOGGING
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+#undef HAVE_LIBRT
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Darwin backend */
+#undef OS_DARWIN
+
+/* Linux backend */
+#undef OS_LINUX
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Backend handles timeout */
+#undef USBI_OS_HANDLES_TIMEOUT
+
+/* timerfd headers available */
+#undef USBI_TIMERFD_AVAILABLE
+
+/* Version number of package */
+#undef VERSION
+
+/* Use GNU extensions */
+#undef _GNU_SOURCE
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#undef inline
+#endif
diff --git a/Platform/Android/jni/External/libusb-1.0.8/config.sub b/Platform/Android/jni/External/libusb-1.0.8/config.sub
new file mode 100644
index 0000000..ba16ebf
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/config.sub
@@ -0,0 +1,1676 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2008-01-16'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis | -knuth | -cray)
+		os=
+		basic_machine=$1
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx | dvp \
+	| fido | fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore | mep \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| mt \
+	| msp430 \
+	| nios | nios2 \
+	| ns16k | ns32k \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| score \
+	| sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu | strongarm \
+	| tahoe | thumb | tic4x | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| z8k)
+		basic_machine=$basic_machine-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* | avr32-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| m32c-* | m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
+	| msp430-* \
+	| nios-* | nios2-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa*-* \
+	| ymp-* \
+	| z8k-*)
+		;;
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=$basic_machine-unknown
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	blackfin)
+		basic_machine=bfin-unknown
+		os=-linux
+		;;
+	blackfin-*)
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16)
+		basic_machine=cr16-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m68knommu)
+		basic_machine=m68k-unknown
+		os=-linux
+		;;
+	m68knommu-*)
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mipsEE* | ee | ps2)
+		basic_machine=mips64r5900el-scei
+		case $os in
+		    -linux*)
+			;;
+		    *)
+			os=-elf
+			;;
+		esac
+		;;
+	iop)
+		basic_machine=mipsel-scei
+		os=-irx
+		;;
+	dvp)
+		basic_machine=dvp-scei
+		os=-elf
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	parisc)
+		basic_machine=hppa-unknown
+		os=-linux
+		;;
+	parisc-*)
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
+		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+		;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tic55x | c55x*)
+		basic_machine=tic55x-unknown
+		os=-coff
+		;;
+	tic6x | c6x*)
+		basic_machine=tic6x-unknown
+		os=-coff
+		;;
+	tile*)
+		basic_machine=tile-unknown
+		os=-linux-gnu
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+        -tpf*)
+		os=-tpf
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+        score-*)
+		os=-elf
+		;;
+        spu-*)
+		os=-elf
+		;;
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+        c4x-* | tic4x-*)
+        	os=-coff
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+	pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+        mep-*)
+		os=-elf
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-haiku)
+		os=-haiku
+		;;
+	*-ibm)
+		os=-aix
+		;;
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+	*-gould)
+		os=-sysv
+		;;
+	*-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+	*-sgi)
+		os=-irix
+		;;
+	*-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/Platform/Android/jni/External/libusb-1.0.8/configure b/Platform/Android/jni/External/libusb-1.0.8/configure
new file mode 100644
index 0000000..fed317a
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/configure
@@ -0,0 +1,13264 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.65 for libusb 1.0.8.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+	# neutralization value for shells without unset; and this also
+	# works around shells that cannot unset nonexistent variables.
+	BASH_ENV=/dev/null
+	ENV=/dev/null
+	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf at gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in #(
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $ECHO works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<_LT_EOF
+$*
+_LT_EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+  if test "X${echo_test_string+set}" != Xset; then
+    # find a string as large as possible, as long as the shell can cope with it
+    for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+      then
+        break
+      fi
+    done
+  fi
+
+  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+     test "X$echo_testing_string" = "X$echo_test_string"; then
+    :
+  else
+    # The Solaris, AIX, and Digital Unix default echo programs unquote
+    # backslashes.  This makes it impossible to quote backslashes using
+    #   echo "$something" | sed 's/\\/\\\\/g'
+    #
+    # So, first we look for a working echo in the user's PATH.
+
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for dir in $PATH /usr/ucb; do
+      IFS="$lt_save_ifs"
+      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        ECHO="$dir/echo"
+        break
+      fi
+    done
+    IFS="$lt_save_ifs"
+
+    if test "X$ECHO" = Xecho; then
+      # We didn't find a better echo, so look for alternatives.
+      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        # This shell has a builtin print -r that does the trick.
+        ECHO='print -r'
+      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+	   test "X$CONFIG_SHELL" != X/bin/ksh; then
+        # If we have ksh, try running configure again with it.
+        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+        export ORIGINAL_CONFIG_SHELL
+        CONFIG_SHELL=/bin/ksh
+        export CONFIG_SHELL
+        exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+      else
+        # Try using printf.
+        ECHO='printf %s\n'
+        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	  # Cool, printf works
+	  :
+        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	  export CONFIG_SHELL
+	  SHELL="$CONFIG_SHELL"
+	  export SHELL
+	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
+        elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
+        else
+	  # maybe with a smaller string...
+	  prev=:
+
+	  for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+	    then
+	      break
+	    fi
+	    prev="$cmd"
+	  done
+
+	  if test "$prev" != 'sed 50q "$0"'; then
+	    echo_test_string=`eval $prev`
+	    export echo_test_string
+	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+	  else
+	    # Oops.  We lost completely, so just stick with echo.
+	    ECHO=echo
+	  fi
+        fi
+      fi
+    fi
+  fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='libusb'
+PACKAGE_TARNAME='libusb'
+PACKAGE_VERSION='1.0.8'
+PACKAGE_STRING='libusb 1.0.8'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+ac_unique_file="libusb/core.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+AM_LDFLAGS
+AM_CFLAGS
+VISIBILITY_CFLAGS
+BUILD_EXAMPLES_FALSE
+BUILD_EXAMPLES_TRUE
+lt_age
+lt_revision
+lt_major
+OS_DARWIN_FALSE
+OS_DARWIN_TRUE
+OS_LINUX_FALSE
+OS_LINUX_TRUE
+OS_DARWIN
+OS_LINUX
+CPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+lt_ECHO
+RANLIB
+AR
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+LIBTOOL
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_dependency_tracking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+enable_libtool_lock
+enable_timerfd
+enable_log
+enable_debug_log
+enable_examples_build
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures libusb 1.0.8 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/libusb]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of libusb 1.0.8:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-timerfd        use timerfd for timing (default auto)
+  --disable-log           disable all logging
+  --enable-debug-log      enable debug logging (default n)
+  --enable-examples-build build example applications (default n)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+libusb configure 1.0.8
+generated by GNU Autoconf 2.65
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR
+# ------------------------------------
+# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
+$as_echo_n "checking whether $2 is declared... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $2
+  (void) $2;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_decl
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by libusb $as_me 1.0.8, which was
+generated by GNU Autoconf 2.65.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+am__api_version='1.11'
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  for ac_t in install-sh install.sh shtool; do
+    if test -f "$ac_dir/$ac_t"; then
+      ac_aux_dir=$ac_dir
+      ac_install_sh="$ac_aux_dir/$ac_t -c"
+      break 2
+    fi
+  done
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      as_fn_error "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='libusb'
+ VERSION='1.0.8'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+case `pwd` in
+  *\ * | *\	*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.2.6b'
+macro_revision='1.3017'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:4539: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:4542: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:4545: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 5751 "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
+else
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&5
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
+else
+  lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[012]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+# Set options
+
+
+
+        enable_dlopen=no
+
+
+  enable_win32_dll=no
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:7277: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:7281: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+
+
+
+
+
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='--shared'
+	lt_prog_compiler_static='--static'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl*)
+	# IBM XL C 8.0/Fortran 10.1 on PPC
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-qpic'
+	lt_prog_compiler_static='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl='-Wl,'
+	  ;;
+	*Sun\ F*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl=''
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:7616: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:7620: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:7721: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:7725: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:7776: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:7780: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec=
+	  tmp_sharedflag='--shared' ;;
+	xl[cC]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec=
+	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    ld_shlibs=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  hardcode_direct=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L=yes
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_libdir_separator=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      export_dynamic_flag_spec='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec='$convenience'
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_from_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  whole_archive_flag_spec=''
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=echo
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld='+b $libdir'
+	hardcode_libdir_separator=:
+	hardcode_direct=yes
+	hardcode_direct_absolute=yes
+	export_dynamic_flag_spec='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	*)
+	  hardcode_direct=yes
+	  hardcode_direct_absolute=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo(void) {}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        LDFLAGS="$save_LDFLAGS"
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct=yes
+	hardcode_shlibpath_var=no
+	hardcode_direct_absolute=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	  export_dynamic_flag_spec='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     hardcode_libdir_flag_spec='-R$libdir'
+	     ;;
+	   *)
+	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+      $RM conftest*
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+	pic_flag=$lt_prog_compiler_pic
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+        then
+	  archive_cmds_need_lc=no
+        else
+	  archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $RM conftest*
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
+$as_echo "$archive_cmds_need_lc" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  # Handle Gentoo/FreeBSD as it was Linux
+  case $host_vendor in
+    gentoo)
+      version_type=linux ;;
+    *)
+      version_type=freebsd-$objformat ;;
+  esac
+
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+    linux)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+      soname_spec='${libname}${release}${shared_ext}$major'
+      need_lib_prefix=no
+      need_version=no
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # Some binutils ld are patched to set DT_RUNPATH
+  save_LDFLAGS=$LDFLAGS
+  save_libdir=$libdir
+  eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+       LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  LDFLAGS=$save_LDFLAGS
+  libdir=$save_libdir
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = x""yes; then :
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 10156 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 10252 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report which library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if test "${ac_cv_c_inline+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+   test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+	 test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+$as_echo "#define _GNU_SOURCE /**/" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking operating system" >&5
+$as_echo_n "checking operating system... " >&6; }
+case $host in
+*-linux*)
+
+$as_echo "#define OS_LINUX /**/" >>confdefs.h
+
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux" >&5
+$as_echo "Linux" >&6; }
+	backend="linux"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_rt_clock_gettime=yes
+else
+  ac_cv_lib_rt_clock_gettime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRT 1
+_ACEOF
+
+  LIBS="-lrt $LIBS"
+
+fi
+
+	AM_LDFLAGS=""
+	;;
+*-darwin*)
+
+$as_echo "#define OS_DARWIN /**/" >>confdefs.h
+
+
+
+$as_echo "#define USBI_OS_HANDLES_TIMEOUT /**/" >>confdefs.h
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin/MacOS X" >&5
+$as_echo "Darwin/MacOS X" >&6; }
+	backend="darwin"
+	AM_LDFLAGS="-Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation -Wl,-prebind -no-undefined"
+	;;
+*)
+	as_fn_error "unsupported operating system" "$LINENO" 5
+esac
+
+ if test "x$backend" == "xlinux"; then
+  OS_LINUX_TRUE=
+  OS_LINUX_FALSE='#'
+else
+  OS_LINUX_TRUE='#'
+  OS_LINUX_FALSE=
+fi
+
+ if test "x$backend" == "xdarwin"; then
+  OS_DARWIN_TRUE=
+  OS_DARWIN_FALSE='#'
+else
+  OS_DARWIN_TRUE='#'
+  OS_DARWIN_FALSE=
+fi
+
+
+# Library versioning
+lt_major="0"
+lt_revision="0"
+lt_age="0"
+
+
+
+
+# timerfd
+ac_fn_c_check_header_mongrel "$LINENO" "sys/timerfd.h" "ac_cv_header_sys_timerfd_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_timerfd_h" = x""yes; then :
+  timerfd_h=1
+else
+  timerfd_h=0
+fi
+
+
+# Check whether --enable-timerfd was given.
+if test "${enable_timerfd+set}" = set; then :
+  enableval=$enable_timerfd; use_timerfd=$enableval
+else
+  use_timerfd='auto'
+fi
+
+
+if test "x$use_timerfd" = "xyes" -a "x$timerfd_h" = "x0"; then
+	as_fn_error "timerfd header not available; glibc 2.9+ required" "$LINENO" 5
+fi
+
+ac_fn_c_check_decl "$LINENO" "TFD_NONBLOCK" "ac_cv_have_decl_TFD_NONBLOCK" "#include <sys/timerfd.h>
+"
+if test "x$ac_cv_have_decl_TFD_NONBLOCK" = x""yes; then :
+  tfd_hdr_ok=yes
+else
+  tfd_hdr_ok=no
+fi
+
+if test "x$use_timerfd" = "xyes" -a "x$tfd_hdr_ok" = "xno"; then
+	as_fn_error "timerfd header not usable; glibc 2.9+ required" "$LINENO" 5
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use timerfd for timing" >&5
+$as_echo_n "checking whether to use timerfd for timing... " >&6; }
+if test "x$use_timerfd" = "xno"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no (disabled by user)" >&5
+$as_echo "no (disabled by user)" >&6; }
+else
+	if test "x$timerfd_h" = "x1" -a "x$tfd_hdr_ok" = "xyes"; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define USBI_TIMERFD_AVAILABLE /**/" >>confdefs.h
+
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no (header not available)" >&5
+$as_echo "no (header not available)" >&6; }
+	fi
+fi
+
+# Message logging
+# Check whether --enable-log was given.
+if test "${enable_log+set}" = set; then :
+  enableval=$enable_log; log_enabled=$enableval
+else
+  log_enabled='yes'
+fi
+
+if test "x$log_enabled" != "xno"; then
+
+$as_echo "#define ENABLE_LOGGING 1" >>confdefs.h
+
+fi
+
+# Check whether --enable-debug-log was given.
+if test "${enable_debug_log+set}" = set; then :
+  enableval=$enable_debug_log; debug_log_enabled=$enableval
+else
+  debug_log_enabled='no'
+fi
+
+if test "x$debug_log_enabled" != "xno"; then
+
+$as_echo "#define ENABLE_DEBUG_LOGGING 1" >>confdefs.h
+
+fi
+
+# Examples build
+# Check whether --enable-examples-build was given.
+if test "${enable_examples_build+set}" = set; then :
+  enableval=$enable_examples_build; build_examples=$enableval
+else
+  build_examples='no'
+fi
+
+ if test "x$build_examples" != "xno"; then
+  BUILD_EXAMPLES_TRUE=
+  BUILD_EXAMPLES_FALSE='#'
+else
+  BUILD_EXAMPLES_TRUE='#'
+  BUILD_EXAMPLES_FALSE=
+fi
+
+
+# Restore gnu89 inline semantics on gcc 4.3 and newer
+saved_cflags="$CFLAGS"
+CFLAGS="$CFLAGS -fgnu89-inline"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  inline_cflags="-fgnu89-inline"
+else
+  inline_cflags=""
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$saved_cflags"
+
+# check for -fvisibility=hidden compiler support (GCC >= 3.4)
+saved_cflags="$CFLAGS"
+CFLAGS="$CFLAGS -fvisibility=hidden"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  VISIBILITY_CFLAGS="-fvisibility=hidden"
+
+$as_echo "#define API_EXPORTED __attribute__((visibility(\"default\")))" >>confdefs.h
+
+else
+   VISIBILITY_CFLAGS=""
+
+$as_echo "#define API_EXPORTED /**/" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$saved_cflags"
+
+# check for -Wno-pointer-sign compiler support (GCC >= 4)
+saved_cflags="$CFLAGS"
+CFLAGS="$CFLAGS -Wno-pointer-sign"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  nopointersign_cflags="-Wno-pointer-sign"
+else
+  nopointersign_cflags=""
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$saved_cflags"
+
+AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow"
+
+
+
+
+
+ac_config_files="$ac_config_files libusb-1.0.pc Makefile libusb/Makefile examples/Makefile doc/Makefile doc/doxygen.cfg"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${OS_LINUX_TRUE}" && test -z "${OS_LINUX_FALSE}"; then
+  as_fn_error "conditional \"OS_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${OS_DARWIN_TRUE}" && test -z "${OS_DARWIN_FALSE}"; then
+  as_fn_error "conditional \"OS_DARWIN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_EXAMPLES_TRUE}" && test -z "${BUILD_EXAMPLES_FALSE}"; then
+  as_fn_error "conditional \"BUILD_EXAMPLES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in #(
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by libusb $as_me 1.0.8, which was
+generated by GNU Autoconf 2.65.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+libusb config.status 1.0.8
+configured by $0, generated by GNU Autoconf 2.65,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
+enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
+host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
+host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
+host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
+build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
+build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
+build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
+SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
+Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
+GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
+EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
+FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
+LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
+NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
+LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
+exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
+AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
+GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
+SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
+ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
+need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
+LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
+libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
+version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
+striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+SHELL \
+ECHO \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+finish_eval \
+old_striplib \
+striplib; do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\$0 --fallback-echo"')  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
+  ;;
+esac
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "libusb-1.0.pc") CONFIG_FILES="$CONFIG_FILES libusb-1.0.pc" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "libusb/Makefile") CONFIG_FILES="$CONFIG_FILES libusb/Makefile" ;;
+    "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+    "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+    "doc/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES doc/doxygen.cfg" ;;
+
+  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| as_fn_error "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that does not interpret backslashes.
+ECHO=$lt_ECHO
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1+=\$2"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+    ;;
+  esac
+
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/configure.ac b/Platform/Android/jni/External/libusb-1.0.8/configure.ac
new file mode 100644
index 0000000..4668cf0
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/configure.ac
@@ -0,0 +1,131 @@
+AC_INIT([libusb], [1.0.8])
+AM_INIT_AUTOMAKE
+AC_CONFIG_SRCDIR([libusb/core.c])
+AC_CONFIG_MACRO_DIR([m4])
+AM_CONFIG_HEADER([config.h])
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
+
+AC_PREREQ([2.50])
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_C_INLINE
+AM_PROG_CC_C_O
+AC_DEFINE([_GNU_SOURCE], [], [Use GNU extensions])
+
+AC_MSG_CHECKING([operating system])
+case $host in
+*-linux*)
+	AC_DEFINE(OS_LINUX, [], [Linux backend])
+	AC_SUBST(OS_LINUX)
+	AC_MSG_RESULT([Linux])
+	backend="linux"
+	AC_CHECK_LIB(rt, clock_gettime)
+	AM_LDFLAGS=""
+	;;
+*-darwin*)
+	AC_DEFINE(OS_DARWIN, [], [Darwin backend])
+	AC_SUBST(OS_DARWIN)
+	AC_DEFINE(USBI_OS_HANDLES_TIMEOUT, [], [Backend handles timeout])
+	AC_MSG_RESULT([Darwin/MacOS X])
+	backend="darwin"
+	AM_LDFLAGS="-Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation -Wl,-prebind -no-undefined"
+	;;
+*)
+	AC_MSG_ERROR([unsupported operating system])
+esac
+
+AM_CONDITIONAL([OS_LINUX], [test "x$backend" == "xlinux"])
+AM_CONDITIONAL([OS_DARWIN], [test "x$backend" == "xdarwin"])
+
+# Library versioning
+lt_major="0"
+lt_revision="0"
+lt_age="0"
+AC_SUBST(lt_major)
+AC_SUBST(lt_revision)
+AC_SUBST(lt_age)
+
+# timerfd
+AC_CHECK_HEADER([sys/timerfd.h], [timerfd_h=1], [timerfd_h=0])
+AC_ARG_ENABLE([timerfd],
+	[AS_HELP_STRING([--enable-timerfd],
+		[use timerfd for timing (default auto)])],
+	[use_timerfd=$enableval], [use_timerfd='auto'])
+
+if test "x$use_timerfd" = "xyes" -a "x$timerfd_h" = "x0"; then
+	AC_MSG_ERROR([timerfd header not available; glibc 2.9+ required])
+fi
+
+AC_CHECK_DECL([TFD_NONBLOCK], [tfd_hdr_ok=yes], [tfd_hdr_ok=no], [#include <sys/timerfd.h>])
+if test "x$use_timerfd" = "xyes" -a "x$tfd_hdr_ok" = "xno"; then
+	AC_MSG_ERROR([timerfd header not usable; glibc 2.9+ required])
+fi
+
+AC_MSG_CHECKING([whether to use timerfd for timing])
+if test "x$use_timerfd" = "xno"; then
+	AC_MSG_RESULT([no (disabled by user)])
+else
+	if test "x$timerfd_h" = "x1" -a "x$tfd_hdr_ok" = "xyes"; then
+		AC_MSG_RESULT([yes])
+		AC_DEFINE(USBI_TIMERFD_AVAILABLE, [], [timerfd headers available])
+	else
+		AC_MSG_RESULT([no (header not available)])
+	fi
+fi
+
+# Message logging
+AC_ARG_ENABLE([log], [AS_HELP_STRING([--disable-log], [disable all logging])],
+	[log_enabled=$enableval],
+	[log_enabled='yes'])
+if test "x$log_enabled" != "xno"; then
+	AC_DEFINE([ENABLE_LOGGING], 1, [Message logging])
+fi
+
+AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log],
+	[enable debug logging (default n)])],
+	[debug_log_enabled=$enableval],
+	[debug_log_enabled='no'])
+if test "x$debug_log_enabled" != "xno"; then
+	AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Debug message logging])
+fi
+
+# Examples build
+AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],
+	[build example applications (default n)])],
+	[build_examples=$enableval],
+	[build_examples='no'])
+AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"])
+
+# Restore gnu89 inline semantics on gcc 4.3 and newer
+saved_cflags="$CFLAGS"
+CFLAGS="$CFLAGS -fgnu89-inline"
+AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), inline_cflags="-fgnu89-inline", inline_cflags="")
+CFLAGS="$saved_cflags"
+
+# check for -fvisibility=hidden compiler support (GCC >= 3.4)
+saved_cflags="$CFLAGS"
+CFLAGS="$CFLAGS -fvisibility=hidden"
+AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
+	[VISIBILITY_CFLAGS="-fvisibility=hidden"
+	 AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility]) ],
+	[ VISIBILITY_CFLAGS=""
+	 AC_DEFINE([API_EXPORTED], [], [Default visibility]) ],
+	])
+CFLAGS="$saved_cflags"
+
+# check for -Wno-pointer-sign compiler support (GCC >= 4)
+saved_cflags="$CFLAGS"
+CFLAGS="$CFLAGS -Wno-pointer-sign"
+AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
+	nopointersign_cflags="-Wno-pointer-sign", nopointersign_cflags="")
+CFLAGS="$saved_cflags"
+
+AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow"
+
+AC_SUBST(VISIBILITY_CFLAGS)
+AC_SUBST(AM_CFLAGS)
+AC_SUBST(AM_LDFLAGS)
+
+AC_CONFIG_FILES([libusb-1.0.pc] [Makefile] [libusb/Makefile] [examples/Makefile] [doc/Makefile] [doc/doxygen.cfg])
+AC_OUTPUT
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/depcomp b/Platform/Android/jni/External/libusb-1.0.8/depcomp
new file mode 100644
index 0000000..ca5ea4e
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/depcomp
@@ -0,0 +1,584 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2006-10-15.18
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
+# Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+  stat=$?
+
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+	set fnord "$@"
+	shift
+	shift
+	;;
+    *)
+	set fnord "$@" "$arg"
+	shift
+	shift
+	;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
+  echo "	" >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/Platform/Android/jni/External/libusb-1.0.8/doc/Makefile.am b/Platform/Android/jni/External/libusb-1.0.8/doc/Makefile.am
new file mode 100644
index 0000000..ac5b189
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/doc/Makefile.am
@@ -0,0 +1,10 @@
+EXTRA_DIST = doxygen.cfg.in
+
+docs: doxygen.cfg
+	doxygen $^
+
+docs-upload: docs
+	ln -s html api-1.0
+	rsync -av api-1.0/ dsd_,libusb at web.sourceforge.net:htdocs/api-1.0/
+	rm -f api-1.0
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/doc/Makefile.in b/Platform/Android/jni/External/libusb-1.0.8/doc/Makefile.in
new file mode 100644
index 0000000..cdeebe6
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/doc/Makefile.in
@@ -0,0 +1,374 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = doc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(srcdir)/doxygen.cfg.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = doxygen.cfg
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_LDFLAGS = @AM_LDFLAGS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OS_DARWIN = @OS_DARWIN@
+OS_LINUX = @OS_LINUX@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+lt_age = @lt_age@
+lt_major = @lt_major@
+lt_revision = @lt_revision@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = doxygen.cfg.in
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu doc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+doxygen.cfg: $(top_builddir)/config.status $(srcdir)/doxygen.cfg.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+
+
+docs: doxygen.cfg
+	doxygen $^
+
+docs-upload: docs
+	ln -s html api-1.0
+	rsync -av api-1.0/ dsd_,libusb at web.sourceforge.net:htdocs/api-1.0/
+	rm -f api-1.0
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Platform/Android/jni/External/libusb-1.0.8/doc/doxygen.cfg.in b/Platform/Android/jni/External/libusb-1.0.8/doc/doxygen.cfg.in
new file mode 100644
index 0000000..574b52f
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/doc/doxygen.cfg.in
@@ -0,0 +1,1294 @@
+# Doxyfile 1.5.3
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file that 
+# follow. The default is UTF-8 which is also the encoding used for all text before 
+# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into 
+# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of 
+# possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = libusb
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = 
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, 
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, 
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, 
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like regular Qt-style comments 
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
+# interpret the first line (until the first dot) of a Qt-style 
+# comment as the brief description. If set to NO, the comments 
+# will behave just like regular Qt-style comments (thus requiring 
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
+# include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be extracted 
+# and appear in the documentation as a namespace called 'anonymous_namespace{file}', 
+# where file will be replaced with the base name of the file that contains the anonymous 
+# namespace. By default anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = NO
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from the 
+# version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = @top_srcdir@/libusb
+
+# This tag can be used to specify the character encoding of the source files that 
+# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default 
+# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. 
+# See http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS          = 
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = @top_srcdir@/libusb/libusbi.h
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the output. 
+# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, 
+# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH 
+# then you must also enable this option. If you don't then doxygen will produce 
+# a warning and turn it on anyway
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.  Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
+# documentation will contain sections that can be hidden and shown after the 
+# page has loaded. For this to work a browser that supports 
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = API_EXPORTED=
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to 
+# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to 
+# specify the directory where the mscgen tool resides. If left empty the tool is assumed to 
+# be found in the default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will 
+# generate a caller dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable caller graphs for selected 
+# functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen if the number 
+# of direct children of the root node in a graph is already larger than 
+# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note 
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that the size of a graph can be further restricted by 
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, which results in a white background. 
+# Warning: Depending on the platform used, enabling this option may lead to 
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
+# read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
diff --git a/Platform/Android/jni/External/libusb-1.0.8/examples/Makefile.am b/Platform/Android/jni/External/libusb-1.0.8/examples/Makefile.am
new file mode 100644
index 0000000..600ebd4
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/examples/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = -I$(top_srcdir)
+noinst_PROGRAMS = lsusb dpfp dpfp_threaded
+
+lsusb_SOURCES = lsusb.c
+lsusb_LDADD = ../libusb/libusb-1.0.la -lusb-1.0
+
+dpfp_SOURCES = dpfp.c
+dpfp_LDADD = ../libusb/libusb-1.0.la -lusb-1.0
+
+dpfp_threaded_SOURCES = dpfp_threaded.c
+dpfp_threaded_CFLAGS = -pthread $(AM_CFLAGS)
+dpfp_threaded_LDADD = ../libusb/libusb-1.0.la -lusb-1.0
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/examples/Makefile.in b/Platform/Android/jni/External/libusb-1.0.8/examples/Makefile.in
new file mode 100644
index 0000000..00598b1
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/examples/Makefile.in
@@ -0,0 +1,533 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = lsusb$(EXEEXT) dpfp$(EXEEXT) dpfp_threaded$(EXEEXT)
+subdir = examples
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_dpfp_OBJECTS = dpfp.$(OBJEXT)
+dpfp_OBJECTS = $(am_dpfp_OBJECTS)
+dpfp_DEPENDENCIES = ../libusb/libusb-1.0.la
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+am_dpfp_threaded_OBJECTS = dpfp_threaded-dpfp_threaded.$(OBJEXT)
+dpfp_threaded_OBJECTS = $(am_dpfp_threaded_OBJECTS)
+dpfp_threaded_DEPENDENCIES = ../libusb/libusb-1.0.la
+dpfp_threaded_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(dpfp_threaded_CFLAGS) \
+	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+am_lsusb_OBJECTS = lsusb.$(OBJEXT)
+lsusb_OBJECTS = $(am_lsusb_OBJECTS)
+lsusb_DEPENDENCIES = ../libusb/libusb-1.0.la
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(dpfp_SOURCES) $(dpfp_threaded_SOURCES) $(lsusb_SOURCES)
+DIST_SOURCES = $(dpfp_SOURCES) $(dpfp_threaded_SOURCES) \
+	$(lsusb_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_LDFLAGS = @AM_LDFLAGS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OS_DARWIN = @OS_DARWIN@
+OS_LINUX = @OS_LINUX@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+lt_age = @lt_age@
+lt_major = @lt_major@
+lt_revision = @lt_revision@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = -I$(top_srcdir)
+lsusb_SOURCES = lsusb.c
+lsusb_LDADD = ../libusb/libusb-1.0.la -lusb-1.0
+dpfp_SOURCES = dpfp.c
+dpfp_LDADD = ../libusb/libusb-1.0.la -lusb-1.0
+dpfp_threaded_SOURCES = dpfp_threaded.c
+dpfp_threaded_CFLAGS = -pthread $(AM_CFLAGS)
+dpfp_threaded_LDADD = ../libusb/libusb-1.0.la -lusb-1.0
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu examples/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+dpfp$(EXEEXT): $(dpfp_OBJECTS) $(dpfp_DEPENDENCIES) 
+	@rm -f dpfp$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(dpfp_OBJECTS) $(dpfp_LDADD) $(LIBS)
+dpfp_threaded$(EXEEXT): $(dpfp_threaded_OBJECTS) $(dpfp_threaded_DEPENDENCIES) 
+	@rm -f dpfp_threaded$(EXEEXT)
+	$(AM_V_CCLD)$(dpfp_threaded_LINK) $(dpfp_threaded_OBJECTS) $(dpfp_threaded_LDADD) $(LIBS)
+lsusb$(EXEEXT): $(lsusb_OBJECTS) $(lsusb_DEPENDENCIES) 
+	@rm -f lsusb$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(lsusb_OBJECTS) $(lsusb_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dpfp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dpfp_threaded-dpfp_threaded.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lsusb.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+dpfp_threaded-dpfp_threaded.o: dpfp_threaded.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -MT dpfp_threaded-dpfp_threaded.o -MD -MP -MF $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo -c -o dpfp_threaded-dpfp_threaded.o `test -f 'dpfp_threaded.c' || echo '$(srcdir)/'`dpfp_threaded.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo $(DEPDIR)/dpfp_threaded-dpfp_threaded.Po
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dpfp_threaded.c' object='dpfp_threaded-dpfp_threaded.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -c -o dpfp_threaded-dpfp_threaded.o `test -f 'dpfp_threaded.c' || echo '$(srcdir)/'`dpfp_threaded.c
+
+dpfp_threaded-dpfp_threaded.obj: dpfp_threaded.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -MT dpfp_threaded-dpfp_threaded.obj -MD -MP -MF $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo -c -o dpfp_threaded-dpfp_threaded.obj `if test -f 'dpfp_threaded.c'; then $(CYGPATH_W) 'dpfp_threaded.c'; else $(CYGPATH_W) '$(srcdir)/dpfp_threaded.c'; fi`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo $(DEPDIR)/dpfp_threaded-dpfp_threaded.Po
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dpfp_threaded.c' object='dpfp_threaded-dpfp_threaded.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -c -o dpfp_threaded-dpfp_threaded.obj `if test -f 'dpfp_threaded.c'; then $(CYGPATH_W) 'dpfp_threaded.c'; else $(CYGPATH_W) '$(srcdir)/dpfp_threaded.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Platform/Android/jni/External/libusb-1.0.8/examples/dpfp.c b/Platform/Android/jni/External/libusb-1.0.8/examples/dpfp.c
new file mode 100644
index 0000000..73cdd76
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/examples/dpfp.c
@@ -0,0 +1,507 @@
+/*
+ * libusb example program to manipulate U.are.U 4000B fingerprint scanner.
+ * Copyright (C) 2007 Daniel Drake <dsd at gentoo.org>
+ *
+ * Basic image capture program only, does not consider the powerup quirks or
+ * the fact that image encryption may be enabled. Not expected to work
+ * flawlessly all of the time.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <libusb/libusb.h>
+
+#define EP_INTR			(1 | LIBUSB_ENDPOINT_IN)
+#define EP_DATA			(2 | LIBUSB_ENDPOINT_IN)
+#define CTRL_IN			(LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN)
+#define CTRL_OUT		(LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT)
+#define USB_RQ			0x04
+#define INTR_LENGTH		64
+
+enum {
+	MODE_INIT = 0x00,
+	MODE_AWAIT_FINGER_ON = 0x10,
+	MODE_AWAIT_FINGER_OFF = 0x12,
+	MODE_CAPTURE = 0x20,
+	MODE_SHUT_UP = 0x30,
+	MODE_READY = 0x80,
+};
+
+static int next_state(void);
+
+enum {
+	STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON = 1,
+	STATE_AWAIT_IRQ_FINGER_DETECTED,
+	STATE_AWAIT_MODE_CHANGE_CAPTURE,
+	STATE_AWAIT_IMAGE,
+	STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF,
+	STATE_AWAIT_IRQ_FINGER_REMOVED,
+};
+
+static int state = 0;
+static struct libusb_device_handle *devh = NULL;
+static unsigned char imgbuf[0x1b340];
+static unsigned char irqbuf[INTR_LENGTH];
+static struct libusb_transfer *img_transfer = NULL;
+static struct libusb_transfer *irq_transfer = NULL;
+static int img_idx = 0;
+static int do_exit = 0;
+
+static int find_dpfp_device(void)
+{
+	devh = libusb_open_device_with_vid_pid(NULL, 0x05ba, 0x000a);
+	return devh ? 0 : -EIO;
+}
+
+static int print_f0_data(void)
+{
+	unsigned char data[0x10];
+	int r;
+	unsigned int i;
+
+	r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0xf0, 0, data,
+		sizeof(data), 0);
+	if (r < 0) {
+		fprintf(stderr, "F0 error %d\n", r);
+		return r;
+	}
+	if ((unsigned int) r < sizeof(data)) {
+		fprintf(stderr, "short read (%d)\n", r);
+		return -1;
+	}
+
+	printf("F0 data:");
+	for (i = 0; i < sizeof(data); i++)
+		printf("%02x ", data[i]);
+	printf("\n");
+	return 0;
+}
+
+static int get_hwstat(unsigned char *status)
+{
+	int r;
+
+	r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0x07, 0, status, 1, 0);
+	if (r < 0) {
+		fprintf(stderr, "read hwstat error %d\n", r);
+		return r;
+	}
+	if ((unsigned int) r < 1) {
+		fprintf(stderr, "short read (%d)\n", r);
+		return -1;
+	}
+
+	printf("hwstat reads %02x\n", *status);
+	return 0;
+}
+
+static int set_hwstat(unsigned char data)
+{
+	int r;
+
+	printf("set hwstat to %02x\n", data);
+	r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x07, 0, &data, 1, 0);
+	if (r < 0) {
+		fprintf(stderr, "set hwstat error %d\n", r);
+		return r;
+	}
+	if ((unsigned int) r < 1) {
+		fprintf(stderr, "short write (%d)", r);
+		return -1;
+	}
+
+	return 0;
+}
+
+static int set_mode(unsigned char data)
+{
+	int r;
+	printf("set mode %02x\n", data);
+
+	r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x4e, 0, &data, 1, 0);
+	if (r < 0) {
+		fprintf(stderr, "set mode error %d\n", r);
+		return r;
+	}
+	if ((unsigned int) r < 1) {
+		fprintf(stderr, "short write (%d)", r);
+		return -1;
+	}
+
+	return 0;
+}
+
+static void cb_mode_changed(struct libusb_transfer *transfer)
+{
+	if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
+		fprintf(stderr, "mode change transfer not completed!\n");
+		do_exit = 2;
+	}
+
+	printf("async cb_mode_changed length=%d actual_length=%d\n",
+		transfer->length, transfer->actual_length);
+	if (next_state() < 0)
+		do_exit = 2;
+}
+
+static int set_mode_async(unsigned char data)
+{
+	unsigned char *buf = malloc(LIBUSB_CONTROL_SETUP_SIZE + 1);
+	struct libusb_transfer *transfer;
+
+	if (!buf)
+		return -ENOMEM;
+	
+	transfer = libusb_alloc_transfer(0);
+	if (!transfer) {
+		free(buf);
+		return -ENOMEM;
+	}
+
+	printf("async set mode %02x\n", data);
+	libusb_fill_control_setup(buf, CTRL_OUT, USB_RQ, 0x4e, 0, 1);
+	buf[LIBUSB_CONTROL_SETUP_SIZE] = data;
+	libusb_fill_control_transfer(transfer, devh, buf, cb_mode_changed, NULL,
+		1000);
+
+	transfer->flags = LIBUSB_TRANSFER_SHORT_NOT_OK
+		| LIBUSB_TRANSFER_FREE_BUFFER | LIBUSB_TRANSFER_FREE_TRANSFER;
+	return libusb_submit_transfer(transfer);
+}
+
+static int do_sync_intr(unsigned char *data)
+{
+	int r;
+	int transferred;
+
+	r = libusb_interrupt_transfer(devh, EP_INTR, data, INTR_LENGTH,
+		&transferred, 1000);
+	if (r < 0) {
+		fprintf(stderr, "intr error %d\n", r);
+		return r;
+	}
+	if (transferred < INTR_LENGTH) {
+		fprintf(stderr, "short read (%d)\n", r);
+		return -1;
+	}
+
+	printf("recv interrupt %04x\n", *((uint16_t *) data));
+	return 0;
+}
+
+static int sync_intr(unsigned char type)
+{	
+	int r;
+	unsigned char data[INTR_LENGTH];
+
+	while (1) {
+		r = do_sync_intr(data);
+		if (r < 0)
+			return r;
+		if (data[0] == type)
+			return 0;
+	}
+}
+
+static int save_to_file(unsigned char *data)
+{
+	FILE *fd;
+	char filename[64];
+
+	sprintf(filename, "finger%d.pgm", img_idx++);
+	fd = fopen(filename, "w");
+	if (!fd)
+		return -1;
+
+	fputs("P5 384 289 255 ", fd);
+	fwrite(data + 64, 1, 384*289, fd);
+	fclose(fd);
+	printf("saved image to %s\n", filename);
+	return 0;
+}
+
+static int next_state(void)
+{
+	int r = 0;
+	printf("old state: %d\n", state);
+	switch (state) {
+	case STATE_AWAIT_IRQ_FINGER_REMOVED:
+		state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON;
+		r = set_mode_async(MODE_AWAIT_FINGER_ON);
+		break;
+	case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON:
+		state = STATE_AWAIT_IRQ_FINGER_DETECTED;
+		break;
+	case STATE_AWAIT_IRQ_FINGER_DETECTED:
+		state = STATE_AWAIT_MODE_CHANGE_CAPTURE;
+		r = set_mode_async(MODE_CAPTURE);
+		break;
+	case STATE_AWAIT_MODE_CHANGE_CAPTURE:
+		state = STATE_AWAIT_IMAGE;
+		break;
+	case STATE_AWAIT_IMAGE:
+		state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF;
+		r = set_mode_async(MODE_AWAIT_FINGER_OFF);
+		break;
+	case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF:
+		state = STATE_AWAIT_IRQ_FINGER_REMOVED;
+		break;
+	default:
+		printf("unrecognised state %d\n", state);
+	}
+	if (r < 0) {
+		fprintf(stderr, "error detected changing state\n");
+		return r;
+	}
+
+	printf("new state: %d\n", state);
+	return 0;
+}
+
+static void cb_irq(struct libusb_transfer *transfer)
+{
+	unsigned char irqtype = transfer->buffer[0];
+
+	if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
+		fprintf(stderr, "irq transfer status %d?\n", transfer->status);
+		do_exit = 2;
+		libusb_free_transfer(transfer);
+		irq_transfer = NULL;
+		return;
+	}
+
+	printf("IRQ callback %02x\n", irqtype);
+	switch (state) {
+	case STATE_AWAIT_IRQ_FINGER_DETECTED:
+		if (irqtype == 0x01) {
+			if (next_state() < 0) {
+				do_exit = 2;
+				return;
+			}
+		} else {
+			printf("finger-on-sensor detected in wrong state!\n");
+		}
+		break;
+	case STATE_AWAIT_IRQ_FINGER_REMOVED:
+		if (irqtype == 0x02) {
+			if (next_state() < 0) {
+				do_exit = 2;
+				return;
+			}
+		} else {
+			printf("finger-on-sensor detected in wrong state!\n");
+		}
+		break;
+	}
+	if (libusb_submit_transfer(irq_transfer) < 0)
+		do_exit = 2;
+}
+
+static void cb_img(struct libusb_transfer *transfer)
+{
+	if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
+		fprintf(stderr, "img transfer status %d?\n", transfer->status);
+		do_exit = 2;
+		libusb_free_transfer(transfer);
+		img_transfer = NULL;
+		return;
+	}
+
+	printf("Image callback\n");
+	save_to_file(imgbuf);
+	if (next_state() < 0) {
+		do_exit = 2;
+		return;
+	}
+	if (libusb_submit_transfer(img_transfer) < 0)
+		do_exit = 2;
+}
+
+static int init_capture(void)
+{
+	int r;
+
+	r = libusb_submit_transfer(irq_transfer);
+	if (r < 0)
+		return r;
+
+	r = libusb_submit_transfer(img_transfer);
+	if (r < 0) {
+		libusb_cancel_transfer(irq_transfer);
+		while (irq_transfer)
+			if (libusb_handle_events(NULL) < 0)
+				break;
+		return r;
+	}
+
+	/* start state machine */
+	state = STATE_AWAIT_IRQ_FINGER_REMOVED;
+	return next_state();
+}
+
+static int do_init(void)
+{
+	unsigned char status;
+	int r;
+
+	r = get_hwstat(&status);
+	if (r < 0)
+		return r;
+
+	if (!(status & 0x80)) {
+		r = set_hwstat(status | 0x80);
+		if (r < 0)
+			return r;
+		r = get_hwstat(&status);
+		if (r < 0)
+			return r;
+	}
+
+	status &= ~0x80;
+	r = set_hwstat(status);
+	if (r < 0)
+		return r;
+
+	r = get_hwstat(&status);
+	if (r < 0)
+		return r;
+
+	r = sync_intr(0x56);
+	if (r < 0)
+		return r;
+
+	return 0;
+}
+
+static int alloc_transfers(void)
+{
+	img_transfer = libusb_alloc_transfer(0);
+	if (!img_transfer)
+		return -ENOMEM;
+	
+	irq_transfer = libusb_alloc_transfer(0);
+	if (!irq_transfer)
+		return -ENOMEM;
+
+	libusb_fill_bulk_transfer(img_transfer, devh, EP_DATA, imgbuf,
+		sizeof(imgbuf), cb_img, NULL, 0);
+	libusb_fill_interrupt_transfer(irq_transfer, devh, EP_INTR, irqbuf,
+		sizeof(irqbuf), cb_irq, NULL, 0);
+
+	return 0;
+}
+
+static void sighandler(int signum)
+{
+	do_exit = 1;	
+}
+
+int main(void)
+{
+	struct sigaction sigact;
+	int r = 1;
+
+	r = libusb_init(NULL);
+	if (r < 0) {
+		fprintf(stderr, "failed to initialise libusb\n");
+		exit(1);
+	}
+
+	r = find_dpfp_device();
+	if (r < 0) {
+		fprintf(stderr, "Could not find/open device\n");
+		goto out;
+	}
+
+	r = libusb_claim_interface(devh, 0);
+	if (r < 0) {
+		fprintf(stderr, "usb_claim_interface error %d\n", r);
+		goto out;
+	}
+	printf("claimed interface\n");
+
+	r = print_f0_data();
+	if (r < 0)
+		goto out_release;
+
+	r = do_init();
+	if (r < 0)
+		goto out_deinit;
+
+	/* async from here onwards */
+
+	r = alloc_transfers();
+	if (r < 0)
+		goto out_deinit;
+
+	r = init_capture();
+	if (r < 0)
+		goto out_deinit;
+
+	sigact.sa_handler = sighandler;
+	sigemptyset(&sigact.sa_mask);
+	sigact.sa_flags = 0;
+	sigaction(SIGINT, &sigact, NULL);
+	sigaction(SIGTERM, &sigact, NULL);
+	sigaction(SIGQUIT, &sigact, NULL);
+
+	while (!do_exit) {
+		r = libusb_handle_events(NULL);
+		if (r < 0)
+			goto out_deinit;
+	}
+
+	printf("shutting down...\n");
+	
+	if (irq_transfer) {
+		r = libusb_cancel_transfer(irq_transfer);
+		if (r < 0)
+			goto out_deinit;
+	}
+
+	if (img_transfer) {
+		r = libusb_cancel_transfer(img_transfer);
+		if (r < 0)
+			goto out_deinit;
+	}
+	
+	while (irq_transfer || img_transfer)
+		if (libusb_handle_events(NULL) < 0)
+			break;
+	
+	if (do_exit == 1)
+		r = 0;
+	else
+		r = 1;
+
+out_deinit:
+	libusb_free_transfer(img_transfer);
+	libusb_free_transfer(irq_transfer);
+	set_mode(0);
+	set_hwstat(0x80);
+out_release:
+	libusb_release_interface(devh, 0);
+out:
+	libusb_close(devh);
+	libusb_exit(NULL);
+	return r >= 0 ? r : -r;
+}
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/examples/dpfp_threaded.c b/Platform/Android/jni/External/libusb-1.0.8/examples/dpfp_threaded.c
new file mode 100644
index 0000000..06fce97
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/examples/dpfp_threaded.c
@@ -0,0 +1,545 @@
+/*
+ * libusb example program to manipulate U.are.U 4000B fingerprint scanner.
+ * Copyright (C) 2007 Daniel Drake <dsd at gentoo.org>
+ *
+ * Basic image capture program only, does not consider the powerup quirks or
+ * the fact that image encryption may be enabled. Not expected to work
+ * flawlessly all of the time.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <libusb/libusb.h>
+
+#define EP_INTR			(1 | LIBUSB_ENDPOINT_IN)
+#define EP_DATA			(2 | LIBUSB_ENDPOINT_IN)
+#define CTRL_IN			(LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN)
+#define CTRL_OUT		(LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT)
+#define USB_RQ			0x04
+#define INTR_LENGTH		64
+
+enum {
+	MODE_INIT = 0x00,
+	MODE_AWAIT_FINGER_ON = 0x10,
+	MODE_AWAIT_FINGER_OFF = 0x12,
+	MODE_CAPTURE = 0x20,
+	MODE_SHUT_UP = 0x30,
+	MODE_READY = 0x80,
+};
+
+static int next_state(void);
+
+enum {
+	STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON = 1,
+	STATE_AWAIT_IRQ_FINGER_DETECTED,
+	STATE_AWAIT_MODE_CHANGE_CAPTURE,
+	STATE_AWAIT_IMAGE,
+	STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF,
+	STATE_AWAIT_IRQ_FINGER_REMOVED,
+};
+
+static int state = 0;
+static struct libusb_device_handle *devh = NULL;
+static unsigned char imgbuf[0x1b340];
+static unsigned char irqbuf[INTR_LENGTH];
+static struct libusb_transfer *img_transfer = NULL;
+static struct libusb_transfer *irq_transfer = NULL;
+static int img_idx = 0;
+static int do_exit = 0;
+
+static pthread_t poll_thread;
+static pthread_cond_t exit_cond = PTHREAD_COND_INITIALIZER;
+static pthread_mutex_t exit_cond_lock = PTHREAD_MUTEX_INITIALIZER;
+
+static void request_exit(int code)
+{
+	do_exit = code;
+	pthread_cond_signal(&exit_cond);
+}
+
+static void *poll_thread_main(void *arg)
+{
+	int r = 0;
+	printf("poll thread running\n");
+
+	while (!do_exit) {
+		struct timeval tv = { 1, 0 };
+		r = libusb_handle_events_timeout(NULL, &tv);
+		if (r < 0) {
+			request_exit(2);
+			break;
+		}
+	}
+
+	printf("poll thread shutting down\n");
+	pthread_exit(NULL);
+}
+
+static int find_dpfp_device(void)
+{
+	devh = libusb_open_device_with_vid_pid(NULL, 0x05ba, 0x000a);
+	return devh ? 0 : -EIO;
+}
+
+static int print_f0_data(void)
+{
+	unsigned char data[0x10];
+	int r;
+	unsigned int i;
+
+	r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0xf0, 0, data,
+		sizeof(data), 0);
+	if (r < 0) {
+		fprintf(stderr, "F0 error %d\n", r);
+		return r;
+	}
+	if ((unsigned int) r < sizeof(data)) {
+		fprintf(stderr, "short read (%d)\n", r);
+		return -1;
+	}
+
+	printf("F0 data:");
+	for (i = 0; i < sizeof(data); i++)
+		printf("%02x ", data[i]);
+	printf("\n");
+	return 0;
+}
+
+static int get_hwstat(unsigned char *status)
+{
+	int r;
+
+	r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0x07, 0, status, 1, 0);
+	if (r < 0) {
+		fprintf(stderr, "read hwstat error %d\n", r);
+		return r;
+	}
+	if ((unsigned int) r < 1) {
+		fprintf(stderr, "short read (%d)\n", r);
+		return -1;
+	}
+
+	printf("hwstat reads %02x\n", *status);
+	return 0;
+}
+
+static int set_hwstat(unsigned char data)
+{
+	int r;
+
+	printf("set hwstat to %02x\n", data);
+	r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x07, 0, &data, 1, 0);
+	if (r < 0) {
+		fprintf(stderr, "set hwstat error %d\n", r);
+		return r;
+	}
+	if ((unsigned int) r < 1) {
+		fprintf(stderr, "short write (%d)", r);
+		return -1;
+	}
+
+	return 0;
+}
+
+static int set_mode(unsigned char data)
+{
+	int r;
+	printf("set mode %02x\n", data);
+
+	r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x4e, 0, &data, 1, 0);
+	if (r < 0) {
+		fprintf(stderr, "set mode error %d\n", r);
+		return r;
+	}
+	if ((unsigned int) r < 1) {
+		fprintf(stderr, "short write (%d)", r);
+		return -1;
+	}
+
+	return 0;
+}
+
+static void cb_mode_changed(struct libusb_transfer *transfer)
+{
+	if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
+		fprintf(stderr, "mode change transfer not completed!\n");
+		request_exit(2);
+	}
+
+	printf("async cb_mode_changed length=%d actual_length=%d\n",
+		transfer->length, transfer->actual_length);
+	if (next_state() < 0)
+		request_exit(2);
+}
+
+static int set_mode_async(unsigned char data)
+{
+	unsigned char *buf = malloc(LIBUSB_CONTROL_SETUP_SIZE + 1);
+	struct libusb_transfer *transfer;
+
+	if (!buf)
+		return -ENOMEM;
+	
+	transfer = libusb_alloc_transfer(0);
+	if (!transfer) {
+		free(buf);
+		return -ENOMEM;
+	}
+
+	printf("async set mode %02x\n", data);
+	libusb_fill_control_setup(buf, CTRL_OUT, USB_RQ, 0x4e, 0, 1);
+	buf[LIBUSB_CONTROL_SETUP_SIZE] = data;
+	libusb_fill_control_transfer(transfer, devh, buf, cb_mode_changed, NULL,
+		1000);
+
+	transfer->flags = LIBUSB_TRANSFER_SHORT_NOT_OK
+		| LIBUSB_TRANSFER_FREE_BUFFER | LIBUSB_TRANSFER_FREE_TRANSFER;
+	return libusb_submit_transfer(transfer);
+}
+
+static int do_sync_intr(unsigned char *data)
+{
+	int r;
+	int transferred;
+
+	r = libusb_interrupt_transfer(devh, EP_INTR, data, INTR_LENGTH,
+		&transferred, 1000);
+	if (r < 0) {
+		fprintf(stderr, "intr error %d\n", r);
+		return r;
+	}
+	if (transferred < INTR_LENGTH) {
+		fprintf(stderr, "short read (%d)\n", r);
+		return -1;
+	}
+
+	printf("recv interrupt %04x\n", *((uint16_t *) data));
+	return 0;
+}
+
+static int sync_intr(unsigned char type)
+{	
+	int r;
+	unsigned char data[INTR_LENGTH];
+
+	while (1) {
+		r = do_sync_intr(data);
+		if (r < 0)
+			return r;
+		if (data[0] == type)
+			return 0;
+	}
+}
+
+static int save_to_file(unsigned char *data)
+{
+	FILE *fd;
+	char filename[64];
+
+	sprintf(filename, "finger%d.pgm", img_idx++);
+	fd = fopen(filename, "w");
+	if (!fd)
+		return -1;
+
+	fputs("P5 384 289 255 ", fd);
+	fwrite(data + 64, 1, 384*289, fd);
+	fclose(fd);
+	printf("saved image to %s\n", filename);
+	return 0;
+}
+
+static int next_state(void)
+{
+	int r = 0;
+	printf("old state: %d\n", state);
+	switch (state) {
+	case STATE_AWAIT_IRQ_FINGER_REMOVED:
+		state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON;
+		r = set_mode_async(MODE_AWAIT_FINGER_ON);
+		break;
+	case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON:
+		state = STATE_AWAIT_IRQ_FINGER_DETECTED;
+		break;
+	case STATE_AWAIT_IRQ_FINGER_DETECTED:
+		state = STATE_AWAIT_MODE_CHANGE_CAPTURE;
+		r = set_mode_async(MODE_CAPTURE);
+		break;
+	case STATE_AWAIT_MODE_CHANGE_CAPTURE:
+		state = STATE_AWAIT_IMAGE;
+		break;
+	case STATE_AWAIT_IMAGE:
+		state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF;
+		r = set_mode_async(MODE_AWAIT_FINGER_OFF);
+		break;
+	case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF:
+		state = STATE_AWAIT_IRQ_FINGER_REMOVED;
+		break;
+	default:
+		printf("unrecognised state %d\n", state);
+	}
+	if (r < 0) {
+		fprintf(stderr, "error detected changing state\n");
+		return r;
+	}
+
+	printf("new state: %d\n", state);
+	return 0;
+}
+
+static void cb_irq(struct libusb_transfer *transfer)
+{
+	unsigned char irqtype = transfer->buffer[0];
+
+	if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
+		fprintf(stderr, "irq transfer status %d?\n", transfer->status);
+		irq_transfer = NULL;
+		request_exit(2);
+		return;
+	}
+
+	printf("IRQ callback %02x\n", irqtype);
+	switch (state) {
+	case STATE_AWAIT_IRQ_FINGER_DETECTED:
+		if (irqtype == 0x01) {
+			if (next_state() < 0) {
+				request_exit(2);
+				return;
+			}
+		} else {
+			printf("finger-on-sensor detected in wrong state!\n");
+		}
+		break;
+	case STATE_AWAIT_IRQ_FINGER_REMOVED:
+		if (irqtype == 0x02) {
+			if (next_state() < 0) {
+				request_exit(2);
+				return;
+			}
+		} else {
+			printf("finger-on-sensor detected in wrong state!\n");
+		}
+		break;
+	}
+	if (libusb_submit_transfer(irq_transfer) < 0)
+		request_exit(2);
+}
+
+static void cb_img(struct libusb_transfer *transfer)
+{
+	if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
+		fprintf(stderr, "img transfer status %d?\n", transfer->status);
+		img_transfer = NULL;
+		request_exit(2);
+		return;
+	}
+
+	printf("Image callback\n");
+	save_to_file(imgbuf);
+	if (next_state() < 0) {
+		request_exit(2);
+		return;
+	}
+	if (libusb_submit_transfer(img_transfer) < 0)
+		request_exit(2);
+}
+
+static int init_capture(void)
+{
+	int r;
+
+	r = libusb_submit_transfer(irq_transfer);
+	if (r < 0)
+		return r;
+
+	r = libusb_submit_transfer(img_transfer);
+	if (r < 0) {
+		libusb_cancel_transfer(irq_transfer);
+		while (irq_transfer)
+			if (libusb_handle_events(NULL) < 0)
+				break;
+		return r;
+	}
+
+	/* start state machine */
+	state = STATE_AWAIT_IRQ_FINGER_REMOVED;
+	return next_state();
+}
+
+static int do_init(void)
+{
+	unsigned char status;
+	int r;
+
+	r = get_hwstat(&status);
+	if (r < 0)
+		return r;
+
+	if (!(status & 0x80)) {
+		r = set_hwstat(status | 0x80);
+		if (r < 0)
+			return r;
+		r = get_hwstat(&status);
+		if (r < 0)
+			return r;
+	}
+
+	status &= ~0x80;
+	r = set_hwstat(status);
+	if (r < 0)
+		return r;
+
+	r = get_hwstat(&status);
+	if (r < 0)
+		return r;
+
+	r = sync_intr(0x56);
+	if (r < 0)
+		return r;
+
+	return 0;
+}
+
+static int alloc_transfers(void)
+{
+	img_transfer = libusb_alloc_transfer(0);
+	if (!img_transfer)
+		return -ENOMEM;
+	
+	irq_transfer = libusb_alloc_transfer(0);
+	if (!irq_transfer)
+		return -ENOMEM;
+
+	libusb_fill_bulk_transfer(img_transfer, devh, EP_DATA, imgbuf,
+		sizeof(imgbuf), cb_img, NULL, 0);
+	libusb_fill_interrupt_transfer(irq_transfer, devh, EP_INTR, irqbuf,
+		sizeof(irqbuf), cb_irq, NULL, 0);
+
+	return 0;
+}
+
+static void sighandler(int signum)
+{
+	request_exit(1);
+}
+
+int main(void)
+{
+	struct sigaction sigact;
+	int r = 1;
+
+	r = libusb_init(NULL);
+	if (r < 0) {
+		fprintf(stderr, "failed to initialise libusb\n");
+		exit(1);
+	}
+
+	r = find_dpfp_device();
+	if (r < 0) {
+		fprintf(stderr, "Could not find/open device\n");
+		goto out;
+	}
+
+	r = libusb_claim_interface(devh, 0);
+	if (r < 0) {
+		fprintf(stderr, "usb_claim_interface error %d %s\n", r, strerror(-r));
+		goto out;
+	}
+	printf("claimed interface\n");
+
+	r = print_f0_data();
+	if (r < 0)
+		goto out_release;
+
+	r = do_init();
+	if (r < 0)
+		goto out_deinit;
+
+	/* async from here onwards */
+
+	sigact.sa_handler = sighandler;
+	sigemptyset(&sigact.sa_mask);
+	sigact.sa_flags = 0;
+	sigaction(SIGINT, &sigact, NULL);
+	sigaction(SIGTERM, &sigact, NULL);
+	sigaction(SIGQUIT, &sigact, NULL);
+
+	r = pthread_create(&poll_thread, NULL, poll_thread_main, NULL);
+	if (r)
+		goto out_deinit;
+
+	r = alloc_transfers();
+	if (r < 0) {
+		request_exit(1);
+		pthread_join(poll_thread, NULL);
+		goto out_deinit;
+	}
+
+	r = init_capture();
+	if (r < 0) {
+		request_exit(1);
+		pthread_join(poll_thread, NULL);
+		goto out_deinit;
+	}
+
+	while (!do_exit) {
+		pthread_mutex_lock(&exit_cond_lock);
+		pthread_cond_wait(&exit_cond, &exit_cond_lock);
+		pthread_mutex_unlock(&exit_cond_lock);
+	}
+
+	printf("shutting down...\n");
+	pthread_join(poll_thread, NULL);
+
+	r = libusb_cancel_transfer(irq_transfer);
+	if (r < 0) {
+		request_exit(1);
+		goto out_deinit;
+	}
+
+	r = libusb_cancel_transfer(img_transfer);
+	if (r < 0) {
+		request_exit(1);
+		goto out_deinit;
+	}
+
+	while (img_transfer || irq_transfer)
+		if (libusb_handle_events(NULL) < 0)
+			break;
+
+	if (do_exit == 1)
+		r = 0;
+	else
+		r = 1;
+
+out_deinit:
+	libusb_free_transfer(img_transfer);
+	libusb_free_transfer(irq_transfer);
+	set_mode(0);
+	set_hwstat(0x80);
+out_release:
+	libusb_release_interface(devh, 0);
+out:
+	libusb_close(devh);
+	libusb_exit(NULL);
+	return r >= 0 ? r : -r;
+}
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/examples/lsusb.c b/Platform/Android/jni/External/libusb-1.0.8/examples/lsusb.c
new file mode 100644
index 0000000..7d06423
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/examples/lsusb.c
@@ -0,0 +1,64 @@
+/*
+ * libusb example program to list devices on the bus
+ * Copyright (C) 2007 Daniel Drake <dsd at gentoo.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#include <libusb/libusb.h>
+
+static void print_devs(libusb_device **devs)
+{
+	libusb_device *dev;
+	int i = 0;
+
+	while ((dev = devs[i++]) != NULL) {
+		struct libusb_device_descriptor desc;
+		int r = libusb_get_device_descriptor(dev, &desc);
+		if (r < 0) {
+			fprintf(stderr, "failed to get device descriptor");
+			return;
+		}
+
+		printf("%04x:%04x (bus %d, device %d)\n",
+			desc.idVendor, desc.idProduct,
+			libusb_get_bus_number(dev), libusb_get_device_address(dev));
+	}
+}
+
+int main(void)
+{
+	libusb_device **devs;
+	int r;
+	ssize_t cnt;
+
+	r = libusb_init(NULL);
+	if (r < 0)
+		return r;
+
+	cnt = libusb_get_device_list(NULL, &devs);
+	if (cnt < 0)
+		return (int) cnt;
+
+	print_devs(devs);
+	libusb_free_device_list(devs, 1);
+
+	libusb_exit(NULL);
+	return 0;
+}
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/install-sh b/Platform/Android/jni/External/libusb-1.0.8/install-sh
new file mode 100644
index 0000000..4fbbae7
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/install-sh
@@ -0,0 +1,507 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2006-10-14.15
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+posix_glob=
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chmodcmd=$chmodprog
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c         (ignored)
+-d         create directories instead of installing files.
+-g GROUP   $chgrpprog installed files to GROUP.
+-m MODE    $chmodprog installed files to MODE.
+-o USER    $chownprog installed files to USER.
+-s         $stripprog installed files.
+-t DIRECTORY  install into DIRECTORY.
+-T         report an error if DSTFILE is a directory.
+--help     display this help and exit.
+--version  display version info and exit.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) shift
+        continue;;
+
+    -d) dir_arg=true
+        shift
+        continue;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift
+        shift
+        continue;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+        shift
+        shift
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+        continue;;
+
+    -o) chowncmd="$chownprog $2"
+        shift
+        shift
+        continue;;
+
+    -s) stripcmd=$stripprog
+        shift
+        continue;;
+
+    -t) dstarg=$2
+	shift
+	shift
+	continue;;
+
+    -T) no_target_directory=true
+	shift
+	continue;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)	shift
+	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
+  esac
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dstarg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dstarg"
+      shift # fnord
+    fi
+    shift # arg
+    dstarg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src ;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dstarg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dstarg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst ;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dstarg: Is a directory" >&2
+	exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writeable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+	/*) prefix=/ ;;
+	-*) prefix=./ ;;
+	*)  prefix= ;;
+      esac
+
+      case $posix_glob in
+        '')
+	  if (set -f) 2>/dev/null; then
+	    posix_glob=true
+	  else
+	    posix_glob=false
+	  fi ;;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob && set -f
+      set fnord $dstdir
+      shift
+      $posix_glob && set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test -z "$d" && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+      || {
+	   # The rename failed, perhaps because mv can't rename something else
+	   # to itself, or perhaps because mv is so ancient that it does not
+	   # support -f.
+
+	   # Now remove or move aside any old file at destination location.
+	   # We try this two ways since rm can't unlink itself on some
+	   # systems and the destination file might be busy for other
+	   # reasons.  In this case, the final cleanup might fail but the new
+	   # file should still install successfully.
+	   {
+	     if test -f "$dst"; then
+	       $doit $rmcmd -f "$dst" 2>/dev/null \
+	       || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
+		     && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+	       || {
+		 echo "$0: cannot unlink or rename $dst" >&2
+		 (exit 1); exit 1
+	       }
+	     else
+	       :
+	     fi
+	   } &&
+
+	   # Now rename the file to the real destination.
+	   $doit $mvcmd "$dsttmp" "$dst"
+	 }
+    } || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb-1.0.pc.in b/Platform/Android/jni/External/libusb-1.0.8/libusb-1.0.pc.in
new file mode 100644
index 0000000..dd6bde0
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb-1.0.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libusb-1.0
+Description: C API for USB device access from Linux userspace
+Version: @VERSION@
+Libs: -L${libdir} -lusb-1.0
+Cflags: -I${includedir}/libusb-1.0
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/Makefile.am b/Platform/Android/jni/External/libusb-1.0.8/libusb/Makefile.am
new file mode 100644
index 0000000..a2be46c
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/Makefile.am
@@ -0,0 +1,21 @@
+lib_LTLIBRARIES = libusb-1.0.la
+
+LINUX_USBFS_SRC = os/linux_usbfs.h os/linux_usbfs.c
+DARWIN_USB_SRC = os/darwin_usb.h os/darwin_usb.c
+
+EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC)
+
+if OS_LINUX
+OS_SRC = $(LINUX_USBFS_SRC)
+endif
+
+if OS_DARWIN
+OS_SRC = $(DARWIN_USB_SRC)
+AM_CFLAGS_EXT = -no-cpp-precomp
+endif
+
+libusb_1_0_la_CFLAGS = $(VISIBILITY_CFLAGS) $(AM_CFLAGS) -pthread
+libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c sync.c $(OS_SRC)
+
+hdrdir = $(includedir)/libusb-1.0
+hdr_HEADERS = libusb.h
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/Makefile.in b/Platform/Android/jni/External/libusb-1.0.8/libusb/Makefile.in
new file mode 100644
index 0000000..34c14b3
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/Makefile.in
@@ -0,0 +1,637 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = libusb
+DIST_COMMON = $(hdr_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(hdrdir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libusb_1_0_la_LIBADD =
+am__libusb_1_0_la_SOURCES_DIST = libusbi.h core.c descriptor.c io.c \
+	sync.c os/darwin_usb.h os/darwin_usb.c os/linux_usbfs.h \
+	os/linux_usbfs.c
+am__objects_1 = libusb_1_0_la-darwin_usb.lo
+am__objects_2 = libusb_1_0_la-linux_usbfs.lo
+ at OS_DARWIN_FALSE@@OS_LINUX_TRUE at am__objects_3 = $(am__objects_2)
+ at OS_DARWIN_TRUE@am__objects_3 = $(am__objects_1)
+am_libusb_1_0_la_OBJECTS = libusb_1_0_la-core.lo \
+	libusb_1_0_la-descriptor.lo libusb_1_0_la-io.lo \
+	libusb_1_0_la-sync.lo $(am__objects_3)
+libusb_1_0_la_OBJECTS = $(am_libusb_1_0_la_OBJECTS)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+libusb_1_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libusb_1_0_la_CFLAGS) \
+	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(libusb_1_0_la_SOURCES)
+DIST_SOURCES = $(am__libusb_1_0_la_SOURCES_DIST)
+HEADERS = $(hdr_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_LDFLAGS = @AM_LDFLAGS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OS_DARWIN = @OS_DARWIN@
+OS_LINUX = @OS_LINUX@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+lt_age = @lt_age@
+lt_major = @lt_major@
+lt_revision = @lt_revision@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+lib_LTLIBRARIES = libusb-1.0.la
+LINUX_USBFS_SRC = os/linux_usbfs.h os/linux_usbfs.c
+DARWIN_USB_SRC = os/darwin_usb.h os/darwin_usb.c
+EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC)
+ at OS_DARWIN_TRUE@OS_SRC = $(DARWIN_USB_SRC)
+ at OS_LINUX_TRUE@OS_SRC = $(LINUX_USBFS_SRC)
+ at OS_DARWIN_TRUE@AM_CFLAGS_EXT = -no-cpp-precomp
+libusb_1_0_la_CFLAGS = $(VISIBILITY_CFLAGS) $(AM_CFLAGS) -pthread
+libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c sync.c $(OS_SRC)
+hdrdir = $(includedir)/libusb-1.0
+hdr_HEADERS = libusb.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libusb/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu libusb/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libusb-1.0.la: $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libusb_1_0_la_LINK) -rpath $(libdir) $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libusb_1_0_la-core.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libusb_1_0_la-darwin_usb.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libusb_1_0_la-descriptor.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libusb_1_0_la-io.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libusb_1_0_la-sync.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+libusb_1_0_la-core.lo: core.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-core.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-core.Tpo -c -o libusb_1_0_la-core.lo `test -f 'core.c' || echo '$(srcdir)/'`core.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-core.Tpo $(DEPDIR)/libusb_1_0_la-core.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='core.c' object='libusb_1_0_la-core.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-core.lo `test -f 'core.c' || echo '$(srcdir)/'`core.c
+
+libusb_1_0_la-descriptor.lo: descriptor.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-descriptor.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-descriptor.Tpo -c -o libusb_1_0_la-descriptor.lo `test -f 'descriptor.c' || echo '$(srcdir)/'`descriptor.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-descriptor.Tpo $(DEPDIR)/libusb_1_0_la-descriptor.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='descriptor.c' object='libusb_1_0_la-descriptor.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-descriptor.lo `test -f 'descriptor.c' || echo '$(srcdir)/'`descriptor.c
+
+libusb_1_0_la-io.lo: io.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-io.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-io.Tpo -c -o libusb_1_0_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-io.Tpo $(DEPDIR)/libusb_1_0_la-io.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='io.c' object='libusb_1_0_la-io.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c
+
+libusb_1_0_la-sync.lo: sync.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-sync.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-sync.Tpo -c -o libusb_1_0_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-sync.Tpo $(DEPDIR)/libusb_1_0_la-sync.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='sync.c' object='libusb_1_0_la-sync.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c
+
+libusb_1_0_la-darwin_usb.lo: os/darwin_usb.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-darwin_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo $(DEPDIR)/libusb_1_0_la-darwin_usb.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='os/darwin_usb.c' object='libusb_1_0_la-darwin_usb.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c
+
+libusb_1_0_la-linux_usbfs.lo: os/linux_usbfs.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_usbfs.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo -c -o libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo $(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='os/linux_usbfs.c' object='libusb_1_0_la-linux_usbfs.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-hdrHEADERS: $(hdr_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(hdrdir)" || $(MKDIR_P) "$(DESTDIR)$(hdrdir)"
+	@list='$(hdr_HEADERS)'; test -n "$(hdrdir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(hdrdir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(hdrdir)" || exit $$?; \
+	done
+
+uninstall-hdrHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(hdr_HEADERS)'; test -n "$(hdrdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(hdrdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(hdrdir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(hdrdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-hdrHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-hdrHEADERS uninstall-libLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-hdrHEADERS \
+	install-html install-html-am install-info install-info-am \
+	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-hdrHEADERS \
+	uninstall-libLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/config.h b/Platform/Android/jni/External/libusb-1.0.8/libusb/config.h
new file mode 100644
index 0000000..05a6c1f
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/config.h
@@ -0,0 +1,5 @@
+#define OS_LINUX
+#define ENABLE_LOGGING 
+#define API_EXPORTED
+
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/core.c b/Platform/Android/jni/External/libusb-1.0.8/libusb/core.c
new file mode 100644
index 0000000..ed320f3
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/core.c
@@ -0,0 +1,1583 @@
+/*
+ * Core functions for libusb
+ * Copyright (C) 2007-2008 Daniel Drake <dsd at gentoo.org>
+ * Copyright (c) 2001 Johannes Erdfelt <johannes at erdfelt.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+
+#include <errno.h>
+#include <poll.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "libusb.h"
+#include "libusbi.h"
+
+#if defined(OS_LINUX)
+const struct usbi_os_backend * const usbi_backend = &linux_usbfs_backend;
+#elif defined(OS_DARWIN)
+const struct usbi_os_backend * const usbi_backend = &darwin_backend;
+#else
+#error "Unsupported OS"
+#endif
+
+struct libusb_context *usbi_default_context = NULL;
+static pthread_mutex_t default_context_lock = PTHREAD_MUTEX_INITIALIZER;
+
+/**
+ * \mainpage libusb-1.0 API Reference
+ *
+ * \section intro Introduction
+ *
+ * libusb is an open source library that allows you to communicate with USB
+ * devices from userspace. For more info, see the
+ * <a href="http://libusb.sourceforge.net">libusb homepage</a>.
+ *
+ * This documentation is aimed at application developers wishing to
+ * communicate with USB peripherals from their own software. After reviewing
+ * this documentation, feedback and questions can be sent to the
+ * <a href="http://sourceforge.net/mail/?group_id=1674">libusb-devel mailing
+ * list</a>.
+ *
+ * This documentation assumes knowledge of how to operate USB devices from
+ * a software standpoint (descriptors, configurations, interfaces, endpoints,
+ * control/bulk/interrupt/isochronous transfers, etc). Full information
+ * can be found in the <a href="http://www.usb.org/developers/docs/">USB 2.0
+ * Specification</a> which is available for free download. You can probably
+ * find less verbose introductions by searching the web.
+ *
+ * \section features Library features
+ *
+ * - All transfer types supported (control/bulk/interrupt/isochronous)
+ * - 2 transfer interfaces:
+ *    -# Synchronous (simple)
+ *    -# Asynchronous (more complicated, but more powerful)
+ * - Thread safe (although the asynchronous interface means that you
+ *   usually won't need to thread)
+ * - Lightweight with lean API
+ * - Compatible with libusb-0.1 through the libusb-compat-0.1 translation layer
+ *
+ * \section gettingstarted Getting Started
+ *
+ * To begin reading the API documentation, start with the Modules page which
+ * links to the different categories of libusb's functionality.
+ *
+ * One decision you will have to make is whether to use the synchronous
+ * or the asynchronous data transfer interface. The \ref io documentation
+ * provides some insight into this topic.
+ *
+ * Some example programs can be found in the libusb source distribution under
+ * the "examples" subdirectory. The libusb homepage includes a list of
+ * real-life project examples which use libusb.
+ *
+ * \section errorhandling Error handling
+ *
+ * libusb functions typically return 0 on success or a negative error code
+ * on failure. These negative error codes relate to LIBUSB_ERROR constants
+ * which are listed on the \ref misc "miscellaneous" documentation page.
+ *
+ * \section msglog Debug message logging
+ *
+ * libusb does not log any messages by default. Your application is therefore
+ * free to close stdout/stderr and those descriptors may be reused without
+ * worry.
+ *
+ * The libusb_set_debug() function can be used to enable stdout/stderr logging
+ * of certain messages. Under standard configuration, libusb doesn't really
+ * log much at all, so you are advised to use this function to enable all
+ * error/warning/informational messages. It will help you debug problems with
+ * your software.
+ *
+ * The logged messages are unstructured. There is no one-to-one correspondence
+ * between messages being logged and success or failure return codes from
+ * libusb functions. There is no format to the messages, so you should not
+ * try to capture or parse them. They are not and will not be localized.
+ * These messages are not suitable for being passed to your application user;
+ * instead, you should interpret the error codes returned from libusb functions
+ * and provide appropriate notification to the user. The messages are simply
+ * there to aid you as a programmer, and if you're confused because you're
+ * getting a strange error code from a libusb function, enabling message
+ * logging may give you a suitable explanation.
+ *
+ * The LIBUSB_DEBUG environment variable can be used to enable message logging
+ * at run-time. This environment variable should be set to a number, which is
+ * interpreted the same as the libusb_set_debug() parameter. When this
+ * environment variable is set, the message logging verbosity level is fixed
+ * and libusb_set_debug() effectively does nothing.
+ *
+ * libusb can be compiled without any logging functions, useful for embedded
+ * systems. In this case, libusb_set_debug() and the LIBUSB_DEBUG environment
+ * variable have no effects.
+ *
+ * libusb can also be compiled with verbose debugging messages. When the
+ * library is compiled in this way, all messages of all verbosities are always
+ * logged.  libusb_set_debug() and the LIBUSB_DEBUG environment variable have
+ * no effects.
+ *
+ * \section remarks Other remarks
+ *
+ * libusb does have imperfections. The \ref caveats "caveats" page attempts
+ * to document these.
+ */
+
+/**
+ * \page caveats Caveats
+ *
+ * \section devresets Device resets
+ *
+ * The libusb_reset_device() function allows you to reset a device. If your
+ * program has to call such a function, it should obviously be aware that
+ * the reset will cause device state to change (e.g. register values may be
+ * reset).
+ *
+ * The problem is that any other program could reset the device your program
+ * is working with, at any time. libusb does not offer a mechanism to inform
+ * you when this has happened, so if someone else resets your device it will
+ * not be clear to your own program why the device state has changed.
+ *
+ * Ultimately, this is a limitation of writing drivers in userspace.
+ * Separation from the USB stack in the underlying kernel makes it difficult
+ * for the operating system to deliver such notifications to your program.
+ * The Linux kernel USB stack allows such reset notifications to be delivered
+ * to in-kernel USB drivers, but it is not clear how such notifications could
+ * be delivered to second-class drivers that live in userspace.
+ *
+ * \section blockonly Blocking-only functionality
+ *
+ * The functionality listed below is only available through synchronous,
+ * blocking functions. There are no asynchronous/non-blocking alternatives,
+ * and no clear ways of implementing these.
+ *
+ * - Configuration activation (libusb_set_configuration())
+ * - Interface/alternate setting activation (libusb_set_interface_alt_setting())
+ * - Releasing of interfaces (libusb_release_interface())
+ * - Clearing of halt/stall condition (libusb_clear_halt())
+ * - Device resets (libusb_reset_device())
+ *
+ * \section nohotplug No hotplugging
+ *
+ * libusb-1.0 lacks functionality for providing notifications of when devices
+ * are added or removed. This functionality is planned to be implemented
+ * for libusb-1.1.
+ *
+ * That said, there is basic disconnection handling for open device handles:
+ *  - If there are ongoing transfers, libusb's handle_events loop will detect
+ *    disconnections and complete ongoing transfers with the
+ *    LIBUSB_TRANSFER_NO_DEVICE status code.
+ *  - Many functions such as libusb_set_configuration() return the special
+ *    LIBUSB_ERROR_NO_DEVICE error code when the device has been disconnected.
+ *
+ * \section configsel Configuration selection and handling
+ *
+ * When libusb presents a device handle to an application, there is a chance
+ * that the corresponding device may be in unconfigured state. For devices
+ * with multiple configurations, there is also a chance that the configuration
+ * currently selected is not the one that the application wants to use.
+ *
+ * The obvious solution is to add a call to libusb_set_configuration() early
+ * on during your device initialization routines, but there are caveats to
+ * be aware of:
+ * -# If the device is already in the desired configuration, calling
+ *    libusb_set_configuration() using the same configuration value will cause
+ *    a lightweight device reset. This may not be desirable behaviour.
+ * -# libusb will be unable to change configuration if the device is in
+ *    another configuration and other programs or drivers have claimed
+ *    interfaces under that configuration.
+ * -# In the case where the desired configuration is already active, libusb
+ *    may not even be able to perform a lightweight device reset. For example,
+ *    take my USB keyboard with fingerprint reader: I'm interested in driving
+ *    the fingerprint reader interface through libusb, but the kernel's
+ *    USB-HID driver will almost always have claimed the keyboard interface.
+ *    Because the kernel has claimed an interface, it is not even possible to
+ *    perform the lightweight device reset, so libusb_set_configuration() will
+ *    fail. (Luckily the device in question only has a single configuration.)
+ *
+ * One solution to some of the above problems is to consider the currently
+ * active configuration. If the configuration we want is already active, then
+ * we don't have to select any configuration:
+\code
+cfg = libusb_get_configuration(dev);
+if (cfg != desired)
+	libusb_set_configuration(dev, desired);
+\endcode
+ *
+ * This is probably suitable for most scenarios, but is inherently racy:
+ * another application or driver may change the selected configuration
+ * <em>after</em> the libusb_get_configuration() call.
+ *
+ * Even in cases where libusb_set_configuration() succeeds, consider that other
+ * applications or drivers may change configuration after your application
+ * calls libusb_set_configuration().
+ *
+ * One possible way to lock your device into a specific configuration is as
+ * follows:
+ * -# Set the desired configuration (or use the logic above to realise that
+ *    it is already in the desired configuration)
+ * -# Claim the interface that you wish to use
+ * -# Check that the currently active configuration is the one that you want
+ *    to use.
+ *
+ * The above method works because once an interface is claimed, no application
+ * or driver is able to select another configuration.
+ *
+ * \section earlycomp Early transfer completion
+ *
+ * NOTE: This section is currently Linux-centric. I am not sure if any of these
+ * considerations apply to Darwin or other platforms.
+ *
+ * When a transfer completes early (i.e. when less data is received/sent in
+ * any one packet than the transfer buffer allows for) then libusb is designed
+ * to terminate the transfer immediately, not transferring or receiving any
+ * more data unless other transfers have been queued by the user.
+ *
+ * On legacy platforms, libusb is unable to do this in all situations. After
+ * the incomplete packet occurs, "surplus" data may be transferred. Prior to
+ * libusb v1.0.2, this information was lost (and for device-to-host transfers,
+ * the corresponding data was discarded). As of libusb v1.0.3, this information
+ * is kept (the data length of the transfer is updated) and, for device-to-host
+ * transfesr, any surplus data was added to the buffer. Still, this is not
+ * a nice solution because it loses the information about the end of the short
+ * packet, and the user probably wanted that surplus data to arrive in the next
+ * logical transfer.
+ *
+ * A previous workaround was to only ever submit transfers of size 16kb or
+ * less.
+ *
+ * As of libusb v1.0.4 and Linux v2.6.32, this is fixed. A technical
+ * explanation of this issue follows.
+ *
+ * When you ask libusb to submit a bulk transfer larger than 16kb in size,
+ * libusb breaks it up into a number of smaller subtransfers. This is because
+ * the usbfs kernel interface only accepts transfers of up to 16kb in size.
+ * The subtransfers are submitted all at once so that the kernel can queue
+ * them at the hardware level, therefore maximizing bus throughput.
+ *
+ * On legacy platforms, this caused problems when transfers completed early
+ * Upon this event, the kernel would terminate all further packets in that
+ * subtransfer (but not any following ones). libusb would note this event and
+ * immediately cancel any following subtransfers that had been queued,
+ * but often libusb was not fast enough, and the following subtransfers had
+ * started before libusb got around to cancelling them.
+ *
+ * Thanks to an API extension to usbfs, this is fixed with recent kernel and
+ * libusb releases. The solution was to allow libusb to communicate to the
+ * kernel where boundaries occur between logical libusb-level transfers. When
+ * a short transfer (or other error) occurs, the kernel will cancel all the
+ * subtransfers until the boundary without allowing those transfers to start.
+ */
+
+/**
+ * \page contexts Contexts
+ *
+ * It is possible that libusb may be used simultaneously from two independent
+ * libraries linked into the same executable. For example, if your application
+ * has a plugin-like system which allows the user to dynamically load a range
+ * of modules into your program, it is feasible that two independently
+ * developed modules may both use libusb.
+ *
+ * libusb is written to allow for these multiple user scenarios. The two
+ * "instances" of libusb will not interfere: libusb_set_debug() calls
+ * from one user will not affect the same settings for other users, other
+ * users can continue using libusb after one of them calls libusb_exit(), etc.
+ *
+ * This is made possible through libusb's <em>context</em> concept. When you
+ * call libusb_init(), you are (optionally) given a context. You can then pass
+ * this context pointer back into future libusb functions.
+ *
+ * In order to keep things simple for more simplistic applications, it is
+ * legal to pass NULL to all functions requiring a context pointer (as long as
+ * you're sure no other code will attempt to use libusb from the same process).
+ * When you pass NULL, the default context will be used. The default context
+ * is created the first time a process calls libusb_init() when no other
+ * context is alive. Contexts are destroyed during libusb_exit().
+ *
+ * You may be wondering why only a subset of libusb functions require a
+ * context pointer in their function definition. Internally, libusb stores
+ * context pointers in other objects (e.g. libusb_device instances) and hence
+ * can infer the context from those objects.
+ */
+
+/**
+ * @defgroup lib Library initialization/deinitialization
+ * This page details how to initialize and deinitialize libusb. Initialization
+ * must be performed before using any libusb functionality, and similarly you
+ * must not call any libusb functions after deinitialization.
+ */
+
+/**
+ * @defgroup dev Device handling and enumeration
+ * The functionality documented below is designed to help with the following
+ * operations:
+ * - Enumerating the USB devices currently attached to the system
+ * - Choosing a device to operate from your software
+ * - Opening and closing the chosen device
+ *
+ * \section nutshell In a nutshell...
+ *
+ * The description below really makes things sound more complicated than they
+ * actually are. The following sequence of function calls will be suitable
+ * for almost all scenarios and does not require you to have such a deep
+ * understanding of the resource management issues:
+ * \code
+// discover devices
+libusb_device **list;
+libusb_device *found = NULL;
+ssize_t cnt = libusb_get_device_list(NULL, &list);
+ssize_t i = 0;
+int err = 0;
+if (cnt < 0)
+	error();
+
+for (i = 0; i < cnt; i++) {
+	libusb_device *device = list[i];
+	if (is_interesting(device)) {
+		found = device;
+		break;
+	}
+}
+
+if (found) {
+	libusb_device_handle *handle;
+
+	err = libusb_open(found, &handle);
+	if (err)
+		error();
+	// etc
+}
+
+libusb_free_device_list(list, 1);
+\endcode
+ *
+ * The two important points:
+ * - You asked libusb_free_device_list() to unreference the devices (2nd
+ *   parameter)
+ * - You opened the device before freeing the list and unreferencing the
+ *   devices
+ *
+ * If you ended up with a handle, you can now proceed to perform I/O on the
+ * device.
+ *
+ * \section devshandles Devices and device handles
+ * libusb has a concept of a USB device, represented by the
+ * \ref libusb_device opaque type. A device represents a USB device that
+ * is currently or was previously connected to the system. Using a reference
+ * to a device, you can determine certain information about the device (e.g.
+ * you can read the descriptor data).
+ *
+ * The libusb_get_device_list() function can be used to obtain a list of
+ * devices currently connected to the system. This is known as device
+ * discovery.
+ *
+ * Just because you have a reference to a device does not mean it is
+ * necessarily usable. The device may have been unplugged, you may not have
+ * permission to operate such device, or another program or driver may be
+ * using the device.
+ *
+ * When you've found a device that you'd like to operate, you must ask
+ * libusb to open the device using the libusb_open() function. Assuming
+ * success, libusb then returns you a <em>device handle</em>
+ * (a \ref libusb_device_handle pointer). All "real" I/O operations then
+ * operate on the handle rather than the original device pointer.
+ *
+ * \section devref Device discovery and reference counting
+ *
+ * Device discovery (i.e. calling libusb_get_device_list()) returns a
+ * freshly-allocated list of devices. The list itself must be freed when
+ * you are done with it. libusb also needs to know when it is OK to free
+ * the contents of the list - the devices themselves.
+ *
+ * To handle these issues, libusb provides you with two separate items:
+ * - A function to free the list itself
+ * - A reference counting system for the devices inside
+ *
+ * New devices presented by the libusb_get_device_list() function all have a
+ * reference count of 1. You can increase and decrease reference count using
+ * libusb_ref_device() and libusb_unref_device(). A device is destroyed when
+ * its reference count reaches 0.
+ *
+ * With the above information in mind, the process of opening a device can
+ * be viewed as follows:
+ * -# Discover devices using libusb_get_device_list().
+ * -# Choose the device that you want to operate, and call libusb_open().
+ * -# Unref all devices in the discovered device list.
+ * -# Free the discovered device list.
+ *
+ * The order is important - you must not unreference the device before
+ * attempting to open it, because unreferencing it may destroy the device.
+ *
+ * For convenience, the libusb_free_device_list() function includes a
+ * parameter to optionally unreference all the devices in the list before
+ * freeing the list itself. This combines steps 3 and 4 above.
+ *
+ * As an implementation detail, libusb_open() actually adds a reference to
+ * the device in question. This is because the device remains available
+ * through the handle via libusb_get_device(). The reference is deleted during
+ * libusb_close().
+ */
+
+/** @defgroup misc Miscellaneous */
+
+/* we traverse usbfs without knowing how many devices we are going to find.
+ * so we create this discovered_devs model which is similar to a linked-list
+ * which grows when required. it can be freed once discovery has completed,
+ * eliminating the need for a list node in the libusb_device structure
+ * itself. */
+#define DISCOVERED_DEVICES_SIZE_STEP 8
+
+static struct discovered_devs *discovered_devs_alloc(void)
+{
+	struct discovered_devs *ret =
+		malloc(sizeof(*ret) + (sizeof(void *) * DISCOVERED_DEVICES_SIZE_STEP));
+
+	if (ret) {
+		ret->len = 0;
+		ret->capacity = DISCOVERED_DEVICES_SIZE_STEP;
+	}
+	return ret;
+}
+
+/* append a device to the discovered devices collection. may realloc itself,
+ * returning new discdevs. returns NULL on realloc failure. */
+struct discovered_devs *discovered_devs_append(
+	struct discovered_devs *discdevs, struct libusb_device *dev)
+{
+	size_t len = discdevs->len;
+	size_t capacity;
+
+	/* if there is space, just append the device */
+	if (len < discdevs->capacity) {
+		discdevs->devices[len] = libusb_ref_device(dev);
+		discdevs->len++;
+		return discdevs;
+	}
+
+	/* exceeded capacity, need to grow */
+	usbi_dbg("need to increase capacity");
+	capacity = discdevs->capacity + DISCOVERED_DEVICES_SIZE_STEP;
+	discdevs = realloc(discdevs,
+		sizeof(*discdevs) + (sizeof(void *) * capacity));
+	if (discdevs) {
+		discdevs->capacity = capacity;
+		discdevs->devices[len] = libusb_ref_device(dev);
+		discdevs->len++;
+	}
+
+	return discdevs;
+}
+
+static void discovered_devs_free(struct discovered_devs *discdevs)
+{
+	size_t i;
+
+	for (i = 0; i < discdevs->len; i++)
+		libusb_unref_device(discdevs->devices[i]);
+
+	free(discdevs);
+}
+
+/* Allocate a new device with a specific session ID. The returned device has
+ * a reference count of 1. */
+struct libusb_device *usbi_alloc_device(struct libusb_context *ctx,
+	unsigned long session_id)
+{
+	size_t priv_size = usbi_backend->device_priv_size;
+	struct libusb_device *dev = malloc(sizeof(*dev) + priv_size);
+	int r;
+
+	if (!dev)
+		return NULL;
+
+	r = pthread_mutex_init(&dev->lock, NULL);
+	if (r)
+		return NULL;
+
+	dev->ctx = ctx;
+	dev->refcnt = 1;
+	dev->session_data = session_id;
+	memset(&dev->os_priv, 0, priv_size);
+
+	pthread_mutex_lock(&ctx->usb_devs_lock);
+	list_add(&dev->list, &ctx->usb_devs);
+	pthread_mutex_unlock(&ctx->usb_devs_lock);
+	return dev;
+}
+
+/* Perform some final sanity checks on a newly discovered device. If this
+ * function fails (negative return code), the device should not be added
+ * to the discovered device list. */
+int usbi_sanitize_device(struct libusb_device *dev)
+{
+	int r;
+	unsigned char raw_desc[DEVICE_DESC_LENGTH];
+	uint8_t num_configurations;
+	int host_endian;
+
+	r = usbi_backend->get_device_descriptor(dev, raw_desc, &host_endian);
+	if (r < 0)
+		return r;
+
+	num_configurations = raw_desc[DEVICE_DESC_LENGTH - 1];
+	if (num_configurations > USB_MAXCONFIG) {
+		usbi_err(DEVICE_CTX(dev), "too many configurations");
+		return LIBUSB_ERROR_IO;
+	} else if (num_configurations < 1) {
+		usbi_dbg("no configurations?");
+		return LIBUSB_ERROR_IO;
+	}
+
+	dev->num_configurations = num_configurations;
+	return 0;
+}
+
+/* Examine libusb's internal list of known devices, looking for one with
+ * a specific session ID. Returns the matching device if it was found, and
+ * NULL otherwise. */
+struct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx,
+	unsigned long session_id)
+{
+	struct libusb_device *dev;
+	struct libusb_device *ret = NULL;
+
+	pthread_mutex_lock(&ctx->usb_devs_lock);
+	list_for_each_entry(dev, &ctx->usb_devs, list)
+		if (dev->session_data == session_id) {
+			ret = dev;
+			break;
+		}
+	pthread_mutex_unlock(&ctx->usb_devs_lock);
+
+	return ret;
+}
+
+/** @ingroup dev
+ * Returns a list of USB devices currently attached to the system. This is
+ * your entry point into finding a USB device to operate.
+ *
+ * You are expected to unreference all the devices when you are done with
+ * them, and then free the list with libusb_free_device_list(). Note that
+ * libusb_free_device_list() can unref all the devices for you. Be careful
+ * not to unreference a device you are about to open until after you have
+ * opened it.
+ *
+ * This return value of this function indicates the number of devices in
+ * the resultant list. The list is actually one element larger, as it is
+ * NULL-terminated.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \param list output location for a list of devices. Must be later freed with
+ * libusb_free_device_list().
+ * \returns the number of devices in the outputted list, or LIBUSB_ERROR_NO_MEM
+ * on memory allocation failure.
+ */
+API_EXPORTED ssize_t libusb_get_device_list(libusb_context *ctx,
+	libusb_device ***list)
+{
+	struct discovered_devs *discdevs = discovered_devs_alloc();
+	struct libusb_device **ret;
+	int r = 0;
+	size_t i;
+	ssize_t len;
+	USBI_GET_CONTEXT(ctx);
+	usbi_dbg("");
+
+	if (!discdevs)
+		return LIBUSB_ERROR_NO_MEM;
+
+	r = usbi_backend->get_device_list(ctx, &discdevs);
+	if (r < 0) {
+		len = r;
+		goto out;
+	}
+
+	/* convert discovered_devs into a list */
+	len = discdevs->len;
+	ret = malloc(sizeof(void *) * (len + 1));
+	if (!ret) {
+		len = LIBUSB_ERROR_NO_MEM;
+		goto out;
+	}
+
+	ret[len] = NULL;
+	for (i = 0; i < len; i++) {
+		struct libusb_device *dev = discdevs->devices[i];
+		ret[i] = libusb_ref_device(dev);
+	}
+	*list = ret;
+
+out:
+	discovered_devs_free(discdevs);
+	return len;
+}
+
+/** \ingroup dev
+ * Frees a list of devices previously discovered using
+ * libusb_get_device_list(). If the unref_devices parameter is set, the
+ * reference count of each device in the list is decremented by 1.
+ * \param list the list to free
+ * \param unref_devices whether to unref the devices in the list
+ */
+API_EXPORTED void libusb_free_device_list(libusb_device **list,
+	int unref_devices)
+{
+	if (!list)
+		return;
+
+	if (unref_devices) {
+		int i = 0;
+		struct libusb_device *dev;
+
+		while ((dev = list[i++]) != NULL)
+			libusb_unref_device(dev);
+	}
+	free(list);
+}
+
+/** \ingroup dev
+ * Get the number of the bus that a device is connected to.
+ * \param dev a device
+ * \returns the bus number
+ */
+API_EXPORTED uint8_t libusb_get_bus_number(libusb_device *dev)
+{
+	return dev->bus_number;
+}
+
+/** \ingroup dev
+ * Get the address of the device on the bus it is connected to.
+ * \param dev a device
+ * \returns the device address
+ */
+API_EXPORTED uint8_t libusb_get_device_address(libusb_device *dev)
+{
+	return dev->device_address;
+}
+
+static const struct libusb_endpoint_descriptor *find_endpoint(
+	struct libusb_config_descriptor *config, unsigned char endpoint)
+{
+	int iface_idx;
+	for (iface_idx = 0; iface_idx < config->bNumInterfaces; iface_idx++) {
+		const struct libusb_interface *iface = &config->interface[iface_idx];
+		int altsetting_idx;
+
+		for (altsetting_idx = 0; altsetting_idx < iface->num_altsetting;
+				altsetting_idx++) {
+			const struct libusb_interface_descriptor *altsetting
+				= &iface->altsetting[altsetting_idx];
+			int ep_idx;
+
+			for (ep_idx = 0; ep_idx < altsetting->bNumEndpoints; ep_idx++) {
+				const struct libusb_endpoint_descriptor *ep =
+					&altsetting->endpoint[ep_idx];
+				if (ep->bEndpointAddress == endpoint)
+					return ep;
+			}
+		}
+	}
+	return NULL;
+}
+
+/** \ingroup dev
+ * Convenience function to retrieve the wMaxPacketSize value for a particular
+ * endpoint in the active device configuration.
+ *
+ * This function was originally intended to be of assistance when setting up
+ * isochronous transfers, but a design mistake resulted in this function
+ * instead. It simply returns the wMaxPacketSize value without considering
+ * its contents. If you're dealing with isochronous transfers, you probably
+ * want libusb_get_max_iso_packet_size() instead.
+ *
+ * \param dev a device
+ * \param endpoint address of the endpoint in question
+ * \returns the wMaxPacketSize value
+ * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist
+ * \returns LIBUSB_ERROR_OTHER on other failure
+ */
+API_EXPORTED int libusb_get_max_packet_size(libusb_device *dev,
+	unsigned char endpoint)
+{
+	struct libusb_config_descriptor *config;
+	const struct libusb_endpoint_descriptor *ep;
+	int r;
+
+	r = libusb_get_active_config_descriptor(dev, &config);
+	if (r < 0) {
+		usbi_err(DEVICE_CTX(dev),
+			"could not retrieve active config descriptor");
+		return LIBUSB_ERROR_OTHER;
+	}
+
+	ep = find_endpoint(config, endpoint);
+	if (!ep)
+		return LIBUSB_ERROR_NOT_FOUND;
+
+	r = ep->wMaxPacketSize;
+	libusb_free_config_descriptor(config);
+	return r;
+}
+
+/** \ingroup dev
+ * Calculate the maximum packet size which a specific endpoint is capable is
+ * sending or receiving in the duration of 1 microframe
+ *
+ * Only the active configution is examined. The calculation is based on the
+ * wMaxPacketSize field in the endpoint descriptor as described in section
+ * 9.6.6 in the USB 2.0 specifications.
+ *
+ * If acting on an isochronous or interrupt endpoint, this function will
+ * multiply the value found in bits 0:10 by the number of transactions per
+ * microframe (determined by bits 11:12). Otherwise, this function just
+ * returns the numeric value found in bits 0:10.
+ *
+ * This function is useful for setting up isochronous transfers, for example
+ * you might pass the return value from this function to
+ * libusb_set_iso_packet_lengths() in order to set the length field of every
+ * isochronous packet in a transfer.
+ *
+ * Since v1.0.3.
+ *
+ * \param dev a device
+ * \param endpoint address of the endpoint in question
+ * \returns the maximum packet size which can be sent/received on this endpoint
+ * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist
+ * \returns LIBUSB_ERROR_OTHER on other failure
+ */
+API_EXPORTED int libusb_get_max_iso_packet_size(libusb_device *dev,
+	unsigned char endpoint)
+{
+	struct libusb_config_descriptor *config;
+	const struct libusb_endpoint_descriptor *ep;
+	enum libusb_transfer_type ep_type;
+	uint16_t val;
+	int r;
+
+	r = libusb_get_active_config_descriptor(dev, &config);
+	if (r < 0) {
+		usbi_err(DEVICE_CTX(dev),
+			"could not retrieve active config descriptor");
+		return LIBUSB_ERROR_OTHER;
+	}
+
+	ep = find_endpoint(config, endpoint);
+	if (!ep)
+		return LIBUSB_ERROR_NOT_FOUND;
+
+	val = ep->wMaxPacketSize;
+	ep_type = ep->bmAttributes & 0x3;
+	libusb_free_config_descriptor(config);
+
+	r = val & 0x07ff;
+	if (ep_type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS
+			|| ep_type == LIBUSB_TRANSFER_TYPE_INTERRUPT)
+		r *= (1 + ((val >> 11) & 3));
+	return r;
+}
+
+/** \ingroup dev
+ * Increment the reference count of a device.
+ * \param dev the device to reference
+ * \returns the same device
+ */
+API_EXPORTED libusb_device *libusb_ref_device(libusb_device *dev)
+{
+	pthread_mutex_lock(&dev->lock);
+	dev->refcnt++;
+	pthread_mutex_unlock(&dev->lock);
+	return dev;
+}
+
+/** \ingroup dev
+ * Decrement the reference count of a device. If the decrement operation
+ * causes the reference count to reach zero, the device shall be destroyed.
+ * \param dev the device to unreference
+ */
+API_EXPORTED void libusb_unref_device(libusb_device *dev)
+{
+	int refcnt;
+
+	if (!dev)
+		return;
+
+	pthread_mutex_lock(&dev->lock);
+	refcnt = --dev->refcnt;
+	pthread_mutex_unlock(&dev->lock);
+
+	if (refcnt == 0) {
+		usbi_dbg("destroy device %d.%d", dev->bus_number, dev->device_address);
+
+		if (usbi_backend->destroy_device)
+			usbi_backend->destroy_device(dev);
+
+		pthread_mutex_lock(&dev->ctx->usb_devs_lock);
+		list_del(&dev->list);
+		pthread_mutex_unlock(&dev->ctx->usb_devs_lock);
+
+		free(dev);
+	}
+}
+
+/** \ingroup dev
+ * Open a device and obtain a device handle. A handle allows you to perform
+ * I/O on the device in question.
+ *
+ * Internally, this function adds a reference to the device and makes it
+ * available to you through libusb_get_device(). This reference is removed
+ * during libusb_close().
+ *
+ * This is a non-blocking function; no requests are sent over the bus.
+ *
+ * \param dev the device to open
+ * \param handle output location for the returned device handle pointer. Only
+ * populated when the return code is 0.
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NO_MEM on memory allocation failure
+ * \returns LIBUSB_ERROR_ACCESS if the user has insufficient permissions
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failure
+ */
+API_EXPORTED int libusb_open(libusb_device *dev, libusb_device_handle **handle)
+{
+	struct libusb_context *ctx = DEVICE_CTX(dev);
+	struct libusb_device_handle *_handle;
+	size_t priv_size = usbi_backend->device_handle_priv_size;
+	unsigned char dummy = 1;
+	int r;
+	usbi_dbg("open %d.%d", dev->bus_number, dev->device_address);
+
+	_handle = malloc(sizeof(*_handle) + priv_size);
+	if (!_handle)
+		return LIBUSB_ERROR_NO_MEM;
+
+	r = pthread_mutex_init(&_handle->lock, NULL);
+	if (r)
+		return LIBUSB_ERROR_OTHER;
+
+	_handle->dev = libusb_ref_device(dev);
+	_handle->claimed_interfaces = 0;
+	memset(&_handle->os_priv, 0, priv_size);
+
+	r = usbi_backend->open(_handle);
+	if (r < 0) {
+		libusb_unref_device(dev);
+		free(_handle);
+		return r;
+	}
+
+	pthread_mutex_lock(&ctx->open_devs_lock);
+	list_add(&_handle->list, &ctx->open_devs);
+	pthread_mutex_unlock(&ctx->open_devs_lock);
+	*handle = _handle;
+
+
+	/* At this point, we want to interrupt any existing event handlers so
+	 * that they realise the addition of the new device's poll fd. One
+	 * example when this is desirable is if the user is running a separate
+	 * dedicated libusb events handling thread, which is running with a long
+	 * or infinite timeout. We want to interrupt that iteration of the loop,
+	 * so that it picks up the new fd, and then continues. */
+
+	/* record that we are messing with poll fds */
+	pthread_mutex_lock(&ctx->pollfd_modify_lock);
+	ctx->pollfd_modify++;
+	pthread_mutex_unlock(&ctx->pollfd_modify_lock);
+
+	/* write some data on control pipe to interrupt event handlers */
+	r = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy));
+	if (r <= 0) {
+		usbi_warn(ctx, "internal signalling write failed");
+		pthread_mutex_lock(&ctx->pollfd_modify_lock);
+		ctx->pollfd_modify--;
+		pthread_mutex_unlock(&ctx->pollfd_modify_lock);
+		return 0;
+	}
+
+	/* take event handling lock */
+	libusb_lock_events(ctx);
+
+	/* read the dummy data */
+	r = read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy));
+	if (r <= 0)
+		usbi_warn(ctx, "internal signalling read failed");
+
+	/* we're done with modifying poll fds */
+	pthread_mutex_lock(&ctx->pollfd_modify_lock);
+	ctx->pollfd_modify--;
+	pthread_mutex_unlock(&ctx->pollfd_modify_lock);
+
+	/* Release event handling lock and wake up event waiters */
+	libusb_unlock_events(ctx);
+
+	return 0;
+}
+
+/** \ingroup dev
+ * Convenience function for finding a device with a particular
+ * <tt>idVendor</tt>/<tt>idProduct</tt> combination. This function is intended
+ * for those scenarios where you are using libusb to knock up a quick test
+ * application - it allows you to avoid calling libusb_get_device_list() and
+ * worrying about traversing/freeing the list.
+ *
+ * This function has limitations and is hence not intended for use in real
+ * applications: if multiple devices have the same IDs it will only
+ * give you the first one, etc.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \param vendor_id the idVendor value to search for
+ * \param product_id the idProduct value to search for
+ * \returns a handle for the first found device, or NULL on error or if the
+ * device could not be found. */
+API_EXPORTED libusb_device_handle *libusb_open_device_with_vid_pid(
+	libusb_context *ctx, uint16_t vendor_id, uint16_t product_id)
+{
+	struct libusb_device **devs;
+	struct libusb_device *found = NULL;
+	struct libusb_device *dev;
+	struct libusb_device_handle *handle = NULL;
+	size_t i = 0;
+	int r;
+
+	if (libusb_get_device_list(ctx, &devs) < 0)
+		return NULL;
+
+	while ((dev = devs[i++]) != NULL) {
+		struct libusb_device_descriptor desc;
+		r = libusb_get_device_descriptor(dev, &desc);
+		if (r < 0)
+			goto out;
+		if (desc.idVendor == vendor_id && desc.idProduct == product_id) {
+			found = dev;
+			break;
+		}
+	}
+
+	if (found) {
+		r = libusb_open(found, &handle);
+		if (r < 0)
+			handle = NULL;
+	}
+
+out:
+	libusb_free_device_list(devs, 1);
+	return handle;
+}
+
+static void do_close(struct libusb_context *ctx,
+	struct libusb_device_handle *dev_handle)
+{
+	pthread_mutex_lock(&ctx->open_devs_lock);
+	list_del(&dev_handle->list);
+	pthread_mutex_unlock(&ctx->open_devs_lock);
+
+	usbi_backend->close(dev_handle);
+	libusb_unref_device(dev_handle->dev);
+	free(dev_handle);
+}
+
+/** \ingroup dev
+ * Close a device handle. Should be called on all open handles before your
+ * application exits.
+ *
+ * Internally, this function destroys the reference that was added by
+ * libusb_open() on the given device.
+ *
+ * This is a non-blocking function; no requests are sent over the bus.
+ *
+ * \param dev_handle the handle to close
+ */
+API_EXPORTED void libusb_close(libusb_device_handle *dev_handle)
+{
+	struct libusb_context *ctx;
+	unsigned char dummy = 1;
+	ssize_t r;
+
+	if (!dev_handle)
+		return;
+	usbi_dbg("");
+
+	ctx = HANDLE_CTX(dev_handle);
+
+	/* Similarly to libusb_open(), we want to interrupt all event handlers
+	 * at this point. More importantly, we want to perform the actual close of
+	 * the device while holding the event handling lock (preventing any other
+	 * thread from doing event handling) because we will be removing a file
+	 * descriptor from the polling loop. */
+
+	/* record that we are messing with poll fds */
+	pthread_mutex_lock(&ctx->pollfd_modify_lock);
+	ctx->pollfd_modify++;
+	pthread_mutex_unlock(&ctx->pollfd_modify_lock);
+
+	/* write some data on control pipe to interrupt event handlers */
+	r = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy));
+	if (r <= 0) {
+		usbi_warn(ctx, "internal signalling write failed, closing anyway");
+		do_close(ctx, dev_handle);
+		pthread_mutex_lock(&ctx->pollfd_modify_lock);
+		ctx->pollfd_modify--;
+		pthread_mutex_unlock(&ctx->pollfd_modify_lock);
+		return;
+	}
+
+	/* take event handling lock */
+	libusb_lock_events(ctx);
+
+	/* read the dummy data */
+	r = read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy));
+	if (r <= 0)
+		usbi_warn(ctx, "internal signalling read failed, closing anyway");
+
+	/* Close the device */
+	do_close(ctx, dev_handle);
+
+	/* we're done with modifying poll fds */
+	pthread_mutex_lock(&ctx->pollfd_modify_lock);
+	ctx->pollfd_modify--;
+	pthread_mutex_unlock(&ctx->pollfd_modify_lock);
+
+	/* Release event handling lock and wake up event waiters */
+	libusb_unlock_events(ctx);
+}
+
+/** \ingroup dev
+ * Get the underlying device for a handle. This function does not modify
+ * the reference count of the returned device, so do not feel compelled to
+ * unreference it when you are done.
+ * \param dev_handle a device handle
+ * \returns the underlying device
+ */
+API_EXPORTED libusb_device *libusb_get_device(libusb_device_handle *dev_handle)
+{
+	return dev_handle->dev;
+}
+
+/** \ingroup dev
+ * Determine the bConfigurationValue of the currently active configuration.
+ *
+ * You could formulate your own control request to obtain this information,
+ * but this function has the advantage that it may be able to retrieve the
+ * information from operating system caches (no I/O involved).
+ *
+ * If the OS does not cache this information, then this function will block
+ * while a control transfer is submitted to retrieve the information.
+ *
+ * This function will return a value of 0 in the <tt>config</tt> output
+ * parameter if the device is in unconfigured state.
+ *
+ * \param dev a device handle
+ * \param config output location for the bConfigurationValue of the active
+ * configuration (only valid for return code 0)
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failure
+ */
+API_EXPORTED int libusb_get_configuration(libusb_device_handle *dev,
+	int *config)
+{
+	int r = LIBUSB_ERROR_NOT_SUPPORTED;
+
+	usbi_dbg("");
+	if (usbi_backend->get_configuration)
+		r = usbi_backend->get_configuration(dev, config);
+
+	if (r == LIBUSB_ERROR_NOT_SUPPORTED) {
+		uint8_t tmp = 0;
+		usbi_dbg("falling back to control message");
+		r = libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,
+			LIBUSB_REQUEST_GET_CONFIGURATION, 0, 0, &tmp, 1, 1000);
+		if (r == 0) {
+			usbi_err(HANDLE_CTX(dev), "zero bytes returned in ctrl transfer?");
+			r = LIBUSB_ERROR_IO;
+		} else if (r == 1) {
+			r = 0;
+			*config = tmp;
+		} else {
+			usbi_dbg("control failed, error %d", r);
+		}
+	}
+
+	if (r == 0)
+		usbi_dbg("active config %d", *config);
+
+	return r;
+}
+
+/** \ingroup dev
+ * Set the active configuration for a device.
+ *
+ * The operating system may or may not have already set an active
+ * configuration on the device. It is up to your application to ensure the
+ * correct configuration is selected before you attempt to claim interfaces
+ * and perform other operations.
+ *
+ * If you call this function on a device already configured with the selected
+ * configuration, then this function will act as a lightweight device reset:
+ * it will issue a SET_CONFIGURATION request using the current configuration,
+ * causing most USB-related device state to be reset (altsetting reset to zero,
+ * endpoint halts cleared, toggles reset).
+ *
+ * You cannot change/reset configuration if your application has claimed
+ * interfaces - you should free them with libusb_release_interface() first.
+ * You cannot change/reset configuration if other applications or drivers have
+ * claimed interfaces.
+ *
+ * A configuration value of -1 will put the device in unconfigured state.
+ * The USB specifications state that a configuration value of 0 does this,
+ * however buggy devices exist which actually have a configuration 0.
+ *
+ * You should always use this function rather than formulating your own
+ * SET_CONFIGURATION control request. This is because the underlying operating
+ * system needs to know when such changes happen.
+ *
+ * This is a blocking function.
+ *
+ * \param dev a device handle
+ * \param configuration the bConfigurationValue of the configuration you
+ * wish to activate, or -1 if you wish to put the device in unconfigured state
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if the requested configuration does not exist
+ * \returns LIBUSB_ERROR_BUSY if interfaces are currently claimed
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failure
+ */
+API_EXPORTED int libusb_set_configuration(libusb_device_handle *dev,
+	int configuration)
+{
+	usbi_dbg("configuration %d", configuration);
+	return usbi_backend->set_configuration(dev, configuration);
+}
+
+/** \ingroup dev
+ * Claim an interface on a given device handle. You must claim the interface
+ * you wish to use before you can perform I/O on any of its endpoints.
+ *
+ * It is legal to attempt to claim an already-claimed interface, in which
+ * case libusb just returns 0 without doing anything.
+ *
+ * Claiming of interfaces is a purely logical operation; it does not cause
+ * any requests to be sent over the bus. Interface claiming is used to
+ * instruct the underlying operating system that your application wishes
+ * to take ownership of the interface.
+ *
+ * This is a non-blocking function.
+ *
+ * \param dev a device handle
+ * \param interface_number the <tt>bInterfaceNumber</tt> of the interface you
+ * wish to claim
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if the requested interface does not exist
+ * \returns LIBUSB_ERROR_BUSY if another program or driver has claimed the
+ * interface
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns a LIBUSB_ERROR code on other failure
+ */
+API_EXPORTED int libusb_claim_interface(libusb_device_handle *dev,
+	int interface_number)
+{
+	int r = 0;
+
+	usbi_dbg("interface %d", interface_number);
+	if (interface_number >= sizeof(dev->claimed_interfaces) * 8)
+		return LIBUSB_ERROR_INVALID_PARAM;
+
+	pthread_mutex_lock(&dev->lock);
+	if (dev->claimed_interfaces & (1 << interface_number))
+		goto out;
+
+	r = usbi_backend->claim_interface(dev, interface_number);
+	if (r == 0)
+		dev->claimed_interfaces |= 1 << interface_number;
+
+out:
+	pthread_mutex_unlock(&dev->lock);
+	return r;
+}
+
+/** \ingroup dev
+ * Release an interface previously claimed with libusb_claim_interface(). You
+ * should release all claimed interfaces before closing a device handle.
+ *
+ * This is a blocking function. A SET_INTERFACE control request will be sent
+ * to the device, resetting interface state to the first alternate setting.
+ *
+ * \param dev a device handle
+ * \param interface_number the <tt>bInterfaceNumber</tt> of the
+ * previously-claimed interface
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failure
+ */
+API_EXPORTED int libusb_release_interface(libusb_device_handle *dev,
+	int interface_number)
+{
+	int r;
+
+	usbi_dbg("interface %d", interface_number);
+	if (interface_number >= sizeof(dev->claimed_interfaces) * 8)
+		return LIBUSB_ERROR_INVALID_PARAM;
+
+	pthread_mutex_lock(&dev->lock);
+	if (!(dev->claimed_interfaces & (1 << interface_number))) {
+		r = LIBUSB_ERROR_NOT_FOUND;
+		goto out;
+	}
+
+	r = usbi_backend->release_interface(dev, interface_number);
+	if (r == 0)
+		dev->claimed_interfaces &= ~(1 << interface_number);
+
+out:
+	pthread_mutex_unlock(&dev->lock);
+	return r;
+}
+
+/** \ingroup dev
+ * Activate an alternate setting for an interface. The interface must have
+ * been previously claimed with libusb_claim_interface().
+ *
+ * You should always use this function rather than formulating your own
+ * SET_INTERFACE control request. This is because the underlying operating
+ * system needs to know when such changes happen.
+ *
+ * This is a blocking function.
+ *
+ * \param dev a device handle
+ * \param interface_number the <tt>bInterfaceNumber</tt> of the
+ * previously-claimed interface
+ * \param alternate_setting the <tt>bAlternateSetting</tt> of the alternate
+ * setting to activate
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed, or the
+ * requested alternate setting does not exist
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failure
+ */
+API_EXPORTED int libusb_set_interface_alt_setting(libusb_device_handle *dev,
+	int interface_number, int alternate_setting)
+{
+	usbi_dbg("interface %d altsetting %d",
+		interface_number, alternate_setting);
+	if (interface_number >= sizeof(dev->claimed_interfaces) * 8)
+		return LIBUSB_ERROR_INVALID_PARAM;
+
+	pthread_mutex_lock(&dev->lock);
+	if (!(dev->claimed_interfaces & (1 << interface_number))) {
+		pthread_mutex_unlock(&dev->lock);
+		return LIBUSB_ERROR_NOT_FOUND;
+	}
+	pthread_mutex_unlock(&dev->lock);
+
+	return usbi_backend->set_interface_altsetting(dev, interface_number,
+		alternate_setting);
+}
+
+/** \ingroup dev
+ * Clear the halt/stall condition for an endpoint. Endpoints with halt status
+ * are unable to receive or transmit data until the halt condition is stalled.
+ *
+ * You should cancel all pending transfers before attempting to clear the halt
+ * condition.
+ *
+ * This is a blocking function.
+ *
+ * \param dev a device handle
+ * \param endpoint the endpoint to clear halt status
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failure
+ */
+API_EXPORTED int libusb_clear_halt(libusb_device_handle *dev,
+	unsigned char endpoint)
+{
+	usbi_dbg("endpoint %x", endpoint);
+	return usbi_backend->clear_halt(dev, endpoint);
+}
+
+/** \ingroup dev
+ * Perform a USB port reset to reinitialize a device. The system will attempt
+ * to restore the previous configuration and alternate settings after the
+ * reset has completed.
+ *
+ * If the reset fails, the descriptors change, or the previous state cannot be
+ * restored, the device will appear to be disconnected and reconnected. This
+ * means that the device handle is no longer valid (you should close it) and
+ * rediscover the device. A return code of LIBUSB_ERROR_NOT_FOUND indicates
+ * when this is the case.
+ *
+ * This is a blocking function which usually incurs a noticeable delay.
+ *
+ * \param dev a handle of the device to reset
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the
+ * device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failure
+ */
+API_EXPORTED int libusb_reset_device(libusb_device_handle *dev)
+{
+	usbi_dbg("");
+	return usbi_backend->reset_device(dev);
+}
+
+/** \ingroup dev
+ * Determine if a kernel driver is active on an interface. If a kernel driver
+ * is active, you cannot claim the interface, and libusb will be unable to
+ * perform I/O.
+ *
+ * \param dev a device handle
+ * \param interface the interface to check
+ * \returns 0 if no kernel driver is active
+ * \returns 1 if a kernel driver is active
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failure
+ * \see libusb_detach_kernel_driver()
+ */
+API_EXPORTED int libusb_kernel_driver_active(libusb_device_handle *dev,
+	int interface)
+{
+	usbi_dbg("interface %d", interface);
+	if (usbi_backend->kernel_driver_active)
+		return usbi_backend->kernel_driver_active(dev, interface);
+	else
+		return LIBUSB_ERROR_NOT_SUPPORTED;
+}
+
+/** \ingroup dev
+ * Detach a kernel driver from an interface. If successful, you will then be
+ * able to claim the interface and perform I/O.
+ *
+ * \param dev a device handle
+ * \param interface the interface to detach the driver from
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active
+ * \returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failure
+ * \see libusb_kernel_driver_active()
+ */
+API_EXPORTED int libusb_detach_kernel_driver(libusb_device_handle *dev,
+	int interface)
+{
+	usbi_dbg("interface %d", interface);
+	if (usbi_backend->detach_kernel_driver)
+		return usbi_backend->detach_kernel_driver(dev, interface);
+	else
+		return LIBUSB_ERROR_NOT_SUPPORTED;
+}
+
+/** \ingroup dev
+ * Re-attach an interface's kernel driver, which was previously detached
+ * using libusb_detach_kernel_driver().
+ *
+ * \param dev a device handle
+ * \param interface the interface to attach the driver from
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active
+ * \returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns LIBUSB_ERROR_BUSY if the driver cannot be attached because the
+ * interface is claimed by a program or driver
+ * \returns another LIBUSB_ERROR code on other failure
+ * \see libusb_kernel_driver_active()
+ */
+API_EXPORTED int libusb_attach_kernel_driver(libusb_device_handle *dev,
+	int interface)
+{
+	usbi_dbg("interface %d", interface);
+	if (usbi_backend->attach_kernel_driver)
+		return usbi_backend->attach_kernel_driver(dev, interface);
+	else
+		return LIBUSB_ERROR_NOT_SUPPORTED;
+}
+
+/** \ingroup lib
+ * Set message verbosity.
+ *  - Level 0: no messages ever printed by the library (default)
+ *  - Level 1: error messages are printed to stderr
+ *  - Level 2: warning and error messages are printed to stderr
+ *  - Level 3: informational messages are printed to stdout, warning and error
+ *    messages are printed to stderr
+ *
+ * The default level is 0, which means no messages are ever printed. If you
+ * choose to increase the message verbosity level, ensure that your
+ * application does not close the stdout/stderr file descriptors.
+ *
+ * You are advised to set level 3. libusb is conservative with its message
+ * logging and most of the time, will only log messages that explain error
+ * conditions and other oddities. This will help you debug your software.
+ *
+ * If the LIBUSB_DEBUG environment variable was set when libusb was
+ * initialized, this function does nothing: the message verbosity is fixed
+ * to the value in the environment variable.
+ *
+ * If libusb was compiled without any message logging, this function does
+ * nothing: you'll never get any messages.
+ *
+ * If libusb was compiled with verbose debug message logging, this function
+ * does nothing: you'll always get messages from all levels.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \param level debug level to set
+ */
+API_EXPORTED void libusb_set_debug(libusb_context *ctx, int level)
+{
+	USBI_GET_CONTEXT(ctx);
+	if (!ctx->debug_fixed)
+		ctx->debug = level;
+}
+
+/** \ingroup lib
+ * Initialize libusb. This function must be called before calling any other
+ * libusb function.
+ * \param context Optional output location for context pointer.
+ * Only valid on return code 0.
+ * \returns 0 on success, or a LIBUSB_ERROR code on failure
+ */
+API_EXPORTED int libusb_init(libusb_context **context)
+{
+	char *dbg = getenv("LIBUSB_DEBUG");
+	struct libusb_context *ctx = malloc(sizeof(*ctx));
+	int r;
+
+	if (!ctx)
+		return LIBUSB_ERROR_NO_MEM;
+	memset(ctx, 0, sizeof(*ctx));
+
+	if (dbg) {
+		ctx->debug = atoi(dbg);
+		if (ctx->debug)
+			ctx->debug_fixed = 1;
+	}
+
+	usbi_dbg("");
+
+	if (usbi_backend->init) {
+		r = usbi_backend->init(ctx);
+		if (r)
+			goto err;
+	}
+
+	pthread_mutex_init(&ctx->usb_devs_lock, NULL);
+	pthread_mutex_init(&ctx->open_devs_lock, NULL);
+	list_init(&ctx->usb_devs);
+	list_init(&ctx->open_devs);
+
+	r = usbi_io_init(ctx);
+	if (r < 0) {
+		if (usbi_backend->exit)
+			usbi_backend->exit();
+		goto err;
+	}
+
+	pthread_mutex_lock(&default_context_lock);
+	if (!usbi_default_context) {
+		usbi_dbg("created default context");
+		usbi_default_context = ctx;
+	}
+	pthread_mutex_unlock(&default_context_lock);
+
+	if (context)
+		*context = ctx;
+	return 0;
+
+err:
+	free(ctx);
+	return r;
+}
+
+/** \ingroup lib
+ * Deinitialize libusb. Should be called after closing all open devices and
+ * before your application terminates.
+ * \param ctx the context to deinitialize, or NULL for the default context
+ */
+API_EXPORTED void libusb_exit(struct libusb_context *ctx)
+{
+	USBI_GET_CONTEXT(ctx);
+	usbi_dbg("");
+
+	/* a little sanity check. doesn't bother with open_devs locking because
+	 * unless there is an application bug, nobody will be accessing this. */
+	if (!list_empty(&ctx->open_devs))
+		usbi_warn(ctx, "application left some devices open");
+
+	usbi_io_exit(ctx);
+	if (usbi_backend->exit)
+		usbi_backend->exit();
+
+	pthread_mutex_lock(&default_context_lock);
+	if (ctx == usbi_default_context) {
+		usbi_dbg("freeing default context");
+		usbi_default_context = NULL;
+	}
+	pthread_mutex_unlock(&default_context_lock);
+
+	free(ctx);
+}
+
+void usbi_log(struct libusb_context *ctx, enum usbi_log_level level,
+	const char *function, const char *format, ...)
+{
+	va_list args;
+	FILE *stream = stdout;
+	const char *prefix;
+
+#ifndef ENABLE_DEBUG_LOGGING
+	USBI_GET_CONTEXT(ctx);
+	if (!ctx->debug)
+		return;
+	if (level == LOG_LEVEL_WARNING && ctx->debug < 2)
+		return;
+	if (level == LOG_LEVEL_INFO && ctx->debug < 3)
+		return;
+#endif
+
+	switch (level) {
+	case LOG_LEVEL_INFO:
+		prefix = "info";
+		break;
+	case LOG_LEVEL_WARNING:
+		stream = stderr;
+		prefix = "warning";
+		break;
+	case LOG_LEVEL_ERROR:
+		stream = stderr;
+		prefix = "error";
+		break;
+	case LOG_LEVEL_DEBUG:
+		stream = stderr;
+		prefix = "debug";
+		break;
+	default:
+		stream = stderr;
+		prefix = "unknown";
+		break;
+	}
+
+	fprintf(stream, "libusb:%s [%s] ", prefix, function);
+
+	va_start (args, format);
+	vfprintf(stream, format, args);
+	va_end (args);
+
+	fprintf(stream, "\n");
+}
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/descriptor.c b/Platform/Android/jni/External/libusb-1.0.8/libusb/descriptor.c
new file mode 100644
index 0000000..6fd62ee
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/descriptor.c
@@ -0,0 +1,719 @@
+/*
+ * USB descriptor handling functions for libusb
+ * Copyright (C) 2007 Daniel Drake <dsd at gentoo.org>
+ * Copyright (c) 2001 Johannes Erdfelt <johannes at erdfelt.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libusbi.h"
+
+#define DESC_HEADER_LENGTH		2
+#define DEVICE_DESC_LENGTH		18
+#define CONFIG_DESC_LENGTH		9
+#define INTERFACE_DESC_LENGTH		9
+#define ENDPOINT_DESC_LENGTH		7
+#define ENDPOINT_AUDIO_DESC_LENGTH	9
+
+/** @defgroup desc USB descriptors
+ * This page details how to examine the various standard USB descriptors
+ * for detected devices
+ */
+
+/* set host_endian if the w values are already in host endian format,
+ * as opposed to bus endian. */
+int usbi_parse_descriptor(unsigned char *source, char *descriptor, void *dest,
+	int host_endian)
+{
+	unsigned char *sp = source, *dp = dest;
+	uint16_t w;
+	char *cp;
+
+	for (cp = descriptor; *cp; cp++) {
+		switch (*cp) {
+			case 'b':	/* 8-bit byte */
+				*dp++ = *sp++;
+				break;
+			case 'w':	/* 16-bit word, convert from little endian to CPU */
+				dp += ((unsigned long)dp & 1);	/* Align to word boundary */
+
+				if (host_endian) {
+					memcpy(dp, sp, 2);
+				} else {
+					w = (sp[1] << 8) | sp[0];
+					*((uint16_t *)dp) = w;
+				}
+				sp += 2;
+				dp += 2;
+				break;
+		}
+	}
+
+	return sp - source;
+}
+
+static void clear_endpoint(struct libusb_endpoint_descriptor *endpoint)
+{
+	if (endpoint->extra)
+		free((unsigned char *) endpoint->extra);
+}
+
+static int parse_endpoint(struct libusb_context *ctx,
+	struct libusb_endpoint_descriptor *endpoint, unsigned char *buffer,
+	int size, int host_endian)
+{
+	struct usb_descriptor_header header;
+	unsigned char *extra;
+	unsigned char *begin;
+	int parsed = 0;
+	int len;
+
+	usbi_parse_descriptor(buffer, "bb", &header, 0);
+
+	/* Everything should be fine being passed into here, but we sanity */
+	/*  check JIC */
+	if (header.bLength > size) {
+		usbi_err(ctx, "ran out of descriptors parsing");
+		return -1;
+	}
+
+	if (header.bDescriptorType != LIBUSB_DT_ENDPOINT) {
+		usbi_err(ctx, "unexpected descriptor %x (expected %x)",
+			header.bDescriptorType, LIBUSB_DT_ENDPOINT);
+		return parsed;
+	}
+
+	if (header.bLength >= ENDPOINT_AUDIO_DESC_LENGTH)
+		usbi_parse_descriptor(buffer, "bbbbwbbb", endpoint, host_endian);
+	else if (header.bLength >= ENDPOINT_DESC_LENGTH)
+		usbi_parse_descriptor(buffer, "bbbbwb", endpoint, host_endian);
+
+	buffer += header.bLength;
+	size -= header.bLength;
+	parsed += header.bLength;
+
+	/* Skip over the rest of the Class Specific or Vendor Specific */
+	/*  descriptors */
+	begin = buffer;
+	while (size >= DESC_HEADER_LENGTH) {
+		usbi_parse_descriptor(buffer, "bb", &header, 0);
+
+		if (header.bLength < 2) {
+			usbi_err(ctx, "invalid descriptor length %d", header.bLength);
+			return -1;
+		}
+
+		/* If we find another "proper" descriptor then we're done  */
+		if ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) ||
+				(header.bDescriptorType == LIBUSB_DT_INTERFACE) ||
+				(header.bDescriptorType == LIBUSB_DT_CONFIG) ||
+				(header.bDescriptorType == LIBUSB_DT_DEVICE))
+			break;
+
+		usbi_dbg("skipping descriptor %x", header.bDescriptorType);
+		buffer += header.bLength;
+		size -= header.bLength;
+		parsed += header.bLength;
+	}
+
+	/* Copy any unknown descriptors into a storage area for drivers */
+	/*  to later parse */
+	len = (int)(buffer - begin);
+	if (!len) {
+		endpoint->extra = NULL;
+		endpoint->extra_length = 0;
+		return parsed;
+	}
+
+	extra = malloc(len);
+	endpoint->extra = extra;
+	if (!extra) {
+		endpoint->extra_length = 0;
+		return LIBUSB_ERROR_NO_MEM;
+	}
+
+	memcpy(extra, begin, len);
+	endpoint->extra_length = len;
+
+	return parsed;
+}
+
+static void clear_interface(struct libusb_interface *interface)
+{
+	int i;
+	int j;
+
+	if (interface->altsetting) {
+		for (i = 0; i < interface->num_altsetting; i++) {
+			struct libusb_interface_descriptor *ifp =
+				(struct libusb_interface_descriptor *)
+				interface->altsetting + i;
+			if (ifp->extra)
+				free((void *) ifp->extra);
+			if (ifp->endpoint) {
+				for (j = 0; j < ifp->bNumEndpoints; j++)
+					clear_endpoint((struct libusb_endpoint_descriptor *)
+						ifp->endpoint + j);
+				free((void *) ifp->endpoint);
+			}
+		}
+		free((void *) interface->altsetting);
+		interface->altsetting = NULL;
+	}
+	
+}
+
+static int parse_interface(libusb_context *ctx,
+	struct libusb_interface *interface, unsigned char *buffer, int size,
+	int host_endian)
+{
+	int i;
+	int len;
+	int r;
+	int parsed = 0;
+	int tmp;
+	struct usb_descriptor_header header;
+	struct libusb_interface_descriptor *ifp;
+	unsigned char *begin;
+
+	interface->num_altsetting = 0;
+
+	while (size >= INTERFACE_DESC_LENGTH) {
+		struct libusb_interface_descriptor *altsetting =
+			(struct libusb_interface_descriptor *) interface->altsetting;
+		altsetting = realloc(altsetting,
+			sizeof(struct libusb_interface_descriptor) *
+			(interface->num_altsetting + 1));
+		if (!altsetting) {
+			r = LIBUSB_ERROR_NO_MEM;
+			goto err;
+		}
+		interface->altsetting = altsetting;
+
+		ifp = altsetting + interface->num_altsetting;
+		interface->num_altsetting++;
+		usbi_parse_descriptor(buffer, "bbbbbbbbb", ifp, 0);
+		ifp->extra = NULL;
+		ifp->extra_length = 0;
+		ifp->endpoint = NULL;
+
+		/* Skip over the interface */
+		buffer += ifp->bLength;
+		parsed += ifp->bLength;
+		size -= ifp->bLength;
+
+		begin = buffer;
+
+		/* Skip over any interface, class or vendor descriptors */
+		while (size >= DESC_HEADER_LENGTH) {
+			usbi_parse_descriptor(buffer, "bb", &header, 0);
+			if (header.bLength < 2) {
+				usbi_err(ctx, "invalid descriptor of length %d",
+					header.bLength);
+				r = LIBUSB_ERROR_IO;
+				goto err;
+			}
+
+			/* If we find another "proper" descriptor then we're done */
+			if ((header.bDescriptorType == LIBUSB_DT_INTERFACE) ||
+					(header.bDescriptorType == LIBUSB_DT_ENDPOINT) ||
+					(header.bDescriptorType == LIBUSB_DT_CONFIG) ||
+					(header.bDescriptorType == LIBUSB_DT_DEVICE))
+				break;
+
+			buffer += header.bLength;
+			parsed += header.bLength;
+			size -= header.bLength;
+		}
+
+		/* Copy any unknown descriptors into a storage area for */
+		/*  drivers to later parse */
+		len = (int)(buffer - begin);
+		if (len) {
+			ifp->extra = malloc(len);
+			if (!ifp->extra) {
+				r = LIBUSB_ERROR_NO_MEM;
+				goto err;
+			}
+			memcpy((unsigned char *) ifp->extra, begin, len);
+			ifp->extra_length = len;
+		}
+
+		/* Did we hit an unexpected descriptor? */
+		usbi_parse_descriptor(buffer, "bb", &header, 0);
+		if ((size >= DESC_HEADER_LENGTH) &&
+				((header.bDescriptorType == LIBUSB_DT_CONFIG) ||
+				 (header.bDescriptorType == LIBUSB_DT_DEVICE)))
+			return parsed;
+
+		if (ifp->bNumEndpoints > USB_MAXENDPOINTS) {
+			usbi_err(ctx, "too many endpoints (%d)", ifp->bNumEndpoints);
+			r = LIBUSB_ERROR_IO;
+			goto err;
+		}
+
+		if (ifp->bNumEndpoints > 0) {
+			struct libusb_endpoint_descriptor *endpoint;
+			tmp = ifp->bNumEndpoints * sizeof(struct libusb_endpoint_descriptor);
+			endpoint = malloc(tmp);
+			ifp->endpoint = endpoint;
+			if (!endpoint) {
+				r = LIBUSB_ERROR_NO_MEM;
+				goto err;
+			}
+
+			memset(endpoint, 0, tmp);
+			for (i = 0; i < ifp->bNumEndpoints; i++) {
+				usbi_parse_descriptor(buffer, "bb", &header, 0);
+
+				if (header.bLength > size) {
+					usbi_err(ctx, "ran out of descriptors parsing");
+					r = LIBUSB_ERROR_IO;
+					goto err;
+				}
+
+				r = parse_endpoint(ctx, endpoint + i, buffer, size,
+					host_endian);
+				if (r < 0)
+					goto err;
+
+				buffer += r;
+				parsed += r;
+				size -= r;
+			}
+		}
+
+		/* We check to see if it's an alternate to this one */
+		ifp = (struct libusb_interface_descriptor *) buffer;
+		if (size < LIBUSB_DT_INTERFACE_SIZE ||
+				ifp->bDescriptorType != LIBUSB_DT_INTERFACE ||
+				!ifp->bAlternateSetting)
+			return parsed;
+	}
+
+	return parsed;
+err:
+	clear_interface(interface);
+	return r;
+}
+
+static void clear_configuration(struct libusb_config_descriptor *config)
+{
+	if (config->interface) {
+		int i;
+		for (i = 0; i < config->bNumInterfaces; i++)
+			clear_interface((struct libusb_interface *)
+				config->interface + i);
+		free((void *) config->interface);
+	}
+	if (config->extra)
+		free((void *) config->extra);
+}
+
+static int parse_configuration(struct libusb_context *ctx,
+	struct libusb_config_descriptor *config, unsigned char *buffer,
+	int host_endian)
+{
+	int i;
+	int r;
+	int size;
+	int tmp;
+	struct usb_descriptor_header header;
+	struct libusb_interface *interface;
+
+	usbi_parse_descriptor(buffer, "bbwbbbbb", config, host_endian);
+	size = config->wTotalLength;
+
+	if (config->bNumInterfaces > USB_MAXINTERFACES) {
+		usbi_err(ctx, "too many interfaces (%d)", config->bNumInterfaces);
+		return LIBUSB_ERROR_IO;
+	}
+
+	tmp = config->bNumInterfaces * sizeof(struct libusb_interface);
+	interface = malloc(tmp);
+	config->interface = interface;
+	if (!config->interface)
+		return LIBUSB_ERROR_NO_MEM;
+
+	memset(interface, 0, tmp);
+	buffer += config->bLength;
+	size -= config->bLength;
+
+	config->extra = NULL;
+	config->extra_length = 0;
+
+	for (i = 0; i < config->bNumInterfaces; i++) {
+		int len;
+		unsigned char *begin;
+
+		/* Skip over the rest of the Class Specific or Vendor */
+		/*  Specific descriptors */
+		begin = buffer;
+		while (size >= DESC_HEADER_LENGTH) {
+			usbi_parse_descriptor(buffer, "bb", &header, 0);
+
+			if ((header.bLength > size) ||
+					(header.bLength < DESC_HEADER_LENGTH)) {
+				usbi_err(ctx, "invalid descriptor length of %d",
+					header.bLength);
+				r = LIBUSB_ERROR_IO;
+				goto err;
+			}
+
+			/* If we find another "proper" descriptor then we're done */
+			if ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) ||
+					(header.bDescriptorType == LIBUSB_DT_INTERFACE) ||
+					(header.bDescriptorType == LIBUSB_DT_CONFIG) ||
+					(header.bDescriptorType == LIBUSB_DT_DEVICE))
+				break;
+
+			usbi_dbg("skipping descriptor 0x%x\n", header.bDescriptorType);
+			buffer += header.bLength;
+			size -= header.bLength;
+		}
+
+		/* Copy any unknown descriptors into a storage area for */
+		/*  drivers to later parse */
+		len = (int)(buffer - begin);
+		if (len) {
+			/* FIXME: We should realloc and append here */
+			if (!config->extra_length) {
+				config->extra = malloc(len);
+				if (!config->extra) {
+					r = LIBUSB_ERROR_NO_MEM;
+					goto err;
+				}
+
+				memcpy((unsigned char *) config->extra, begin, len);
+				config->extra_length = len;
+			}
+		}
+
+		r = parse_interface(ctx, interface + i, buffer, size, host_endian);
+		if (r < 0)
+			goto err;
+
+		buffer += r;
+		size -= r;
+	}
+
+	return size;
+
+err:
+	clear_configuration(config);
+	return r;
+}
+
+/** \ingroup desc
+ * Get the USB device descriptor for a given device.
+ *
+ * This is a non-blocking function; the device descriptor is cached in memory.
+ *
+ * \param dev the device
+ * \param desc output location for the descriptor data
+ * \returns 0 on success or a LIBUSB_ERROR code on failure
+ */
+API_EXPORTED int libusb_get_device_descriptor(libusb_device *dev,
+	struct libusb_device_descriptor *desc)
+{
+	unsigned char raw_desc[DEVICE_DESC_LENGTH];
+	int host_endian = 0;
+	int r;
+
+	usbi_dbg("");
+	r = usbi_backend->get_device_descriptor(dev, raw_desc, &host_endian);
+	if (r < 0)
+		return r;
+
+	memcpy((unsigned char *) desc, raw_desc, sizeof(raw_desc));
+	if (!host_endian) {
+		desc->bcdUSB = libusb_le16_to_cpu(desc->bcdUSB);
+		desc->idVendor = libusb_le16_to_cpu(desc->idVendor);
+		desc->idProduct = libusb_le16_to_cpu(desc->idProduct);
+		desc->bcdDevice = libusb_le16_to_cpu(desc->bcdDevice);
+	}
+	return 0;
+}
+
+/** \ingroup desc
+ * Get the USB configuration descriptor for the currently active configuration.
+ * This is a non-blocking function which does not involve any requests being
+ * sent to the device.
+ *
+ * \param dev a device
+ * \param config output location for the USB configuration descriptor. Only
+ * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()
+ * after use.
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state
+ * \returns another LIBUSB_ERROR code on error
+ * \see libusb_get_config_descriptor
+ */
+API_EXPORTED int libusb_get_active_config_descriptor(libusb_device *dev,
+	struct libusb_config_descriptor **config)
+{
+	struct libusb_config_descriptor *_config = malloc(sizeof(*_config));
+	unsigned char tmp[8];
+	unsigned char *buf = NULL;
+	int host_endian = 0;
+	int r;
+
+	usbi_dbg("");
+	if (!_config)
+		return LIBUSB_ERROR_NO_MEM;
+
+	r = usbi_backend->get_active_config_descriptor(dev, tmp, sizeof(tmp),
+		&host_endian);
+	if (r < 0)
+		goto err;
+
+	usbi_parse_descriptor(tmp, "bbw", _config, host_endian);
+	buf = malloc(_config->wTotalLength);
+	if (!buf) {
+		r = LIBUSB_ERROR_NO_MEM;
+		goto err;
+	}
+
+	r = usbi_backend->get_active_config_descriptor(dev, buf,
+		_config->wTotalLength, &host_endian);
+	if (r < 0)
+		goto err;
+
+	r = parse_configuration(dev->ctx, _config, buf, host_endian);
+	if (r < 0) {
+		usbi_err(dev->ctx, "parse_configuration failed with error %d", r);
+		goto err;
+	} else if (r > 0) {
+		usbi_warn(dev->ctx, "descriptor data still left");
+	}
+
+	free(buf);
+	*config = _config;
+	return 0;
+
+err:
+	free(_config);
+	if (buf)
+		free(buf);
+	return r;
+}
+
+/** \ingroup desc
+ * Get a USB configuration descriptor based on its index.
+ * This is a non-blocking function which does not involve any requests being
+ * sent to the device.
+ *
+ * \param dev a device
+ * \param config_index the index of the configuration you wish to retrieve
+ * \param config output location for the USB configuration descriptor. Only
+ * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()
+ * after use.
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist
+ * \returns another LIBUSB_ERROR code on error
+ * \see libusb_get_active_config_descriptor()
+ * \see libusb_get_config_descriptor_by_value()
+ */
+API_EXPORTED int libusb_get_config_descriptor(libusb_device *dev,
+	uint8_t config_index, struct libusb_config_descriptor **config)
+{
+	struct libusb_config_descriptor *_config;
+	unsigned char tmp[8];
+	unsigned char *buf = NULL;
+	int host_endian = 0;
+	int r;
+
+	usbi_dbg("index %d", config_index);
+	if (config_index >= dev->num_configurations)
+		return LIBUSB_ERROR_NOT_FOUND;
+
+	_config = malloc(sizeof(*_config));
+	if (!_config)
+		return LIBUSB_ERROR_NO_MEM;
+
+	r = usbi_backend->get_config_descriptor(dev, config_index, tmp,
+		sizeof(tmp), &host_endian);
+	if (r < 0)
+		goto err;
+
+	usbi_parse_descriptor(tmp, "bbw", _config, host_endian);
+	buf = malloc(_config->wTotalLength);
+	if (!buf) {
+		r = LIBUSB_ERROR_NO_MEM;
+		goto err;
+	}
+
+	host_endian = 0;
+	r = usbi_backend->get_config_descriptor(dev, config_index, buf,
+		_config->wTotalLength, &host_endian);
+	if (r < 0)
+		goto err;
+
+	r = parse_configuration(dev->ctx, _config, buf, host_endian);
+	if (r < 0) {
+		usbi_err(dev->ctx, "parse_configuration failed with error %d", r);
+		goto err;
+	} else if (r > 0) {
+		usbi_warn(dev->ctx, "descriptor data still left");
+	}
+
+	free(buf);
+	*config = _config;
+	return 0;
+
+err:
+	free(_config);
+	if (buf)
+		free(buf);
+	return r;
+}
+
+/* iterate through all configurations, returning the index of the configuration
+ * matching a specific bConfigurationValue in the idx output parameter, or -1
+ * if the config was not found.
+ * returns 0 or a LIBUSB_ERROR code
+ */
+int usbi_get_config_index_by_value(struct libusb_device *dev,
+	uint8_t bConfigurationValue, int *idx)
+{
+	int i;
+
+	usbi_dbg("value %d", bConfigurationValue);
+	for (i = 0; i < dev->num_configurations; i++) {
+		unsigned char tmp[6];
+		int host_endian;
+		int r = usbi_backend->get_config_descriptor(dev, i, tmp, sizeof(tmp),
+			&host_endian);
+		if (r < 0)
+			return r;
+		if (tmp[5] == bConfigurationValue) {
+			*idx = i;
+			return 0;
+		}
+	}
+
+	*idx = -1;
+	return 0;
+}
+
+/** \ingroup desc
+ * Get a USB configuration descriptor with a specific bConfigurationValue.
+ * This is a non-blocking function which does not involve any requests being
+ * sent to the device.
+ *
+ * \param dev a device
+ * \param bConfigurationValue the bConfigurationValue of the configuration you
+ * wish to retrieve
+ * \param config output location for the USB configuration descriptor. Only
+ * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()
+ * after use.
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist
+ * \returns another LIBUSB_ERROR code on error
+ * \see libusb_get_active_config_descriptor()
+ * \see libusb_get_config_descriptor()
+ */
+API_EXPORTED int libusb_get_config_descriptor_by_value(libusb_device *dev,
+	uint8_t bConfigurationValue, struct libusb_config_descriptor **config)
+{
+	int idx;
+	int r = usbi_get_config_index_by_value(dev, bConfigurationValue, &idx);
+	if (r < 0)
+		return r;
+	else if (idx == -1)
+		return LIBUSB_ERROR_NOT_FOUND;
+	else
+		return libusb_get_config_descriptor(dev, idx, config);
+}
+
+/** \ingroup desc
+ * Free a configuration descriptor obtained from
+ * libusb_get_active_config_descriptor() or libusb_get_config_descriptor().
+ * It is safe to call this function with a NULL config parameter, in which
+ * case the function simply returns.
+ *
+ * \param config the configuration descriptor to free
+ */
+API_EXPORTED void libusb_free_config_descriptor(
+	struct libusb_config_descriptor *config)
+{
+	if (!config)
+		return;
+
+	clear_configuration(config);
+	free(config);
+}
+
+/** \ingroup desc
+ * Retrieve a string descriptor in C style ASCII.
+ *
+ * Wrapper around libusb_get_string_descriptor(). Uses the first language 
+ * supported by the device.
+ *
+ * \param dev a device handle
+ * \param desc_index the index of the descriptor to retrieve
+ * \param data output buffer for ASCII string descriptor
+ * \param length size of data buffer
+ * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure
+ */
+API_EXPORTED int libusb_get_string_descriptor_ascii(libusb_device_handle *dev,
+	uint8_t desc_index, unsigned char *data, int length)
+{
+	unsigned char tbuf[255]; /* Some devices choke on size > 255 */
+	int r, langid, si, di;
+
+	/* Asking for the zero'th index is special - it returns a string
+	 * descriptor that contains all the language IDs supported by the device.
+	 * Typically there aren't many - often only one. The language IDs are 16
+	 * bit numbers, and they start at the third byte in the descriptor. See
+	 * USB 2.0 specification section 9.6.7 for more information. */
+	r = libusb_get_string_descriptor(dev, 0, 0, tbuf, sizeof(tbuf));
+	if (r < 0)
+		return r;
+
+	if (r < 4)
+		return LIBUSB_ERROR_IO;
+
+	langid = tbuf[2] | (tbuf[3] << 8);
+
+	r = libusb_get_string_descriptor(dev, desc_index, langid, tbuf,
+		sizeof(tbuf));
+	if (r < 0)
+		return r;
+
+	if (tbuf[1] != LIBUSB_DT_STRING)
+		return LIBUSB_ERROR_IO;
+
+	if (tbuf[0] > r)
+		return LIBUSB_ERROR_IO;
+
+	for (di = 0, si = 2; si < tbuf[0]; si += 2) {
+		if (di >= (length - 1))
+			break;
+
+		if (tbuf[si + 1]) /* high byte */
+			data[di++] = '?';
+		else
+			data[di++] = tbuf[si];
+	}
+
+	data[di] = 0;
+	return di;
+}
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/io.c b/Platform/Android/jni/External/libusb-1.0.8/libusb/io.c
new file mode 100644
index 0000000..b785eec
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/io.c
@@ -0,0 +1,2313 @@
+/*
+ * I/O functions for libusb
+ * Copyright (C) 2007-2009 Daniel Drake <dsd at gentoo.org>
+ * Copyright (c) 2001 Johannes Erdfelt <johannes at erdfelt.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include <errno.h>
+#include <poll.h>
+#include <pthread.h>
+#include <signal.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
+#include <time.h>
+#include <unistd.h>
+
+#ifdef USBI_TIMERFD_AVAILABLE
+#include <sys/timerfd.h>
+#endif
+#define TIMESPEC_TO_TIMEVAL(tv, ts)                                     \
+        do {                                                            \
+                (tv)->tv_sec = (ts)->tv_sec;                            \
+                (tv)->tv_usec = (ts)->tv_nsec / 1000;                   \
+        } while (0)
+
+#include "libusbi.h"
+
+/**
+ * \page io Synchronous and asynchronous device I/O
+ *
+ * \section intro Introduction
+ *
+ * If you're using libusb in your application, you're probably wanting to
+ * perform I/O with devices - you want to perform USB data transfers.
+ *
+ * libusb offers two separate interfaces for device I/O. This page aims to
+ * introduce the two in order to help you decide which one is more suitable
+ * for your application. You can also choose to use both interfaces in your
+ * application by considering each transfer on a case-by-case basis.
+ *
+ * Once you have read through the following discussion, you should consult the
+ * detailed API documentation pages for the details:
+ * - \ref syncio
+ * - \ref asyncio
+ *
+ * \section theory Transfers at a logical level
+ *
+ * At a logical level, USB transfers typically happen in two parts. For
+ * example, when reading data from a endpoint:
+ * -# A request for data is sent to the device
+ * -# Some time later, the incoming data is received by the host
+ *
+ * or when writing data to an endpoint:
+ *
+ * -# The data is sent to the device
+ * -# Some time later, the host receives acknowledgement from the device that
+ *    the data has been transferred.
+ *
+ * There may be an indefinite delay between the two steps. Consider a
+ * fictional USB input device with a button that the user can press. In order
+ * to determine when the button is pressed, you would likely submit a request
+ * to read data on a bulk or interrupt endpoint and wait for data to arrive.
+ * Data will arrive when the button is pressed by the user, which is
+ * potentially hours later.
+ *
+ * libusb offers both a synchronous and an asynchronous interface to performing
+ * USB transfers. The main difference is that the synchronous interface
+ * combines both steps indicated above into a single function call, whereas
+ * the asynchronous interface separates them.
+ *
+ * \section sync The synchronous interface
+ *
+ * The synchronous I/O interface allows you to perform a USB transfer with
+ * a single function call. When the function call returns, the transfer has
+ * completed and you can parse the results.
+ *
+ * If you have used the libusb-0.1 before, this I/O style will seem familar to
+ * you. libusb-0.1 only offered a synchronous interface.
+ *
+ * In our input device example, to read button presses you might write code
+ * in the following style:
+\code
+unsigned char data[4];
+int actual_length,
+int r = libusb_bulk_transfer(handle, EP_IN, data, sizeof(data), &actual_length, 0);
+if (r == 0 && actual_length == sizeof(data)) {
+	// results of the transaction can now be found in the data buffer
+	// parse them here and report button press
+} else {
+	error();
+}
+\endcode
+ *
+ * The main advantage of this model is simplicity: you did everything with
+ * a single simple function call.
+ *
+ * However, this interface has its limitations. Your application will sleep
+ * inside libusb_bulk_transfer() until the transaction has completed. If it
+ * takes the user 3 hours to press the button, your application will be
+ * sleeping for that long. Execution will be tied up inside the library -
+ * the entire thread will be useless for that duration.
+ *
+ * Another issue is that by tieing up the thread with that single transaction
+ * there is no possibility of performing I/O with multiple endpoints and/or
+ * multiple devices simultaneously, unless you resort to creating one thread
+ * per transaction.
+ *
+ * Additionally, there is no opportunity to cancel the transfer after the
+ * request has been submitted.
+ *
+ * For details on how to use the synchronous API, see the
+ * \ref syncio "synchronous I/O API documentation" pages.
+ * 
+ * \section async The asynchronous interface
+ *
+ * Asynchronous I/O is the most significant new feature in libusb-1.0.
+ * Although it is a more complex interface, it solves all the issues detailed
+ * above.
+ *
+ * Instead of providing which functions that block until the I/O has complete,
+ * libusb's asynchronous interface presents non-blocking functions which
+ * begin a transfer and then return immediately. Your application passes a
+ * callback function pointer to this non-blocking function, which libusb will
+ * call with the results of the transaction when it has completed.
+ *
+ * Transfers which have been submitted through the non-blocking functions
+ * can be cancelled with a separate function call.
+ *
+ * The non-blocking nature of this interface allows you to be simultaneously
+ * performing I/O to multiple endpoints on multiple devices, without having
+ * to use threads.
+ *
+ * This added flexibility does come with some complications though:
+ * - In the interest of being a lightweight library, libusb does not create
+ * threads and can only operate when your application is calling into it. Your
+ * application must call into libusb from it's main loop when events are ready
+ * to be handled, or you must use some other scheme to allow libusb to
+ * undertake whatever work needs to be done.
+ * - libusb also needs to be called into at certain fixed points in time in
+ * order to accurately handle transfer timeouts.
+ * - Memory handling becomes more complex. You cannot use stack memory unless
+ * the function with that stack is guaranteed not to return until the transfer
+ * callback has finished executing.
+ * - You generally lose some linearity from your code flow because submitting
+ * the transfer request is done in a separate function from where the transfer
+ * results are handled. This becomes particularly obvious when you want to
+ * submit a second transfer based on the results of an earlier transfer.
+ *
+ * Internally, libusb's synchronous interface is expressed in terms of function
+ * calls to the asynchronous interface.
+ *
+ * For details on how to use the asynchronous API, see the
+ * \ref asyncio "asynchronous I/O API" documentation pages.
+ */
+
+
+/**
+ * \page packetoverflow Packets and overflows
+ *
+ * \section packets Packet abstraction
+ *
+ * The USB specifications describe how data is transmitted in packets, with
+ * constraints on packet size defined by endpoint descriptors. The host must
+ * not send data payloads larger than the endpoint's maximum packet size.
+ *
+ * libusb and the underlying OS abstract out the packet concept, allowing you
+ * to request transfers of any size. Internally, the request will be divided
+ * up into correctly-sized packets. You do not have to be concerned with
+ * packet sizes, but there is one exception when considering overflows.
+ *
+ * \section overflow Bulk/interrupt transfer overflows
+ *
+ * When requesting data on a bulk endpoint, libusb requires you to supply a
+ * buffer and the maximum number of bytes of data that libusb can put in that
+ * buffer. However, the size of the buffer is not communicated to the device -
+ * the device is just asked to send any amount of data.
+ *
+ * There is no problem if the device sends an amount of data that is less than
+ * or equal to the buffer size. libusb reports this condition to you through
+ * the \ref libusb_transfer::actual_length "libusb_transfer.actual_length"
+ * field.
+ *
+ * Problems may occur if the device attempts to send more data than can fit in
+ * the buffer. libusb reports LIBUSB_TRANSFER_OVERFLOW for this condition but
+ * other behaviour is largely undefined: actual_length may or may not be
+ * accurate, the chunk of data that can fit in the buffer (before overflow)
+ * may or may not have been transferred.
+ *
+ * Overflows are nasty, but can be avoided. Even though you were told to
+ * ignore packets above, think about the lower level details: each transfer is
+ * split into packets (typically small, with a maximum size of 512 bytes).
+ * Overflows can only happen if the final packet in an incoming data transfer
+ * is smaller than the actual packet that the device wants to transfer.
+ * Therefore, you will never see an overflow if your transfer buffer size is a
+ * multiple of the endpoint's packet size: the final packet will either
+ * fill up completely or will be only partially filled.
+ */
+
+/**
+ * @defgroup asyncio Asynchronous device I/O
+ *
+ * This page details libusb's asynchronous (non-blocking) API for USB device
+ * I/O. This interface is very powerful but is also quite complex - you will
+ * need to read this page carefully to understand the necessary considerations
+ * and issues surrounding use of this interface. Simplistic applications
+ * may wish to consider the \ref syncio "synchronous I/O API" instead.
+ *
+ * The asynchronous interface is built around the idea of separating transfer
+ * submission and handling of transfer completion (the synchronous model
+ * combines both of these into one). There may be a long delay between
+ * submission and completion, however the asynchronous submission function
+ * is non-blocking so will return control to your application during that
+ * potentially long delay.
+ *
+ * \section asyncabstraction Transfer abstraction
+ *
+ * For the asynchronous I/O, libusb implements the concept of a generic
+ * transfer entity for all types of I/O (control, bulk, interrupt,
+ * isochronous). The generic transfer object must be treated slightly
+ * differently depending on which type of I/O you are performing with it.
+ *
+ * This is represented by the public libusb_transfer structure type.
+ *
+ * \section asynctrf Asynchronous transfers
+ *
+ * We can view asynchronous I/O as a 5 step process:
+ * -# <b>Allocation</b>: allocate a libusb_transfer
+ * -# <b>Filling</b>: populate the libusb_transfer instance with information
+ *    about the transfer you wish to perform
+ * -# <b>Submission</b>: ask libusb to submit the transfer
+ * -# <b>Completion handling</b>: examine transfer results in the
+ *    libusb_transfer structure
+ * -# <b>Deallocation</b>: clean up resources
+ * 
+ *
+ * \subsection asyncalloc Allocation
+ *
+ * This step involves allocating memory for a USB transfer. This is the
+ * generic transfer object mentioned above. At this stage, the transfer
+ * is "blank" with no details about what type of I/O it will be used for.
+ *
+ * Allocation is done with the libusb_alloc_transfer() function. You must use
+ * this function rather than allocating your own transfers.
+ *
+ * \subsection asyncfill Filling
+ *
+ * This step is where you take a previously allocated transfer and fill it
+ * with information to determine the message type and direction, data buffer,
+ * callback function, etc.
+ *
+ * You can either fill the required fields yourself or you can use the
+ * helper functions: libusb_fill_control_transfer(), libusb_fill_bulk_transfer()
+ * and libusb_fill_interrupt_transfer().
+ *
+ * \subsection asyncsubmit Submission
+ *
+ * When you have allocated a transfer and filled it, you can submit it using
+ * libusb_submit_transfer(). This function returns immediately but can be
+ * regarded as firing off the I/O request in the background.
+ *
+ * \subsection asynccomplete Completion handling
+ *
+ * After a transfer has been submitted, one of four things can happen to it:
+ *
+ * - The transfer completes (i.e. some data was transferred)
+ * - The transfer has a timeout and the timeout expires before all data is
+ * transferred
+ * - The transfer fails due to an error
+ * - The transfer is cancelled
+ *
+ * Each of these will cause the user-specified transfer callback function to
+ * be invoked. It is up to the callback function to determine which of the
+ * above actually happened and to act accordingly.
+ *
+ * The user-specified callback is passed a pointer to the libusb_transfer
+ * structure which was used to setup and submit the transfer. At completion
+ * time, libusb has populated this structure with results of the transfer:
+ * success or failure reason, number of bytes of data transferred, etc. See
+ * the libusb_transfer structure documentation for more information.
+ *
+ * \subsection Deallocation
+ *
+ * When a transfer has completed (i.e. the callback function has been invoked),
+ * you are advised to free the transfer (unless you wish to resubmit it, see
+ * below). Transfers are deallocated with libusb_free_transfer().
+ *
+ * It is undefined behaviour to free a transfer which has not completed.
+ *
+ * \section asyncresubmit Resubmission
+ *
+ * You may be wondering why allocation, filling, and submission are all
+ * separated above where they could reasonably be combined into a single
+ * operation.
+ *
+ * The reason for separation is to allow you to resubmit transfers without
+ * having to allocate new ones every time. This is especially useful for
+ * common situations dealing with interrupt endpoints - you allocate one
+ * transfer, fill and submit it, and when it returns with results you just
+ * resubmit it for the next interrupt.
+ *
+ * \section asynccancel Cancellation
+ *
+ * Another advantage of using the asynchronous interface is that you have
+ * the ability to cancel transfers which have not yet completed. This is
+ * done by calling the libusb_cancel_transfer() function.
+ *
+ * libusb_cancel_transfer() is asynchronous/non-blocking in itself. When the
+ * cancellation actually completes, the transfer's callback function will
+ * be invoked, and the callback function should check the transfer status to
+ * determine that it was cancelled.
+ *
+ * Freeing the transfer after it has been cancelled but before cancellation
+ * has completed will result in undefined behaviour.
+ *
+ * When a transfer is cancelled, some of the data may have been transferred.
+ * libusb will communicate this to you in the transfer callback. Do not assume
+ * that no data was transferred.
+ *
+ * \section bulk_overflows Overflows on device-to-host bulk/interrupt endpoints
+ *
+ * If your device does not have predictable transfer sizes (or it misbehaves),
+ * your application may submit a request for data on an IN endpoint which is
+ * smaller than the data that the device wishes to send. In some circumstances
+ * this will cause an overflow, which is a nasty condition to deal with. See
+ * the \ref packetoverflow page for discussion.
+ *
+ * \section asyncctrl Considerations for control transfers
+ *
+ * The <tt>libusb_transfer</tt> structure is generic and hence does not
+ * include specific fields for the control-specific setup packet structure.
+ *
+ * In order to perform a control transfer, you must place the 8-byte setup
+ * packet at the start of the data buffer. To simplify this, you could
+ * cast the buffer pointer to type struct libusb_control_setup, or you can
+ * use the helper function libusb_fill_control_setup().
+ *
+ * The wLength field placed in the setup packet must be the length you would
+ * expect to be sent in the setup packet: the length of the payload that
+ * follows (or the expected maximum number of bytes to receive). However,
+ * the length field of the libusb_transfer object must be the length of
+ * the data buffer - i.e. it should be wLength <em>plus</em> the size of
+ * the setup packet (LIBUSB_CONTROL_SETUP_SIZE).
+ *
+ * If you use the helper functions, this is simplified for you:
+ * -# Allocate a buffer of size LIBUSB_CONTROL_SETUP_SIZE plus the size of the
+ * data you are sending/requesting.
+ * -# Call libusb_fill_control_setup() on the data buffer, using the transfer
+ * request size as the wLength value (i.e. do not include the extra space you
+ * allocated for the control setup).
+ * -# If this is a host-to-device transfer, place the data to be transferred
+ * in the data buffer, starting at offset LIBUSB_CONTROL_SETUP_SIZE.
+ * -# Call libusb_fill_control_transfer() to associate the data buffer with
+ * the transfer (and to set the remaining details such as callback and timeout).
+ *   - Note that there is no parameter to set the length field of the transfer.
+ *     The length is automatically inferred from the wLength field of the setup
+ *     packet.
+ * -# Submit the transfer.
+ *
+ * The multi-byte control setup fields (wValue, wIndex and wLength) must
+ * be given in little-endian byte order (the endianness of the USB bus).
+ * Endianness conversion is transparently handled by
+ * libusb_fill_control_setup() which is documented to accept host-endian
+ * values.
+ *
+ * Further considerations are needed when handling transfer completion in
+ * your callback function:
+ * - As you might expect, the setup packet will still be sitting at the start
+ * of the data buffer.
+ * - If this was a device-to-host transfer, the received data will be sitting
+ * at offset LIBUSB_CONTROL_SETUP_SIZE into the buffer.
+ * - The actual_length field of the transfer structure is relative to the
+ * wLength of the setup packet, rather than the size of the data buffer. So,
+ * if your wLength was 4, your transfer's <tt>length</tt> was 12, then you
+ * should expect an <tt>actual_length</tt> of 4 to indicate that the data was
+ * transferred in entirity.
+ *
+ * To simplify parsing of setup packets and obtaining the data from the
+ * correct offset, you may wish to use the libusb_control_transfer_get_data()
+ * and libusb_control_transfer_get_setup() functions within your transfer
+ * callback.
+ *
+ * Even though control endpoints do not halt, a completed control transfer
+ * may have a LIBUSB_TRANSFER_STALL status code. This indicates the control
+ * request was not supported.
+ *
+ * \section asyncintr Considerations for interrupt transfers
+ * 
+ * All interrupt transfers are performed using the polling interval presented
+ * by the bInterval value of the endpoint descriptor.
+ *
+ * \section asynciso Considerations for isochronous transfers
+ *
+ * Isochronous transfers are more complicated than transfers to
+ * non-isochronous endpoints.
+ *
+ * To perform I/O to an isochronous endpoint, allocate the transfer by calling
+ * libusb_alloc_transfer() with an appropriate number of isochronous packets.
+ *
+ * During filling, set \ref libusb_transfer::type "type" to
+ * \ref libusb_transfer_type::LIBUSB_TRANSFER_TYPE_ISOCHRONOUS
+ * "LIBUSB_TRANSFER_TYPE_ISOCHRONOUS", and set
+ * \ref libusb_transfer::num_iso_packets "num_iso_packets" to a value less than
+ * or equal to the number of packets you requested during allocation.
+ * libusb_alloc_transfer() does not set either of these fields for you, given
+ * that you might not even use the transfer on an isochronous endpoint.
+ *
+ * Next, populate the length field for the first num_iso_packets entries in
+ * the \ref libusb_transfer::iso_packet_desc "iso_packet_desc" array. Section
+ * 5.6.3 of the USB2 specifications describe how the maximum isochronous
+ * packet length is determined by the wMaxPacketSize field in the endpoint
+ * descriptor.
+ * Two functions can help you here:
+ *
+ * - libusb_get_max_iso_packet_size() is an easy way to determine the max
+ *   packet size for an isochronous endpoint. Note that the maximum packet
+ *   size is actually the maximum number of bytes that can be transmitted in
+ *   a single microframe, therefore this function multiplies the maximum number
+ *   of bytes per transaction by the number of transaction opportunities per
+ *   microframe.
+ * - libusb_set_iso_packet_lengths() assigns the same length to all packets
+ *   within a transfer, which is usually what you want.
+ *
+ * For outgoing transfers, you'll obviously fill the buffer and populate the
+ * packet descriptors in hope that all the data gets transferred. For incoming
+ * transfers, you must ensure the buffer has sufficient capacity for
+ * the situation where all packets transfer the full amount of requested data.
+ *
+ * Completion handling requires some extra consideration. The
+ * \ref libusb_transfer::actual_length "actual_length" field of the transfer
+ * is meaningless and should not be examined; instead you must refer to the
+ * \ref libusb_iso_packet_descriptor::actual_length "actual_length" field of
+ * each individual packet.
+ *
+ * The \ref libusb_transfer::status "status" field of the transfer is also a
+ * little misleading:
+ *  - If the packets were submitted and the isochronous data microframes
+ *    completed normally, status will have value
+ *    \ref libusb_transfer_status::LIBUSB_TRANSFER_COMPLETED
+ *    "LIBUSB_TRANSFER_COMPLETED". Note that bus errors and software-incurred
+ *    delays are not counted as transfer errors; the transfer.status field may
+ *    indicate COMPLETED even if some or all of the packets failed. Refer to
+ *    the \ref libusb_iso_packet_descriptor::status "status" field of each
+ *    individual packet to determine packet failures.
+ *  - The status field will have value
+ *    \ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR
+ *    "LIBUSB_TRANSFER_ERROR" only when serious errors were encountered.
+ *  - Other transfer status codes occur with normal behaviour.
+ *
+ * The data for each packet will be found at an offset into the buffer that
+ * can be calculated as if each prior packet completed in full. The
+ * libusb_get_iso_packet_buffer() and libusb_get_iso_packet_buffer_simple()
+ * functions may help you here.
+ *
+ * \section asyncmem Memory caveats
+ *
+ * In most circumstances, it is not safe to use stack memory for transfer
+ * buffers. This is because the function that fired off the asynchronous
+ * transfer may return before libusb has finished using the buffer, and when
+ * the function returns it's stack gets destroyed. This is true for both
+ * host-to-device and device-to-host transfers.
+ *
+ * The only case in which it is safe to use stack memory is where you can
+ * guarantee that the function owning the stack space for the buffer does not
+ * return until after the transfer's callback function has completed. In every
+ * other case, you need to use heap memory instead.
+ *
+ * \section asyncflags Fine control
+ *
+ * Through using this asynchronous interface, you may find yourself repeating
+ * a few simple operations many times. You can apply a bitwise OR of certain
+ * flags to a transfer to simplify certain things:
+ * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_SHORT_NOT_OK
+ *   "LIBUSB_TRANSFER_SHORT_NOT_OK" results in transfers which transferred
+ *   less than the requested amount of data being marked with status
+ *   \ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR "LIBUSB_TRANSFER_ERROR"
+ *   (they would normally be regarded as COMPLETED)
+ * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER
+ *   "LIBUSB_TRANSFER_FREE_BUFFER" allows you to ask libusb to free the transfer
+ *   buffer when freeing the transfer.
+ * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_TRANSFER
+ *   "LIBUSB_TRANSFER_FREE_TRANSFER" causes libusb to automatically free the
+ *   transfer after the transfer callback returns.
+ *
+ * \section asyncevent Event handling
+ *
+ * In accordance of the aim of being a lightweight library, libusb does not
+ * create threads internally. This means that libusb code does not execute
+ * at any time other than when your application is calling a libusb function.
+ * However, an asynchronous model requires that libusb perform work at various
+ * points in time - namely processing the results of previously-submitted
+ * transfers and invoking the user-supplied callback function.
+ *
+ * This gives rise to the libusb_handle_events() function which your
+ * application must call into when libusb has work do to. This gives libusb
+ * the opportunity to reap pending transfers, invoke callbacks, etc.
+ *
+ * The first issue to discuss here is how your application can figure out
+ * when libusb has work to do. In fact, there are two naive options which
+ * do not actually require your application to know this:
+ * -# Periodically call libusb_handle_events() in non-blocking mode at fixed
+ *    short intervals from your main loop
+ * -# Repeatedly call libusb_handle_events() in blocking mode from a dedicated
+ *    thread.
+ *
+ * The first option is plainly not very nice, and will cause unnecessary 
+ * CPU wakeups leading to increased power usage and decreased battery life.
+ * The second option is not very nice either, but may be the nicest option
+ * available to you if the "proper" approach can not be applied to your
+ * application (read on...).
+ * 
+ * The recommended option is to integrate libusb with your application main
+ * event loop. libusb exposes a set of file descriptors which allow you to do
+ * this. Your main loop is probably already calling poll() or select() or a
+ * variant on a set of file descriptors for other event sources (e.g. keyboard
+ * button presses, mouse movements, network sockets, etc). You then add
+ * libusb's file descriptors to your poll()/select() calls, and when activity
+ * is detected on such descriptors you know it is time to call
+ * libusb_handle_events().
+ *
+ * There is one final event handling complication. libusb supports
+ * asynchronous transfers which time out after a specified time period, and
+ * this requires that libusb is called into at or after the timeout so that
+ * the timeout can be handled. So, in addition to considering libusb's file
+ * descriptors in your main event loop, you must also consider that libusb
+ * sometimes needs to be called into at fixed points in time even when there
+ * is no file descriptor activity.
+ *
+ * For the details on retrieving the set of file descriptors and determining
+ * the next timeout, see the \ref poll "polling and timing" API documentation.
+ */
+
+/**
+ * @defgroup poll Polling and timing
+ *
+ * This page documents libusb's functions for polling events and timing.
+ * These functions are only necessary for users of the
+ * \ref asyncio "asynchronous API". If you are only using the simpler
+ * \ref syncio "synchronous API" then you do not need to ever call these
+ * functions.
+ *
+ * The justification for the functionality described here has already been
+ * discussed in the \ref asyncevent "event handling" section of the
+ * asynchronous API documentation. In summary, libusb does not create internal
+ * threads for event processing and hence relies on your application calling
+ * into libusb at certain points in time so that pending events can be handled.
+ * In order to know precisely when libusb needs to be called into, libusb
+ * offers you a set of pollable file descriptors and information about when
+ * the next timeout expires.
+ *
+ * If you are using the asynchronous I/O API, you must take one of the two
+ * following options, otherwise your I/O will not complete.
+ *
+ * \section pollsimple The simple option
+ *
+ * If your application revolves solely around libusb and does not need to
+ * handle other event sources, you can have a program structure as follows:
+\code
+// initialize libusb
+// find and open device
+// maybe fire off some initial async I/O
+
+while (user_has_not_requested_exit)
+	libusb_handle_events(ctx);
+
+// clean up and exit
+\endcode
+ *
+ * With such a simple main loop, you do not have to worry about managing
+ * sets of file descriptors or handling timeouts. libusb_handle_events() will
+ * handle those details internally.
+ *
+ * \section pollmain The more advanced option
+ *
+ * In more advanced applications, you will already have a main loop which
+ * is monitoring other event sources: network sockets, X11 events, mouse
+ * movements, etc. Through exposing a set of file descriptors, libusb is
+ * designed to cleanly integrate into such main loops.
+ *
+ * In addition to polling file descriptors for the other event sources, you
+ * take a set of file descriptors from libusb and monitor those too. When you
+ * detect activity on libusb's file descriptors, you call
+ * libusb_handle_events_timeout() in non-blocking mode.
+ *
+ * What's more, libusb may also need to handle events at specific moments in
+ * time. No file descriptor activity is generated at these times, so your
+ * own application needs to be continually aware of when the next one of these
+ * moments occurs (through calling libusb_get_next_timeout()), and then it
+ * needs to call libusb_handle_events_timeout() in non-blocking mode when
+ * these moments occur. This means that you need to adjust your
+ * poll()/select() timeout accordingly.
+ *
+ * libusb provides you with a set of file descriptors to poll and expects you
+ * to poll all of them, treating them as a single entity. The meaning of each
+ * file descriptor in the set is an internal implementation detail,
+ * platform-dependent and may vary from release to release. Don't try and
+ * interpret the meaning of the file descriptors, just do as libusb indicates,
+ * polling all of them at once.
+ *
+ * In pseudo-code, you want something that looks like:
+\code
+// initialise libusb
+
+libusb_get_pollfds(ctx)
+while (user has not requested application exit) {
+	libusb_get_next_timeout(ctx);
+	poll(on libusb file descriptors plus any other event sources of interest,
+		using a timeout no larger than the value libusb just suggested)
+	if (poll() indicated activity on libusb file descriptors)
+		libusb_handle_events_timeout(ctx, 0);
+	if (time has elapsed to or beyond the libusb timeout)
+		libusb_handle_events_timeout(ctx, 0);
+	// handle events from other sources here
+}
+
+// clean up and exit
+\endcode
+ *
+ * \subsection polltime Notes on time-based events
+ *
+ * The above complication with having to track time and call into libusb at
+ * specific moments is a bit of a headache. For maximum compatibility, you do
+ * need to write your main loop as above, but you may decide that you can
+ * restrict the supported platforms of your application and get away with
+ * a more simplistic scheme.
+ *
+ * These time-based event complications are \b not required on the following
+ * platforms:
+ *  - Darwin
+ *  - Linux, provided that the following version requirements are satisfied:
+ *   - Linux v2.6.27 or newer, compiled with timerfd support
+ *   - glibc v2.9 or newer
+ *   - libusb v1.0.5 or newer
+ *
+ * Under these configurations, libusb_get_next_timeout() will \em always return
+ * 0, so your main loop can be simplified to:
+\code
+// initialise libusb
+
+libusb_get_pollfds(ctx)
+while (user has not requested application exit) {
+	poll(on libusb file descriptors plus any other event sources of interest,
+		using any timeout that you like)
+	if (poll() indicated activity on libusb file descriptors)
+		libusb_handle_events_timeout(ctx, 0);
+	// handle events from other sources here
+}
+
+// clean up and exit
+\endcode
+ *
+ * Do remember that if you simplify your main loop to the above, you will
+ * lose compatibility with some platforms (including legacy Linux platforms,
+ * and <em>any future platforms supported by libusb which may have time-based
+ * event requirements</em>). The resultant problems will likely appear as
+ * strange bugs in your application.
+ *
+ * You can use the libusb_pollfds_handle_timeouts() function to do a runtime
+ * check to see if it is safe to ignore the time-based event complications.
+ * If your application has taken the shortcut of ignoring libusb's next timeout
+ * in your main loop, then you are advised to check the return value of
+ * libusb_pollfds_handle_timeouts() during application startup, and to abort
+ * if the platform does suffer from these timing complications.
+ *
+ * \subsection fdsetchange Changes in the file descriptor set
+ *
+ * The set of file descriptors that libusb uses as event sources may change
+ * during the life of your application. Rather than having to repeatedly
+ * call libusb_get_pollfds(), you can set up notification functions for when
+ * the file descriptor set changes using libusb_set_pollfd_notifiers().
+ *
+ * \subsection mtissues Multi-threaded considerations
+ *
+ * Unfortunately, the situation is complicated further when multiple threads
+ * come into play. If two threads are monitoring the same file descriptors,
+ * the fact that only one thread will be woken up when an event occurs causes
+ * some headaches.
+ *
+ * The events lock, event waiters lock, and libusb_handle_events_locked()
+ * entities are added to solve these problems. You do not need to be concerned
+ * with these entities otherwise.
+ *
+ * See the extra documentation: \ref mtasync
+ */
+
+/** \page mtasync Multi-threaded applications and asynchronous I/O
+ *
+ * libusb is a thread-safe library, but extra considerations must be applied
+ * to applications which interact with libusb from multiple threads.
+ *
+ * The underlying issue that must be addressed is that all libusb I/O
+ * revolves around monitoring file descriptors through the poll()/select()
+ * system calls. This is directly exposed at the
+ * \ref asyncio "asynchronous interface" but it is important to note that the
+ * \ref syncio "synchronous interface" is implemented on top of the
+ * asynchonrous interface, therefore the same considerations apply.
+ *
+ * The issue is that if two or more threads are concurrently calling poll()
+ * or select() on libusb's file descriptors then only one of those threads
+ * will be woken up when an event arrives. The others will be completely
+ * oblivious that anything has happened.
+ *
+ * Consider the following pseudo-code, which submits an asynchronous transfer
+ * then waits for its completion. This style is one way you could implement a
+ * synchronous interface on top of the asynchronous interface (and libusb
+ * does something similar, albeit more advanced due to the complications
+ * explained on this page).
+ *
+\code
+void cb(struct libusb_transfer *transfer)
+{
+	int *completed = transfer->user_data;
+	*completed = 1;
+}
+
+void myfunc() {
+	struct libusb_transfer *transfer;
+	unsigned char buffer[LIBUSB_CONTROL_SETUP_SIZE];
+	int completed = 0;
+
+	transfer = libusb_alloc_transfer(0);
+	libusb_fill_control_setup(buffer,
+		LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT, 0x04, 0x01, 0, 0);
+	libusb_fill_control_transfer(transfer, dev, buffer, cb, &completed, 1000);
+	libusb_submit_transfer(transfer);
+
+	while (!completed) {
+		poll(libusb file descriptors, 120*1000);
+		if (poll indicates activity)
+			libusb_handle_events_timeout(ctx, 0);
+	}
+	printf("completed!");
+	// other code here
+}
+\endcode
+ *
+ * Here we are <em>serializing</em> completion of an asynchronous event
+ * against a condition - the condition being completion of a specific transfer.
+ * The poll() loop has a long timeout to minimize CPU usage during situations
+ * when nothing is happening (it could reasonably be unlimited).
+ *
+ * If this is the only thread that is polling libusb's file descriptors, there
+ * is no problem: there is no danger that another thread will swallow up the
+ * event that we are interested in. On the other hand, if there is another
+ * thread polling the same descriptors, there is a chance that it will receive
+ * the event that we were interested in. In this situation, <tt>myfunc()</tt>
+ * will only realise that the transfer has completed on the next iteration of
+ * the loop, <em>up to 120 seconds later.</em> Clearly a two-minute delay is
+ * undesirable, and don't even think about using short timeouts to circumvent
+ * this issue!
+ * 
+ * The solution here is to ensure that no two threads are ever polling the
+ * file descriptors at the same time. A naive implementation of this would
+ * impact the capabilities of the library, so libusb offers the scheme
+ * documented below to ensure no loss of functionality.
+ *
+ * Before we go any further, it is worth mentioning that all libusb-wrapped
+ * event handling procedures fully adhere to the scheme documented below.
+ * This includes libusb_handle_events() and all the synchronous I/O functions - 
+ * libusb hides this headache from you. You do not need to worry about any
+ * of these issues if you stick to that level.
+ *
+ * The problem is when we consider the fact that libusb exposes file
+ * descriptors to allow for you to integrate asynchronous USB I/O into
+ * existing main loops, effectively allowing you to do some work behind
+ * libusb's back. If you do take libusb's file descriptors and pass them to
+ * poll()/select() yourself, you need to be aware of the associated issues.
+ *
+ * \section eventlock The events lock
+ *
+ * The first concept to be introduced is the events lock. The events lock
+ * is used to serialize threads that want to handle events, such that only
+ * one thread is handling events at any one time.
+ *
+ * You must take the events lock before polling libusb file descriptors,
+ * using libusb_lock_events(). You must release the lock as soon as you have
+ * aborted your poll()/select() loop, using libusb_unlock_events().
+ *
+ * \section threadwait Letting other threads do the work for you
+ *
+ * Although the events lock is a critical part of the solution, it is not
+ * enough on it's own. You might wonder if the following is sufficient...
+\code
+	libusb_lock_events(ctx);
+	while (!completed) {
+		poll(libusb file descriptors, 120*1000);
+		if (poll indicates activity)
+			libusb_handle_events_timeout(ctx, 0);
+	}
+	libusb_unlock_events(ctx);
+\endcode
+ * ...and the answer is that it is not. This is because the transfer in the
+ * code shown above may take a long time (say 30 seconds) to complete, and
+ * the lock is not released until the transfer is completed.
+ *
+ * Another thread with similar code that wants to do event handling may be
+ * working with a transfer that completes after a few milliseconds. Despite
+ * having such a quick completion time, the other thread cannot check that
+ * status of its transfer until the code above has finished (30 seconds later)
+ * due to contention on the lock.
+ *
+ * To solve this, libusb offers you a mechanism to determine when another
+ * thread is handling events. It also offers a mechanism to block your thread
+ * until the event handling thread has completed an event (and this mechanism
+ * does not involve polling of file descriptors).
+ *
+ * After determining that another thread is currently handling events, you
+ * obtain the <em>event waiters</em> lock using libusb_lock_event_waiters().
+ * You then re-check that some other thread is still handling events, and if
+ * so, you call libusb_wait_for_event().
+ *
+ * libusb_wait_for_event() puts your application to sleep until an event
+ * occurs, or until a thread releases the events lock. When either of these
+ * things happen, your thread is woken up, and should re-check the condition
+ * it was waiting on. It should also re-check that another thread is handling
+ * events, and if not, it should start handling events itself.
+ *
+ * This looks like the following, as pseudo-code:
+\code
+retry:
+if (libusb_try_lock_events(ctx) == 0) {
+	// we obtained the event lock: do our own event handling
+	while (!completed) {
+		if (!libusb_event_handling_ok(ctx)) {
+			libusb_unlock_events(ctx);
+			goto retry;
+		}
+		poll(libusb file descriptors, 120*1000);
+		if (poll indicates activity)
+			libusb_handle_events_locked(ctx, 0);
+	}
+	libusb_unlock_events(ctx);
+} else {
+	// another thread is doing event handling. wait for it to signal us that
+	// an event has completed
+	libusb_lock_event_waiters(ctx);
+
+	while (!completed) {
+		// now that we have the event waiters lock, double check that another
+		// thread is still handling events for us. (it may have ceased handling
+		// events in the time it took us to reach this point)
+		if (!libusb_event_handler_active(ctx)) {
+			// whoever was handling events is no longer doing so, try again
+			libusb_unlock_event_waiters(ctx);
+			goto retry;
+		}
+	
+		libusb_wait_for_event(ctx);
+	}
+	libusb_unlock_event_waiters(ctx);
+}
+printf("completed!\n");
+\endcode
+ *
+ * A naive look at the above code may suggest that this can only support
+ * one event waiter (hence a total of 2 competing threads, the other doing
+ * event handling), because the event waiter seems to have taken the event
+ * waiters lock while waiting for an event. However, the system does support
+ * multiple event waiters, because libusb_wait_for_event() actually drops
+ * the lock while waiting, and reaquires it before continuing.
+ *
+ * We have now implemented code which can dynamically handle situations where
+ * nobody is handling events (so we should do it ourselves), and it can also
+ * handle situations where another thread is doing event handling (so we can
+ * piggyback onto them). It is also equipped to handle a combination of
+ * the two, for example, another thread is doing event handling, but for
+ * whatever reason it stops doing so before our condition is met, so we take
+ * over the event handling.
+ *
+ * Four functions were introduced in the above pseudo-code. Their importance
+ * should be apparent from the code shown above.
+ * -# libusb_try_lock_events() is a non-blocking function which attempts
+ *    to acquire the events lock but returns a failure code if it is contended.
+ * -# libusb_event_handling_ok() checks that libusb is still happy for your
+ *    thread to be performing event handling. Sometimes, libusb needs to
+ *    interrupt the event handler, and this is how you can check if you have
+ *    been interrupted. If this function returns 0, the correct behaviour is
+ *    for you to give up the event handling lock, and then to repeat the cycle.
+ *    The following libusb_try_lock_events() will fail, so you will become an
+ *    events waiter. For more information on this, read \ref fullstory below.
+ * -# libusb_handle_events_locked() is a variant of
+ *    libusb_handle_events_timeout() that you can call while holding the
+ *    events lock. libusb_handle_events_timeout() itself implements similar
+ *    logic to the above, so be sure not to call it when you are
+ *    "working behind libusb's back", as is the case here.
+ * -# libusb_event_handler_active() determines if someone is currently
+ *    holding the events lock
+ *
+ * You might be wondering why there is no function to wake up all threads
+ * blocked on libusb_wait_for_event(). This is because libusb can do this
+ * internally: it will wake up all such threads when someone calls
+ * libusb_unlock_events() or when a transfer completes (at the point after its
+ * callback has returned).
+ *
+ * \subsection fullstory The full story
+ *
+ * The above explanation should be enough to get you going, but if you're
+ * really thinking through the issues then you may be left with some more
+ * questions regarding libusb's internals. If you're curious, read on, and if
+ * not, skip to the next section to avoid confusing yourself!
+ *
+ * The immediate question that may spring to mind is: what if one thread
+ * modifies the set of file descriptors that need to be polled while another
+ * thread is doing event handling?
+ *
+ * There are 2 situations in which this may happen.
+ * -# libusb_open() will add another file descriptor to the poll set,
+ *    therefore it is desirable to interrupt the event handler so that it
+ *    restarts, picking up the new descriptor.
+ * -# libusb_close() will remove a file descriptor from the poll set. There
+ *    are all kinds of race conditions that could arise here, so it is
+ *    important that nobody is doing event handling at this time.
+ *
+ * libusb handles these issues internally, so application developers do not
+ * have to stop their event handlers while opening/closing devices. Here's how
+ * it works, focusing on the libusb_close() situation first:
+ *
+ * -# During initialization, libusb opens an internal pipe, and it adds the read
+ *    end of this pipe to the set of file descriptors to be polled.
+ * -# During libusb_close(), libusb writes some dummy data on this control pipe.
+ *    This immediately interrupts the event handler. libusb also records
+ *    internally that it is trying to interrupt event handlers for this
+ *    high-priority event.
+ * -# At this point, some of the functions described above start behaving
+ *    differently:
+ *   - libusb_event_handling_ok() starts returning 1, indicating that it is NOT
+ *     OK for event handling to continue.
+ *   - libusb_try_lock_events() starts returning 1, indicating that another
+ *     thread holds the event handling lock, even if the lock is uncontended.
+ *   - libusb_event_handler_active() starts returning 1, indicating that
+ *     another thread is doing event handling, even if that is not true.
+ * -# The above changes in behaviour result in the event handler stopping and
+ *    giving up the events lock very quickly, giving the high-priority
+ *    libusb_close() operation a "free ride" to acquire the events lock. All
+ *    threads that are competing to do event handling become event waiters.
+ * -# With the events lock held inside libusb_close(), libusb can safely remove
+ *    a file descriptor from the poll set, in the safety of knowledge that
+ *    nobody is polling those descriptors or trying to access the poll set.
+ * -# After obtaining the events lock, the close operation completes very
+ *    quickly (usually a matter of milliseconds) and then immediately releases
+ *    the events lock.
+ * -# At the same time, the behaviour of libusb_event_handling_ok() and friends
+ *    reverts to the original, documented behaviour.
+ * -# The release of the events lock causes the threads that are waiting for
+ *    events to be woken up and to start competing to become event handlers
+ *    again. One of them will succeed; it will then re-obtain the list of poll
+ *    descriptors, and USB I/O will then continue as normal.
+ *
+ * libusb_open() is similar, and is actually a more simplistic case. Upon a
+ * call to libusb_open():
+ *
+ * -# The device is opened and a file descriptor is added to the poll set.
+ * -# libusb sends some dummy data on the control pipe, and records that it
+ *    is trying to modify the poll descriptor set.
+ * -# The event handler is interrupted, and the same behaviour change as for
+ *    libusb_close() takes effect, causing all event handling threads to become
+ *    event waiters.
+ * -# The libusb_open() implementation takes its free ride to the events lock.
+ * -# Happy that it has successfully paused the events handler, libusb_open()
+ *    releases the events lock.
+ * -# The event waiter threads are all woken up and compete to become event
+ *    handlers again. The one that succeeds will obtain the list of poll
+ *    descriptors again, which will include the addition of the new device.
+ *
+ * \subsection concl Closing remarks
+ *
+ * The above may seem a little complicated, but hopefully I have made it clear
+ * why such complications are necessary. Also, do not forget that this only
+ * applies to applications that take libusb's file descriptors and integrate
+ * them into their own polling loops.
+ *
+ * You may decide that it is OK for your multi-threaded application to ignore
+ * some of the rules and locks detailed above, because you don't think that
+ * two threads can ever be polling the descriptors at the same time. If that
+ * is the case, then that's good news for you because you don't have to worry.
+ * But be careful here; remember that the synchronous I/O functions do event
+ * handling internally. If you have one thread doing event handling in a loop
+ * (without implementing the rules and locking semantics documented above)
+ * and another trying to send a synchronous USB transfer, you will end up with
+ * two threads monitoring the same descriptors, and the above-described
+ * undesirable behaviour occuring. The solution is for your polling thread to
+ * play by the rules; the synchronous I/O functions do so, and this will result
+ * in them getting along in perfect harmony.
+ *
+ * If you do have a dedicated thread doing event handling, it is perfectly
+ * legal for it to take the event handling lock for long periods of time. Any
+ * synchronous I/O functions you call from other threads will transparently
+ * fall back to the "event waiters" mechanism detailed above. The only
+ * consideration that your event handling thread must apply is the one related
+ * to libusb_event_handling_ok(): you must call this before every poll(), and
+ * give up the events lock if instructed.
+ */
+
+int usbi_io_init(struct libusb_context *ctx)
+{
+	int r;
+
+	pthread_mutex_init(&ctx->flying_transfers_lock, NULL);
+	pthread_mutex_init(&ctx->pollfds_lock, NULL);
+	pthread_mutex_init(&ctx->pollfd_modify_lock, NULL);
+	pthread_mutex_init(&ctx->events_lock, NULL);
+	pthread_mutex_init(&ctx->event_waiters_lock, NULL);
+	pthread_cond_init(&ctx->event_waiters_cond, NULL);
+	list_init(&ctx->flying_transfers);
+	list_init(&ctx->pollfds);
+
+	/* FIXME should use an eventfd on kernels that support it */
+	r = pipe(ctx->ctrl_pipe);
+	if (r < 0)
+		return LIBUSB_ERROR_OTHER;
+
+	r = usbi_add_pollfd(ctx, ctx->ctrl_pipe[0], POLLIN);
+	if (r < 0)
+		return r;
+
+#ifdef USBI_TIMERFD_AVAILABLE
+	ctx->timerfd = timerfd_create(usbi_backend->get_timerfd_clockid(),
+		TFD_NONBLOCK);
+	if (ctx->timerfd >= 0) {
+		usbi_dbg("using timerfd for timeouts");
+		r = usbi_add_pollfd(ctx, ctx->timerfd, POLLIN);
+		if (r < 0) {
+			close(ctx->timerfd);
+			return r;
+		}
+	} else {
+		usbi_dbg("timerfd not available (code %d error %d)", ctx->timerfd, errno);
+		ctx->timerfd = -1;
+	}
+#endif
+
+	return 0;
+}
+
+void usbi_io_exit(struct libusb_context *ctx)
+{
+	usbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]);
+	close(ctx->ctrl_pipe[0]);
+	close(ctx->ctrl_pipe[1]);
+#ifdef USBI_TIMERFD_AVAILABLE
+	if (usbi_using_timerfd(ctx)) {
+		usbi_remove_pollfd(ctx, ctx->timerfd);
+		close(ctx->timerfd);
+	}
+#endif
+}
+
+static int calculate_timeout(struct usbi_transfer *transfer)
+{
+	int r;
+	struct timespec current_time;
+	unsigned int timeout =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout;
+
+	if (!timeout)
+		return 0;
+
+	r = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &current_time);
+	if (r < 0) {
+		usbi_err(ITRANSFER_CTX(transfer),
+			"failed to read monotonic clock, errno=%d", errno);
+		return r;
+	}
+
+	current_time.tv_sec += timeout / 1000;
+	current_time.tv_nsec += (timeout % 1000) * 1000000;
+
+	if (current_time.tv_nsec > 1000000000) {
+		current_time.tv_nsec -= 1000000000;
+		current_time.tv_sec++;
+	}
+
+	TIMESPEC_TO_TIMEVAL(&transfer->timeout, &current_time);
+	return 0;
+}
+
+/* add a transfer to the (timeout-sorted) active transfers list.
+ * returns 1 if the transfer has a timeout and it is the timeout next to
+ * expire */
+static int add_to_flying_list(struct usbi_transfer *transfer)
+{
+	struct usbi_transfer *cur;
+	struct timeval *timeout = &transfer->timeout;
+	struct libusb_context *ctx = ITRANSFER_CTX(transfer);
+	int r = 0;
+	int first = 1;
+
+	pthread_mutex_lock(&ctx->flying_transfers_lock);
+
+	/* if we have no other flying transfers, start the list with this one */
+	if (list_empty(&ctx->flying_transfers)) {
+		list_add(&transfer->list, &ctx->flying_transfers);
+		if (timerisset(timeout))
+			r = 1;
+		goto out;
+	}
+
+	/* if we have infinite timeout, append to end of list */
+	if (!timerisset(timeout)) {
+		list_add_tail(&transfer->list, &ctx->flying_transfers);
+		goto out;
+	}
+
+	/* otherwise, find appropriate place in list */
+	list_for_each_entry(cur, &ctx->flying_transfers, list) {
+		/* find first timeout that occurs after the transfer in question */
+		struct timeval *cur_tv = &cur->timeout;
+
+		if (!timerisset(cur_tv) || (cur_tv->tv_sec > timeout->tv_sec) ||
+				(cur_tv->tv_sec == timeout->tv_sec &&
+					cur_tv->tv_usec > timeout->tv_usec)) {
+			list_add_tail(&transfer->list, &cur->list);
+			r = first;
+			goto out;
+		}
+		first = 0;
+	}
+
+	/* otherwise we need to be inserted at the end */
+	list_add_tail(&transfer->list, &ctx->flying_transfers);
+out:
+	pthread_mutex_unlock(&ctx->flying_transfers_lock);
+	return r;
+}
+
+/** \ingroup asyncio
+ * Allocate a libusb transfer with a specified number of isochronous packet
+ * descriptors. The returned transfer is pre-initialized for you. When the new
+ * transfer is no longer needed, it should be freed with
+ * libusb_free_transfer().
+ *
+ * Transfers intended for non-isochronous endpoints (e.g. control, bulk,
+ * interrupt) should specify an iso_packets count of zero.
+ *
+ * For transfers intended for isochronous endpoints, specify an appropriate
+ * number of packet descriptors to be allocated as part of the transfer.
+ * The returned transfer is not specially initialized for isochronous I/O;
+ * you are still required to set the
+ * \ref libusb_transfer::num_iso_packets "num_iso_packets" and
+ * \ref libusb_transfer::type "type" fields accordingly.
+ *
+ * It is safe to allocate a transfer with some isochronous packets and then
+ * use it on a non-isochronous endpoint. If you do this, ensure that at time
+ * of submission, num_iso_packets is 0 and that type is set appropriately.
+ *
+ * \param iso_packets number of isochronous packet descriptors to allocate
+ * \returns a newly allocated transfer, or NULL on error
+ */
+API_EXPORTED struct libusb_transfer *libusb_alloc_transfer(int iso_packets)
+{
+	size_t os_alloc_size = usbi_backend->transfer_priv_size
+		+ (usbi_backend->add_iso_packet_size * iso_packets);
+	int alloc_size = sizeof(struct usbi_transfer)
+		+ sizeof(struct libusb_transfer)
+		+ (sizeof(struct libusb_iso_packet_descriptor) * iso_packets)
+		+ os_alloc_size;
+	struct usbi_transfer *itransfer = malloc(alloc_size);
+	if (!itransfer)
+		return NULL;
+
+	memset(itransfer, 0, alloc_size);
+	itransfer->num_iso_packets = iso_packets;
+	pthread_mutex_init(&itransfer->lock, NULL);
+	return __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+}
+
+/** \ingroup asyncio
+ * Free a transfer structure. This should be called for all transfers
+ * allocated with libusb_alloc_transfer().
+ *
+ * If the \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER
+ * "LIBUSB_TRANSFER_FREE_BUFFER" flag is set and the transfer buffer is
+ * non-NULL, this function will also free the transfer buffer using the
+ * standard system memory allocator (e.g. free()).
+ *
+ * It is legal to call this function with a NULL transfer. In this case,
+ * the function will simply return safely.
+ *
+ * It is not legal to free an active transfer (one which has been submitted
+ * and has not yet completed).
+ *
+ * \param transfer the transfer to free
+ */
+API_EXPORTED void libusb_free_transfer(struct libusb_transfer *transfer)
+{
+	struct usbi_transfer *itransfer;
+	if (!transfer)
+		return;
+
+	if (transfer->flags & LIBUSB_TRANSFER_FREE_BUFFER && transfer->buffer)
+		free(transfer->buffer);
+
+	itransfer = __LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);
+	pthread_mutex_destroy(&itransfer->lock);
+	free(itransfer);
+}
+
+/** \ingroup asyncio
+ * Submit a transfer. This function will fire off the USB transfer and then
+ * return immediately.
+ *
+ * \param transfer the transfer to submit
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns LIBUSB_ERROR_BUSY if the transfer has already been submitted.
+ * \returns another LIBUSB_ERROR code on other failure
+ */
+API_EXPORTED int libusb_submit_transfer(struct libusb_transfer *transfer)
+{
+	struct libusb_context *ctx = TRANSFER_CTX(transfer);
+	struct usbi_transfer *itransfer =
+		__LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);
+	int r;
+	int first;
+
+	pthread_mutex_lock(&itransfer->lock);
+	itransfer->transferred = 0;
+	itransfer->flags = 0;
+	r = calculate_timeout(itransfer);
+	if (r < 0) {
+		r = LIBUSB_ERROR_OTHER;
+		goto out;
+	}
+
+	first = add_to_flying_list(itransfer);
+	r = usbi_backend->submit_transfer(itransfer);
+	if (r) {
+		pthread_mutex_lock(&ctx->flying_transfers_lock);
+		list_del(&itransfer->list);
+		pthread_mutex_unlock(&ctx->flying_transfers_lock);
+	}
+#ifdef USBI_TIMERFD_AVAILABLE
+	else if (first && usbi_using_timerfd(ctx)) {
+		/* if this transfer has the lowest timeout of all active transfers,
+		 * rearm the timerfd with this transfer's timeout */
+		const struct itimerspec it = { {0, 0},
+			{ itransfer->timeout.tv_sec, itransfer->timeout.tv_usec * 1000 } };
+		usbi_dbg("arm timerfd for timeout in %dms (first in line)", transfer->timeout);
+		r = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL);
+		if (r < 0)
+			r = LIBUSB_ERROR_OTHER;
+	}
+#endif
+
+out:
+	pthread_mutex_unlock(&itransfer->lock);
+	return r;
+}
+
+/** \ingroup asyncio
+ * Asynchronously cancel a previously submitted transfer.
+ * This function returns immediately, but this does not indicate cancellation
+ * is complete. Your callback function will be invoked at some later time
+ * with a transfer status of
+ * \ref libusb_transfer_status::LIBUSB_TRANSFER_CANCELLED
+ * "LIBUSB_TRANSFER_CANCELLED."
+ *
+ * \param transfer the transfer to cancel
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if the transfer is already complete or
+ * cancelled.
+ * \returns a LIBUSB_ERROR code on failure
+ */
+API_EXPORTED int libusb_cancel_transfer(struct libusb_transfer *transfer)
+{
+	struct usbi_transfer *itransfer =
+		__LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);
+	int r;
+
+	usbi_dbg("");
+	pthread_mutex_lock(&itransfer->lock);
+	r = usbi_backend->cancel_transfer(itransfer);
+	if (r < 0)
+		usbi_err(TRANSFER_CTX(transfer),
+			"cancel transfer failed error %d", r);
+	pthread_mutex_unlock(&itransfer->lock);
+	return r;
+}
+
+#ifdef USBI_TIMERFD_AVAILABLE
+static int disarm_timerfd(struct libusb_context *ctx)
+{
+	const struct itimerspec disarm_timer = { { 0, 0 }, { 0, 0 } };
+	int r;
+
+	usbi_dbg("");
+	r = timerfd_settime(ctx->timerfd, 0, &disarm_timer, NULL);
+	if (r < 0)
+		return LIBUSB_ERROR_OTHER;
+	else
+		return 0;
+}
+
+/* iterates through the flying transfers, and rearms the timerfd based on the
+ * next upcoming timeout.
+ * must be called with flying_list locked.
+ * returns 0 if there was no timeout to arm, 1 if the next timeout was armed,
+ * or a LIBUSB_ERROR code on failure.
+ */
+static int arm_timerfd_for_next_timeout(struct libusb_context *ctx)
+{
+	struct usbi_transfer *transfer;
+
+	list_for_each_entry(transfer, &ctx->flying_transfers, list) {
+		struct timeval *cur_tv = &transfer->timeout;
+
+		/* if we've reached transfers of infinite timeout, then we have no
+		 * arming to do */
+		if (!timerisset(cur_tv))
+			return 0;
+
+		/* act on first transfer that is not already cancelled */
+		if (!(transfer->flags & USBI_TRANSFER_TIMED_OUT)) {
+			int r;
+			const struct itimerspec it = { {0, 0},
+				{ cur_tv->tv_sec, cur_tv->tv_usec * 1000 } };
+			usbi_dbg("next timeout originally %dms", __USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout);
+			r = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL);
+			if (r < 0)
+				return LIBUSB_ERROR_OTHER;
+			return 1;
+		}
+	}
+
+	return 0;
+}
+#else
+static int disarm_timerfd(struct libusb_context *ctx)
+{
+	return 0;
+}
+static int arm_timerfd_for_next_timeout(struct libusb_context *ctx)
+{
+	return 0;
+}
+#endif
+
+/* Handle completion of a transfer (completion might be an error condition).
+ * This will invoke the user-supplied callback function, which may end up
+ * freeing the transfer. Therefore you cannot use the transfer structure
+ * after calling this function, and you should free all backend-specific
+ * data before calling it.
+ * Do not call this function with the usbi_transfer lock held. User-specified
+ * callback functions may attempt to directly resubmit the transfer, which
+ * will attempt to take the lock. */
+int usbi_handle_transfer_completion(struct usbi_transfer *itransfer,
+	enum libusb_transfer_status status)
+{
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+	struct libusb_context *ctx = TRANSFER_CTX(transfer);
+	uint8_t flags;
+	int r;
+
+	/* FIXME: could be more intelligent with the timerfd here. we don't need
+	 * to disarm the timerfd if there was no timer running, and we only need
+	 * to rearm the timerfd if the transfer that expired was the one with
+	 * the shortest timeout. */
+
+	pthread_mutex_lock(&ctx->flying_transfers_lock);
+	list_del(&itransfer->list);
+	r = arm_timerfd_for_next_timeout(ctx);
+	pthread_mutex_unlock(&ctx->flying_transfers_lock);
+
+	if (r < 0) {
+		return r;
+	} else if (r == 0) {
+		r = disarm_timerfd(ctx);
+		if (r < 0)
+			return r;
+	}
+
+	if (status == LIBUSB_TRANSFER_COMPLETED
+			&& transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) {
+		int rqlen = transfer->length;
+		if (transfer->type == LIBUSB_TRANSFER_TYPE_CONTROL)
+			rqlen -= LIBUSB_CONTROL_SETUP_SIZE;
+		if (rqlen != itransfer->transferred) {
+			usbi_dbg("interpreting short transfer as error");
+			status = LIBUSB_TRANSFER_ERROR;
+		}
+	}
+
+	flags = transfer->flags;
+	transfer->status = status;
+	transfer->actual_length = itransfer->transferred;
+	if (transfer->callback)
+		transfer->callback(transfer);
+	/* transfer might have been freed by the above call, do not use from
+	 * this point. */
+	if (flags & LIBUSB_TRANSFER_FREE_TRANSFER)
+		libusb_free_transfer(transfer);
+	pthread_mutex_lock(&ctx->event_waiters_lock);
+	pthread_cond_broadcast(&ctx->event_waiters_cond);
+	pthread_mutex_unlock(&ctx->event_waiters_lock);
+	return 0;
+}
+
+/* Similar to usbi_handle_transfer_completion() but exclusively for transfers
+ * that were asynchronously cancelled. The same concerns w.r.t. freeing of
+ * transfers exist here.
+ * Do not call this function with the usbi_transfer lock held. User-specified
+ * callback functions may attempt to directly resubmit the transfer, which
+ * will attempt to take the lock. */
+int usbi_handle_transfer_cancellation(struct usbi_transfer *transfer)
+{
+	/* if the URB was cancelled due to timeout, report timeout to the user */
+	if (transfer->flags & USBI_TRANSFER_TIMED_OUT) {
+		usbi_dbg("detected timeout cancellation");
+		return usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_TIMED_OUT);
+	}
+
+	/* otherwise its a normal async cancel */
+	return usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_CANCELLED);
+}
+
+/** \ingroup poll
+ * Attempt to acquire the event handling lock. This lock is used to ensure that
+ * only one thread is monitoring libusb event sources at any one time.
+ *
+ * You only need to use this lock if you are developing an application
+ * which calls poll() or select() on libusb's file descriptors directly.
+ * If you stick to libusb's event handling loop functions (e.g.
+ * libusb_handle_events()) then you do not need to be concerned with this
+ * locking.
+ *
+ * While holding this lock, you are trusted to actually be handling events.
+ * If you are no longer handling events, you must call libusb_unlock_events()
+ * as soon as possible.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \returns 0 if the lock was obtained successfully
+ * \returns 1 if the lock was not obtained (i.e. another thread holds the lock)
+ * \see \ref mtasync
+ */
+API_EXPORTED int libusb_try_lock_events(libusb_context *ctx)
+{
+	int r;
+	USBI_GET_CONTEXT(ctx);
+
+	/* is someone else waiting to modify poll fds? if so, don't let this thread
+	 * start event handling */
+	pthread_mutex_lock(&ctx->pollfd_modify_lock);
+	r = ctx->pollfd_modify;
+	pthread_mutex_unlock(&ctx->pollfd_modify_lock);
+	if (r) {
+		usbi_dbg("someone else is modifying poll fds");
+		return 1;
+	}
+
+	r = pthread_mutex_trylock(&ctx->events_lock);
+	if (r)
+		return 1;
+
+	ctx->event_handler_active = 1;	
+	return 0;
+}
+
+/** \ingroup poll
+ * Acquire the event handling lock, blocking until successful acquisition if
+ * it is contended. This lock is used to ensure that only one thread is
+ * monitoring libusb event sources at any one time.
+ *
+ * You only need to use this lock if you are developing an application
+ * which calls poll() or select() on libusb's file descriptors directly.
+ * If you stick to libusb's event handling loop functions (e.g.
+ * libusb_handle_events()) then you do not need to be concerned with this
+ * locking.
+ *
+ * While holding this lock, you are trusted to actually be handling events.
+ * If you are no longer handling events, you must call libusb_unlock_events()
+ * as soon as possible.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \see \ref mtasync
+ */
+API_EXPORTED void libusb_lock_events(libusb_context *ctx)
+{
+	USBI_GET_CONTEXT(ctx);
+	pthread_mutex_lock(&ctx->events_lock);
+	ctx->event_handler_active = 1;
+}
+
+/** \ingroup poll
+ * Release the lock previously acquired with libusb_try_lock_events() or
+ * libusb_lock_events(). Releasing this lock will wake up any threads blocked
+ * on libusb_wait_for_event().
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \see \ref mtasync
+ */
+API_EXPORTED void libusb_unlock_events(libusb_context *ctx)
+{
+	USBI_GET_CONTEXT(ctx);
+	ctx->event_handler_active = 0;
+	pthread_mutex_unlock(&ctx->events_lock);
+
+	/* FIXME: perhaps we should be a bit more efficient by not broadcasting
+	 * the availability of the events lock when we are modifying pollfds
+	 * (check ctx->pollfd_modify)? */
+	pthread_mutex_lock(&ctx->event_waiters_lock);
+	pthread_cond_broadcast(&ctx->event_waiters_cond);
+	pthread_mutex_unlock(&ctx->event_waiters_lock);
+}
+
+/** \ingroup poll
+ * Determine if it is still OK for this thread to be doing event handling.
+ *
+ * Sometimes, libusb needs to temporarily pause all event handlers, and this
+ * is the function you should use before polling file descriptors to see if
+ * this is the case.
+ *
+ * If this function instructs your thread to give up the events lock, you
+ * should just continue the usual logic that is documented in \ref mtasync.
+ * On the next iteration, your thread will fail to obtain the events lock,
+ * and will hence become an event waiter.
+ *
+ * This function should be called while the events lock is held: you don't
+ * need to worry about the results of this function if your thread is not
+ * the current event handler.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \returns 1 if event handling can start or continue
+ * \returns 0 if this thread must give up the events lock
+ * \see \ref fullstory "Multi-threaded I/O: the full story"
+ */
+API_EXPORTED int libusb_event_handling_ok(libusb_context *ctx)
+{
+	int r;
+	USBI_GET_CONTEXT(ctx);
+
+	/* is someone else waiting to modify poll fds? if so, don't let this thread
+	 * continue event handling */
+	pthread_mutex_lock(&ctx->pollfd_modify_lock);
+	r = ctx->pollfd_modify;
+	pthread_mutex_unlock(&ctx->pollfd_modify_lock);
+	if (r) {
+		usbi_dbg("someone else is modifying poll fds");
+		return 0;
+	}
+
+	return 1;
+}
+
+
+/** \ingroup poll
+ * Determine if an active thread is handling events (i.e. if anyone is holding
+ * the event handling lock).
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \returns 1 if a thread is handling events
+ * \returns 0 if there are no threads currently handling events
+ * \see \ref mtasync
+ */
+API_EXPORTED int libusb_event_handler_active(libusb_context *ctx)
+{
+	int r;
+	USBI_GET_CONTEXT(ctx);
+
+	/* is someone else waiting to modify poll fds? if so, don't let this thread
+	 * start event handling -- indicate that event handling is happening */
+	pthread_mutex_lock(&ctx->pollfd_modify_lock);
+	r = ctx->pollfd_modify;
+	pthread_mutex_unlock(&ctx->pollfd_modify_lock);
+	if (r) {
+		usbi_dbg("someone else is modifying poll fds");
+		return 1;
+	}
+
+	return ctx->event_handler_active;
+}
+
+/** \ingroup poll
+ * Acquire the event waiters lock. This lock is designed to be obtained under
+ * the situation where you want to be aware when events are completed, but
+ * some other thread is event handling so calling libusb_handle_events() is not
+ * allowed.
+ *
+ * You then obtain this lock, re-check that another thread is still handling
+ * events, then call libusb_wait_for_event().
+ *
+ * You only need to use this lock if you are developing an application
+ * which calls poll() or select() on libusb's file descriptors directly,
+ * <b>and</b> may potentially be handling events from 2 threads simultaenously.
+ * If you stick to libusb's event handling loop functions (e.g.
+ * libusb_handle_events()) then you do not need to be concerned with this
+ * locking.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \see \ref mtasync
+ */
+API_EXPORTED void libusb_lock_event_waiters(libusb_context *ctx)
+{
+	USBI_GET_CONTEXT(ctx);
+	pthread_mutex_lock(&ctx->event_waiters_lock);
+}
+
+/** \ingroup poll
+ * Release the event waiters lock.
+ * \param ctx the context to operate on, or NULL for the default context
+ * \see \ref mtasync
+ */
+API_EXPORTED void libusb_unlock_event_waiters(libusb_context *ctx)
+{
+	USBI_GET_CONTEXT(ctx);
+	pthread_mutex_unlock(&ctx->event_waiters_lock);
+}
+
+/** \ingroup poll
+ * Wait for another thread to signal completion of an event. Must be called
+ * with the event waiters lock held, see libusb_lock_event_waiters().
+ *
+ * This function will block until any of the following conditions are met:
+ * -# The timeout expires
+ * -# A transfer completes
+ * -# A thread releases the event handling lock through libusb_unlock_events()
+ *
+ * Condition 1 is obvious. Condition 2 unblocks your thread <em>after</em>
+ * the callback for the transfer has completed. Condition 3 is important
+ * because it means that the thread that was previously handling events is no
+ * longer doing so, so if any events are to complete, another thread needs to
+ * step up and start event handling.
+ *
+ * This function releases the event waiters lock before putting your thread
+ * to sleep, and reacquires the lock as it is being woken up.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \param tv maximum timeout for this blocking function. A NULL value
+ * indicates unlimited timeout.
+ * \returns 0 after a transfer completes or another thread stops event handling
+ * \returns 1 if the timeout expired
+ * \see \ref mtasync
+ */
+API_EXPORTED int libusb_wait_for_event(libusb_context *ctx, struct timeval *tv)
+{
+	struct timespec timeout;
+	int r;
+
+	USBI_GET_CONTEXT(ctx);
+	if (tv == NULL) {
+		pthread_cond_wait(&ctx->event_waiters_cond, &ctx->event_waiters_lock);
+		return 0;
+	}
+
+	r = usbi_backend->clock_gettime(USBI_CLOCK_REALTIME, &timeout);
+	if (r < 0) {
+		usbi_err(ctx, "failed to read realtime clock, error %d", errno);
+		return LIBUSB_ERROR_OTHER;
+	}
+
+	timeout.tv_sec += tv->tv_sec;
+	timeout.tv_nsec += tv->tv_usec * 1000;
+	if (timeout.tv_nsec > 1000000000) {
+		timeout.tv_nsec -= 1000000000;
+		timeout.tv_sec++;
+	}
+
+	r = pthread_cond_timedwait(&ctx->event_waiters_cond,
+		&ctx->event_waiters_lock, &timeout);
+	return (r == ETIMEDOUT);
+}
+
+static void handle_timeout(struct usbi_transfer *itransfer)
+{
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+	int r;
+
+	itransfer->flags |= USBI_TRANSFER_TIMED_OUT;
+	r = libusb_cancel_transfer(transfer);
+	if (r < 0)
+		usbi_warn(TRANSFER_CTX(transfer),
+			"async cancel failed %d errno=%d", r, errno);
+}
+
+#ifdef USBI_OS_HANDLES_TIMEOUT
+static int handle_timeouts_locked(struct libusb_context *ctx)
+{
+	return 0;
+}
+static int handle_timeouts(struct libusb_context *ctx)
+{
+	return 0;
+}
+#else
+static int handle_timeouts_locked(struct libusb_context *ctx)
+{
+	int r;
+	struct timespec systime_ts;
+	struct timeval systime;
+	struct usbi_transfer *transfer;
+
+	if (list_empty(&ctx->flying_transfers))
+		return 0;
+
+	/* get current time */
+	r = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &systime_ts);
+	if (r < 0)
+		return r;
+
+	TIMESPEC_TO_TIMEVAL(&systime, &systime_ts);
+
+	/* iterate through flying transfers list, finding all transfers that
+	 * have expired timeouts */
+	list_for_each_entry(transfer, &ctx->flying_transfers, list) {
+		struct timeval *cur_tv = &transfer->timeout;
+
+		/* if we've reached transfers of infinite timeout, we're all done */
+		if (!timerisset(cur_tv))
+			return 0;
+
+		/* ignore timeouts we've already handled */
+		if (transfer->flags & USBI_TRANSFER_TIMED_OUT)
+			continue;
+
+		/* if transfer has non-expired timeout, nothing more to do */
+		if ((cur_tv->tv_sec > systime.tv_sec) ||
+				(cur_tv->tv_sec == systime.tv_sec &&
+					cur_tv->tv_usec > systime.tv_usec))
+			return 0;
+	
+		/* otherwise, we've got an expired timeout to handle */
+		handle_timeout(transfer);
+	}
+	return 0;
+}
+
+static int handle_timeouts(struct libusb_context *ctx)
+{
+	int r;
+	USBI_GET_CONTEXT(ctx);
+	pthread_mutex_lock(&ctx->flying_transfers_lock);
+	r = handle_timeouts_locked(ctx);
+	pthread_mutex_unlock(&ctx->flying_transfers_lock);
+	return r;
+}
+#endif
+
+#ifdef USBI_TIMERFD_AVAILABLE
+static int handle_timerfd_trigger(struct libusb_context *ctx)
+{
+	int r;
+
+	r = disarm_timerfd(ctx);
+	if (r < 0)
+		return r;
+
+	pthread_mutex_lock(&ctx->flying_transfers_lock);
+
+	/* process the timeout that just happened */
+	r = handle_timeouts_locked(ctx);
+	if (r < 0)
+		goto out;
+
+	/* arm for next timeout*/
+	r = arm_timerfd_for_next_timeout(ctx);
+
+out:
+	pthread_mutex_unlock(&ctx->flying_transfers_lock);
+	return r;
+}
+#endif
+
+/* do the actual event handling. assumes that no other thread is concurrently
+ * doing the same thing. */
+static int handle_events(struct libusb_context *ctx, struct timeval *tv)
+{
+	int r;
+	struct usbi_pollfd *ipollfd;
+	nfds_t nfds = 0;
+	struct pollfd *fds;
+	int i = -1;
+	int timeout_ms;
+
+	pthread_mutex_lock(&ctx->pollfds_lock);
+	list_for_each_entry(ipollfd, &ctx->pollfds, list)
+		nfds++;
+
+	/* TODO: malloc when number of fd's changes, not on every poll */
+	fds = malloc(sizeof(*fds) * nfds);
+	if (!fds)
+		return LIBUSB_ERROR_NO_MEM;
+
+	list_for_each_entry(ipollfd, &ctx->pollfds, list) {
+		struct libusb_pollfd *pollfd = &ipollfd->pollfd;
+		int fd = pollfd->fd;
+		i++;
+		fds[i].fd = fd;
+		fds[i].events = pollfd->events;
+		fds[i].revents = 0;
+	}
+	pthread_mutex_unlock(&ctx->pollfds_lock);
+
+	timeout_ms = (tv->tv_sec * 1000) + (tv->tv_usec / 1000);
+
+	/* round up to next millisecond */
+	if (tv->tv_usec % 1000)
+		timeout_ms++;
+
+	usbi_dbg("poll() %d fds with timeout in %dms", nfds, timeout_ms);
+	r = poll(fds, nfds, timeout_ms);
+	usbi_dbg("poll() returned %d", r);
+	if (r == 0) {
+		free(fds);
+		return handle_timeouts(ctx);
+	} else if (r == -1 && errno == EINTR) {
+		free(fds);
+		return LIBUSB_ERROR_INTERRUPTED;
+	} else if (r < 0) {
+		free(fds);
+		usbi_err(ctx, "poll failed %d err=%d\n", r, errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	/* fd[0] is always the ctrl pipe */
+	if (fds[0].revents) {
+		/* another thread wanted to interrupt event handling, and it succeeded!
+		 * handle any other events that cropped up at the same time, and
+		 * simply return */
+		usbi_dbg("caught a fish on the control pipe");
+
+		if (r == 1) {
+			r = 0;
+			goto handled;
+		} else {
+			/* prevent OS backend from trying to handle events on ctrl pipe */
+			fds[0].revents = 0;
+			r--;
+		}
+	}
+
+#ifdef USBI_TIMERFD_AVAILABLE
+	/* on timerfd configurations, fds[1] is the timerfd */
+	if (usbi_using_timerfd(ctx) && fds[1].revents) {
+		/* timerfd indicates that a timeout has expired */
+		int ret;
+		usbi_dbg("timerfd triggered");
+
+		ret = handle_timerfd_trigger(ctx);
+		if (ret < 0) {
+			/* return error code */
+			r = ret;
+			goto handled;
+		} else if (r == 1) {
+			/* no more active file descriptors, nothing more to do */
+			r = 0;
+			goto handled;
+		} else {
+			/* more events pending...
+			 * prevent OS backend from trying to handle events on timerfd */
+			fds[1].revents = 0;
+			r--;
+		}
+	}
+#endif
+
+	r = usbi_backend->handle_events(ctx, fds, nfds, r);
+	if (r)
+		usbi_err(ctx, "backend handle_events failed with error %d", r);
+
+handled:
+	free(fds);
+	return r;
+}
+
+/* returns the smallest of:
+ *  1. timeout of next URB
+ *  2. user-supplied timeout
+ * returns 1 if there is an already-expired timeout, otherwise returns 0
+ * and populates out
+ */
+static int get_next_timeout(libusb_context *ctx, struct timeval *tv,
+	struct timeval *out)
+{
+	struct timeval timeout;
+	int r = libusb_get_next_timeout(ctx, &timeout);
+	if (r) {
+		/* timeout already expired? */
+		if (!timerisset(&timeout))
+			return 1;
+
+		/* choose the smallest of next URB timeout or user specified timeout */
+		if (timercmp(&timeout, tv, <))
+			*out = timeout;
+		else
+			*out = *tv;
+	} else {
+		*out = *tv;
+	}
+	return 0;
+}
+
+/** \ingroup poll
+ * Handle any pending events.
+ *
+ * libusb determines "pending events" by checking if any timeouts have expired
+ * and by checking the set of file descriptors for activity.
+ *
+ * If a zero timeval is passed, this function will handle any already-pending
+ * events and then immediately return in non-blocking style.
+ *
+ * If a non-zero timeval is passed and no events are currently pending, this
+ * function will block waiting for events to handle up until the specified
+ * timeout. If an event arrives or a signal is raised, this function will
+ * return early.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \param tv the maximum time to block waiting for events, or zero for
+ * non-blocking mode
+ * \returns 0 on success, or a LIBUSB_ERROR code on failure
+ */
+API_EXPORTED int libusb_handle_events_timeout(libusb_context *ctx,
+	struct timeval *tv)
+{
+	int r;
+	struct timeval poll_timeout;
+
+	USBI_GET_CONTEXT(ctx);
+	r = get_next_timeout(ctx, tv, &poll_timeout);
+	if (r) {
+		/* timeout already expired */
+		return handle_timeouts(ctx);
+	}
+
+retry:
+	if (libusb_try_lock_events(ctx) == 0) {
+		/* we obtained the event lock: do our own event handling */
+		r = handle_events(ctx, &poll_timeout);
+		libusb_unlock_events(ctx);
+		return r;
+	}
+
+	/* another thread is doing event handling. wait for pthread events that
+	 * notify event completion. */
+	libusb_lock_event_waiters(ctx);
+
+	if (!libusb_event_handler_active(ctx)) {
+		/* we hit a race: whoever was event handling earlier finished in the
+		 * time it took us to reach this point. try the cycle again. */
+		libusb_unlock_event_waiters(ctx);
+		usbi_dbg("event handler was active but went away, retrying");
+		goto retry;
+	}
+
+	usbi_dbg("another thread is doing event handling");
+	r = libusb_wait_for_event(ctx, &poll_timeout);
+	libusb_unlock_event_waiters(ctx);
+
+	if (r < 0)
+		return r;
+	else if (r == 1)
+		return handle_timeouts(ctx);
+	else
+		return 0;
+}
+
+/** \ingroup poll
+ * Handle any pending events in blocking mode. There is currently a timeout
+ * hardcoded at 60 seconds but we plan to make it unlimited in future. For
+ * finer control over whether this function is blocking or non-blocking, or
+ * for control over the timeout, use libusb_handle_events_timeout() instead.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \returns 0 on success, or a LIBUSB_ERROR code on failure
+ */
+API_EXPORTED int libusb_handle_events(libusb_context *ctx)
+{
+	struct timeval tv;
+	tv.tv_sec = 60;
+	tv.tv_usec = 0;
+	return libusb_handle_events_timeout(ctx, &tv);
+}
+
+/** \ingroup poll
+ * Handle any pending events by polling file descriptors, without checking if
+ * any other threads are already doing so. Must be called with the event lock
+ * held, see libusb_lock_events().
+ *
+ * This function is designed to be called under the situation where you have
+ * taken the event lock and are calling poll()/select() directly on libusb's
+ * file descriptors (as opposed to using libusb_handle_events() or similar).
+ * You detect events on libusb's descriptors, so you then call this function
+ * with a zero timeout value (while still holding the event lock).
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \param tv the maximum time to block waiting for events, or zero for
+ * non-blocking mode
+ * \returns 0 on success, or a LIBUSB_ERROR code on failure
+ * \see \ref mtasync
+ */
+API_EXPORTED int libusb_handle_events_locked(libusb_context *ctx,
+	struct timeval *tv)
+{
+	int r;
+	struct timeval poll_timeout;
+
+	USBI_GET_CONTEXT(ctx);
+	r = get_next_timeout(ctx, tv, &poll_timeout);
+	if (r) {
+		/* timeout already expired */
+		return handle_timeouts(ctx);
+	}
+
+	return handle_events(ctx, &poll_timeout);
+}
+
+/** \ingroup poll
+ * Determines whether your application must apply special timing considerations
+ * when monitoring libusb's file descriptors.
+ *
+ * This function is only useful for applications which retrieve and poll
+ * libusb's file descriptors in their own main loop (\ref pollmain).
+ *
+ * Ordinarily, libusb's event handler needs to be called into at specific
+ * moments in time (in addition to times when there is activity on the file
+ * descriptor set). The usual approach is to use libusb_get_next_timeout()
+ * to learn about when the next timeout occurs, and to adjust your
+ * poll()/select() timeout accordingly so that you can make a call into the
+ * library at that time.
+ *
+ * Some platforms supported by libusb do not come with this baggage - any
+ * events relevant to timing will be represented by activity on the file
+ * descriptor set, and libusb_get_next_timeout() will always return 0.
+ * This function allows you to detect whether you are running on such a
+ * platform.
+ *
+ * Since v1.0.5.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \returns 0 if you must call into libusb at times determined by
+ * libusb_get_next_timeout(), or 1 if all timeout events are handled internally
+ * or through regular activity on the file descriptors.
+ * \see \ref pollmain "Polling libusb file descriptors for event handling"
+ */
+API_EXPORTED int libusb_pollfds_handle_timeouts(libusb_context *ctx)
+{
+#if defined(USBI_OS_HANDLES_TIMEOUT)
+	return 1;
+#elif defined(USBI_TIMERFD_AVAILABLE)
+	USBI_GET_CONTEXT(ctx);
+	return usbi_using_timerfd(ctx);
+#else
+	return 0;
+#endif
+}
+
+/** \ingroup poll
+ * Determine the next internal timeout that libusb needs to handle. You only
+ * need to use this function if you are calling poll() or select() or similar
+ * on libusb's file descriptors yourself - you do not need to use it if you
+ * are calling libusb_handle_events() or a variant directly.
+ * 
+ * You should call this function in your main loop in order to determine how
+ * long to wait for select() or poll() to return results. libusb needs to be
+ * called into at this timeout, so you should use it as an upper bound on
+ * your select() or poll() call.
+ *
+ * When the timeout has expired, call into libusb_handle_events_timeout()
+ * (perhaps in non-blocking mode) so that libusb can handle the timeout.
+ *
+ * This function may return 1 (success) and an all-zero timeval. If this is
+ * the case, it indicates that libusb has a timeout that has already expired
+ * so you should call libusb_handle_events_timeout() or similar immediately.
+ * A return code of 0 indicates that there are no pending timeouts.
+ *
+ * On some platforms, this function will always returns 0 (no pending
+ * timeouts). See \ref polltime.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \param tv output location for a relative time against the current
+ * clock in which libusb must be called into in order to process timeout events
+ * \returns 0 if there are no pending timeouts, 1 if a timeout was returned,
+ * or LIBUSB_ERROR_OTHER on failure
+ */
+API_EXPORTED int libusb_get_next_timeout(libusb_context *ctx,
+	struct timeval *tv)
+{
+#ifndef USBI_OS_HANDLES_TIMEOUT
+	struct usbi_transfer *transfer;
+	struct timespec cur_ts;
+	struct timeval cur_tv;
+	struct timeval *next_timeout;
+	int r;
+	int found = 0;
+
+	USBI_GET_CONTEXT(ctx);
+	if (usbi_using_timerfd(ctx))
+		return 0;
+
+	pthread_mutex_lock(&ctx->flying_transfers_lock);
+	if (list_empty(&ctx->flying_transfers)) {
+		pthread_mutex_unlock(&ctx->flying_transfers_lock);
+		usbi_dbg("no URBs, no timeout!");
+		return 0;
+	}
+
+	/* find next transfer which hasn't already been processed as timed out */
+	list_for_each_entry(transfer, &ctx->flying_transfers, list) {
+		if (!(transfer->flags & USBI_TRANSFER_TIMED_OUT)) {
+			found = 1;
+			break;
+		}
+	}
+	pthread_mutex_unlock(&ctx->flying_transfers_lock);
+
+	if (!found) {
+		usbi_dbg("all URBs have already been processed for timeouts");
+		return 0;
+	}
+
+	next_timeout = &transfer->timeout;
+
+	/* no timeout for next transfer */
+	if (!timerisset(next_timeout)) {
+		usbi_dbg("no URBs with timeouts, no timeout!");
+		return 0;
+	}
+
+	r = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &cur_ts);
+	if (r < 0) {
+		usbi_err(ctx, "failed to read monotonic clock, errno=%d", errno);
+		return LIBUSB_ERROR_OTHER;
+	}
+	TIMESPEC_TO_TIMEVAL(&cur_tv, &cur_ts);
+
+	if (timercmp(&cur_tv, next_timeout, >=)) {
+		usbi_dbg("first timeout already expired");
+		timerclear(tv);
+	} else {
+		timersub(next_timeout, &cur_tv, tv);
+		usbi_dbg("next timeout in %d.%06ds", tv->tv_sec, tv->tv_usec);
+	}
+
+	return 1;
+#else
+	return 0;
+#endif
+}
+
+/** \ingroup poll
+ * Register notification functions for file descriptor additions/removals.
+ * These functions will be invoked for every new or removed file descriptor
+ * that libusb uses as an event source.
+ *
+ * To remove notifiers, pass NULL values for the function pointers.
+ *
+ * Note that file descriptors may have been added even before you register
+ * these notifiers (e.g. at libusb_init() time).
+ *
+ * Additionally, note that the removal notifier may be called during
+ * libusb_exit() (e.g. when it is closing file descriptors that were opened
+ * and added to the poll set at libusb_init() time). If you don't want this,
+ * remove the notifiers immediately before calling libusb_exit().
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \param added_cb pointer to function for addition notifications
+ * \param removed_cb pointer to function for removal notifications
+ * \param user_data User data to be passed back to callbacks (useful for
+ * passing context information)
+ */
+API_EXPORTED void libusb_set_pollfd_notifiers(libusb_context *ctx,
+	libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb,
+	void *user_data)
+{
+	USBI_GET_CONTEXT(ctx);
+	ctx->fd_added_cb = added_cb;
+	ctx->fd_removed_cb = removed_cb;
+	ctx->fd_cb_user_data = user_data;
+}
+
+/* Add a file descriptor to the list of file descriptors to be monitored.
+ * events should be specified as a bitmask of events passed to poll(), e.g.
+ * POLLIN and/or POLLOUT. */
+int usbi_add_pollfd(struct libusb_context *ctx, int fd, short events)
+{
+	struct usbi_pollfd *ipollfd = malloc(sizeof(*ipollfd));
+	if (!ipollfd)
+		return LIBUSB_ERROR_NO_MEM;
+
+	usbi_dbg("add fd %d events %d", fd, events);
+	ipollfd->pollfd.fd = fd;
+	ipollfd->pollfd.events = events;
+	pthread_mutex_lock(&ctx->pollfds_lock);
+	list_add_tail(&ipollfd->list, &ctx->pollfds);
+	pthread_mutex_unlock(&ctx->pollfds_lock);
+
+	if (ctx->fd_added_cb)
+		ctx->fd_added_cb(fd, events, ctx->fd_cb_user_data);
+	return 0;
+}
+
+/* Remove a file descriptor from the list of file descriptors to be polled. */
+void usbi_remove_pollfd(struct libusb_context *ctx, int fd)
+{
+	struct usbi_pollfd *ipollfd;
+	int found = 0;
+
+	usbi_dbg("remove fd %d", fd);
+	pthread_mutex_lock(&ctx->pollfds_lock);
+	list_for_each_entry(ipollfd, &ctx->pollfds, list)
+		if (ipollfd->pollfd.fd == fd) {
+			found = 1;
+			break;
+		}
+
+	if (!found) {
+		usbi_dbg("couldn't find fd %d to remove", fd);
+		pthread_mutex_unlock(&ctx->pollfds_lock);
+		return;
+	}
+
+	list_del(&ipollfd->list);
+	pthread_mutex_unlock(&ctx->pollfds_lock);
+	free(ipollfd);
+	if (ctx->fd_removed_cb)
+		ctx->fd_removed_cb(fd, ctx->fd_cb_user_data);
+}
+
+/** \ingroup poll
+ * Retrieve a list of file descriptors that should be polled by your main loop
+ * as libusb event sources.
+ *
+ * The returned list is NULL-terminated and should be freed with free() when
+ * done. The actual list contents must not be touched.
+ *
+ * \param ctx the context to operate on, or NULL for the default context
+ * \returns a NULL-terminated list of libusb_pollfd structures, or NULL on
+ * error
+ */
+API_EXPORTED const struct libusb_pollfd **libusb_get_pollfds(
+	libusb_context *ctx)
+{
+	struct libusb_pollfd **ret = NULL;
+	struct usbi_pollfd *ipollfd;
+	size_t i = 0;
+	size_t cnt = 0;
+	USBI_GET_CONTEXT(ctx);
+
+	pthread_mutex_lock(&ctx->pollfds_lock);
+	list_for_each_entry(ipollfd, &ctx->pollfds, list)
+		cnt++;
+
+	ret = calloc(cnt + 1, sizeof(struct libusb_pollfd *));
+	if (!ret)
+		goto out;
+
+	list_for_each_entry(ipollfd, &ctx->pollfds, list)
+		ret[i++] = (struct libusb_pollfd *) ipollfd;
+	ret[cnt] = NULL;
+
+out:
+	pthread_mutex_unlock(&ctx->pollfds_lock);
+	return (const struct libusb_pollfd **) ret;
+}
+
+/* Backends call this from handle_events to report disconnection of a device.
+ * The transfers get cancelled appropriately.
+ */
+void usbi_handle_disconnect(struct libusb_device_handle *handle)
+{
+	struct usbi_transfer *cur;
+	struct usbi_transfer *to_cancel;
+
+	usbi_dbg("device %d.%d",
+		handle->dev->bus_number, handle->dev->device_address);
+
+	/* terminate all pending transfers with the LIBUSB_TRANSFER_NO_DEVICE
+	 * status code.
+	 * 
+	 * this is a bit tricky because:
+	 * 1. we can't do transfer completion while holding flying_transfers_lock
+	 * 2. the transfers list can change underneath us - if we were to build a
+	 *    list of transfers to complete (while holding look), the situation
+	 *    might be different by the time we come to free them
+	 *
+	 * so we resort to a loop-based approach as below
+	 * FIXME: is this still potentially racy?
+	 */
+
+	while (1) {
+		pthread_mutex_lock(&HANDLE_CTX(handle)->flying_transfers_lock);
+		to_cancel = NULL;
+		list_for_each_entry(cur, &HANDLE_CTX(handle)->flying_transfers, list)
+			if (__USBI_TRANSFER_TO_LIBUSB_TRANSFER(cur)->dev_handle == handle) {
+				to_cancel = cur;
+				break;
+			}
+		pthread_mutex_unlock(&HANDLE_CTX(handle)->flying_transfers_lock);
+
+		if (!to_cancel)
+			break;
+
+		usbi_backend->clear_transfer_priv(to_cancel);
+		usbi_handle_transfer_completion(to_cancel, LIBUSB_TRANSFER_NO_DEVICE);
+	}
+
+}
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/libusb.h b/Platform/Android/jni/External/libusb-1.0.8/libusb/libusb.h
new file mode 100644
index 0000000..1a8d77d
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/libusb.h
@@ -0,0 +1,1241 @@
+/*
+ * Public libusb header file
+ * Copyright (C) 2007-2008 Daniel Drake <dsd at gentoo.org>
+ * Copyright (c) 2001 Johannes Erdfelt <johannes at erdfelt.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __LIBUSB_H__
+#define __LIBUSB_H__
+
+#include <stdint.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <time.h>
+#include <limits.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** \def libusb_cpu_to_le16
+ * \ingroup misc
+ * Convert a 16-bit value from host-endian to little-endian format. On
+ * little endian systems, this function does nothing. On big endian systems,
+ * the bytes are swapped.
+ * \param x the host-endian value to convert
+ * \returns the value in little-endian byte order
+ */
+#define libusb_cpu_to_le16(x) ({ \
+	union { \
+		uint8_t  b8[2]; \
+		uint16_t b16; \
+	} _tmp; \
+	uint16_t _tmp2 = (uint16_t)(x); \
+	_tmp.b8[1] = _tmp2 >> 8; \
+	_tmp.b8[0] = _tmp2 & 0xff; \
+	_tmp.b16; \
+})
+
+/** \def libusb_le16_to_cpu
+ * \ingroup misc
+ * Convert a 16-bit value from little-endian to host-endian format. On
+ * little endian systems, this function does nothing. On big endian systems,
+ * the bytes are swapped.
+ * \param x the little-endian value to convert
+ * \returns the value in host-endian byte order
+ */
+#define libusb_le16_to_cpu libusb_cpu_to_le16
+
+/* standard USB stuff */
+
+/** \ingroup desc
+ * Device and/or Interface Class codes */
+enum libusb_class_code {
+	/** In the context of a \ref libusb_device_descriptor "device descriptor",
+	 * this bDeviceClass value indicates that each interface specifies its
+	 * own class information and all interfaces operate independently.
+	 */
+	LIBUSB_CLASS_PER_INTERFACE = 0,
+
+	/** Audio class */
+	LIBUSB_CLASS_AUDIO = 1,
+
+	/** Communications class */
+	LIBUSB_CLASS_COMM = 2,
+
+	/** Human Interface Device class */
+	LIBUSB_CLASS_HID = 3,
+
+	/** Printer dclass */
+	LIBUSB_CLASS_PRINTER = 7,
+
+	/** Picture transfer protocol class */
+	LIBUSB_CLASS_PTP = 6,
+
+	/** Mass storage class */
+	LIBUSB_CLASS_MASS_STORAGE = 8,
+
+	/** Hub class */
+	LIBUSB_CLASS_HUB = 9,
+
+	/** Data class */
+	LIBUSB_CLASS_DATA = 10,
+
+	/** Wireless class */
+	LIBUSB_CLASS_WIRELESS = 0xe0,
+
+	/** Application class */
+	LIBUSB_CLASS_APPLICATION = 0xfe,
+
+	/** Class is vendor-specific */
+	LIBUSB_CLASS_VENDOR_SPEC = 0xff
+};
+
+/** \ingroup desc
+ * Descriptor types as defined by the USB specification. */
+enum libusb_descriptor_type {
+	/** Device descriptor. See libusb_device_descriptor. */
+	LIBUSB_DT_DEVICE = 0x01,
+
+	/** Configuration descriptor. See libusb_config_descriptor. */
+	LIBUSB_DT_CONFIG = 0x02,
+
+	/** String descriptor */
+	LIBUSB_DT_STRING = 0x03,
+
+	/** Interface descriptor. See libusb_interface_descriptor. */
+	LIBUSB_DT_INTERFACE = 0x04,
+
+	/** Endpoint descriptor. See libusb_endpoint_descriptor. */
+	LIBUSB_DT_ENDPOINT = 0x05,
+
+	/** HID descriptor */
+	LIBUSB_DT_HID = 0x21,
+
+	/** HID report descriptor */
+	LIBUSB_DT_REPORT = 0x22,
+
+	/** Physical descriptor */
+	LIBUSB_DT_PHYSICAL = 0x23,
+
+	/** Hub descriptor */
+	LIBUSB_DT_HUB = 0x29
+};
+
+/* Descriptor sizes per descriptor type */
+#define LIBUSB_DT_DEVICE_SIZE			18
+#define LIBUSB_DT_CONFIG_SIZE			9
+#define LIBUSB_DT_INTERFACE_SIZE		9
+#define LIBUSB_DT_ENDPOINT_SIZE		7
+#define LIBUSB_DT_ENDPOINT_AUDIO_SIZE	9	/* Audio extension */
+#define LIBUSB_DT_HUB_NONVAR_SIZE		7
+
+#define LIBUSB_ENDPOINT_ADDRESS_MASK	0x0f    /* in bEndpointAddress */
+#define LIBUSB_ENDPOINT_DIR_MASK		0x80
+
+/** \ingroup desc
+ * Endpoint direction. Values for bit 7 of the
+ * \ref libusb_endpoint_descriptor::bEndpointAddress "endpoint address" scheme.
+ */
+enum libusb_endpoint_direction {
+	/** In: device-to-host */
+	LIBUSB_ENDPOINT_IN = 0x80,
+
+	/** Out: host-to-device */
+	LIBUSB_ENDPOINT_OUT = 0x00
+};
+
+#define LIBUSB_TRANSFER_TYPE_MASK			0x03    /* in bmAttributes */
+
+/** \ingroup desc
+ * Endpoint transfer type. Values for bits 0:1 of the
+ * \ref libusb_endpoint_descriptor::bmAttributes "endpoint attributes" field.
+ */
+enum libusb_transfer_type {
+	/** Control endpoint */
+	LIBUSB_TRANSFER_TYPE_CONTROL = 0,
+
+	/** Isochronous endpoint */
+	LIBUSB_TRANSFER_TYPE_ISOCHRONOUS = 1,
+
+	/** Bulk endpoint */
+	LIBUSB_TRANSFER_TYPE_BULK = 2,
+
+	/** Interrupt endpoint */
+	LIBUSB_TRANSFER_TYPE_INTERRUPT = 3
+};
+
+/** \ingroup misc
+ * Standard requests, as defined in table 9-3 of the USB2 specifications */
+enum libusb_standard_request {
+	/** Request status of the specific recipient */
+	LIBUSB_REQUEST_GET_STATUS = 0x00,
+
+	/** Clear or disable a specific feature */
+	LIBUSB_REQUEST_CLEAR_FEATURE = 0x01,
+
+	/* 0x02 is reserved */
+
+	/** Set or enable a specific feature */
+	LIBUSB_REQUEST_SET_FEATURE = 0x03,
+
+	/* 0x04 is reserved */
+
+	/** Set device address for all future accesses */
+	LIBUSB_REQUEST_SET_ADDRESS = 0x05,
+
+	/** Get the specified descriptor */
+	LIBUSB_REQUEST_GET_DESCRIPTOR = 0x06,
+
+	/** Used to update existing descriptors or add new descriptors */
+	LIBUSB_REQUEST_SET_DESCRIPTOR = 0x07,
+
+	/** Get the current device configuration value */
+	LIBUSB_REQUEST_GET_CONFIGURATION = 0x08,
+
+	/** Set device configuration */
+	LIBUSB_REQUEST_SET_CONFIGURATION = 0x09,
+
+	/** Return the selected alternate setting for the specified interface */
+	LIBUSB_REQUEST_GET_INTERFACE = 0x0A,
+
+	/** Select an alternate interface for the specified interface */
+	LIBUSB_REQUEST_SET_INTERFACE = 0x0B,
+
+	/** Set then report an endpoint's synchronization frame */
+	LIBUSB_REQUEST_SYNCH_FRAME = 0x0C
+};
+
+/** \ingroup misc
+ * Request type bits of the
+ * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control
+ * transfers. */
+enum libusb_request_type {
+	/** Standard */
+	LIBUSB_REQUEST_TYPE_STANDARD = (0x00 << 5),
+
+	/** Class */
+	LIBUSB_REQUEST_TYPE_CLASS = (0x01 << 5),
+
+	/** Vendor */
+	LIBUSB_REQUEST_TYPE_VENDOR = (0x02 << 5),
+
+	/** Reserved */
+	LIBUSB_REQUEST_TYPE_RESERVED = (0x03 << 5)
+};
+
+/** \ingroup misc
+ * Recipient bits of the
+ * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control
+ * transfers. Values 4 through 31 are reserved. */
+enum libusb_request_recipient {
+	/** Device */
+	LIBUSB_RECIPIENT_DEVICE = 0x00,
+
+	/** Interface */
+	LIBUSB_RECIPIENT_INTERFACE = 0x01,
+
+	/** Endpoint */
+	LIBUSB_RECIPIENT_ENDPOINT = 0x02,
+
+	/** Other */
+	LIBUSB_RECIPIENT_OTHER = 0x03
+};
+
+#define LIBUSB_ISO_SYNC_TYPE_MASK		0x0C
+
+/** \ingroup desc
+ * Synchronization type for isochronous endpoints. Values for bits 2:3 of the
+ * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in
+ * libusb_endpoint_descriptor.
+ */
+enum libusb_iso_sync_type {
+	/** No synchronization */
+	LIBUSB_ISO_SYNC_TYPE_NONE = 0,
+
+	/** Asynchronous */
+	LIBUSB_ISO_SYNC_TYPE_ASYNC = 1,
+
+	/** Adaptive */
+	LIBUSB_ISO_SYNC_TYPE_ADAPTIVE = 2,
+
+	/** Synchronous */
+	LIBUSB_ISO_SYNC_TYPE_SYNC = 3
+};
+
+#define LIBUSB_ISO_USAGE_TYPE_MASK 0x30
+
+/** \ingroup desc
+ * Usage type for isochronous endpoints. Values for bits 4:5 of the
+ * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in
+ * libusb_endpoint_descriptor.
+ */
+enum libusb_iso_usage_type {
+	/** Data endpoint */
+	LIBUSB_ISO_USAGE_TYPE_DATA = 0,
+
+	/** Feedback endpoint */
+	LIBUSB_ISO_USAGE_TYPE_FEEDBACK = 1,
+
+	/** Implicit feedback Data endpoint */
+	LIBUSB_ISO_USAGE_TYPE_IMPLICIT = 2
+};
+
+/** \ingroup desc
+ * A structure representing the standard USB device descriptor. This
+ * descriptor is documented in section 9.6.1 of the USB 2.0 specification.
+ * All multiple-byte fields are represented in host-endian format.
+ */
+struct libusb_device_descriptor {
+	/** Size of this descriptor (in bytes) */
+	uint8_t  bLength;
+
+	/** Descriptor type. Will have value
+	 * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE LIBUSB_DT_DEVICE in this
+	 * context. */
+	uint8_t  bDescriptorType;
+
+	/** USB specification release number in binary-coded decimal. A value of
+	 * 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc. */
+	uint16_t bcdUSB;
+
+	/** USB-IF class code for the device. See \ref libusb_class_code. */
+	uint8_t  bDeviceClass;
+
+	/** USB-IF subclass code for the device, qualified by the bDeviceClass
+	 * value */
+	uint8_t  bDeviceSubClass;
+
+	/** USB-IF protocol code for the device, qualified by the bDeviceClass and
+	 * bDeviceSubClass values */
+	uint8_t  bDeviceProtocol;
+
+	/** Maximum packet size for endpoint 0 */
+	uint8_t  bMaxPacketSize0;
+
+	/** USB-IF vendor ID */
+	uint16_t idVendor;
+
+	/** USB-IF product ID */
+	uint16_t idProduct;
+
+	/** Device release number in binary-coded decimal */
+	uint16_t bcdDevice;
+
+	/** Index of string descriptor describing manufacturer */
+	uint8_t  iManufacturer;
+
+	/** Index of string descriptor describing product */
+	uint8_t  iProduct;
+
+	/** Index of string descriptor containing device serial number */
+	uint8_t  iSerialNumber;
+
+	/** Number of possible configurations */
+	uint8_t  bNumConfigurations;
+};
+
+/** \ingroup desc
+ * A structure representing the standard USB endpoint descriptor. This
+ * descriptor is documented in section 9.6.3 of the USB 2.0 specification.
+ * All multiple-byte fields are represented in host-endian format.
+ */
+struct libusb_endpoint_descriptor {
+	/** Size of this descriptor (in bytes) */
+	uint8_t  bLength;
+
+	/** Descriptor type. Will have value
+	 * \ref libusb_descriptor_type::LIBUSB_DT_ENDPOINT LIBUSB_DT_ENDPOINT in
+	 * this context. */
+	uint8_t  bDescriptorType;
+
+	/** The address of the endpoint described by this descriptor. Bits 0:3 are
+	 * the endpoint number. Bits 4:6 are reserved. Bit 7 indicates direction,
+	 * see \ref libusb_endpoint_direction.
+	 */
+	uint8_t  bEndpointAddress;
+
+	/** Attributes which apply to the endpoint when it is configured using
+	 * the bConfigurationValue. Bits 0:1 determine the transfer type and
+	 * correspond to \ref libusb_transfer_type. Bits 2:3 are only used for
+	 * isochronous endpoints and correspond to \ref libusb_iso_sync_type.
+	 * Bits 4:5 are also only used for isochronous endpoints and correspond to
+	 * \ref libusb_iso_usage_type. Bits 6:7 are reserved.
+	 */
+	uint8_t  bmAttributes;
+
+	/** Maximum packet size this endpoint is capable of sending/receiving. */
+	uint16_t wMaxPacketSize;
+
+	/** Interval for polling endpoint for data transfers. */
+	uint8_t  bInterval;
+
+	/** For audio devices only: the rate at which synchronization feedback
+	 * is provided. */
+	uint8_t  bRefresh;
+
+	/** For audio devices only: the address if the synch endpoint */
+	uint8_t  bSynchAddress;
+
+	/** Extra descriptors. If libusb encounters unknown endpoint descriptors,
+	 * it will store them here, should you wish to parse them. */
+	const unsigned char *extra;
+
+	/** Length of the extra descriptors, in bytes. */
+	int extra_length;
+};
+
+/** \ingroup desc
+ * A structure representing the standard USB interface descriptor. This
+ * descriptor is documented in section 9.6.5 of the USB 2.0 specification.
+ * All multiple-byte fields are represented in host-endian format.
+ */
+struct libusb_interface_descriptor {
+	/** Size of this descriptor (in bytes) */
+	uint8_t  bLength;
+
+	/** Descriptor type. Will have value
+	 * \ref libusb_descriptor_type::LIBUSB_DT_INTERFACE LIBUSB_DT_INTERFACE
+	 * in this context. */
+	uint8_t  bDescriptorType;
+
+	/** Number of this interface */
+	uint8_t  bInterfaceNumber;
+
+	/** Value used to select this alternate setting for this interface */
+	uint8_t  bAlternateSetting;
+
+	/** Number of endpoints used by this interface (excluding the control
+	 * endpoint). */
+	uint8_t  bNumEndpoints;
+
+	/** USB-IF class code for this interface. See \ref libusb_class_code. */
+	uint8_t  bInterfaceClass;
+
+	/** USB-IF subclass code for this interface, qualified by the
+	 * bInterfaceClass value */
+	uint8_t  bInterfaceSubClass;
+
+	/** USB-IF protocol code for this interface, qualified by the
+	 * bInterfaceClass and bInterfaceSubClass values */
+	uint8_t  bInterfaceProtocol;
+
+	/** Index of string descriptor describing this interface */
+	uint8_t  iInterface;
+
+	/** Array of endpoint descriptors. This length of this array is determined
+	 * by the bNumEndpoints field. */
+	const struct libusb_endpoint_descriptor *endpoint;
+
+	/** Extra descriptors. If libusb encounters unknown interface descriptors,
+	 * it will store them here, should you wish to parse them. */
+	const unsigned char *extra;
+
+	/** Length of the extra descriptors, in bytes. */
+	int extra_length;
+};
+
+/** \ingroup desc
+ * A collection of alternate settings for a particular USB interface.
+ */
+struct libusb_interface {
+	/** Array of interface descriptors. The length of this array is determined
+	 * by the num_altsetting field. */
+	const struct libusb_interface_descriptor *altsetting;
+
+	/** The number of alternate settings that belong to this interface */
+	int num_altsetting;
+};
+
+/** \ingroup desc
+ * A structure representing the standard USB configuration descriptor. This
+ * descriptor is documented in section 9.6.3 of the USB 2.0 specification.
+ * All multiple-byte fields are represented in host-endian format.
+ */
+struct libusb_config_descriptor {
+	/** Size of this descriptor (in bytes) */
+	uint8_t  bLength;
+
+	/** Descriptor type. Will have value
+	 * \ref libusb_descriptor_type::LIBUSB_DT_CONFIG LIBUSB_DT_CONFIG
+	 * in this context. */
+	uint8_t  bDescriptorType;
+
+	/** Total length of data returned for this configuration */
+	uint16_t wTotalLength;
+
+	/** Number of interfaces supported by this configuration */
+	uint8_t  bNumInterfaces;
+
+	/** Identifier value for this configuration */
+	uint8_t  bConfigurationValue;
+
+	/** Index of string descriptor describing this configuration */
+	uint8_t  iConfiguration;
+
+	/** Configuration characteristics */
+	uint8_t  bmAttributes;
+
+	/** Maximum power consumption of the USB device from this bus in this
+	 * configuration when the device is fully opreation. Expressed in units
+	 * of 2 mA. */
+	uint8_t  MaxPower;
+
+	/** Array of interfaces supported by this configuration. The length of
+	 * this array is determined by the bNumInterfaces field. */
+	const struct libusb_interface *interface;
+
+	/** Extra descriptors. If libusb encounters unknown configuration
+	 * descriptors, it will store them here, should you wish to parse them. */
+	const unsigned char *extra;
+
+	/** Length of the extra descriptors, in bytes. */
+	int extra_length;
+};
+
+/** \ingroup asyncio
+ * Setup packet for control transfers. */
+struct libusb_control_setup {
+	/** Request type. Bits 0:4 determine recipient, see
+	 * \ref libusb_request_recipient. Bits 5:6 determine type, see
+	 * \ref libusb_request_type. Bit 7 determines data transfer direction, see
+	 * \ref libusb_endpoint_direction.
+	 */
+	uint8_t  bmRequestType;
+
+	/** Request. If the type bits of bmRequestType are equal to
+	 * \ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD
+	 * "LIBUSB_REQUEST_TYPE_STANDARD" then this field refers to
+	 * \ref libusb_standard_request. For other cases, use of this field is
+	 * application-specific. */
+	uint8_t  bRequest;
+
+	/** Value. Varies according to request */
+	uint16_t wValue;
+
+	/** Index. Varies according to request, typically used to pass an index
+	 * or offset */
+	uint16_t wIndex;
+
+	/** Number of bytes to transfer */
+	uint16_t wLength;
+};
+
+#define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))
+
+/* libusb */
+
+struct libusb_context;
+struct libusb_device;
+struct libusb_device_handle;
+
+/** \ingroup lib
+ * Structure representing a libusb session. The concept of individual libusb
+ * sessions allows for your program to use two libraries (or dynamically
+ * load two modules) which both independently use libusb. This will prevent
+ * interference between the individual libusb users - for example
+ * libusb_set_debug() will not affect the other user of the library, and
+ * libusb_exit() will not destroy resources that the other user is still
+ * using.
+ *
+ * Sessions are created by libusb_init() and destroyed through libusb_exit().
+ * If your application is guaranteed to only ever include a single libusb
+ * user (i.e. you), you do not have to worry about contexts: pass NULL in
+ * every function call where a context is required. The default context
+ * will be used.
+ *
+ * For more information, see \ref contexts.
+ */
+typedef struct libusb_context libusb_context;
+
+/** \ingroup dev
+ * Structure representing a USB device detected on the system. This is an
+ * opaque type for which you are only ever provided with a pointer, usually
+ * originating from libusb_get_device_list().
+ *
+ * Certain operations can be performed on a device, but in order to do any
+ * I/O you will have to first obtain a device handle using libusb_open().
+ *
+ * Devices are reference counted with libusb_device_ref() and
+ * libusb_device_unref(), and are freed when the reference count reaches 0.
+ * New devices presented by libusb_get_device_list() have a reference count of
+ * 1, and libusb_free_device_list() can optionally decrease the reference count
+ * on all devices in the list. libusb_open() adds another reference which is
+ * later destroyed by libusb_close().
+ */
+typedef struct libusb_device libusb_device;
+
+
+/** \ingroup dev
+ * Structure representing a handle on a USB device. This is an opaque type for
+ * which you are only ever provided with a pointer, usually originating from
+ * libusb_open().
+ *
+ * A device handle is used to perform I/O and other operations. When finished
+ * with a device handle, you should call libusb_close().
+ */
+typedef struct libusb_device_handle libusb_device_handle;
+
+/** \ingroup misc
+ * Error codes. Most libusb functions return 0 on success or one of these
+ * codes on failure.
+ */
+enum libusb_error {
+	/** Success (no error) */
+	LIBUSB_SUCCESS = 0,
+
+	/** Input/output error */
+	LIBUSB_ERROR_IO = -1,
+
+	/** Invalid parameter */
+	LIBUSB_ERROR_INVALID_PARAM = -2,
+
+	/** Access denied (insufficient permissions) */
+	LIBUSB_ERROR_ACCESS = -3,
+
+	/** No such device (it may have been disconnected) */
+	LIBUSB_ERROR_NO_DEVICE = -4,
+
+	/** Entity not found */
+	LIBUSB_ERROR_NOT_FOUND = -5,
+
+	/** Resource busy */
+	LIBUSB_ERROR_BUSY = -6,
+
+	/** Operation timed out */
+	LIBUSB_ERROR_TIMEOUT = -7,
+
+	/** Overflow */
+	LIBUSB_ERROR_OVERFLOW = -8,
+
+	/** Pipe error */
+	LIBUSB_ERROR_PIPE = -9,
+
+	/** System call interrupted (perhaps due to signal) */
+	LIBUSB_ERROR_INTERRUPTED = -10,
+
+	/** Insufficient memory */
+	LIBUSB_ERROR_NO_MEM = -11,
+
+	/** Operation not supported or unimplemented on this platform */
+	LIBUSB_ERROR_NOT_SUPPORTED = -12,
+
+	/** Other error */
+	LIBUSB_ERROR_OTHER = -99
+};
+
+/** \ingroup asyncio
+ * Transfer status codes */
+enum libusb_transfer_status {
+	/** Transfer completed without error. Note that this does not indicate
+	 * that the entire amount of requested data was transferred. */
+	LIBUSB_TRANSFER_COMPLETED,
+
+	/** Transfer failed */
+	LIBUSB_TRANSFER_ERROR,
+
+	/** Transfer timed out */
+	LIBUSB_TRANSFER_TIMED_OUT,
+
+	/** Transfer was cancelled */
+	LIBUSB_TRANSFER_CANCELLED,
+
+	/** For bulk/interrupt endpoints: halt condition detected (endpoint
+	 * stalled). For control endpoints: control request not supported. */
+	LIBUSB_TRANSFER_STALL,
+
+	/** Device was disconnected */
+	LIBUSB_TRANSFER_NO_DEVICE,
+
+	/** Device sent more data than requested */
+	LIBUSB_TRANSFER_OVERFLOW
+};
+
+/** \ingroup asyncio
+ * libusb_transfer.flags values */
+enum libusb_transfer_flags {
+	/** Report short frames as errors */
+	LIBUSB_TRANSFER_SHORT_NOT_OK = 1<<0,
+
+	/** Automatically free() transfer buffer during libusb_free_transfer() */
+	LIBUSB_TRANSFER_FREE_BUFFER = 1<<1,
+
+	/** Automatically call libusb_free_transfer() after callback returns.
+	 * If this flag is set, it is illegal to call libusb_free_transfer()
+	 * from your transfer callback, as this will result in a double-free
+	 * when this flag is acted upon. */
+	LIBUSB_TRANSFER_FREE_TRANSFER = 1<<2
+};
+
+/** \ingroup asyncio
+ * Isochronous packet descriptor. */
+struct libusb_iso_packet_descriptor {
+	/** Length of data to request in this packet */
+	unsigned int length;
+
+	/** Amount of data that was actually transferred */
+	unsigned int actual_length;
+
+	/** Status code for this packet */
+	enum libusb_transfer_status status;
+};
+
+struct libusb_transfer;
+
+/** \ingroup asyncio
+ * Asynchronous transfer callback function type. When submitting asynchronous
+ * transfers, you pass a pointer to a callback function of this type via the
+ * \ref libusb_transfer::callback "callback" member of the libusb_transfer
+ * structure. libusb will call this function later, when the transfer has
+ * completed or failed. See \ref asyncio for more information.
+ * \param transfer The libusb_transfer struct the callback function is being
+ * notified about.
+ */
+typedef void (*libusb_transfer_cb_fn)(struct libusb_transfer *transfer);
+
+/** \ingroup asyncio
+ * The generic USB transfer structure. The user populates this structure and
+ * then submits it in order to request a transfer. After the transfer has
+ * completed, the library populates the transfer with the results and passes
+ * it back to the user.
+ */
+struct libusb_transfer {
+	/** Handle of the device that this transfer will be submitted to */
+	libusb_device_handle *dev_handle;
+
+	/** A bitwise OR combination of \ref libusb_transfer_flags. */
+	uint8_t flags;
+
+	/** Address of the endpoint where this transfer will be sent. */
+	unsigned char endpoint;
+
+	/** Type of the endpoint from \ref libusb_transfer_type */
+	unsigned char type;
+
+	/** Timeout for this transfer in millseconds. A value of 0 indicates no
+	 * timeout. */
+	unsigned int timeout;
+
+	/** The status of the transfer. Read-only, and only for use within
+	 * transfer callback function.
+	 *
+	 * If this is an isochronous transfer, this field may read COMPLETED even
+	 * if there were errors in the frames. Use the
+	 * \ref libusb_iso_packet_descriptor::status "status" field in each packet
+	 * to determine if errors occurred. */
+	enum libusb_transfer_status status;
+
+	/** Length of the data buffer */
+	int length;
+
+	/** Actual length of data that was transferred. Read-only, and only for
+	 * use within transfer callback function. Not valid for isochronous
+	 * endpoint transfers. */
+	int actual_length;
+
+	/** Callback function. This will be invoked when the transfer completes,
+	 * fails, or is cancelled. */
+	libusb_transfer_cb_fn callback;
+
+	/** User context data to pass to the callback function. */
+	void *user_data;
+
+	/** Data buffer */
+	unsigned char *buffer;
+
+	/** Number of isochronous packets. Only used for I/O with isochronous
+	 * endpoints. */
+	int num_iso_packets;
+
+	/** Isochronous packet descriptors, for isochronous transfers only. */
+	struct libusb_iso_packet_descriptor iso_packet_desc
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+	[] /* valid C99 code */
+#else
+	[0] /* non-standard, but usually working code */
+#endif
+	;
+};
+
+int libusb_init(libusb_context **ctx);
+void libusb_exit(libusb_context *ctx);
+void libusb_set_debug(libusb_context *ctx, int level);
+
+ssize_t libusb_get_device_list(libusb_context *ctx,
+	libusb_device ***list);
+void libusb_free_device_list(libusb_device **list, int unref_devices);
+libusb_device *libusb_ref_device(libusb_device *dev);
+void libusb_unref_device(libusb_device *dev);
+
+int libusb_get_configuration(libusb_device_handle *dev, int *config);
+int libusb_get_device_descriptor(libusb_device *dev,
+	struct libusb_device_descriptor *desc);
+int libusb_get_active_config_descriptor(libusb_device *dev,
+	struct libusb_config_descriptor **config);
+int libusb_get_config_descriptor(libusb_device *dev, uint8_t config_index,
+	struct libusb_config_descriptor **config);
+int libusb_get_config_descriptor_by_value(libusb_device *dev,
+	uint8_t bConfigurationValue, struct libusb_config_descriptor **config);
+void libusb_free_config_descriptor(struct libusb_config_descriptor *config);
+uint8_t libusb_get_bus_number(libusb_device *dev);
+uint8_t libusb_get_device_address(libusb_device *dev);
+int libusb_get_max_packet_size(libusb_device *dev, unsigned char endpoint);
+int libusb_get_max_iso_packet_size(libusb_device *dev, unsigned char endpoint);
+
+int libusb_open(libusb_device *dev, libusb_device_handle **handle);
+void libusb_close(libusb_device_handle *dev_handle);
+libusb_device *libusb_get_device(libusb_device_handle *dev_handle);
+
+int libusb_set_configuration(libusb_device_handle *dev, int configuration);
+int libusb_claim_interface(libusb_device_handle *dev, int iface);
+int libusb_release_interface(libusb_device_handle *dev, int iface);
+
+libusb_device_handle *libusb_open_device_with_vid_pid(libusb_context *ctx,
+	uint16_t vendor_id, uint16_t product_id);
+
+int libusb_set_interface_alt_setting(libusb_device_handle *dev,
+	int interface_number, int alternate_setting);
+int libusb_clear_halt(libusb_device_handle *dev, unsigned char endpoint);
+int libusb_reset_device(libusb_device_handle *dev);
+
+int libusb_kernel_driver_active(libusb_device_handle *dev, int interface);
+int libusb_detach_kernel_driver(libusb_device_handle *dev, int interface);
+int libusb_attach_kernel_driver(libusb_device_handle *dev, int interface);
+
+/* async I/O */
+
+/** \ingroup asyncio
+ * Get the data section of a control transfer. This convenience function is here
+ * to remind you that the data does not start until 8 bytes into the actual
+ * buffer, as the setup packet comes first.
+ *
+ * Calling this function only makes sense from a transfer callback function,
+ * or situations where you have already allocated a suitably sized buffer at
+ * transfer->buffer.
+ *
+ * \param transfer a transfer
+ * \returns pointer to the first byte of the data section
+ */
+static inline unsigned char *libusb_control_transfer_get_data(
+	struct libusb_transfer *transfer)
+{
+	return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;
+}
+
+/** \ingroup asyncio
+ * Get the control setup packet of a control transfer. This convenience
+ * function is here to remind you that the control setup occupies the first
+ * 8 bytes of the transfer data buffer.
+ *
+ * Calling this function only makes sense from a transfer callback function,
+ * or situations where you have already allocated a suitably sized buffer at
+ * transfer->buffer.
+ *
+ * \param transfer a transfer
+ * \returns a casted pointer to the start of the transfer data buffer
+ */
+static inline struct libusb_control_setup *libusb_control_transfer_get_setup(
+	struct libusb_transfer *transfer)
+{
+	return (struct libusb_control_setup *) transfer->buffer;
+}
+
+/** \ingroup asyncio
+ * Helper function to populate the setup packet (first 8 bytes of the data
+ * buffer) for a control transfer. The wIndex, wValue and wLength values should
+ * be given in host-endian byte order.
+ *
+ * \param buffer buffer to output the setup packet into
+ * \param bmRequestType see the
+ * \ref libusb_control_setup::bmRequestType "bmRequestType" field of
+ * \ref libusb_control_setup
+ * \param bRequest see the
+ * \ref libusb_control_setup::bRequest "bRequest" field of
+ * \ref libusb_control_setup
+ * \param wValue see the
+ * \ref libusb_control_setup::wValue "wValue" field of
+ * \ref libusb_control_setup
+ * \param wIndex see the
+ * \ref libusb_control_setup::wIndex "wIndex" field of
+ * \ref libusb_control_setup
+ * \param wLength see the
+ * \ref libusb_control_setup::wLength "wLength" field of
+ * \ref libusb_control_setup
+ */
+static inline void libusb_fill_control_setup(unsigned char *buffer,
+	uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
+	uint16_t wLength)
+{
+	struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer;
+	setup->bmRequestType = bmRequestType;
+	setup->bRequest = bRequest;
+	setup->wValue = libusb_cpu_to_le16(wValue);
+	setup->wIndex = libusb_cpu_to_le16(wIndex);
+	setup->wLength = libusb_cpu_to_le16(wLength);
+}
+
+struct libusb_transfer *libusb_alloc_transfer(int iso_packets);
+int libusb_submit_transfer(struct libusb_transfer *transfer);
+int libusb_cancel_transfer(struct libusb_transfer *transfer);
+void libusb_free_transfer(struct libusb_transfer *transfer);
+
+/** \ingroup asyncio
+ * Helper function to populate the required \ref libusb_transfer fields
+ * for a control transfer.
+ *
+ * If you pass a transfer buffer to this function, the first 8 bytes will
+ * be interpreted as a control setup packet, and the wLength field will be
+ * used to automatically populate the \ref libusb_transfer::length "length"
+ * field of the transfer. Therefore the recommended approach is:
+ * -# Allocate a suitably sized data buffer (including space for control setup)
+ * -# Call libusb_fill_control_setup()
+ * -# If this is a host-to-device transfer with a data stage, put the data
+ *    in place after the setup packet
+ * -# Call this function
+ * -# Call libusb_submit_transfer()
+ *
+ * It is also legal to pass a NULL buffer to this function, in which case this
+ * function will not attempt to populate the length field. Remember that you
+ * must then populate the buffer and length fields later.
+ *
+ * \param transfer the transfer to populate
+ * \param dev_handle handle of the device that will handle the transfer
+ * \param buffer data buffer. If provided, this function will interpret the
+ * first 8 bytes as a setup packet and infer the transfer length from that.
+ * \param callback callback function to be invoked on transfer completion
+ * \param user_data user data to pass to callback function
+ * \param timeout timeout for the transfer in milliseconds
+ */
+static inline void libusb_fill_control_transfer(
+	struct libusb_transfer *transfer, libusb_device_handle *dev_handle,
+	unsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data,
+	unsigned int timeout)
+{
+	struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer;
+	transfer->dev_handle = dev_handle;
+	transfer->endpoint = 0;
+	transfer->type = LIBUSB_TRANSFER_TYPE_CONTROL;
+	transfer->timeout = timeout;
+	transfer->buffer = buffer;
+	if (setup)
+		transfer->length = LIBUSB_CONTROL_SETUP_SIZE
+			+ libusb_le16_to_cpu(setup->wLength);
+	transfer->user_data = user_data;
+	transfer->callback = callback;
+}
+
+/** \ingroup asyncio
+ * Helper function to populate the required \ref libusb_transfer fields
+ * for a bulk transfer.
+ *
+ * \param transfer the transfer to populate
+ * \param dev_handle handle of the device that will handle the transfer
+ * \param endpoint address of the endpoint where this transfer will be sent
+ * \param buffer data buffer
+ * \param length length of data buffer
+ * \param callback callback function to be invoked on transfer completion
+ * \param user_data user data to pass to callback function
+ * \param timeout timeout for the transfer in milliseconds
+ */
+static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer,
+	libusb_device_handle *dev_handle, unsigned char endpoint,
+	unsigned char *buffer, int length, libusb_transfer_cb_fn callback,
+	void *user_data, unsigned int timeout)
+{
+	transfer->dev_handle = dev_handle;
+	transfer->endpoint = endpoint;
+	transfer->type = LIBUSB_TRANSFER_TYPE_BULK;
+	transfer->timeout = timeout;
+	transfer->buffer = buffer;
+	transfer->length = length;
+	transfer->user_data = user_data;
+	transfer->callback = callback;
+}
+
+/** \ingroup asyncio
+ * Helper function to populate the required \ref libusb_transfer fields
+ * for an interrupt transfer.
+ *
+ * \param transfer the transfer to populate
+ * \param dev_handle handle of the device that will handle the transfer
+ * \param endpoint address of the endpoint where this transfer will be sent
+ * \param buffer data buffer
+ * \param length length of data buffer
+ * \param callback callback function to be invoked on transfer completion
+ * \param user_data user data to pass to callback function
+ * \param timeout timeout for the transfer in milliseconds
+ */
+static inline void libusb_fill_interrupt_transfer(
+	struct libusb_transfer *transfer, libusb_device_handle *dev_handle,
+	unsigned char endpoint, unsigned char *buffer, int length,
+	libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
+{
+	transfer->dev_handle = dev_handle;
+	transfer->endpoint = endpoint;
+	transfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT;
+	transfer->timeout = timeout;
+	transfer->buffer = buffer;
+	transfer->length = length;
+	transfer->user_data = user_data;
+	transfer->callback = callback;
+}
+
+/** \ingroup asyncio
+ * Helper function to populate the required \ref libusb_transfer fields
+ * for an isochronous transfer.
+ *
+ * \param transfer the transfer to populate
+ * \param dev_handle handle of the device that will handle the transfer
+ * \param endpoint address of the endpoint where this transfer will be sent
+ * \param buffer data buffer
+ * \param length length of data buffer
+ * \param num_iso_packets the number of isochronous packets
+ * \param callback callback function to be invoked on transfer completion
+ * \param user_data user data to pass to callback function
+ * \param timeout timeout for the transfer in milliseconds
+ */
+static inline void libusb_fill_iso_transfer(struct libusb_transfer *transfer,
+	libusb_device_handle *dev_handle, unsigned char endpoint,
+	unsigned char *buffer, int length, int num_iso_packets,
+	libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
+{
+	transfer->dev_handle = dev_handle;
+	transfer->endpoint = endpoint;
+	transfer->type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS;
+	transfer->timeout = timeout;
+	transfer->buffer = buffer;
+	transfer->length = length;
+	transfer->num_iso_packets = num_iso_packets;
+	transfer->user_data = user_data;
+	transfer->callback = callback;
+}
+
+/** \ingroup asyncio
+ * Convenience function to set the length of all packets in an isochronous
+ * transfer, based on the num_iso_packets field in the transfer structure.
+ *
+ * \param transfer a transfer
+ * \param length the length to set in each isochronous packet descriptor
+ * \see libusb_get_max_packet_size()
+ */
+static inline void libusb_set_iso_packet_lengths(
+	struct libusb_transfer *transfer, unsigned int length)
+{
+	int i;
+	for (i = 0; i < transfer->num_iso_packets; i++)
+		transfer->iso_packet_desc[i].length = length;
+}
+
+/** \ingroup asyncio
+ * Convenience function to locate the position of an isochronous packet
+ * within the buffer of an isochronous transfer.
+ *
+ * This is a thorough function which loops through all preceding packets,
+ * accumulating their lengths to find the position of the specified packet.
+ * Typically you will assign equal lengths to each packet in the transfer,
+ * and hence the above method is sub-optimal. You may wish to use
+ * libusb_get_iso_packet_buffer_simple() instead.
+ *
+ * \param transfer a transfer
+ * \param packet the packet to return the address of
+ * \returns the base address of the packet buffer inside the transfer buffer,
+ * or NULL if the packet does not exist.
+ * \see libusb_get_iso_packet_buffer_simple()
+ */
+static inline unsigned char *libusb_get_iso_packet_buffer(
+	struct libusb_transfer *transfer, unsigned int packet)
+{
+	int i;
+	size_t offset = 0;
+	int _packet;
+
+	/* oops..slight bug in the API. packet is an unsigned int, but we use
+	 * signed integers almost everywhere else. range-check and convert to
+	 * signed to avoid compiler warnings. FIXME for libusb-2. */
+	if (packet > INT_MAX)
+		return NULL;
+	_packet = packet;
+
+	if (_packet >= transfer->num_iso_packets)
+		return NULL;
+
+	for (i = 0; i < _packet; i++)
+		offset += transfer->iso_packet_desc[i].length;
+
+	return transfer->buffer + offset;
+}
+
+/** \ingroup asyncio
+ * Convenience function to locate the position of an isochronous packet
+ * within the buffer of an isochronous transfer, for transfers where each
+ * packet is of identical size.
+ *
+ * This function relies on the assumption that every packet within the transfer
+ * is of identical size to the first packet. Calculating the location of
+ * the packet buffer is then just a simple calculation:
+ * <tt>buffer + (packet_size * packet)</tt>
+ *
+ * Do not use this function on transfers other than those that have identical
+ * packet lengths for each packet.
+ *
+ * \param transfer a transfer
+ * \param packet the packet to return the address of
+ * \returns the base address of the packet buffer inside the transfer buffer,
+ * or NULL if the packet does not exist.
+ * \see libusb_get_iso_packet_buffer()
+ */
+static inline unsigned char *libusb_get_iso_packet_buffer_simple(
+	struct libusb_transfer *transfer, unsigned int packet)
+{
+	int _packet;
+
+	/* oops..slight bug in the API. packet is an unsigned int, but we use
+	 * signed integers almost everywhere else. range-check and convert to
+	 * signed to avoid compiler warnings. FIXME for libusb-2. */
+	if (packet > INT_MAX)
+		return NULL;
+	_packet = packet;
+
+	if (_packet >= transfer->num_iso_packets)
+		return NULL;
+
+	return transfer->buffer + (transfer->iso_packet_desc[0].length * _packet);
+}
+
+/* sync I/O */
+
+int libusb_control_transfer(libusb_device_handle *dev_handle,
+	uint8_t request_type, uint8_t request, uint16_t value, uint16_t index,
+	unsigned char *data, uint16_t length, unsigned int timeout);
+
+int libusb_bulk_transfer(libusb_device_handle *dev_handle,
+	unsigned char endpoint, unsigned char *data, int length,
+	int *actual_length, unsigned int timeout);
+
+int libusb_interrupt_transfer(libusb_device_handle *dev_handle,
+	unsigned char endpoint, unsigned char *data, int length,
+	int *actual_length, unsigned int timeout);
+
+/** \ingroup desc
+ * Retrieve a descriptor from the default control pipe.
+ * This is a convenience function which formulates the appropriate control
+ * message to retrieve the descriptor.
+ *
+ * \param dev a device handle
+ * \param desc_type the descriptor type, see \ref libusb_descriptor_type
+ * \param desc_index the index of the descriptor to retrieve
+ * \param data output buffer for descriptor
+ * \param length size of data buffer
+ * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure
+ */
+static inline int libusb_get_descriptor(libusb_device_handle *dev,
+	uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length)
+{
+	return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,
+		LIBUSB_REQUEST_GET_DESCRIPTOR, (desc_type << 8) | desc_index, 0, data,
+		length, 1000);
+}
+
+/** \ingroup desc
+ * Retrieve a descriptor from a device.
+ * This is a convenience function which formulates the appropriate control
+ * message to retrieve the descriptor. The string returned is Unicode, as
+ * detailed in the USB specifications.
+ *
+ * \param dev a device handle
+ * \param desc_index the index of the descriptor to retrieve
+ * \param langid the language ID for the string descriptor
+ * \param data output buffer for descriptor
+ * \param length size of data buffer
+ * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure
+ * \see libusb_get_string_descriptor_ascii()
+ */
+static inline int libusb_get_string_descriptor(libusb_device_handle *dev,
+	uint8_t desc_index, uint16_t langid, unsigned char *data, int length)
+{
+	return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,
+		LIBUSB_REQUEST_GET_DESCRIPTOR, (LIBUSB_DT_STRING << 8) | desc_index,
+		langid, data, length, 1000);
+}
+
+int libusb_get_string_descriptor_ascii(libusb_device_handle *dev,
+	uint8_t index, unsigned char *data, int length);
+
+/* polling and timeouts */
+
+int libusb_try_lock_events(libusb_context *ctx);
+void libusb_lock_events(libusb_context *ctx);
+void libusb_unlock_events(libusb_context *ctx);
+int libusb_event_handling_ok(libusb_context *ctx);
+int libusb_event_handler_active(libusb_context *ctx);
+void libusb_lock_event_waiters(libusb_context *ctx);
+void libusb_unlock_event_waiters(libusb_context *ctx);
+int libusb_wait_for_event(libusb_context *ctx, struct timeval *tv);
+
+int libusb_handle_events_timeout(libusb_context *ctx, struct timeval *tv);
+int libusb_handle_events(libusb_context *ctx);
+int libusb_handle_events_locked(libusb_context *ctx, struct timeval *tv);
+int libusb_pollfds_handle_timeouts(libusb_context *ctx);
+int libusb_get_next_timeout(libusb_context *ctx, struct timeval *tv);
+
+/** \ingroup poll
+ * File descriptor for polling
+ */
+struct libusb_pollfd {
+	/** Numeric file descriptor */
+	int fd;
+
+	/** Event flags to poll for from <poll.h>. POLLIN indicates that you
+	 * should monitor this file descriptor for becoming ready to read from,
+	 * and POLLOUT indicates that you should monitor this file descriptor for
+	 * nonblocking write readiness. */
+	short events;
+};
+
+/** \ingroup poll
+ * Callback function, invoked when a new file descriptor should be added
+ * to the set of file descriptors monitored for events.
+ * \param fd the new file descriptor
+ * \param events events to monitor for, see \ref libusb_pollfd for a
+ * description
+ * \param user_data User data pointer specified in
+ * libusb_set_pollfd_notifiers() call
+ * \see libusb_set_pollfd_notifiers()
+ */
+typedef void (*libusb_pollfd_added_cb)(int fd, short events, void *user_data);
+
+/** \ingroup poll
+ * Callback function, invoked when a file descriptor should be removed from
+ * the set of file descriptors being monitored for events. After returning
+ * from this callback, do not use that file descriptor again.
+ * \param fd the file descriptor to stop monitoring
+ * \param user_data User data pointer specified in
+ * libusb_set_pollfd_notifiers() call
+ * \see libusb_set_pollfd_notifiers()
+ */
+typedef void (*libusb_pollfd_removed_cb)(int fd, void *user_data);
+
+const struct libusb_pollfd **libusb_get_pollfds(libusb_context *ctx);
+void libusb_set_pollfd_notifiers(libusb_context *ctx,
+	libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb,
+	void *user_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/libusbi.h b/Platform/Android/jni/External/libusb-1.0.8/libusb/libusbi.h
new file mode 100644
index 0000000..bb38e06
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/libusbi.h
@@ -0,0 +1,809 @@
+/*
+ * Internal header for libusb
+ * Copyright (C) 2007-2009 Daniel Drake <dsd at gentoo.org>
+ * Copyright (c) 2001 Johannes Erdfelt <johannes at erdfelt.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __LIBUSBI_H__
+#define __LIBUSBI_H__
+
+#include "config.h"
+
+#include <poll.h>
+#include <pthread.h>
+#include <stddef.h>
+#include <time.h>
+#include "libusb.h"
+
+#define DEVICE_DESC_LENGTH		18
+
+#define USB_MAXENDPOINTS	32
+#define USB_MAXINTERFACES	32
+#define USB_MAXCONFIG		8
+
+struct list_head {
+	struct list_head *prev, *next;
+};
+
+/* Get an entry from the list 
+ * 	ptr - the address of this list_head element in "type" 
+ * 	type - the data type that contains "member"
+ * 	member - the list_head element in "type" 
+ */
+#define list_entry(ptr, type, member) \
+	((type *)((char *)(ptr) - (unsigned long)(&((type *)0L)->member)))
+
+/* Get each entry from a list
+ *	pos - A structure pointer has a "member" element
+ *	head - list head
+ *	member - the list_head element in "pos"
+ */
+#define list_for_each_entry(pos, head, member)				\
+	for (pos = list_entry((head)->next, typeof(*pos), member);	\
+	     &pos->member != (head);					\
+	     pos = list_entry(pos->member.next, typeof(*pos), member))
+
+#define list_for_each_entry_safe(pos, n, head, member)			\
+        for (pos = list_entry((head)->next, typeof(*pos), member),	\
+		n = list_entry(pos->member.next, typeof(*pos), member);	\
+	     &pos->member != (head);					\
+	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
+#define list_empty(entry) ((entry)->next == (entry))
+
+static inline void list_init(struct list_head *entry)
+{
+	entry->prev = entry->next = entry;
+}
+
+static inline void list_add(struct list_head *entry, struct list_head *head)
+{
+	entry->next = head->next;
+	entry->prev = head;
+
+	head->next->prev = entry;
+	head->next = entry;
+}
+
+static inline void list_add_tail(struct list_head *entry,
+	struct list_head *head)
+{
+	entry->next = head;
+	entry->prev = head->prev;
+
+	head->prev->next = entry;
+	head->prev = entry;
+}
+
+static inline void list_del(struct list_head *entry)
+{
+	entry->next->prev = entry->prev;
+	entry->prev->next = entry->next;
+}
+
+#define container_of(ptr, type, member) ({                      \
+        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
+        (type *)( (char *)__mptr - offsetof(type,member) );})
+
+#define MIN(a, b)	((a) < (b) ? (a) : (b))
+#define MAX(a, b)	((a) > (b) ? (a) : (b))
+
+#define TIMESPEC_IS_SET(ts) ((ts)->tv_sec != 0 || (ts)->tv_nsec != 0)
+
+enum usbi_log_level {
+	LOG_LEVEL_DEBUG,
+	LOG_LEVEL_INFO,
+	LOG_LEVEL_WARNING,
+	LOG_LEVEL_ERROR,
+};
+
+void usbi_log(struct libusb_context *ctx, enum usbi_log_level,
+	const char *function, const char *format, ...);
+
+#ifdef ENABLE_LOGGING
+#define _usbi_log(ctx, level, fmt...) usbi_log(ctx, level, __FUNCTION__, fmt)
+#else
+#define _usbi_log(ctx, level, fmt...)
+#endif
+
+#ifdef ENABLE_DEBUG_LOGGING
+#define usbi_dbg(fmt...) _usbi_log(NULL, LOG_LEVEL_DEBUG, fmt)
+#else
+#define usbi_dbg(fmt...)
+#endif
+
+#define usbi_info(ctx, fmt...) _usbi_log(ctx, LOG_LEVEL_INFO, fmt)
+#define usbi_warn(ctx, fmt...) _usbi_log(ctx, LOG_LEVEL_WARNING, fmt)
+#define usbi_err(ctx, fmt...) _usbi_log(ctx, LOG_LEVEL_ERROR, fmt)
+
+#define USBI_GET_CONTEXT(ctx) if (!(ctx)) (ctx) = usbi_default_context
+#define DEVICE_CTX(dev) ((dev)->ctx)
+#define HANDLE_CTX(handle) (DEVICE_CTX((handle)->dev))
+#define TRANSFER_CTX(transfer) (HANDLE_CTX((transfer)->dev_handle))
+#define ITRANSFER_CTX(transfer) \
+	(TRANSFER_CTX(__USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)))
+
+extern struct libusb_context *usbi_default_context;
+
+struct libusb_context {
+	int debug;
+	int debug_fixed;
+
+	/* internal control pipe, used for interrupting event handling when
+	 * something needs to modify poll fds. */
+	int ctrl_pipe[2];
+
+	struct list_head usb_devs;
+	pthread_mutex_t usb_devs_lock;
+
+	/* A list of open handles. Backends are free to traverse this if required.
+	 */
+	struct list_head open_devs;
+	pthread_mutex_t open_devs_lock;
+
+	/* this is a list of in-flight transfer handles, sorted by timeout 
+	 * expiration. URBs to timeout the soonest are placed at the beginning of
+	 * the list, URBs that will time out later are placed after, and urbs with
+	 * infinite timeout are always placed at the very end. */
+	struct list_head flying_transfers;
+	pthread_mutex_t flying_transfers_lock;
+
+	/* list of poll fds */
+	struct list_head pollfds;
+	pthread_mutex_t pollfds_lock;
+
+	/* a counter that is set when we want to interrupt event handling, in order
+	 * to modify the poll fd set. and a lock to protect it. */
+	unsigned int pollfd_modify;
+	pthread_mutex_t pollfd_modify_lock;
+
+	/* user callbacks for pollfd changes */
+	libusb_pollfd_added_cb fd_added_cb;
+	libusb_pollfd_removed_cb fd_removed_cb;
+	void *fd_cb_user_data;
+
+	/* ensures that only one thread is handling events at any one time */
+	pthread_mutex_t events_lock;
+
+	/* used to see if there is an active thread doing event handling */
+	int event_handler_active;
+
+	/* used to wait for event completion in threads other than the one that is
+	 * event handling */
+	pthread_mutex_t event_waiters_lock;
+	pthread_cond_t event_waiters_cond;
+
+#ifdef USBI_TIMERFD_AVAILABLE
+	/* used for timeout handling, if supported by OS.
+	 * this timerfd is maintained to trigger on the next pending timeout */
+	int timerfd;
+#endif
+};
+
+#ifdef USBI_TIMERFD_AVAILABLE
+#define usbi_using_timerfd(ctx) ((ctx)->timerfd >= 0)
+#else
+#define usbi_using_timerfd(ctx) (0)
+#endif
+
+struct libusb_device {
+	/* lock protects refcnt, everything else is finalized at initialization
+	 * time */
+	pthread_mutex_t lock;
+	int refcnt;
+
+	struct libusb_context *ctx;
+
+	uint8_t bus_number;
+	uint8_t device_address;
+	uint8_t num_configurations;
+
+	struct list_head list;
+	unsigned long session_data;
+	unsigned char os_priv[0];
+};
+
+struct libusb_device_handle {
+	/* lock protects claimed_interfaces */
+	pthread_mutex_t lock;
+	unsigned long claimed_interfaces;
+
+	struct list_head list;
+	struct libusb_device *dev;
+	unsigned char os_priv[0];
+};
+
+#define USBI_TRANSFER_TIMED_OUT	 			(1<<0)
+
+enum {
+  USBI_CLOCK_MONOTONIC,
+  USBI_CLOCK_REALTIME
+};
+
+/* in-memory transfer layout:
+ *
+ * 1. struct usbi_transfer
+ * 2. struct libusb_transfer (which includes iso packets) [variable size]
+ * 3. os private data [variable size]
+ *
+ * from a libusb_transfer, you can get the usbi_transfer by rewinding the
+ * appropriate number of bytes.
+ * the usbi_transfer includes the number of allocated packets, so you can
+ * determine the size of the transfer and hence the start and length of the
+ * OS-private data.
+ */
+
+struct usbi_transfer {
+	int num_iso_packets;
+	struct list_head list;
+	struct timeval timeout;
+	int transferred;
+	uint8_t flags;
+
+	/* this lock is held during libusb_submit_transfer() and
+	 * libusb_cancel_transfer() (allowing the OS backend to prevent duplicate
+	 * cancellation, submission-during-cancellation, etc). the OS backend
+	 * should also take this lock in the handle_events path, to prevent the user
+	 * cancelling the transfer from another thread while you are processing
+	 * its completion (presumably there would be races within your OS backend
+	 * if this were possible). */
+	pthread_mutex_t lock;
+};
+
+#define __USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer) \
+	((struct libusb_transfer *)(((void *)(transfer)) \
+		+ sizeof(struct usbi_transfer)))
+#define __LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer) \
+	((struct usbi_transfer *)(((void *)(transfer)) \
+		- sizeof(struct usbi_transfer)))
+
+static inline void *usbi_transfer_get_os_priv(struct usbi_transfer *transfer)
+{
+	return ((void *)transfer) + sizeof(struct usbi_transfer)
+		+ sizeof(struct libusb_transfer)
+		+ (transfer->num_iso_packets
+			* sizeof(struct libusb_iso_packet_descriptor));
+}
+
+/* bus structures */
+
+/* All standard descriptors have these 2 fields in common */
+struct usb_descriptor_header {
+	uint8_t  bLength;
+	uint8_t  bDescriptorType;
+};
+
+/* shared data and functions */
+
+int usbi_io_init(struct libusb_context *ctx);
+void usbi_io_exit(struct libusb_context *ctx);
+
+struct libusb_device *usbi_alloc_device(struct libusb_context *ctx,
+	unsigned long session_id);
+struct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx,
+	unsigned long session_id);
+int usbi_sanitize_device(struct libusb_device *dev);
+void usbi_handle_disconnect(struct libusb_device_handle *handle);
+
+int usbi_handle_transfer_completion(struct usbi_transfer *itransfer,
+	enum libusb_transfer_status status);
+int usbi_handle_transfer_cancellation(struct usbi_transfer *transfer);
+
+int usbi_parse_descriptor(unsigned char *source, char *descriptor, void *dest,
+	int host_endian);
+int usbi_get_config_index_by_value(struct libusb_device *dev,
+	uint8_t bConfigurationValue, int *idx);
+
+/* polling */
+
+struct usbi_pollfd {
+	/* must come first */
+	struct libusb_pollfd pollfd;
+
+	struct list_head list;
+};
+
+int usbi_add_pollfd(struct libusb_context *ctx, int fd, short events);
+void usbi_remove_pollfd(struct libusb_context *ctx, int fd);
+
+/* device discovery */
+
+/* we traverse usbfs without knowing how many devices we are going to find.
+ * so we create this discovered_devs model which is similar to a linked-list
+ * which grows when required. it can be freed once discovery has completed,
+ * eliminating the need for a list node in the libusb_device structure
+ * itself. */
+struct discovered_devs {
+	size_t len;
+	size_t capacity;
+	struct libusb_device *devices[0];
+};
+
+struct discovered_devs *discovered_devs_append(
+	struct discovered_devs *discdevs, struct libusb_device *dev);
+
+/* OS abstraction */
+
+/* This is the interface that OS backends need to implement.
+ * All fields are mandatory, except ones explicitly noted as optional. */
+struct usbi_os_backend {
+	/* A human-readable name for your backend, e.g. "Linux usbfs" */
+	const char *name;
+
+	/* Perform initialization of your backend. You might use this function
+	 * to determine specific capabilities of the system, allocate required
+	 * data structures for later, etc.
+	 *
+	 * This function is called when a libusb user initializes the library
+	 * prior to use.
+	 *
+	 * Return 0 on success, or a LIBUSB_ERROR code on failure.
+	 */
+	int (*init)(struct libusb_context *ctx);
+
+	/* Deinitialization. Optional. This function should destroy anything
+	 * that was set up by init.
+	 *
+	 * This function is called when the user deinitializes the library.
+	 */
+	void (*exit)(void);
+
+	/* Enumerate all the USB devices on the system, returning them in a list
+	 * of discovered devices.
+	 *
+	 * Your implementation should enumerate all devices on the system,
+	 * regardless of whether they have been seen before or not.
+	 *
+	 * When you have found a device, compute a session ID for it. The session
+	 * ID should uniquely represent that particular device for that particular
+	 * connection session since boot (i.e. if you disconnect and reconnect a
+	 * device immediately after, it should be assigned a different session ID).
+	 * If your OS cannot provide a unique session ID as described above,
+	 * presenting a session ID of (bus_number << 8 | device_address) should
+	 * be sufficient. Bus numbers and device addresses wrap and get reused,
+	 * but that is an unlikely case.
+	 *
+	 * After computing a session ID for a device, call
+	 * usbi_get_device_by_session_id(). This function checks if libusb already
+	 * knows about the device, and if so, it provides you with a libusb_device
+	 * structure for it.
+	 *
+	 * If usbi_get_device_by_session_id() returns NULL, it is time to allocate
+	 * a new device structure for the device. Call usbi_alloc_device() to
+	 * obtain a new libusb_device structure with reference count 1. Populate
+	 * the bus_number and device_address attributes of the new device, and
+	 * perform any other internal backend initialization you need to do. At
+	 * this point, you should be ready to provide device descriptors and so
+	 * on through the get_*_descriptor functions. Finally, call
+	 * usbi_sanitize_device() to perform some final sanity checks on the
+	 * device. Assuming all of the above succeeded, we can now continue.
+	 * If any of the above failed, remember to unreference the device that
+	 * was returned by usbi_alloc_device().
+	 *
+	 * At this stage we have a populated libusb_device structure (either one
+	 * that was found earlier, or one that we have just allocated and
+	 * populated). This can now be added to the discovered devices list
+	 * using discovered_devs_append(). Note that discovered_devs_append()
+	 * may reallocate the list, returning a new location for it, and also
+	 * note that reallocation can fail. Your backend should handle these
+	 * error conditions appropriately.
+	 *
+	 * This function should not generate any bus I/O and should not block.
+	 * If I/O is required (e.g. reading the active configuration value), it is
+	 * OK to ignore these suggestions :)
+	 *
+	 * This function is executed when the user wishes to retrieve a list
+	 * of USB devices connected to the system.
+	 *
+	 * Return 0 on success, or a LIBUSB_ERROR code on failure.
+	 */
+	int (*get_device_list)(struct libusb_context *ctx,
+		struct discovered_devs **discdevs);
+
+	/* Open a device for I/O and other USB operations. The device handle
+	 * is preallocated for you, you can retrieve the device in question
+	 * through handle->dev.
+	 *
+	 * Your backend should allocate any internal resources required for I/O
+	 * and other operations so that those operations can happen (hopefully)
+	 * without hiccup. This is also a good place to inform libusb that it
+	 * should monitor certain file descriptors related to this device -
+	 * see the usbi_add_pollfd() function.
+	 *
+	 * This function should not generate any bus I/O and should not block.
+	 *
+	 * This function is called when the user attempts to obtain a device
+	 * handle for a device.
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_ACCESS if the user has insufficient permissions
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since
+	 *   discovery
+	 * - another LIBUSB_ERROR code on other failure
+	 *
+	 * Do not worry about freeing the handle on failed open, the upper layers
+	 * do this for you.
+	 */
+	int (*open)(struct libusb_device_handle *handle);
+
+	/* Close a device such that the handle cannot be used again. Your backend
+	 * should destroy any resources that were allocated in the open path.
+	 * This may also be a good place to call usbi_remove_pollfd() to inform
+	 * libusb of any file descriptors associated with this device that should
+	 * no longer be monitored.
+	 *
+	 * This function is called when the user closes a device handle.
+	 */
+	void (*close)(struct libusb_device_handle *handle);
+
+	/* Retrieve the device descriptor from a device.
+	 *
+	 * The descriptor should be retrieved from memory, NOT via bus I/O to the
+	 * device. This means that you may have to cache it in a private structure
+	 * during get_device_list enumeration. Alternatively, you may be able
+	 * to retrieve it from a kernel interface (some Linux setups can do this)
+	 * still without generating bus I/O.
+	 *
+	 * This function is expected to write DEVICE_DESC_LENGTH (18) bytes into
+	 * buffer, which is guaranteed to be big enough.
+	 *
+	 * This function is called when sanity-checking a device before adding
+	 * it to the list of discovered devices, and also when the user requests
+	 * to read the device descriptor.
+	 *
+	 * This function is expected to return the descriptor in bus-endian format
+	 * (LE). If it returns the multi-byte values in host-endian format,
+	 * set the host_endian output parameter to "1".
+	 *
+	 * Return 0 on success or a LIBUSB_ERROR code on failure.
+	 */
+	int (*get_device_descriptor)(struct libusb_device *device,
+		unsigned char *buffer, int *host_endian);
+
+	/* Get the ACTIVE configuration descriptor for a device.
+	 *
+	 * The descriptor should be retrieved from memory, NOT via bus I/O to the
+	 * device. This means that you may have to cache it in a private structure
+	 * during get_device_list enumeration. You may also have to keep track
+	 * of which configuration is active when the user changes it.
+	 *
+	 * This function is expected to write len bytes of data into buffer, which
+	 * is guaranteed to be big enough. If you can only do a partial write,
+	 * return an error code.
+	 *
+	 * This function is expected to return the descriptor in bus-endian format
+	 * (LE). If it returns the multi-byte values in host-endian format,
+	 * set the host_endian output parameter to "1".
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state
+	 * - another LIBUSB_ERROR code on other failure
+	 */
+	int (*get_active_config_descriptor)(struct libusb_device *device,
+		unsigned char *buffer, size_t len, int *host_endian);
+
+	/* Get a specific configuration descriptor for a device.
+	 *
+	 * The descriptor should be retrieved from memory, NOT via bus I/O to the
+	 * device. This means that you may have to cache it in a private structure
+	 * during get_device_list enumeration.
+	 *
+	 * The requested descriptor is expressed as a zero-based index (i.e. 0
+	 * indicates that we are requesting the first descriptor). The index does
+	 * not (necessarily) equal the bConfigurationValue of the configuration
+	 * being requested.
+	 *
+	 * This function is expected to write len bytes of data into buffer, which
+	 * is guaranteed to be big enough. If you can only do a partial write,
+	 * return an error code.
+	 *
+	 * This function is expected to return the descriptor in bus-endian format
+	 * (LE). If it returns the multi-byte values in host-endian format,
+	 * set the host_endian output parameter to "1".
+	 *
+	 * Return 0 on success or a LIBUSB_ERROR code on failure.
+	 */
+	int (*get_config_descriptor)(struct libusb_device *device,
+		uint8_t config_index, unsigned char *buffer, size_t len,
+		int *host_endian);
+
+	/* Get the bConfigurationValue for the active configuration for a device.
+	 * Optional. This should only be implemented if you can retrieve it from
+	 * cache (don't generate I/O).
+	 *
+	 * If you cannot retrieve this from cache, either do not implement this
+	 * function, or return LIBUSB_ERROR_NOT_SUPPORTED. This will cause
+	 * libusb to retrieve the information through a standard control transfer.
+	 *
+	 * This function must be non-blocking.
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
+	 *   was opened
+	 * - LIBUSB_ERROR_NOT_SUPPORTED if the value cannot be retrieved without
+	 *   blocking
+	 * - another LIBUSB_ERROR code on other failure.
+	 */
+	int (*get_configuration)(struct libusb_device_handle *handle, int *config);
+
+	/* Set the active configuration for a device.
+	 *
+	 * A configuration value of -1 should put the device in unconfigured state.
+	 *
+	 * This function can block.
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NOT_FOUND if the configuration does not exist
+	 * - LIBUSB_ERROR_BUSY if interfaces are currently claimed (and hence
+	 *   configuration cannot be changed)
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
+	 *   was opened
+	 * - another LIBUSB_ERROR code on other failure.
+	 */
+	int (*set_configuration)(struct libusb_device_handle *handle, int config);
+
+	/* Claim an interface. When claimed, the application can then perform
+	 * I/O to an interface's endpoints.
+	 *
+	 * This function should not generate any bus I/O and should not block.
+	 * Interface claiming is a logical operation that simply ensures that
+	 * no other drivers/applications are using the interface, and after
+	 * claiming, no other drivers/applicatiosn can use the interface because
+	 * we now "own" it.
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NOT_FOUND if the interface does not exist
+	 * - LIBUSB_ERROR_BUSY if the interface is in use by another driver/app
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
+	 *   was opened
+	 * - another LIBUSB_ERROR code on other failure
+	 */
+	int (*claim_interface)(struct libusb_device_handle *handle, int iface);
+
+	/* Release a previously claimed interface.
+	 *
+	 * This function should also generate a SET_INTERFACE control request,
+	 * resetting the alternate setting of that interface to 0. It's OK for
+	 * this function to block as a result.
+	 *
+	 * You will only ever be asked to release an interface which was
+	 * successfully claimed earlier.
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
+	 *   was opened
+	 * - another LIBUSB_ERROR code on other failure
+	 */
+	int (*release_interface)(struct libusb_device_handle *handle, int iface);
+
+	/* Set the alternate setting for an interface.
+	 *
+	 * You will only ever be asked to set the alternate setting for an
+	 * interface which was successfully claimed earlier.
+	 *
+	 * It's OK for this function to block.
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NOT_FOUND if the alternate setting does not exist
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
+	 *   was opened
+	 * - another LIBUSB_ERROR code on other failure
+	 */
+	int (*set_interface_altsetting)(struct libusb_device_handle *handle,
+		int iface, int altsetting);
+
+	/* Clear a halt/stall condition on an endpoint.
+	 *
+	 * It's OK for this function to block.
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
+	 *   was opened
+	 * - another LIBUSB_ERROR code on other failure
+	 */
+	int (*clear_halt)(struct libusb_device_handle *handle,
+		unsigned char endpoint);
+
+	/* Perform a USB port reset to reinitialize a device.
+	 *
+	 * If possible, the handle should still be usable after the reset
+	 * completes, assuming that the device descriptors did not change during
+	 * reset and all previous interface state can be restored.
+	 *
+	 * If something changes, or you cannot easily locate/verify the resetted
+	 * device, return LIBUSB_ERROR_NOT_FOUND. This prompts the application
+	 * to close the old handle and re-enumerate the device.
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the device
+	 *   has been disconnected since it was opened
+	 * - another LIBUSB_ERROR code on other failure
+	 */
+	int (*reset_device)(struct libusb_device_handle *handle);
+
+	/* Determine if a kernel driver is active on an interface. Optional.
+	 *
+	 * The presence of a kernel driver on an interface indicates that any
+	 * calls to claim_interface would fail with the LIBUSB_ERROR_BUSY code.
+	 *
+	 * Return:
+	 * - 0 if no driver is active
+	 * - 1 if a driver is active
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
+	 *   was opened
+	 * - another LIBUSB_ERROR code on other failure
+	 */
+	int (*kernel_driver_active)(struct libusb_device_handle *handle,
+		int interface);
+	
+	/* Detach a kernel driver from an interface. Optional.
+	 *
+	 * After detaching a kernel driver, the interface should be available
+	 * for claim.
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NOT_FOUND if no kernel driver was active
+	 * - LIBUSB_ERROR_INVALID_PARAM if the interface does not exist
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
+	 *   was opened
+	 * - another LIBUSB_ERROR code on other failure
+	 */
+	int (*detach_kernel_driver)(struct libusb_device_handle *handle,
+		int interface);
+
+	/* Attach a kernel driver to an interface. Optional.
+	 *
+	 * Reattach a kernel driver to the device.
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NOT_FOUND if no kernel driver was active
+	 * - LIBUSB_ERROR_INVALID_PARAM if the interface does not exist
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it
+	 *   was opened
+	 * - LIBUSB_ERROR_BUSY if a program or driver has claimed the interface,
+	 *   preventing reattachment
+	 * - another LIBUSB_ERROR code on other failure
+	 */
+	int (*attach_kernel_driver)(struct libusb_device_handle *handle,
+		int interface);
+
+	/* Destroy a device. Optional.
+	 *
+	 * This function is called when the last reference to a device is
+	 * destroyed. It should free any resources allocated in the get_device_list
+	 * path.
+	 */
+	void (*destroy_device)(struct libusb_device *dev);
+
+	/* Submit a transfer. Your implementation should take the transfer,
+	 * morph it into whatever form your platform requires, and submit it
+	 * asynchronously.
+	 *
+	 * This function must not block.
+	 *
+	 * Return:
+	 * - 0 on success
+	 * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+	 * - another LIBUSB_ERROR code on other failure
+	 */
+	int (*submit_transfer)(struct usbi_transfer *itransfer);
+
+	/* Cancel a previously submitted transfer.
+	 *
+	 * This function must not block. The transfer cancellation must complete
+	 * later, resulting in a call to usbi_handle_transfer_cancellation()
+	 * from the context of handle_events.
+	 */
+	int (*cancel_transfer)(struct usbi_transfer *itransfer);
+
+	/* Clear a transfer as if it has completed or cancelled, but do not
+	 * report any completion/cancellation to the library. You should free
+	 * all private data from the transfer as if you were just about to report
+	 * completion or cancellation.
+	 *
+	 * This function might seem a bit out of place. It is used when libusb
+	 * detects a disconnected device - it calls this function for all pending
+	 * transfers before reporting completion (with the disconnect code) to
+	 * the user. Maybe we can improve upon this internal interface in future.
+	 */
+	void (*clear_transfer_priv)(struct usbi_transfer *itransfer);
+
+	/* Handle any pending events. This involves monitoring any active
+	 * transfers and processing their completion or cancellation.
+	 *
+	 * The function is passed an array of pollfd structures (size nfds)
+	 * as a result of the poll() system call. The num_ready parameter
+	 * indicates the number of file descriptors that have reported events
+	 * (i.e. the poll() return value). This should be enough information
+	 * for you to determine which actions need to be taken on the currently
+	 * active transfers.
+	 *
+	 * For any cancelled transfers, call usbi_handle_transfer_cancellation().
+	 * For completed transfers, call usbi_handle_transfer_completion().
+	 * For control/bulk/interrupt transfers, populate the "transferred"
+	 * element of the appropriate usbi_transfer structure before calling the
+	 * above functions. For isochronous transfers, populate the status and
+	 * transferred fields of the iso packet descriptors of the transfer.
+	 *
+	 * This function should also be able to detect disconnection of the
+	 * device, reporting that situation with usbi_handle_disconnect().
+	 *
+	 * When processing an event related to a transfer, you probably want to
+	 * take usbi_transfer.lock to prevent races. See the documentation for
+	 * the usbi_transfer structure.
+	 *
+	 * Return 0 on success, or a LIBUSB_ERROR code on failure.
+	 */
+	int (*handle_events)(struct libusb_context *ctx,
+		struct pollfd *fds, nfds_t nfds, int num_ready);
+
+	/* Get time from specified clock. At least two clocks must be implemented
+	   by the backend: USBI_CLOCK_REALTIME, and USBI_CLOCK_MONOTONIC.
+
+	   Description of clocks:
+	     USBI_CLOCK_REALTIME : clock returns time since system epoch.
+	     USBI_CLOCK_MONOTONIC: clock returns time since unspecified start
+	                             time (usually boot).
+	 */
+	int (*clock_gettime)(int clkid, struct timespec *tp);
+
+#ifdef USBI_TIMERFD_AVAILABLE
+	/* clock ID of the clock that should be used for timerfd */
+	clockid_t (*get_timerfd_clockid)(void);
+#endif
+
+	/* Number of bytes to reserve for per-device private backend data.
+	 * This private data area is accessible through the "os_priv" field of
+	 * struct libusb_device. */
+	size_t device_priv_size;
+
+	/* Number of bytes to reserve for per-handle private backend data.
+	 * This private data area is accessible through the "os_priv" field of
+	 * struct libusb_device. */
+	size_t device_handle_priv_size;
+
+	/* Number of bytes to reserve for per-transfer private backend data.
+	 * This private data area is accessible by calling
+	 * usbi_transfer_get_os_priv() on the appropriate usbi_transfer instance.
+	 */
+	size_t transfer_priv_size;
+
+	/* Mumber of additional bytes for os_priv for each iso packet.
+	 * Can your backend use this? */
+	/* FIXME: linux can't use this any more. if other OS's cannot either,
+	 * then remove this */
+	size_t add_iso_packet_size;
+};
+
+extern const struct usbi_os_backend * const usbi_backend;
+
+extern const struct usbi_os_backend linux_usbfs_backend;
+extern const struct usbi_os_backend darwin_backend;
+
+#endif
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/os/darwin_usb.c b/Platform/Android/jni/External/libusb-1.0.8/libusb/os/darwin_usb.c
new file mode 100644
index 0000000..a90fe80
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/os/darwin_usb.c
@@ -0,0 +1,1513 @@
+/*
+ * darwin backend for libusb 1.0
+ * Copyright (C) 2008-2010 Nathan Hjelm <hjelmn at users.sourceforge.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <mach/clock.h>
+#include <mach/clock_types.h>
+#include <mach/mach_host.h>
+
+#include <mach/mach_port.h>
+#include <IOKit/IOCFBundle.h>
+#include <IOKit/usb/IOUSBLib.h>
+#include <IOKit/IOCFPlugIn.h>
+
+#include "darwin_usb.h"
+
+static mach_port_t  libusb_darwin_mp = 0; /* master port */
+static CFRunLoopRef libusb_darwin_acfl = NULL; /* async cf loop */
+static int initCount = 0;
+
+/* async event thread */
+static pthread_t libusb_darwin_at;
+
+static int darwin_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian);
+static int darwin_claim_interface(struct libusb_device_handle *dev_handle, int iface);
+static int darwin_release_interface(struct libusb_device_handle *dev_handle, int iface);
+static int darwin_reset_device(struct libusb_device_handle *dev_handle);
+static void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0);
+
+static const char *darwin_error_str (int result) {
+  switch (result) {
+  case kIOReturnSuccess:
+    return "no error";
+  case kIOReturnNotOpen:
+    return "device not opened for exclusive access";
+  case kIOReturnNoDevice:
+    return "no connection to an IOService";
+  case kIOUSBNoAsyncPortErr:
+    return "no async port has been opened for interface";
+  case kIOReturnExclusiveAccess:
+    return "another process has device opened for exclusive access";
+  case kIOUSBPipeStalled:
+    return "pipe is stalled";
+  case kIOReturnError:
+    return "could not establish a connection to the Darwin kernel";
+  case kIOUSBTransactionTimeout:
+    return "transaction timed out";
+  case kIOReturnBadArgument:
+    return "invalid argument";
+  case kIOReturnAborted:
+    return "transaction aborted";
+  case kIOReturnNotResponding:
+    return "device not responding";
+  case kIOReturnOverrun:
+    return "data overrun";
+  case kIOReturnCannotWire:
+    return "physical memory can not be wired down";
+  default:
+    return "unknown error";
+  }
+}
+
+static int darwin_to_libusb (int result) {
+  switch (result) {
+  case kIOReturnSuccess:
+    return LIBUSB_SUCCESS;
+  case kIOReturnNotOpen:
+  case kIOReturnNoDevice:
+    return LIBUSB_ERROR_NO_DEVICE;
+  case kIOReturnExclusiveAccess:
+    return LIBUSB_ERROR_ACCESS;
+  case kIOUSBPipeStalled:
+    return LIBUSB_ERROR_PIPE;
+  case kIOReturnBadArgument:
+    return LIBUSB_ERROR_INVALID_PARAM;
+  case kIOUSBTransactionTimeout:
+    return LIBUSB_ERROR_TIMEOUT;
+  case kIOReturnNotResponding:
+  case kIOReturnAborted:
+  case kIOReturnError:
+  case kIOUSBNoAsyncPortErr:
+  default:
+    return LIBUSB_ERROR_OTHER;
+  }
+}
+
+
+static int ep_to_pipeRef(struct libusb_device_handle *dev_handle, uint8_t ep, uint8_t *pipep, uint8_t *ifcp) {
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
+
+  /* current interface */
+  struct __darwin_interface *cInterface;
+
+  int8_t i, iface;
+
+  usbi_info (HANDLE_CTX(dev_handle), "converting ep address 0x%02x to pipeRef and interface", ep);
+
+  for (iface = 0 ; iface < USB_MAXINTERFACES ; iface++) {
+    cInterface = &priv->interfaces[iface];
+
+    if (dev_handle->claimed_interfaces & (1 << iface)) {
+      for (i = 0 ; i < cInterface->num_endpoints ; i++) {
+	if (cInterface->endpoint_addrs[i] == ep) {
+	  *pipep = i + 1;
+	  *ifcp = iface;
+	  usbi_info (HANDLE_CTX(dev_handle), "pipe %d on interface %d matches", *pipep, *ifcp);
+	  return 0;
+	}
+      }
+    }
+  }
+
+  /* No pipe found with the correct endpoint address */
+  usbi_warn (HANDLE_CTX(dev_handle), "no pipeRef found with endpoint address 0x%02x.", ep);
+  
+  return -1;
+}
+
+static int usb_setup_device_iterator (io_iterator_t *deviceIterator) {
+  return IOServiceGetMatchingServices(libusb_darwin_mp, IOServiceMatching(kIOUSBDeviceClassName), deviceIterator);
+}
+
+static usb_device_t **usb_get_next_device (io_iterator_t deviceIterator, UInt32 *locationp) {
+  io_cf_plugin_ref_t *plugInInterface = NULL;
+  usb_device_t **device;
+  io_service_t usbDevice;
+  long result;
+  SInt32 score;
+
+  if (!IOIteratorIsValid (deviceIterator))
+    return NULL;
+
+
+  while ((usbDevice = IOIteratorNext(deviceIterator))) {
+    result = IOCreatePlugInInterfaceForService(usbDevice, kIOUSBDeviceUserClientTypeID,
+					       kIOCFPlugInInterfaceID, &plugInInterface,
+					       &score);
+    if (kIOReturnSuccess == result && plugInInterface)
+      break;
+
+    usbi_dbg ("libusb/darwin.c usb_get_next_device: could not set up plugin for service: %s\n", darwin_error_str (result));
+  }
+
+  if (!usbDevice)
+    return NULL;
+
+  (void)IOObjectRelease(usbDevice);
+  (void)(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(DeviceInterfaceID),
+					   (LPVOID)&device);
+
+  (*plugInInterface)->Stop(plugInInterface);
+  IODestroyPlugInInterface (plugInInterface);
+  
+  (*(device))->GetLocationID(device, locationp);
+
+  return device;
+}
+
+static kern_return_t darwin_get_device (uint32_t dev_location, usb_device_t ***darwin_device) {
+  kern_return_t kresult;
+  UInt32        location;
+  io_iterator_t deviceIterator;
+
+  kresult = usb_setup_device_iterator (&deviceIterator);
+  if (kresult)
+    return kresult;
+
+  /* This port of libusb uses locations to keep track of devices. */
+  while ((*darwin_device = usb_get_next_device (deviceIterator, &location)) != NULL) {
+    if (location == dev_location)
+      break;
+
+    (**darwin_device)->Release(*darwin_device);
+  }
+
+  IOObjectRelease (deviceIterator);
+
+  if (!(*darwin_device))
+    return kIOReturnNoDevice;
+
+  return kIOReturnSuccess;
+}
+
+
+
+static void darwin_devices_detached (void *ptr, io_iterator_t rem_devices) {  
+  struct libusb_context *ctx = (struct libusb_context *)ptr;
+  struct libusb_device_handle *handle;
+  struct darwin_device_priv *dpriv;
+  struct darwin_device_handle_priv *priv;
+
+  io_service_t device;
+  long location;
+  CFTypeRef locationCF;
+  UInt32 message;
+
+  usbi_info (ctx, "a device has been detached");
+
+  while ((device = IOIteratorNext (rem_devices)) != 0) {
+    /* get the location from the i/o registry */
+    locationCF = IORegistryEntryCreateCFProperty (device, CFSTR(kUSBDevicePropertyLocationID), kCFAllocatorDefault, 0);
+
+    CFNumberGetValue(locationCF, kCFNumberLongType, &location);
+    CFRelease (locationCF);
+    IOObjectRelease (device);
+
+    pthread_mutex_lock(&ctx->open_devs_lock);
+    list_for_each_entry(handle, &ctx->open_devs, list) {
+      dpriv = (struct darwin_device_priv *)handle->dev->os_priv;
+
+      /* the device may have been opened several times. write to each handle's event descriptor */
+      if (dpriv->location == location  && handle->os_priv) {
+	priv  = (struct darwin_device_handle_priv *)handle->os_priv;
+
+	message = MESSAGE_DEVICE_GONE;
+	write (priv->fds[1], &message, sizeof (message));
+      }
+    }
+
+    pthread_mutex_unlock(&ctx->open_devs_lock);
+  }
+}
+
+static void darwin_clear_iterator (io_iterator_t iter) {
+  io_service_t device;
+
+  while ((device = IOIteratorNext (iter)) != 0)
+    IOObjectRelease (device);
+}
+
+static void *event_thread_main (void *arg0) {
+  IOReturn kresult;
+  struct libusb_context *ctx = (struct libusb_context *)arg0;
+
+  /* hotplug (device removal) source */
+  CFRunLoopSourceRef     libusb_notification_cfsource;
+  io_notification_port_t libusb_notification_port;
+  io_iterator_t          libusb_rem_device_iterator;
+
+  usbi_info (ctx, "creating hotplug event source");
+
+  CFRetain (CFRunLoopGetCurrent ());
+
+  /* add the notification port to the run loop */
+  libusb_notification_port     = IONotificationPortCreate (libusb_darwin_mp);
+  libusb_notification_cfsource = IONotificationPortGetRunLoopSource (libusb_notification_port);
+  CFRunLoopAddSource(CFRunLoopGetCurrent (), libusb_notification_cfsource, kCFRunLoopDefaultMode);
+
+  /* create notifications for removed devices */
+  kresult = IOServiceAddMatchingNotification (libusb_notification_port, kIOTerminatedNotification,
+					      IOServiceMatching(kIOUSBDeviceClassName),
+					      (IOServiceMatchingCallback)darwin_devices_detached,
+					      (void *)ctx, &libusb_rem_device_iterator);
+ 
+  if (kresult != kIOReturnSuccess) {
+    usbi_err (ctx, "could not add hotplug event source: %s", darwin_error_str (kresult));
+
+    pthread_exit ((void *)kresult);
+  }
+
+  /* arm notifiers */
+  darwin_clear_iterator (libusb_rem_device_iterator);
+
+  /* let the main thread know about the async runloop */
+  libusb_darwin_acfl = CFRunLoopGetCurrent ();
+
+  usbi_info (ctx, "libopenusb/darwin.c event_thread_main: thread ready to receive events");
+
+  /* run the runloop */
+  CFRunLoopRun();
+
+  usbi_info (ctx, "libopenusb/darwin.c event_thread_main: thread exiting");
+
+  /* delete notification port */
+  CFRunLoopSourceInvalidate (libusb_notification_cfsource);
+  IONotificationPortDestroy (libusb_notification_port);
+
+  CFRelease (CFRunLoopGetCurrent ());
+
+  libusb_darwin_acfl = NULL;
+
+  pthread_exit (0);
+}
+
+static int darwin_init(struct libusb_context *ctx) {
+  IOReturn kresult;
+
+  if (!(initCount++)) {
+    /* Create the master port for talking to IOKit */
+    if (!libusb_darwin_mp) {
+      kresult = IOMasterPort (MACH_PORT_NULL, &libusb_darwin_mp);
+
+      if (kresult != kIOReturnSuccess || !libusb_darwin_mp)
+	return darwin_to_libusb (kresult);
+    }
+
+    pthread_create (&libusb_darwin_at, NULL, event_thread_main, (void *)ctx);
+
+    while (!libusb_darwin_acfl)
+      usleep (10);
+  }
+
+  return 0;
+}
+
+static void darwin_exit (void) {
+  if (!(--initCount)) {
+    void *ret;
+
+    /* stop the async runloop */
+    CFRunLoopStop (libusb_darwin_acfl);
+    pthread_join (libusb_darwin_at, &ret);
+
+    if (libusb_darwin_mp)
+      mach_port_deallocate(mach_task_self(), libusb_darwin_mp);
+
+    libusb_darwin_mp = 0;
+  }
+}
+
+static int darwin_get_device_descriptor(struct libusb_device *dev, unsigned char *buffer, int *host_endian) {
+  struct darwin_device_priv *priv = (struct darwin_device_priv *)dev->os_priv;
+
+  /* return cached copy */
+  memmove (buffer, &(priv->dev_descriptor), DEVICE_DESC_LENGTH);
+
+  *host_endian = 0;
+
+  return 0;
+}
+
+static int get_configuration_index (struct libusb_device *dev, int config_value) {
+  struct darwin_device_priv *priv = (struct darwin_device_priv *)dev->os_priv;
+  UInt8 i, numConfig;
+  IOUSBConfigurationDescriptorPtr desc;
+  IOReturn kresult;
+
+  /* is there a simpler way to determine the index? */
+  kresult = (*(priv->device))->GetNumberOfConfigurations (priv->device, &numConfig);
+  if (kresult != kIOReturnSuccess)
+    return darwin_to_libusb (kresult);
+
+  for (i = 0 ; i < numConfig ; i++) {
+    (*(priv->device))->GetConfigurationDescriptorPtr (priv->device, i, &desc);
+
+    if (libusb_le16_to_cpu (desc->bConfigurationValue) == config_value)
+      return i;
+  }
+
+  /* configuration not found */
+  return LIBUSB_ERROR_OTHER;
+}
+
+static int darwin_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian) {
+  struct darwin_device_priv *priv = (struct darwin_device_priv *)dev->os_priv;
+  UInt8 config_value;
+  int config_index;
+  IOReturn kresult;
+
+  kresult = (*(priv->device))->GetConfiguration (priv->device, &config_value);
+  if (kresult != kIOReturnSuccess)
+    return darwin_to_libusb (kresult);
+
+  config_index = get_configuration_index (dev, config_value);
+  if (config_index < 0)
+    return config_index;
+
+  return darwin_get_config_descriptor (dev, config_index, buffer, len, host_endian);
+}
+
+static int darwin_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian) {
+  struct darwin_device_priv *priv = (struct darwin_device_priv *)dev->os_priv;
+  IOUSBConfigurationDescriptorPtr desc;
+  IOReturn kresult;
+  usb_device_t **device = NULL;
+
+  if (!priv)
+    return LIBUSB_ERROR_OTHER;
+
+  if (!priv->device) {
+    kresult = darwin_get_device (priv->location, &device);
+    if (kresult || !device) {
+      usbi_err (DEVICE_CTX (dev), "could not find device: %s", darwin_error_str (kresult));
+
+      return darwin_to_libusb (kresult);
+    }
+
+    /* don't have to open the device to get a config descriptor */
+  } else
+    device = priv->device;
+
+  kresult = (*device)->GetConfigurationDescriptorPtr (device, config_index, &desc);
+  if (kresult == kIOReturnSuccess) {
+    /* copy descriptor */
+    if (libusb_le16_to_cpu(desc->wTotalLength) < len)
+      len = libusb_le16_to_cpu(desc->wTotalLength);
+
+    memmove (buffer, desc, len);
+
+    /* GetConfigurationDescriptorPtr returns the descriptor in USB bus order */
+    *host_endian = 0;
+  }
+
+  if (!priv->device)
+    (*device)->Release (device);
+
+  return darwin_to_libusb (kresult);
+}
+
+static int process_new_device (struct libusb_context *ctx, usb_device_t **device, UInt32 locationID, struct discovered_devs **_discdevs) {
+  struct darwin_device_priv *priv;
+  struct libusb_device *dev; 
+  struct discovered_devs *discdevs;
+  UInt16                address, idVendor, idProduct;
+  UInt8                 bDeviceClass, bDeviceSubClass;
+  IOUSBDevRequest      req;
+  int ret = 0, need_unref = 0;
+
+  do {
+    dev = usbi_get_device_by_session_id(ctx, locationID);
+    if (!dev) {
+      usbi_info (ctx, "allocating new device for location 0x%08x", locationID);
+      dev = usbi_alloc_device(ctx, locationID);
+      need_unref = 1;
+    } else
+      usbi_info (ctx, "using existing device for location 0x%08x", locationID);
+
+    if (!dev) {
+      ret = LIBUSB_ERROR_NO_MEM;
+      break;
+    }
+
+    priv = (struct darwin_device_priv *)dev->os_priv;
+
+    /* Set up request for device descriptor */
+    req.bmRequestType = USBmakebmRequestType(kUSBIn, kUSBStandard, kUSBDevice);
+    req.bRequest      = kUSBRqGetDescriptor;
+    req.wValue        = kUSBDeviceDesc << 8;
+    req.wIndex        = 0;
+    req.wLength       = sizeof(IOUSBDeviceDescriptor);
+    req.pData         = &(priv->dev_descriptor);
+    
+    (*(device))->GetDeviceAddress (device, (USBDeviceAddress *)&address);
+    (*(device))->GetDeviceProduct (device, &idProduct);
+    (*(device))->GetDeviceVendor (device, &idVendor);
+    (*(device))->GetDeviceClass (device, &bDeviceClass);
+    (*(device))->GetDeviceSubClass (device, &bDeviceSubClass);
+
+    /**** retrieve device descriptors ****/
+    /* device must be open for DeviceRequest */
+    (*device)->USBDeviceOpen(device);
+
+    ret = (*(device))->DeviceRequest (device, &req);
+    if (ret != kIOReturnSuccess) {
+      int try_unsuspend = 1;
+#if DeviceVersion >= 320
+      UInt32 info;
+
+      /* device may be suspended. unsuspend it and try again */
+      /* IOUSBFamily 320+ provides a way to detect device suspension but earlier versions do not */
+      (void)(*device)->GetUSBDeviceInformation (device, &info);
+
+      try_unsuspend = info & (1 << kUSBInformationDeviceIsSuspendedBit);
+#endif
+
+      if (try_unsuspend) {
+	/* resume the device */
+	(void)(*device)->USBDeviceSuspend (device, 0);
+
+	ret = (*(device))->DeviceRequest (device, &req);
+
+	/* resuspend the device */
+	(void)(*device)->USBDeviceSuspend (device, 1);
+      }
+    }
+
+    (*device)->USBDeviceClose (device);
+
+    if (ret != kIOReturnSuccess) {
+      usbi_warn (ctx, "could not retrieve device descriptor: %s. skipping device", darwin_error_str (ret));
+      ret = -1;
+      break;
+    }
+
+    /**** end: retrieve device descriptors ****/
+    
+    /* catch buggy hubs (which appear to be virtual). Apple's own USB prober has problems with these devices. */
+    if (libusb_le16_to_cpu (priv->dev_descriptor.idProduct) != idProduct) {
+      /* not a valid device */
+      usbi_warn (ctx, "idProduct from iokit (%04x) does not match idProduct in descriptor (%04x). skipping device",
+		 idProduct, libusb_le16_to_cpu (priv->dev_descriptor.idProduct));
+      ret = -1;
+      break;
+    }
+
+    dev->bus_number     = locationID >> 24;
+    dev->device_address = address;
+
+    /* save our location, we'll need this later */
+    priv->location = locationID;
+    snprintf(priv->sys_path, 20, "%03i-%04x-%04x-%02x-%02x", address, idVendor, idProduct, bDeviceClass, bDeviceSubClass);
+
+    ret = usbi_sanitize_device (dev);
+    if (ret < 0)
+      break;
+
+    /* append the device to the list of discovered devices */
+    discdevs = discovered_devs_append(*_discdevs, dev);
+    if (!discdevs) {
+      ret = LIBUSB_ERROR_NO_MEM;
+      break;
+    }
+    
+    *_discdevs = discdevs;
+  
+    usbi_info (ctx, "found device with address %d at %s", dev->device_address, priv->sys_path);
+  } while (0);
+
+  if (need_unref)
+    libusb_unref_device(dev);
+
+  return ret;
+}
+
+static int darwin_get_device_list(struct libusb_context *ctx, struct discovered_devs **_discdevs) {
+  io_iterator_t        deviceIterator;
+  usb_device_t         **device;
+  kern_return_t        kresult;
+  UInt32               location;
+
+  if (!libusb_darwin_mp)
+    return LIBUSB_ERROR_INVALID_PARAM;
+  
+  kresult = usb_setup_device_iterator (&deviceIterator);
+  if (kresult != kIOReturnSuccess)
+    return darwin_to_libusb (kresult);
+
+  while ((device = usb_get_next_device (deviceIterator, &location)) != NULL) {
+    (void) process_new_device (ctx, device, location, _discdevs);
+
+    (*(device))->Release(device);
+  }
+
+  IOObjectRelease(deviceIterator);
+
+  return 0;
+}
+
+static int darwin_open (struct libusb_device_handle *dev_handle) {
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
+  struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;
+  usb_device_t  **darwin_device;
+  IOReturn kresult;
+
+  if (0 == dpriv->open_count) {
+    kresult = darwin_get_device (dpriv->location, &darwin_device);
+    if (kresult) {
+      usbi_err (HANDLE_CTX (dev_handle), "could not find device: %s", darwin_error_str (kresult));
+      return darwin_to_libusb (kresult);
+    }
+
+    dpriv->device = darwin_device;
+
+    /* try to open the device */
+    kresult = (*(dpriv->device))->USBDeviceOpenSeize (dpriv->device);
+
+    if (kresult != kIOReturnSuccess) {
+      usbi_err (HANDLE_CTX (dev_handle), "USBDeviceOpen: %s", darwin_error_str(kresult));
+
+      switch (kresult) {
+      case kIOReturnExclusiveAccess:
+	/* it is possible to perform some actions on a device that is not open so do not return an error */
+	priv->is_open = 0;
+
+	break;
+      default:
+	(*(dpriv->device))->Release (dpriv->device);
+	dpriv->device = NULL;
+	return darwin_to_libusb (kresult);
+      }
+    } else {
+      priv->is_open = 1;
+
+      /* create async event source */
+      kresult = (*(dpriv->device))->CreateDeviceAsyncEventSource (dpriv->device, &priv->cfSource);
+
+      CFRetain (libusb_darwin_acfl);
+
+      /* add the cfSource to the aync run loop */
+      CFRunLoopAddSource(libusb_darwin_acfl, priv->cfSource, kCFRunLoopCommonModes);
+    }
+  }
+
+  /* device opened successfully */
+  dpriv->open_count++;
+
+  /* create a file descriptor for notifications */
+  pipe (priv->fds);
+
+  /* set the pipe to be non-blocking */
+  fcntl (priv->fds[1], F_SETFD, O_NONBLOCK);
+
+  usbi_add_pollfd(HANDLE_CTX(dev_handle), priv->fds[0], POLLIN);
+
+  usbi_info (HANDLE_CTX (dev_handle), "device open for access");
+
+  return 0;
+}
+
+static void darwin_close (struct libusb_device_handle *dev_handle) {
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
+  struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;
+  IOReturn kresult;
+  int i;
+
+  if (dpriv->open_count == 0) {
+    /* something is probably very wrong if this is the case */
+    usbi_err (HANDLE_CTX (dev_handle), "Close called on a device that was not open!\n");
+    return;
+  }
+
+  dpriv->open_count--;
+
+  /* make sure all interfaces are released */
+  for (i = 0 ; i < USB_MAXINTERFACES ; i++)
+    if (dev_handle->claimed_interfaces & (1 << i))
+      libusb_release_interface (dev_handle, i);
+
+  if (0 == dpriv->open_count) {
+    if (priv->is_open) {
+      /* delete the device's async event source */
+      if (priv->cfSource) {
+	CFRunLoopRemoveSource (libusb_darwin_acfl, priv->cfSource, kCFRunLoopDefaultMode);
+	CFRelease (priv->cfSource);
+      }
+
+      /* close the device */
+      kresult = (*(dpriv->device))->USBDeviceClose(dpriv->device);
+      if (kresult) {
+	/* Log the fact that we had a problem closing the file, however failing a
+	 * close isn't really an error, so return success anyway */
+	usbi_err (HANDLE_CTX (dev_handle), "USBDeviceClose: %s", darwin_error_str(kresult));
+      }
+    }
+  
+    kresult = (*(dpriv->device))->Release(dpriv->device);
+    if (kresult) {
+      /* Log the fact that we had a problem closing the file, however failing a
+       * close isn't really an error, so return success anyway */
+      usbi_err (HANDLE_CTX (dev_handle), "Release: %s", darwin_error_str(kresult));
+    }
+
+    dpriv->device = NULL;
+  }
+
+  /* file descriptors are maintained per-instance */
+  usbi_remove_pollfd (HANDLE_CTX (dev_handle), priv->fds[0]);
+  close (priv->fds[1]);
+  close (priv->fds[0]);
+
+  priv->fds[0] = priv->fds[1] = -1;
+}
+
+static int darwin_get_configuration(struct libusb_device_handle *dev_handle, int *config) {
+  struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;
+  UInt8 configNum;
+  IOReturn kresult;
+
+  kresult = (*(dpriv->device))->GetConfiguration (dpriv->device, &configNum);
+  if (kresult != kIOReturnSuccess)
+    return darwin_to_libusb (kresult);
+
+  *config = (int) configNum;
+
+  return 0;
+}
+
+static int darwin_set_configuration(struct libusb_device_handle *dev_handle, int config) {
+  struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;
+  IOReturn kresult;
+  int i;
+
+  /* Setting configuration will invalidate the interface, so we need
+     to reclaim it. First, dispose of existing interfaces, if any. */
+  for (i = 0 ; i < USB_MAXINTERFACES ; i++)
+    if (dev_handle->claimed_interfaces & (1 << i))
+      darwin_release_interface (dev_handle, i);
+
+  kresult = (*(dpriv->device))->SetConfiguration (dpriv->device, config);
+  if (kresult != kIOReturnSuccess)
+    return darwin_to_libusb (kresult);
+
+  /* Reclaim any interfaces. */
+  for (i = 0 ; i < USB_MAXINTERFACES ; i++)
+    if (dev_handle->claimed_interfaces & (1 << i))
+      darwin_claim_interface (dev_handle, i);
+
+  return 0;
+}
+
+static int darwin_get_interface (usb_device_t **darwin_device, uint8_t ifc, io_service_t *usbInterfacep) {
+  IOUSBFindInterfaceRequest request;
+  uint8_t                   current_interface;
+  kern_return_t             kresult;
+  io_iterator_t             interface_iterator;
+
+  *usbInterfacep = IO_OBJECT_NULL;
+  
+  /* Setup the Interface Request */
+  request.bInterfaceClass    = kIOUSBFindInterfaceDontCare;
+  request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
+  request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
+  request.bAlternateSetting  = kIOUSBFindInterfaceDontCare;
+
+  kresult = (*(darwin_device))->CreateInterfaceIterator(darwin_device, &request, &interface_iterator);
+  if (kresult)
+    return kresult;
+
+  for ( current_interface = 0 ; current_interface <= ifc ; current_interface++ )
+    *usbInterfacep = IOIteratorNext(interface_iterator);
+  
+  /* done with the interface iterator */
+  IOObjectRelease(interface_iterator);
+  
+  return 0;
+}
+
+static int get_endpoints (struct libusb_device_handle *dev_handle, int iface) {
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
+
+  /* current interface */
+  struct __darwin_interface *cInterface = &priv->interfaces[iface];
+
+  kern_return_t kresult;
+
+  u_int8_t numep, direction, number;
+  u_int8_t dont_care1, dont_care3;
+  u_int16_t dont_care2;
+  int i;
+
+  usbi_info (HANDLE_CTX (dev_handle), "building table of endpoints.");
+  
+  /* retrieve the total number of endpoints on this interface */
+  kresult = (*(cInterface->interface))->GetNumEndpoints(cInterface->interface, &numep);
+  if (kresult) {
+    usbi_err (HANDLE_CTX (dev_handle), "can't get number of endpoints for interface: %s", darwin_error_str(kresult));
+    return darwin_to_libusb (kresult);
+  }
+
+  /* iterate through pipe references */
+  for (i = 1 ; i <= numep ; i++) {
+    kresult = (*(cInterface->interface))->GetPipeProperties(cInterface->interface, i, &direction, &number, &dont_care1,
+							    &dont_care2, &dont_care3);
+
+    if (kresult != kIOReturnSuccess) {
+      usbi_err (HANDLE_CTX (dev_handle), "error getting pipe information for pipe %d: %s", i, darwin_error_str(kresult));
+
+      return darwin_to_libusb (kresult);
+    }
+
+    usbi_info (HANDLE_CTX (dev_handle), "interface: %i pipe %i: dir: %i number: %i", iface, i, direction, number);
+
+    cInterface->endpoint_addrs[i - 1] = ((direction << 7 & LIBUSB_ENDPOINT_DIR_MASK) | (number & LIBUSB_ENDPOINT_ADDRESS_MASK));
+  }
+
+  cInterface->num_endpoints = numep;
+  
+  return 0;
+}
+
+static int darwin_claim_interface(struct libusb_device_handle *dev_handle, int iface) {
+  struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
+  io_service_t          usbInterface = IO_OBJECT_NULL;
+  IOReturn kresult;
+  IOCFPlugInInterface **plugInInterface = NULL;
+  SInt32                score;
+  uint8_t               new_config;
+
+  /* current interface */
+  struct __darwin_interface *cInterface = &priv->interfaces[iface];
+
+  kresult = darwin_get_interface (dpriv->device, iface, &usbInterface);
+  if (kresult != kIOReturnSuccess)
+    return darwin_to_libusb (kresult);
+
+  /* make sure we have an interface */
+  if (!usbInterface) {
+    u_int8_t nConfig;     /* Index of configuration to use */
+    IOUSBConfigurationDescriptorPtr configDesc; /* to describe which configuration to select */
+    /* Only a composite class device with no vendor-specific driver will
+       be configured. Otherwise, we need to do it ourselves, or there
+       will be no interfaces for the device. */
+
+    usbi_info (HANDLE_CTX (dev_handle), "no interface found; selecting configuration" );
+
+    kresult = (*(dpriv->device))->GetNumberOfConfigurations (dpriv->device, &nConfig);
+    if (kresult != kIOReturnSuccess) {
+      usbi_err (HANDLE_CTX (dev_handle), "GetNumberOfConfigurations: %s", darwin_error_str(kresult));
+      return darwin_to_libusb(kresult);
+    }
+    
+    if (nConfig < 1) {
+      usbi_err (HANDLE_CTX (dev_handle), "GetNumberOfConfigurations: no configurations");
+      return LIBUSB_ERROR_OTHER;
+    }
+
+    usbi_info (HANDLE_CTX (dev_handle), "device has %d configuration%s. using the first",
+	      (int)nConfig, (nConfig > 1 ? "s" : "") );
+
+    /* Always use the first configuration */
+    kresult = (*(dpriv->device))->GetConfigurationDescriptorPtr (dpriv->device, 0, &configDesc);
+    if (kresult != kIOReturnSuccess) {
+      usbi_err (HANDLE_CTX (dev_handle), "GetConfigurationDescriptorPtr: %s",
+		darwin_error_str(kresult));
+
+      new_config = 1;
+    } else
+      new_config = configDesc->bConfigurationValue;
+
+    usbi_info (HANDLE_CTX (dev_handle), "new configuration value is %d", new_config);
+
+    /* set the configuration */
+    kresult = darwin_set_configuration (dev_handle, new_config);
+    if (kresult != LIBUSB_SUCCESS) {
+      usbi_err (HANDLE_CTX (dev_handle), "could not set configuration");
+      return kresult;
+    }
+
+    kresult = darwin_get_interface (dpriv->device, iface, &usbInterface);
+    if (kresult) {
+      usbi_err (HANDLE_CTX (dev_handle), "darwin_get_interface: %s", darwin_error_str(kresult));
+      return darwin_to_libusb (kresult);
+    }
+  }
+
+  if (!usbInterface) {
+    usbi_err (HANDLE_CTX (dev_handle), "interface not found");
+    return LIBUSB_ERROR_NOT_FOUND;
+  }
+  
+  /* get an interface to the device's interface */
+  kresult = IOCreatePlugInInterfaceForService (usbInterface, kIOUSBInterfaceUserClientTypeID,
+					       kIOCFPlugInInterfaceID, &plugInInterface, &score);
+  if (kresult) {
+    usbi_err (HANDLE_CTX (dev_handle), "IOCreatePlugInInterfaceForService: %s", darwin_error_str(kresult));
+    return darwin_to_libusb (kresult);
+  }
+
+  if (!plugInInterface) {
+    usbi_err (HANDLE_CTX (dev_handle), "plugin interface not found");
+    return LIBUSB_ERROR_NOT_FOUND;
+  }
+
+  /* ignore release error */
+  (void)IOObjectRelease (usbInterface);
+  
+  /* Do the actual claim */
+  kresult = (*plugInInterface)->QueryInterface(plugInInterface,
+					       CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID),
+					       (LPVOID)&cInterface->interface);
+  if (kresult || !cInterface->interface) {
+    usbi_err (HANDLE_CTX (dev_handle), "QueryInterface: %s", darwin_error_str(kresult));
+    return darwin_to_libusb (kresult);
+  }
+  
+  /* We no longer need the intermediate plug-in */
+  (*plugInInterface)->Release(plugInInterface);
+
+  /* claim the interface */
+  kresult = (*(cInterface->interface))->USBInterfaceOpen(cInterface->interface);
+  if (kresult) {
+    usbi_err (HANDLE_CTX (dev_handle), "USBInterfaceOpen: %s", darwin_error_str(kresult));
+    return darwin_to_libusb (kresult);
+  }
+
+  /* update list of endpoints */
+  kresult = get_endpoints (dev_handle, iface);
+  if (kresult) {
+    /* this should not happen */
+    darwin_release_interface (dev_handle, iface);
+    usbi_err (HANDLE_CTX (dev_handle), "could not build endpoint table");
+    return kresult;
+  }
+
+  cInterface->cfSource = NULL;
+
+  /* create async event source */
+  kresult = (*(cInterface->interface))->CreateInterfaceAsyncEventSource (cInterface->interface, &cInterface->cfSource);
+  if (kresult != kIOReturnSuccess) {
+    usbi_err (HANDLE_CTX (dev_handle), "could not create async event source");
+
+    /* can't continue without an async event source */
+    (void)darwin_release_interface (dev_handle, iface);
+
+    return darwin_to_libusb (kresult);
+  }
+
+  /* add the cfSource to the async thread's run loop */
+  CFRunLoopAddSource(libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode);
+
+  usbi_info (HANDLE_CTX (dev_handle), "interface opened");
+
+  return 0;
+}
+
+static int darwin_release_interface(struct libusb_device_handle *dev_handle, int iface) {
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
+  IOReturn kresult;
+
+  /* current interface */
+  struct __darwin_interface *cInterface = &priv->interfaces[iface];
+
+  /* Check to see if an interface is open */
+  if (!cInterface->interface)
+    return LIBUSB_SUCCESS;
+
+  /* clean up endpoint data */
+  cInterface->num_endpoints = 0;
+  
+  /* delete the interface's async event source */
+  if (cInterface->cfSource) {
+    CFRunLoopRemoveSource (libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode);
+    CFRelease (cInterface->cfSource);
+  }
+
+  kresult = (*(cInterface->interface))->USBInterfaceClose(cInterface->interface);
+  if (kresult)
+    usbi_err (HANDLE_CTX (dev_handle), "USBInterfaceClose: %s", darwin_error_str(kresult));
+
+  kresult = (*(cInterface->interface))->Release(cInterface->interface);
+  if (kresult != kIOReturnSuccess)
+    usbi_err (HANDLE_CTX (dev_handle), "Release: %s", darwin_error_str(kresult));
+
+  cInterface->interface = IO_OBJECT_NULL;
+
+  return darwin_to_libusb (kresult);
+}
+
+static int darwin_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting) {
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
+  IOReturn kresult;
+
+  /* current interface */
+  struct __darwin_interface *cInterface = &priv->interfaces[iface];
+
+  if (!cInterface->interface)
+    return LIBUSB_ERROR_NO_DEVICE;
+
+  kresult = (*(cInterface->interface))->SetAlternateInterface (cInterface->interface, altsetting);
+  if (kresult != kIOReturnSuccess)
+    darwin_reset_device (dev_handle);
+
+  /* update list of endpoints */
+  kresult = get_endpoints (dev_handle, iface);
+  if (kresult) {
+    /* this should not happen */
+    darwin_release_interface (dev_handle, iface);
+    usbi_err (HANDLE_CTX (dev_handle), "could not build endpoint table");
+    return kresult;
+  }
+
+  return darwin_to_libusb (kresult);
+}
+
+static int darwin_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint) {
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;
+
+  /* current interface */
+  struct __darwin_interface *cInterface;
+  uint8_t pipeRef, iface;
+  IOReturn kresult;
+
+  /* determine the interface/endpoint to use */
+  if (ep_to_pipeRef (dev_handle, endpoint, &pipeRef, &iface) != 0) {
+    usbi_err (HANDLE_CTX (dev_handle), "endpoint not found on any open interface");
+
+    return LIBUSB_ERROR_NOT_FOUND;
+  }
+
+  cInterface = &priv->interfaces[iface];
+
+#if (InterfaceVersion < 190)
+  kresult = (*(cInterface->interface))->ClearPipeStall(cInterface->interface, pipeRef);
+#else
+  /* newer versions of darwin support clearing additional bits on the device's endpoint */
+  kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef);
+#endif
+  if (kresult)
+    usbi_err (HANDLE_CTX (dev_handle), "ClearPipeStall: %s", darwin_error_str (kresult));
+
+  return darwin_to_libusb (kresult);
+}
+
+static int darwin_reset_device(struct libusb_device_handle *dev_handle) {
+  struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;
+  IOReturn kresult;
+
+  kresult = (*(dpriv->device))->ResetDevice (dpriv->device);
+  if (kresult)
+    usbi_err (HANDLE_CTX (dev_handle), "ResetDevice: %s", darwin_error_str (kresult));
+
+  return darwin_to_libusb (kresult);
+}
+
+static int darwin_kernel_driver_active(struct libusb_device_handle *dev_handle, int interface) {
+  struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv;
+  io_service_t usbInterface;
+  CFTypeRef driver;
+  IOReturn kresult;
+
+  kresult = darwin_get_interface (dpriv->device, interface, &usbInterface);
+  if (kresult) {
+    usbi_err (HANDLE_CTX (dev_handle), "darwin_get_interface: %s", darwin_error_str(kresult));
+
+    return darwin_to_libusb (kresult);
+  }
+  
+  driver = IORegistryEntryCreateCFProperty (usbInterface, kIOBundleIdentifierKey, kCFAllocatorDefault, 0);
+  IOObjectRelease (usbInterface);
+
+  if (driver) {
+    CFRelease (driver);
+
+    return 1;
+  }
+
+  /* no driver */
+  return 0;
+}
+
+/* attaching/detaching kernel drivers is not currently supported (maybe in the future?) */
+static int darwin_attach_kernel_driver (struct libusb_device_handle *dev_handle, int interface) {
+  return LIBUSB_ERROR_NOT_SUPPORTED;
+}
+
+static int darwin_detach_kernel_driver (struct libusb_device_handle *dev_handle, int interface) {
+  return LIBUSB_ERROR_NOT_SUPPORTED;
+}
+
+static void darwin_destroy_device(struct libusb_device *dev) {
+}
+
+static int submit_bulk_transfer(struct usbi_transfer *itransfer) {
+  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;
+
+  IOReturn               ret;
+  uint8_t                is_read; /* 0 = we're reading, 1 = we're writing */
+  uint8_t                transferType;
+  /* None of the values below are used in libusb for bulk transfers */
+  uint8_t                direction, number, interval, pipeRef, iface;
+  uint16_t               maxPacketSize;
+
+  struct __darwin_interface *cInterface;
+
+  /* are we reading or writing? */
+  is_read = transfer->endpoint & LIBUSB_ENDPOINT_IN;
+  
+  if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {
+    usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface");
+
+    return LIBUSB_ERROR_NOT_FOUND;
+  }
+
+  cInterface = &priv->interfaces[iface];
+
+  (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number,
+						 &transferType, &maxPacketSize, &interval);
+  
+  /* submit the request */
+  /* timeouts are unavailable on interrupt endpoints */
+  if (transferType == kUSBInterrupt) {
+    if (is_read)
+      ret = (*(cInterface->interface))->ReadPipeAsync(cInterface->interface, pipeRef, transfer->buffer,
+						      transfer->length, darwin_async_io_callback, itransfer);
+    else
+      ret = (*(cInterface->interface))->WritePipeAsync(cInterface->interface, pipeRef, transfer->buffer,
+						       transfer->length, darwin_async_io_callback, itransfer);
+  } else {
+    if (is_read)
+      ret = (*(cInterface->interface))->ReadPipeAsyncTO(cInterface->interface, pipeRef, transfer->buffer,
+							transfer->length, transfer->timeout, transfer->timeout,
+							darwin_async_io_callback, (void *)itransfer);
+    else
+      ret = (*(cInterface->interface))->WritePipeAsyncTO(cInterface->interface, pipeRef, transfer->buffer,
+							 transfer->length, transfer->timeout, transfer->timeout,
+							 darwin_async_io_callback, (void *)itransfer);
+  }
+
+  if (ret)
+    usbi_err (TRANSFER_CTX (transfer), "bulk transfer failed (dir = %s): %s (code = 0x%08x)", is_read ? "In" : "Out",
+	       darwin_error_str(ret), ret);
+
+  return darwin_to_libusb (ret);
+}
+
+static int submit_iso_transfer(struct usbi_transfer *itransfer) {
+  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+  struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;
+
+  IOReturn                kresult;
+  uint8_t                 is_read; /* 0 = we're writing, 1 = we're reading */
+  uint8_t                 pipeRef, iface;
+  UInt64                  frame;
+  AbsoluteTime            atTime;
+  int                     i;
+
+  struct __darwin_interface *cInterface;
+
+  /* are we reading or writing? */
+  is_read = transfer->endpoint & LIBUSB_ENDPOINT_IN;
+  
+  /* construct an array of IOUSBIsocFrames */
+  tpriv->isoc_framelist = (IOUSBIsocFrame*) calloc (transfer->num_iso_packets, sizeof(IOUSBIsocFrame));
+  if (!tpriv->isoc_framelist)
+    return LIBUSB_ERROR_NO_MEM;
+
+  /* copy the frame list from the libusb descriptor (the structures differ only is member order) */
+  for (i = 0 ; i < transfer->num_iso_packets ; i++)
+    tpriv->isoc_framelist[i].frReqCount = transfer->iso_packet_desc[i].length;
+
+  /* determine the interface/endpoint to use */
+  if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {
+    usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface");
+
+    return LIBUSB_ERROR_NOT_FOUND;
+  }
+
+  cInterface = &priv->interfaces[iface];
+
+  /* Last but not least we need the bus frame number */
+  kresult = (*(cInterface->interface))->GetBusFrameNumber(cInterface->interface, &frame, &atTime);
+  if (kresult) {
+    usbi_err (TRANSFER_CTX (transfer), "failed to get bus frame number: %d", kresult);
+    free(tpriv->isoc_framelist);
+    tpriv->isoc_framelist = NULL;
+
+    return darwin_to_libusb (kresult);
+  }
+
+  /* schedule for a frame a little in the future */
+  frame += 2;
+	
+  /* submit the request */
+  if (is_read)
+    kresult = (*(cInterface->interface))->ReadIsochPipeAsync(cInterface->interface, pipeRef, transfer->buffer, frame,
+							     transfer->num_iso_packets, tpriv->isoc_framelist, darwin_async_io_callback,
+							     itransfer);
+  else
+    kresult = (*(cInterface->interface))->WriteIsochPipeAsync(cInterface->interface, pipeRef, transfer->buffer, frame,
+							      transfer->num_iso_packets, tpriv->isoc_framelist, darwin_async_io_callback,
+							      itransfer);
+
+  if (kresult != kIOReturnSuccess) {
+    usbi_err (TRANSFER_CTX (transfer), "isochronous transfer failed (dir: %s): %s", is_read ? "In" : "Out",
+	       darwin_error_str(kresult));
+    free (tpriv->isoc_framelist);
+    tpriv->isoc_framelist = NULL;
+  }
+
+  return darwin_to_libusb (kresult);
+}
+
+static int submit_control_transfer(struct usbi_transfer *itransfer) {  
+  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+  struct libusb_control_setup *setup = (struct libusb_control_setup *) transfer->buffer;
+  struct darwin_device_priv *dpriv = (struct darwin_device_priv *)transfer->dev_handle->dev->os_priv;
+  struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+
+  IOReturn               kresult;
+
+  bzero(&tpriv->req, sizeof(tpriv->req));
+
+  /* IOUSBDeviceInterface expects the request in cpu endianess */
+  tpriv->req.bmRequestType     = setup->bmRequestType;
+  tpriv->req.bRequest          = setup->bRequest;
+  /* these values should be in bus order from libusb_fill_control_setup */
+  tpriv->req.wValue            = OSSwapLittleToHostInt16 (setup->wValue);
+  tpriv->req.wIndex            = OSSwapLittleToHostInt16 (setup->wIndex);
+  tpriv->req.wLength           = OSSwapLittleToHostInt16 (setup->wLength);
+  /* data is stored after the libusb control block */
+  tpriv->req.pData             = transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;
+  tpriv->req.completionTimeout = transfer->timeout;
+  tpriv->req.noDataTimeout     = transfer->timeout;
+
+  /* all transfers in libusb-1.0 are async */
+  kresult = (*(dpriv->device))->DeviceRequestAsyncTO(dpriv->device, &(tpriv->req), darwin_async_io_callback, itransfer);
+
+  if (kresult != kIOReturnSuccess)
+    usbi_err (TRANSFER_CTX (transfer), "control request failed: %s", darwin_error_str(kresult));
+  
+  return darwin_to_libusb (kresult);
+}
+
+static int darwin_submit_transfer(struct usbi_transfer *itransfer) {
+  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+
+  switch (transfer->type) {
+  case LIBUSB_TRANSFER_TYPE_CONTROL:
+    return submit_control_transfer(itransfer);
+  case LIBUSB_TRANSFER_TYPE_BULK:
+  case LIBUSB_TRANSFER_TYPE_INTERRUPT:
+    return submit_bulk_transfer(itransfer);
+  case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
+    return submit_iso_transfer(itransfer);
+  default:
+    usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type);
+    return LIBUSB_ERROR_INVALID_PARAM;
+  }
+}
+
+static int cancel_control_transfer(struct usbi_transfer *itransfer) {
+  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+  struct darwin_device_priv *dpriv = (struct darwin_device_priv *)transfer->dev_handle->dev->os_priv;
+  IOReturn kresult;
+
+  usbi_info (ITRANSFER_CTX (itransfer), "WARNING: aborting all transactions control pipe");
+
+  kresult = (*(dpriv->device))->USBDeviceAbortPipeZero (dpriv->device);
+
+  return darwin_to_libusb (kresult);
+}
+
+static int darwin_abort_transfers (struct usbi_transfer *itransfer) {
+  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;
+  struct __darwin_interface *cInterface;
+  uint8_t pipeRef, iface;
+  IOReturn kresult;
+
+  if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {
+    usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface");
+
+    return LIBUSB_ERROR_NOT_FOUND;
+  }
+
+  cInterface = &priv->interfaces[iface];
+
+  usbi_info (ITRANSFER_CTX (itransfer), "WARNING: aborting all transactions on interface %d pipe %d", iface, pipeRef);
+
+  /* abort transactions */
+  (*(cInterface->interface))->AbortPipe (cInterface->interface, pipeRef);
+  
+  usbi_info (ITRANSFER_CTX (itransfer), "calling clear pipe stall to clear the data toggle bit");
+
+  /* clear the data toggle bit */
+#if (InterfaceVersion < 190)
+  kresult = (*(cInterface->interface))->ClearPipeStall(cInterface->interface, pipeRef);
+#else
+  /* newer versions of darwin support clearing additional bits on the device's endpoint */
+  kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef);
+#endif
+
+  return darwin_to_libusb (kresult);
+}
+
+static int darwin_cancel_transfer(struct usbi_transfer *itransfer) {
+  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+
+  switch (transfer->type) {
+  case LIBUSB_TRANSFER_TYPE_CONTROL:
+    return cancel_control_transfer(itransfer);
+  case LIBUSB_TRANSFER_TYPE_BULK:
+  case LIBUSB_TRANSFER_TYPE_INTERRUPT:
+  case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
+    return darwin_abort_transfers (itransfer);
+  default:
+    usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type);
+    return LIBUSB_ERROR_INVALID_PARAM;
+  }
+}
+
+static void darwin_clear_transfer_priv (struct usbi_transfer *itransfer) {
+  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+  struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+
+  if (transfer->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS && tpriv->isoc_framelist) {
+    free (tpriv->isoc_framelist);
+    tpriv->isoc_framelist = NULL;
+  }
+}
+
+static void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0) {
+  struct usbi_transfer *itransfer = (struct usbi_transfer *)refcon;
+  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;
+  UInt32 message;
+
+  usbi_info (ITRANSFER_CTX (itransfer), "an async io operation has completed");
+
+  /* send a completion message to the device's file descriptor */
+  message = MESSAGE_ASYNC_IO_COMPLETE;
+  write (priv->fds[1], &message, sizeof (message));
+  write (priv->fds[1], &itransfer, sizeof (itransfer));
+  write (priv->fds[1], &result, sizeof (IOReturn));
+  write (priv->fds[1], &arg0, sizeof (UInt32));
+}
+
+static int darwin_transfer_status (struct usbi_transfer *itransfer, kern_return_t result) {
+  switch (result) {
+  case kIOReturnSuccess:
+    return LIBUSB_TRANSFER_COMPLETED;
+  case kIOReturnAborted:
+    return LIBUSB_TRANSFER_CANCELLED;
+  case kIOUSBPipeStalled:
+    usbi_warn (ITRANSFER_CTX (itransfer), "transfer error: pipe is stalled");
+    return LIBUSB_TRANSFER_STALL;
+  case kIOReturnOverrun:
+    usbi_err (ITRANSFER_CTX (itransfer), "transfer error: data overrun", darwin_error_str (result));
+    return LIBUSB_TRANSFER_OVERFLOW;
+  case kIOUSBTransactionTimeout:
+    usbi_err (ITRANSFER_CTX (itransfer), "transfer error: timed out");
+    return LIBUSB_TRANSFER_TIMED_OUT;
+  default:
+    usbi_err (ITRANSFER_CTX (itransfer), "transfer error: %s (value = 0x%08x)", darwin_error_str (result), result);
+    return LIBUSB_TRANSFER_ERROR;
+  }
+}
+
+static void darwin_handle_callback (struct usbi_transfer *itransfer, kern_return_t result, UInt32 io_size) {
+  struct libusb_transfer *transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+  struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+  int isIsoc      = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS == transfer->type;
+  int isBulk      = LIBUSB_TRANSFER_TYPE_BULK == transfer->type;
+  int isControl   = LIBUSB_TRANSFER_TYPE_CONTROL == transfer->type;
+  int isInterrupt = LIBUSB_TRANSFER_TYPE_INTERRUPT == transfer->type;
+  int i;
+
+  if (!isIsoc && !isBulk && !isControl && !isInterrupt) {
+    usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type);
+    return;
+  }
+
+  usbi_info (ITRANSFER_CTX (itransfer), "handling %s completion with kernel status %d",
+	     isControl ? "control" : isBulk ? "bulk" : isIsoc ? "isoc" : "interrupt", result);
+
+  if (kIOReturnSuccess == result) {
+    if (isIsoc && tpriv->isoc_framelist) {
+      /* copy isochronous results back */
+
+      for (i = 0; i < transfer->num_iso_packets ; i++) {
+	struct libusb_iso_packet_descriptor *lib_desc = transfer->iso_packet_desc;
+	lib_desc->status = darwin_to_libusb (tpriv->isoc_framelist[i].frStatus);
+	lib_desc->actual_length = tpriv->isoc_framelist[i].frActCount;
+      }
+    } else if (!isIsoc)
+      itransfer->transferred += io_size;
+  }
+
+  /* it is ok to handle cancelled transfers without calling usbi_handle_transfer_cancellation (we catch timeout transfers) */
+  usbi_handle_transfer_completion (itransfer, darwin_transfer_status (itransfer, result));
+}
+
+static int op_handle_events(struct libusb_context *ctx, struct pollfd *fds, nfds_t nfds, int num_ready) {
+  struct usbi_transfer *itransfer;
+  UInt32 io_size;
+  IOReturn kresult;
+  int i = 0, ret;
+  UInt32 message;
+
+  pthread_mutex_lock(&ctx->open_devs_lock);
+  for (i = 0; i < nfds && num_ready > 0; i++) {
+    struct pollfd *pollfd = &fds[i];
+    struct libusb_device_handle *handle;
+    struct darwin_device_handle_priv *hpriv = NULL;
+
+    usbi_info (ctx, "checking fd %i with revents = %x", fds[i], pollfd->revents);
+
+    if (!pollfd->revents)
+      continue;
+
+    num_ready--;
+    list_for_each_entry(handle, &ctx->open_devs, list) {
+      hpriv =  (struct darwin_device_handle_priv *)handle->os_priv;
+      if (hpriv->fds[0] == pollfd->fd)
+	break;
+    }
+
+    if (!(pollfd->revents & POLLERR)) {
+      ret = read (hpriv->fds[0], &message, sizeof (message));
+      if (ret < sizeof (message))
+	continue;
+    } else
+      /* could not poll the device-- response is to delete the device (this seems a little heavy-handed) */
+      message = MESSAGE_DEVICE_GONE;
+
+    switch (message) {
+    case MESSAGE_DEVICE_GONE:
+      /* remove the device's async port from the runloop */
+      if (hpriv->cfSource) {
+	if (libusb_darwin_acfl)
+	  CFRunLoopRemoveSource (libusb_darwin_acfl, hpriv->cfSource, kCFRunLoopDefaultMode);
+	CFRelease (hpriv->cfSource);
+	hpriv->cfSource = NULL;
+      }
+
+      usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->fds[0]);
+      usbi_handle_disconnect(handle);
+      
+      /* done with this device */
+      continue;
+    case MESSAGE_ASYNC_IO_COMPLETE:
+      read (hpriv->fds[0], &itransfer, sizeof (itransfer));
+      read (hpriv->fds[0], &kresult, sizeof (IOReturn));
+      read (hpriv->fds[0], &io_size, sizeof (UInt32));
+
+      darwin_handle_callback (itransfer, kresult, io_size);
+      break;
+    default:
+      usbi_err (ctx, "unknown message received from device pipe");
+    }
+  }
+
+  pthread_mutex_unlock(&ctx->open_devs_lock);
+
+  return 0;
+}
+
+static int darwin_clock_gettime(int clk_id, struct timespec *tp) {
+  mach_timespec_t sys_time;
+  clock_serv_t clock_ref;
+
+  switch (clk_id) {
+  case USBI_CLOCK_REALTIME:
+    /* CLOCK_REALTIME represents time since the epoch */
+    host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &clock_ref);
+    break;
+  case USBI_CLOCK_MONOTONIC:
+    /* use system boot time as reference for the monotonic clock */
+    host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &clock_ref);
+    break;
+  default:
+    return LIBUSB_ERROR_INVALID_PARAM;
+  }
+
+  clock_get_time (clock_ref, &sys_time);
+
+  tp->tv_sec  = sys_time.tv_sec;
+  tp->tv_nsec = sys_time.tv_nsec;
+
+  return 0;
+}
+
+const struct usbi_os_backend darwin_backend = {
+	.name = "Darwin",
+	.init = darwin_init,
+	.exit = darwin_exit,
+	.get_device_list = darwin_get_device_list,
+	.get_device_descriptor = darwin_get_device_descriptor,
+	.get_active_config_descriptor = darwin_get_active_config_descriptor,
+	.get_config_descriptor = darwin_get_config_descriptor,
+
+	.open = darwin_open,
+	.close = darwin_close,
+	.get_configuration = darwin_get_configuration,
+	.set_configuration = darwin_set_configuration,
+	.claim_interface = darwin_claim_interface,
+	.release_interface = darwin_release_interface,
+
+	.set_interface_altsetting = darwin_set_interface_altsetting,
+	.clear_halt = darwin_clear_halt,
+	.reset_device = darwin_reset_device,
+
+	.kernel_driver_active = darwin_kernel_driver_active,
+	.detach_kernel_driver = darwin_detach_kernel_driver,
+	.attach_kernel_driver = darwin_attach_kernel_driver,
+
+	.destroy_device = darwin_destroy_device,
+
+	.submit_transfer = darwin_submit_transfer,
+	.cancel_transfer = darwin_cancel_transfer,
+	.clear_transfer_priv = darwin_clear_transfer_priv,
+
+	.handle_events = op_handle_events,
+
+	.clock_gettime = darwin_clock_gettime,
+
+	.device_priv_size = sizeof(struct darwin_device_priv),
+	.device_handle_priv_size = sizeof(struct darwin_device_handle_priv),
+	.transfer_priv_size = sizeof(struct darwin_transfer_priv),
+	.add_iso_packet_size = 0,
+};
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/os/darwin_usb.h b/Platform/Android/jni/External/libusb-1.0.8/libusb/os/darwin_usb.h
new file mode 100644
index 0000000..3b4bfa6
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/os/darwin_usb.h
@@ -0,0 +1,161 @@
+/*
+ * darwin backend for libusb 1.0
+ * Copyright (C) 2008-2009 Nathan Hjelm <hjelmn at users.sourceforge.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#if !defined(LIBUSB_DARWIN_H)
+#define LIBUSB_DARWIN_H
+
+#include "libusbi.h"
+
+#include <IOKit/IOCFBundle.h>
+#include <IOKit/usb/IOUSBLib.h>
+#include <IOKit/IOCFPlugIn.h>
+
+/* IOUSBInterfaceInferface */
+#if defined (kIOUSBInterfaceInterfaceID300)
+
+#define usb_interface_t IOUSBInterfaceInterface300
+#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID300
+#define InterfaceVersion 300
+
+#elif defined (kIOUSBInterfaceInterfaceID245)
+
+#define usb_interface_t IOUSBInterfaceInterface245
+#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID245
+#define InterfaceVersion 245
+
+#elif defined (kIOUSBInterfaceInterfaceID220)
+
+#define usb_interface_t IOUSBInterfaceInterface220
+#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID220
+#define InterfaceVersion 220
+
+#elif defined (kIOUSBInterfaceInterfaceID197)
+
+#define usb_interface_t IOUSBInterfaceInterface197
+#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID197
+#define InterfaceVersion 197
+
+#elif defined (kIOUSBInterfaceInterfaceID190)
+
+#define usb_interface_t IOUSBInterfaceInterface190
+#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID190
+#define InterfaceVersion 190
+
+#elif defined (kIOUSBInterfaceInterfaceID182)
+
+#define usb_interface_t IOUSBInterfaceInterface182
+#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID182
+#define InterfaceVersion 182
+
+#else
+
+#error "IOUSBFamily is too old. Please upgrade your OS"
+
+#endif
+
+/* IOUSBDeviceInterface */
+#if defined (kIOUSBDeviceInterfaceID320)
+
+#define usb_device_t    IOUSBDeviceInterface320
+#define DeviceInterfaceID kIOUSBDeviceInterfaceID320
+#define DeviceVersion 320
+
+#elif defined (kIOUSBDeviceInterfaceID300)
+
+#define usb_device_t    IOUSBDeviceInterface300
+#define DeviceInterfaceID kIOUSBDeviceInterfaceID300
+#define DeviceVersion 300
+
+#elif defined (kIOUSBDeviceInterfaceID245)
+
+#define usb_device_t    IOUSBDeviceInterface245
+#define DeviceInterfaceID kIOUSBDeviceInterfaceID245
+#define DeviceVersion 245
+
+#elif defined (kIOUSBDeviceInterfaceID197)
+
+#define usb_device_t    IOUSBDeviceInterface197
+#define DeviceInterfaceID kIOUSBDeviceInterfaceID197
+#define DeviceVersion 197
+
+#elif defined (kIOUSBDeviceInterfaceID187)
+
+#define usb_device_t    IOUSBDeviceInterface187
+#define DeviceInterfaceID kIOUSBDeviceInterfaceID187
+#define DeviceVersion 187
+
+#elif defined (kIOUSBDeviceInterfaceID182)
+
+#define usb_device_t    IOUSBDeviceInterface182
+#define DeviceInterfaceID kIOUSBDeviceInterfaceID182
+#define DeviceVersion 182
+
+#else
+
+#error "IOUSBFamily is too old. Please upgrade your OS"
+
+#endif
+
+typedef IOCFPlugInInterface *io_cf_plugin_ref_t;
+typedef IONotificationPortRef io_notification_port_t;
+
+/* private structures */
+struct darwin_device_priv {
+  IOUSBDeviceDescriptor dev_descriptor;
+  UInt32                location;
+  char                  sys_path[21];
+  usb_device_t        **device;
+  int                  open_count;
+};
+
+struct darwin_device_handle_priv {
+  int                  is_open;
+  CFRunLoopSourceRef   cfSource;
+  int                  fds[2];
+
+  struct __darwin_interface {
+    usb_interface_t    **interface;
+    uint8_t              num_endpoints;
+    CFRunLoopSourceRef   cfSource;
+    uint8_t            endpoint_addrs[USB_MAXENDPOINTS];
+  } interfaces[USB_MAXINTERFACES];
+};
+
+struct darwin_transfer_priv {
+  /* Isoc */
+  IOUSBIsocFrame *isoc_framelist;
+
+  /* Control */
+#if !defined (LIBUSB_NO_TIMEOUT_DEVICE)
+  IOUSBDevRequestTO req;
+#else
+  IOUSBDevRequest req;
+#endif
+
+  /* Bulk */
+};
+
+enum {
+  MESSAGE_DEVICE_GONE,
+  MESSAGE_ASYNC_IO_COMPLETE
+};
+
+
+
+#endif
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/os/linux_usbfs.c b/Platform/Android/jni/External/libusb-1.0.8/libusb/os/linux_usbfs.c
new file mode 100644
index 0000000..9970f81
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/os/linux_usbfs.c
@@ -0,0 +1,2211 @@
+/*
+ * Linux usbfs backend for libusb
+ * Copyright (C) 2007-2009 Daniel Drake <dsd at gentoo.org>
+ * Copyright (c) 2001 Johannes Erdfelt <johannes at erdfelt.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <poll.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/utsname.h>
+#include <unistd.h>
+
+#include "libusb.h"
+#include "libusbi.h"
+#include "linux_usbfs.h"
+
+/* sysfs vs usbfs:
+ * opening a usbfs node causes the device to be resumed, so we attempt to
+ * avoid this during enumeration.
+ *
+ * sysfs allows us to read the kernel's in-memory copies of device descriptors
+ * and so forth, avoiding the need to open the device:
+ *  - The binary "descriptors" file was added in 2.6.23.
+ *  - The "busnum" file was added in 2.6.22
+ *  - The "devnum" file has been present since pre-2.6.18
+ *  - the "bConfigurationValue" file has been present since pre-2.6.18
+ *
+ * If we have bConfigurationValue, busnum, and devnum, then we can determine
+ * the active configuration without having to open the usbfs node in RDWR mode.
+ * We assume this is the case if we see the busnum file (indicates 2.6.22+).
+ * The busnum file is important as that is the only way we can relate sysfs
+ * devices to usbfs nodes.
+ *
+ * If we also have descriptors, we can obtain the device descriptor and active 
+ * configuration without touching usbfs at all.
+ *
+ * The descriptors file originally only contained the active configuration
+ * descriptor alongside the device descriptor, but all configurations are
+ * included as of Linux 2.6.26.
+ */
+
+/* endianness for multi-byte fields:
+ *
+ * Descriptors exposed by usbfs have the multi-byte fields in the device
+ * descriptor as host endian. Multi-byte fields in the other descriptors are
+ * bus-endian. The kernel documentation says otherwise, but it is wrong.
+ */
+
+static const char *usbfs_path = NULL;
+
+/* Linux 2.6.32 adds support for a bulk continuation URB flag. this basically
+ * allows us to mark URBs as being part of a specific logical transfer when
+ * we submit them to the kernel. then, on any error error except a
+ * cancellation, all URBs within that transfer will be cancelled with the
+ * endpoint is disabled, meaning that no more data can creep in during the
+ * time it takes to cancel the remaining URBs.
+ *
+ * The BULK_CONTINUATION flag must be set on all URBs within a bulk transfer
+ * (in either direction) except the first.
+ * For IN transfers, we must also set SHORT_NOT_OK on all the URBs.
+ * For OUT transfers, SHORT_NOT_OK must not be set. The effective behaviour
+ * (where an OUT transfer does not complete, the rest of the URBs in the
+ * transfer get cancelled) is already in effect, and setting this flag is
+ * disallowed (a kernel with USB debugging enabled will reject such URBs).
+ */
+static int supports_flag_bulk_continuation = -1;
+
+/* clock ID for monotonic clock, as not all clock sources are available on all
+ * systems. appropriate choice made at initialization time. */
+static clockid_t monotonic_clkid = -1;
+
+/* do we have a busnum to relate devices? this also implies that we can read
+ * the active configuration through bConfigurationValue */
+static int sysfs_can_relate_devices = -1;
+
+/* do we have a descriptors file? */
+static int sysfs_has_descriptors = -1;
+
+struct linux_device_priv {
+	char *sysfs_dir;
+	unsigned char *dev_descriptor;
+	unsigned char *config_descriptor;
+};
+
+struct linux_device_handle_priv {
+	int fd;
+};
+
+enum reap_action {
+	NORMAL = 0,
+	/* submission failed after the first URB, so await cancellation/completion
+	 * of all the others */
+	SUBMIT_FAILED,
+
+	/* cancelled by user or timeout */
+	CANCELLED,
+
+	/* completed multi-URB transfer in non-final URB */
+	COMPLETED_EARLY,
+};
+
+struct linux_transfer_priv {
+	union {
+		struct usbfs_urb *urbs;
+		struct usbfs_urb **iso_urbs;
+	};
+
+	enum reap_action reap_action;
+	int num_urbs;
+	unsigned int num_retired;
+
+	/* next iso packet in user-supplied transfer to be populated */
+	int iso_packet_offset;
+};
+
+static void __get_usbfs_path(struct libusb_device *dev, char *path)
+{
+	snprintf(path, PATH_MAX, "%s/%03d/%03d", usbfs_path, dev->bus_number,
+		dev->device_address);
+}
+
+static struct linux_device_priv *__device_priv(struct libusb_device *dev)
+{
+	return (struct linux_device_priv *) dev->os_priv;
+}
+
+static struct linux_device_handle_priv *__device_handle_priv(
+	struct libusb_device_handle *handle)
+{
+	return (struct linux_device_handle_priv *) handle->os_priv;
+}
+
+static int check_usb_vfs(const char *dirname)
+{
+	DIR *dir;
+	struct dirent *entry;
+	int found = 0;
+
+	dir = opendir(dirname);
+	if (!dir)
+		return 0;
+
+	while ((entry = readdir(dir)) != NULL) {
+		if (entry->d_name[0] == '.')
+			continue;
+
+		/* We assume if we find any files that it must be the right place */
+		found = 1;
+		break;
+	}
+
+	closedir(dir);
+	return found;
+}
+
+static const char *find_usbfs_path(void)
+{
+/* 
+ * Note: this func originally searched '/dev/bus/usb' before /proc/bus/usb.
+ *       i reversed the order, because it's currently easier to manage the /proc usbfs permissions
+ */
+	const char *path = "/proc/bus/usb";
+	const char *ret = NULL;
+
+	if (check_usb_vfs(path)) {
+		ret = path;
+	} else {
+		path = "/dev/bus/usb";
+		if (check_usb_vfs(path))
+			ret = path;
+	}
+
+	usbi_dbg("found usbfs at %s", ret);
+	printf("found usbfs at %s\n",ret);
+	return ret;
+}
+
+/* the monotonic clock is not usable on all systems (e.g. embedded ones often
+ * seem to lack it). fall back to REALTIME if we have to. */
+static clockid_t find_monotonic_clock(void)
+{
+	struct timespec ts;
+	int r;
+
+	/* Linux 2.6.28 adds CLOCK_MONOTONIC_RAW but we don't use it
+	 * because it's not available through timerfd */
+	r = clock_gettime(CLOCK_MONOTONIC, &ts);
+	if (r == 0) {
+		return CLOCK_MONOTONIC;
+	} else {
+		usbi_dbg("monotonic clock doesn't work, errno %d", errno);
+		return CLOCK_REALTIME;
+	}
+}
+
+/* bulk continuation URB flag available from Linux 2.6.32 */
+static int check_flag_bulk_continuation(void)
+{
+	struct utsname uts;
+	int sublevel;
+
+	if (uname(&uts) < 0)
+		return -1;
+	if (strlen(uts.release) < 4)
+		return 0;
+	if (strncmp(uts.release, "2.6.", 4) != 0)
+		return 0;
+
+	sublevel = atoi(uts.release + 4);
+	return sublevel >= 32;
+}
+
+static int op_init(struct libusb_context *ctx)
+{
+	struct stat statbuf;
+	int r;
+
+	usbfs_path = find_usbfs_path();
+	if (!usbfs_path) {
+		usbi_err(ctx, "could not find usbfs");
+		return LIBUSB_ERROR_OTHER;
+	}
+
+	if (monotonic_clkid == -1)
+		monotonic_clkid = find_monotonic_clock();
+
+	if (supports_flag_bulk_continuation == -1) {
+		supports_flag_bulk_continuation = check_flag_bulk_continuation();
+		if (supports_flag_bulk_continuation == -1) {
+			usbi_err(ctx, "error checking for bulk continuation support");
+			return LIBUSB_ERROR_OTHER;
+		}
+	}
+
+	if (supports_flag_bulk_continuation)
+		usbi_dbg("bulk continuation flag supported");
+
+	r = stat(SYSFS_DEVICE_PATH, &statbuf);
+	if (r == 0 && S_ISDIR(statbuf.st_mode)) {
+		usbi_dbg("found usb devices in sysfs");
+	} else {
+		usbi_dbg("sysfs usb info not available");
+		sysfs_has_descriptors = 0;
+		sysfs_can_relate_devices = 0;
+	}
+
+	return 0;
+}
+
+static int usbfs_get_device_descriptor(struct libusb_device *dev,
+	unsigned char *buffer)
+{
+	struct linux_device_priv *priv = __device_priv(dev);
+
+	/* return cached copy */
+	memcpy(buffer, priv->dev_descriptor, DEVICE_DESC_LENGTH);
+	return 0;
+}
+
+static int __open_sysfs_attr(struct libusb_device *dev, const char *attr)
+{
+	struct linux_device_priv *priv = __device_priv(dev);
+	char filename[PATH_MAX];
+	int fd;
+
+	snprintf(filename, PATH_MAX, "%s/%s/%s",
+		SYSFS_DEVICE_PATH, priv->sysfs_dir, attr);
+	fd = open(filename, O_RDONLY);
+	if (fd < 0) {
+		usbi_err(DEVICE_CTX(dev),
+			"open %s failed ret=%d errno=%d", filename, fd, errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	return fd;
+}
+
+static int sysfs_get_device_descriptor(struct libusb_device *dev,
+	unsigned char *buffer)
+{
+	int fd;
+	ssize_t r;
+
+	/* sysfs provides access to an in-memory copy of the device descriptor,
+	 * so we use that rather than keeping our own copy */
+
+	fd = __open_sysfs_attr(dev, "descriptors");
+	if (fd < 0)
+		return fd;
+
+	r = read(fd, buffer, DEVICE_DESC_LENGTH);;
+	close(fd);
+	if (r < 0) {
+		usbi_err(DEVICE_CTX(dev), "read failed, ret=%d errno=%d", fd, errno);
+		return LIBUSB_ERROR_IO;
+	} else if (r < DEVICE_DESC_LENGTH) {
+		usbi_err(DEVICE_CTX(dev), "short read %d/%d", r, DEVICE_DESC_LENGTH);
+		return LIBUSB_ERROR_IO;
+	}
+
+	return 0;
+}
+
+static int op_get_device_descriptor(struct libusb_device *dev,
+	unsigned char *buffer, int *host_endian)
+{
+	if (sysfs_has_descriptors) {
+		return sysfs_get_device_descriptor(dev, buffer);
+	} else {
+		*host_endian = 1;
+		return usbfs_get_device_descriptor(dev, buffer);
+	}
+}
+
+static int usbfs_get_active_config_descriptor(struct libusb_device *dev,
+	unsigned char *buffer, size_t len)
+{
+	struct linux_device_priv *priv = __device_priv(dev);
+	if (!priv->config_descriptor)
+		return LIBUSB_ERROR_NOT_FOUND; /* device is unconfigured */
+
+	/* retrieve cached copy */
+	memcpy(buffer, priv->config_descriptor, len);
+	return 0;
+}
+
+/* read the bConfigurationValue for a device */
+static int sysfs_get_active_config(struct libusb_device *dev, int *config)
+{
+	char *endptr;
+	char tmp[4] = {0, 0, 0, 0};
+	long num;
+	int fd;
+	size_t r;
+
+	fd = __open_sysfs_attr(dev, "bConfigurationValue");
+	if (fd < 0)
+		return fd;
+
+	r = read(fd, tmp, sizeof(tmp));
+	close(fd);
+	if (r < 0) {
+		usbi_err(DEVICE_CTX(dev), 
+			"read bConfigurationValue failed ret=%d errno=%d", r, errno);
+		return LIBUSB_ERROR_IO;
+	} else if (r == 0) {
+		usbi_err(DEVICE_CTX(dev), "device unconfigured");
+		*config = -1;
+		return 0;
+	}
+
+	if (tmp[sizeof(tmp) - 1] != 0) {
+		usbi_err(DEVICE_CTX(dev), "not null-terminated?");
+		return LIBUSB_ERROR_IO;
+	} else if (tmp[0] == 0) {
+		usbi_err(DEVICE_CTX(dev), "no configuration value?");
+		return LIBUSB_ERROR_IO;
+	}
+
+	num = strtol(tmp, &endptr, 10);
+	if (endptr == tmp) {
+		usbi_err(DEVICE_CTX(dev), "error converting '%s' to integer", tmp);
+		return LIBUSB_ERROR_IO;
+	}
+
+	*config = (int) num;
+	return 0;
+}
+
+/* takes a usbfs/descriptors fd seeked to the start of a configuration, and
+ * seeks to the next one. */
+static int seek_to_next_config(struct libusb_context *ctx, int fd,
+	int host_endian)
+{
+	struct libusb_config_descriptor config;
+	unsigned char tmp[6];
+	off_t off;
+	int r;
+
+	/* read first 6 bytes of descriptor */
+	r = read(fd, tmp, sizeof(tmp));
+	if (r < 0) {
+		usbi_err(ctx, "read failed ret=%d errno=%d", r, errno);
+		return LIBUSB_ERROR_IO;
+	} else if (r < sizeof(tmp)) {
+		usbi_err(ctx, "short descriptor read %d/%d", r, sizeof(tmp));
+		return LIBUSB_ERROR_IO;
+	}
+
+	/* seek forward to end of config */
+	usbi_parse_descriptor(tmp, "bbwbb", &config, host_endian);
+	off = lseek(fd, config.wTotalLength - sizeof(tmp), SEEK_CUR);
+	if (off < 0) {
+		usbi_err(ctx, "seek failed ret=%d errno=%d", off, errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	return 0;
+}
+
+static int sysfs_get_active_config_descriptor(struct libusb_device *dev,
+	unsigned char *buffer, size_t len)
+{
+	int fd;
+	ssize_t r;
+	off_t off;
+	int to_copy;
+	int config;
+	unsigned char tmp[6];
+
+	r = sysfs_get_active_config(dev, &config);
+	if (r < 0)
+		return r;
+	if (config == -1)
+		return LIBUSB_ERROR_NOT_FOUND;
+
+	usbi_dbg("active configuration %d", config);
+
+	/* sysfs provides access to an in-memory copy of the device descriptor,
+	 * so we use that rather than keeping our own copy */
+
+	fd = __open_sysfs_attr(dev, "descriptors");
+	if (fd < 0)
+		return fd;
+
+	/* device might have been unconfigured since we read bConfigurationValue,
+	 * so first check that there is any config descriptor data at all... */
+	off = lseek(fd, 0, SEEK_END);
+	if (off < 1) {
+		usbi_err(DEVICE_CTX(dev), "end seek failed, ret=%d errno=%d",
+			off, errno);
+		close(fd);
+		return LIBUSB_ERROR_IO;
+	} else if (off == DEVICE_DESC_LENGTH) {
+		close(fd);
+		return LIBUSB_ERROR_NOT_FOUND;
+	}
+
+	off = lseek(fd, DEVICE_DESC_LENGTH, SEEK_SET);
+	if (off < 0) {
+		usbi_err(DEVICE_CTX(dev), "seek failed, ret=%d errno=%d", off, errno);
+		close(fd);
+		return LIBUSB_ERROR_IO;
+	}
+
+	/* unbounded loop: we expect the descriptor to be present under all
+	 * circumstances */
+	while (1) {
+		r = read(fd, tmp, sizeof(tmp));
+		if (r < 0) {
+			usbi_err(DEVICE_CTX(dev), "read failed, ret=%d errno=%d",
+				fd, errno);
+			return LIBUSB_ERROR_IO;
+		} else if (r < sizeof(tmp)) {
+			usbi_err(DEVICE_CTX(dev), "short read %d/%d", r, sizeof(tmp));
+			return LIBUSB_ERROR_IO;
+		}
+
+		/* check bConfigurationValue */
+		if (tmp[5] == config)
+			break;
+
+		/* try the next descriptor */
+		off = lseek(fd, 0 - sizeof(tmp), SEEK_CUR);
+		if (off < 0)
+			return LIBUSB_ERROR_IO;
+
+		r = seek_to_next_config(DEVICE_CTX(dev), fd, 1);
+		if (r < 0)
+			return r;
+	}
+
+	to_copy = (len < sizeof(tmp)) ? len : sizeof(tmp);
+	memcpy(buffer, tmp, to_copy);
+	if (len > sizeof(tmp)) {
+		r = read(fd, buffer + sizeof(tmp), len - sizeof(tmp));
+		if (r < 0) {
+			usbi_err(DEVICE_CTX(dev), "read failed, ret=%d errno=%d",
+				fd, errno);
+			r = LIBUSB_ERROR_IO;
+		} else if (r == 0) {
+			usbi_dbg("device is unconfigured");
+			r = LIBUSB_ERROR_NOT_FOUND;
+		} else if (r < len - sizeof(tmp)) {
+			usbi_err(DEVICE_CTX(dev), "short read %d/%d", r, len);
+			r = LIBUSB_ERROR_IO;
+		}
+	} else {
+		r = 0;
+	}
+
+	close(fd);
+	return r;
+}
+
+static int op_get_active_config_descriptor(struct libusb_device *dev,
+	unsigned char *buffer, size_t len, int *host_endian)
+{
+	if (sysfs_has_descriptors) {
+		return sysfs_get_active_config_descriptor(dev, buffer, len);
+	} else {
+		return usbfs_get_active_config_descriptor(dev, buffer, len);
+	}
+}
+
+/* takes a usbfs fd, attempts to find the requested config and copy a certain
+ * amount of it into an output buffer. */
+static int get_config_descriptor(struct libusb_context *ctx, int fd,
+	uint8_t config_index, unsigned char *buffer, size_t len)
+{
+	off_t off;
+	ssize_t r;
+
+	off = lseek(fd, DEVICE_DESC_LENGTH, SEEK_SET);
+	if (off < 0) {
+		usbi_err(ctx, "seek failed ret=%d errno=%d", off, errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	/* might need to skip some configuration descriptors to reach the
+	 * requested configuration */
+	while (config_index > 0) {
+		r = seek_to_next_config(ctx, fd, 0);
+		if (r < 0)
+			return r;
+		config_index--;
+	}
+
+	/* read the rest of the descriptor */
+	r = read(fd, buffer, len);
+	if (r < 0) {
+		usbi_err(ctx, "read failed ret=%d errno=%d", r, errno);
+		return LIBUSB_ERROR_IO;
+	} else if (r < len) {
+		usbi_err(ctx, "short output read %d/%d", r, len);
+		return LIBUSB_ERROR_IO;
+	}
+
+	return 0;
+}
+
+static int op_get_config_descriptor(struct libusb_device *dev,
+	uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian)
+{
+	char filename[PATH_MAX];
+	int fd;
+	int r;
+
+	/* always read from usbfs: sysfs only has the active descriptor
+	 * this will involve waking the device up, but oh well! */
+
+	/* FIXME: the above is no longer true, new kernels have all descriptors
+	 * in the descriptors file. but its kinda hard to detect if the kernel
+	 * is sufficiently new. */
+
+	__get_usbfs_path(dev, filename);
+	fd = open(filename, O_RDONLY);
+	if (fd < 0) {
+		usbi_err(DEVICE_CTX(dev),
+			"open '%s' failed, ret=%d errno=%d", filename, fd, errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	r = get_config_descriptor(DEVICE_CTX(dev), fd, config_index, buffer, len);
+	close(fd);
+	return r;
+}
+
+/* cache the active config descriptor in memory. a value of -1 means that
+ * we aren't sure which one is active, so just assume the first one. 
+ * only for usbfs. */
+static int cache_active_config(struct libusb_device *dev, int fd,
+	int active_config)
+{
+	struct linux_device_priv *priv = __device_priv(dev);
+	struct libusb_config_descriptor config;
+	unsigned char tmp[8];
+	unsigned char *buf;
+	int idx;
+	int r;
+
+	if (active_config == -1) {
+		idx = 0;
+	} else {
+		r = usbi_get_config_index_by_value(dev, active_config, &idx);
+		if (r < 0)
+			return r;
+		if (idx == -1)
+			return LIBUSB_ERROR_NOT_FOUND;
+	}
+
+	r = get_config_descriptor(DEVICE_CTX(dev), fd, idx, tmp, sizeof(tmp));
+	if (r < 0) {
+		usbi_err(DEVICE_CTX(dev), "first read error %d", r);
+		return r;
+	}
+
+	usbi_parse_descriptor(tmp, "bbw", &config, 0);
+	buf = malloc(config.wTotalLength);
+	if (!buf)
+		return LIBUSB_ERROR_NO_MEM;
+
+	r = get_config_descriptor(DEVICE_CTX(dev), fd, idx, buf,
+		config.wTotalLength);
+	if (r < 0) {
+		free(buf);
+		return r;
+	}
+
+	if (priv->config_descriptor)
+		free(priv->config_descriptor);
+	priv->config_descriptor = buf;
+	return 0;
+}
+
+/* send a control message to retrieve active configuration */
+static int usbfs_get_active_config(struct libusb_device *dev, int fd)
+{
+	unsigned char active_config = 0;
+	int r;
+
+	struct usbfs_ctrltransfer ctrl = {
+		.bmRequestType = LIBUSB_ENDPOINT_IN,
+		.bRequest = LIBUSB_REQUEST_GET_CONFIGURATION,
+		.wValue = 0,
+		.wIndex = 0,
+		.wLength = 1,
+		.timeout = 1000,
+		.data = &active_config
+	};
+
+	r = ioctl(fd, IOCTL_USBFS_CONTROL, &ctrl);
+	if (r < 0) {
+		if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+
+		/* we hit this error path frequently with buggy devices :( */
+		usbi_warn(DEVICE_CTX(dev),
+			"get_configuration failed ret=%d errno=%d", r, errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	return active_config;
+}
+
+static int initialize_device(struct libusb_device *dev, uint8_t busnum,
+	uint8_t devaddr, const char *sysfs_dir)
+{
+	struct linux_device_priv *priv = __device_priv(dev);
+	unsigned char *dev_buf;
+	char path[PATH_MAX];
+	int fd;
+	int active_config = 0;
+	int device_configured = 1;
+	ssize_t r;
+
+	dev->bus_number = busnum;
+	dev->device_address = devaddr;
+
+	if (sysfs_dir) {
+		priv->sysfs_dir = malloc(strlen(sysfs_dir) + 1);
+		if (!priv->sysfs_dir)
+			return LIBUSB_ERROR_NO_MEM;
+		strcpy(priv->sysfs_dir, sysfs_dir);
+	}
+
+	if (sysfs_has_descriptors)
+		return 0;
+
+	/* cache device descriptor in memory so that we can retrieve it later
+	 * without waking the device up (op_get_device_descriptor) */
+
+	priv->dev_descriptor = NULL;
+	priv->config_descriptor = NULL;
+
+	if (sysfs_can_relate_devices) {
+		int tmp = sysfs_get_active_config(dev, &active_config);
+		if (tmp < 0)
+			return tmp;
+		if (active_config == -1)
+			device_configured = 0;
+	}
+
+	__get_usbfs_path(dev, path);
+	fd = open(path, O_RDWR);
+	if (fd < 0 && errno == EACCES) {
+		fd = open(path, O_RDONLY);
+		/* if we only have read-only access to the device, we cannot
+		 * send a control message to determine the active config. just
+		 * assume the first one is active. */
+		active_config = -1;
+	}
+
+	if (fd < 0) {
+		usbi_err(DEVICE_CTX(dev), "open failed, ret=%d errno=%d", fd, errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	if (!sysfs_can_relate_devices) {
+		if (active_config == -1) {
+			/* if we only have read-only access to the device, we cannot
+			 * send a control message to determine the active config. just
+			 * assume the first one is active. */
+			usbi_warn(DEVICE_CTX(dev), "access to %s is read-only; cannot "
+				"determine active configuration descriptor", path);
+		} else {
+			active_config = usbfs_get_active_config(dev, fd);
+			if (active_config == LIBUSB_ERROR_IO) {
+				/* buggy devices sometimes fail to report their active config.
+				 * assume unconfigured and continue the probing */
+				usbi_warn(DEVICE_CTX(dev), "couldn't query active "
+					"configuration, assumung unconfigured");
+				device_configured = 0;
+			} else if (active_config < 0) {
+				close(fd);
+				return active_config;
+			} else if (active_config == 0) {
+				/* some buggy devices have a configuration 0, but we're
+				 * reaching into the corner of a corner case here, so let's
+				 * not support buggy devices in these circumstances.
+				 * stick to the specs: a configuration value of 0 means
+				 * unconfigured. */
+				usbi_dbg("active cfg 0? assuming unconfigured device");
+				device_configured = 0;
+			}
+		}
+	}
+
+	dev_buf = malloc(DEVICE_DESC_LENGTH);
+	if (!dev_buf) {
+		close(fd);
+		return LIBUSB_ERROR_NO_MEM;
+	}
+
+	r = read(fd, dev_buf, DEVICE_DESC_LENGTH);
+	if (r < 0) {
+		usbi_err(DEVICE_CTX(dev),
+			"read descriptor failed ret=%d errno=%d", fd, errno);
+		free(dev_buf);
+		close(fd);
+		return LIBUSB_ERROR_IO;
+	} else if (r < DEVICE_DESC_LENGTH) {
+		usbi_err(DEVICE_CTX(dev), "short descriptor read (%d)", r);
+		free(dev_buf);
+		close(fd);
+		return LIBUSB_ERROR_IO;
+	}
+
+	/* bit of a hack: set num_configurations now because cache_active_config()
+	 * calls usbi_get_config_index_by_value() which uses it */
+	dev->num_configurations = dev_buf[DEVICE_DESC_LENGTH - 1];
+
+	if (device_configured) {
+		r = cache_active_config(dev, fd, active_config);
+		if (r < 0) {
+			close(fd);
+			free(dev_buf);
+			return r;
+		}
+	}
+
+	close(fd);
+	priv->dev_descriptor = dev_buf;
+	return 0;
+}
+
+static int enumerate_device(struct libusb_context *ctx,
+	struct discovered_devs **_discdevs, uint8_t busnum, uint8_t devaddr,
+	const char *sysfs_dir)
+{
+	struct discovered_devs *discdevs;
+	unsigned long session_id;
+	int need_unref = 0;
+	struct libusb_device *dev;
+	int r = 0;
+
+	/* FIXME: session ID is not guaranteed unique as addresses can wrap and
+	 * will be reused. instead we should add a simple sysfs attribute with
+	 * a session ID. */
+	session_id = busnum << 8 | devaddr;
+	usbi_dbg("busnum %d devaddr %d session_id %ld", busnum, devaddr,
+		session_id);
+
+	dev = usbi_get_device_by_session_id(ctx, session_id);
+	if (dev) {
+		usbi_dbg("using existing device for %d/%d (session %ld)",
+			busnum, devaddr, session_id);
+	} else {
+		usbi_dbg("allocating new device for %d/%d (session %ld)",
+			busnum, devaddr, session_id);
+		dev = usbi_alloc_device(ctx, session_id);
+		if (!dev)
+			return LIBUSB_ERROR_NO_MEM;
+		need_unref = 1;
+		r = initialize_device(dev, busnum, devaddr, sysfs_dir);
+		if (r < 0)
+			goto out;
+		r = usbi_sanitize_device(dev);
+		if (r < 0)
+			goto out;
+	}
+
+	discdevs = discovered_devs_append(*_discdevs, dev);
+	if (!discdevs)
+		r = LIBUSB_ERROR_NO_MEM;
+	else
+		*_discdevs = discdevs;
+
+out:
+	if (need_unref)
+		libusb_unref_device(dev);
+	return r;
+}
+
+/* open a bus directory and adds all discovered devices to discdevs. on
+ * failure (non-zero return) the pre-existing discdevs should be destroyed
+ * (and devices freed). on success, the new discdevs pointer should be used
+ * as it may have been moved. */
+static int usbfs_scan_busdir(struct libusb_context *ctx,
+	struct discovered_devs **_discdevs, uint8_t busnum)
+{
+	DIR *dir;
+	char dirpath[PATH_MAX];
+	struct dirent *entry;
+	struct discovered_devs *discdevs = *_discdevs;
+	int r = 0;
+
+	snprintf(dirpath, PATH_MAX, "%s/%03d", usbfs_path, busnum);
+	usbi_dbg("%s", dirpath);
+	dir = opendir(dirpath);
+	if (!dir) {
+		usbi_err(ctx, "opendir '%s' failed, errno=%d", dirpath, errno);
+		/* FIXME: should handle valid race conditions like hub unplugged
+		 * during directory iteration - this is not an error */
+		return LIBUSB_ERROR_IO;
+	}
+
+	while ((entry = readdir(dir))) {
+		int devaddr;
+
+		if (entry->d_name[0] == '.')
+			continue;
+
+		devaddr = atoi(entry->d_name);
+		if (devaddr == 0) {
+			usbi_dbg("unknown dir entry %s", entry->d_name);
+			continue;
+		}
+
+		r = enumerate_device(ctx, &discdevs, busnum, (uint8_t) devaddr, NULL);
+		if (r < 0)
+			goto out;
+	}
+
+	*_discdevs = discdevs;
+out:
+	closedir(dir);
+	return r;
+}
+
+static int usbfs_get_device_list(struct libusb_context *ctx,
+	struct discovered_devs **_discdevs)
+{
+	struct dirent *entry;
+	DIR *buses = opendir(usbfs_path);
+	struct discovered_devs *discdevs = *_discdevs;
+	int r = 0;
+
+	if (!buses) {
+		usbi_err(ctx, "opendir buses failed errno=%d", errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	while ((entry = readdir(buses))) {
+		struct discovered_devs *discdevs_new = discdevs;
+		int busnum;
+
+		if (entry->d_name[0] == '.')
+			continue;
+
+		busnum = atoi(entry->d_name);
+		if (busnum == 0) {
+			usbi_dbg("unknown dir entry %s", entry->d_name);
+			continue;
+		}
+
+		r = usbfs_scan_busdir(ctx, &discdevs_new, busnum);
+		if (r < 0)
+			goto out;
+		discdevs = discdevs_new;
+	}
+
+out:
+	closedir(buses);
+	*_discdevs = discdevs;
+	return r;
+
+}
+
+static int sysfs_scan_device(struct libusb_context *ctx,
+	struct discovered_devs **_discdevs, const char *devname,
+	int *usbfs_fallback)
+{
+	int r;
+	FILE *fd;
+	char filename[PATH_MAX];
+	int busnum;
+	int devaddr;
+
+	usbi_dbg("scan %s", devname);
+
+	/* determine descriptors presence ahead of time, we need to know this
+	 * when we reach initialize_device */
+	if (sysfs_has_descriptors == -1) {
+		struct stat statbuf;
+
+		snprintf(filename, PATH_MAX, "%s/%s/descriptors", SYSFS_DEVICE_PATH,
+			devname);
+		r = stat(filename, &statbuf);
+		if (r == 0 && S_ISREG(statbuf.st_mode)) {
+			usbi_dbg("sysfs descriptors available");
+			sysfs_has_descriptors = 1;
+		} else {
+			usbi_dbg("sysfs descriptors not available");
+			sysfs_has_descriptors = 0;
+		}
+	}
+
+	snprintf(filename, PATH_MAX, "%s/%s/busnum", SYSFS_DEVICE_PATH, devname);
+	fd = fopen(filename, "r");
+	if (!fd) {
+		if (errno == ENOENT) {
+			usbi_dbg("busnum not found, cannot relate sysfs to usbfs, "
+				"falling back on pure usbfs");
+			sysfs_can_relate_devices = 0;
+			*usbfs_fallback = 1;
+			return LIBUSB_ERROR_OTHER;
+		}
+		usbi_err(ctx, "open busnum failed, errno=%d", errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	sysfs_can_relate_devices = 1;
+
+	r = fscanf(fd, "%d", &busnum);
+	fclose(fd);
+	if (r != 1) {
+		usbi_err(ctx, "fscanf busnum returned %d, errno=%d", r, errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	snprintf(filename, PATH_MAX, "%s/%s/devnum", SYSFS_DEVICE_PATH, devname);
+	fd = fopen(filename, "r");
+	if (!fd) {
+		usbi_err(ctx, "open devnum failed, errno=%d", errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	r = fscanf(fd, "%d", &devaddr);
+	fclose(fd);
+	if (r != 1) {
+		usbi_err(ctx, "fscanf devnum returned %d, errno=%d", r, errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	usbi_dbg("bus=%d dev=%d", busnum, devaddr);
+	if (busnum > 255 || devaddr > 255)
+		return LIBUSB_ERROR_INVALID_PARAM;
+
+	return enumerate_device(ctx, _discdevs, busnum & 0xff, devaddr & 0xff,
+		devname);
+}
+
+static int sysfs_get_device_list(struct libusb_context *ctx,
+	struct discovered_devs **_discdevs, int *usbfs_fallback)
+{
+	struct discovered_devs *discdevs = *_discdevs;
+	DIR *devices = opendir(SYSFS_DEVICE_PATH);
+	struct dirent *entry;
+	int r = 0;
+
+	if (!devices) {
+		usbi_err(ctx, "opendir devices failed errno=%d", errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	while ((entry = readdir(devices))) {
+		struct discovered_devs *discdevs_new = discdevs;
+
+		if ((!isdigit(entry->d_name[0]) && strncmp(entry->d_name, "usb", 3))
+				|| strchr(entry->d_name, ':'))
+			continue;
+
+		r = sysfs_scan_device(ctx, &discdevs_new, entry->d_name,
+			usbfs_fallback);
+		if (r < 0)
+			goto out;
+		discdevs = discdevs_new;
+	}	
+
+out:
+	closedir(devices);
+	*_discdevs = discdevs;
+	return r;
+}
+
+static int op_get_device_list(struct libusb_context *ctx,
+	struct discovered_devs **_discdevs)
+{
+	/* we can retrieve device list and descriptors from sysfs or usbfs.
+	 * sysfs is preferable, because if we use usbfs we end up resuming
+	 * any autosuspended USB devices. however, sysfs is not available
+	 * everywhere, so we need a usbfs fallback too.
+	 *
+	 * as described in the "sysfs vs usbfs" comment, sometimes we have
+	 * sysfs but not enough information to relate sysfs devices to usbfs
+	 * nodes. the usbfs_fallback variable is used to indicate that we should
+	 * fall back on usbfs.
+	 */
+	if (sysfs_can_relate_devices != 0) {
+		int usbfs_fallback = 0;
+		int r = sysfs_get_device_list(ctx, _discdevs, &usbfs_fallback);
+		if (!usbfs_fallback)
+			return r;
+	}
+
+	return usbfs_get_device_list(ctx, _discdevs);
+}
+
+static int op_open(struct libusb_device_handle *handle)
+{
+	struct linux_device_handle_priv *hpriv = __device_handle_priv(handle);
+	char filename[PATH_MAX];
+
+	__get_usbfs_path(handle->dev, filename);
+	hpriv->fd = open(filename, O_RDWR);
+	if (hpriv->fd < 0) {
+		if (errno == EACCES) {
+			fprintf(stderr, "libusb couldn't open USB device %s: "
+				"Permission denied.\n"
+				"libusb requires write access to USB device nodes.\n",
+				filename);
+			return LIBUSB_ERROR_ACCESS;
+		} else if (errno == ENOENT) {
+			return LIBUSB_ERROR_NO_DEVICE;
+		} else {
+			usbi_err(HANDLE_CTX(handle),
+				"open failed, code %d errno %d", hpriv->fd, errno);
+			return LIBUSB_ERROR_IO;
+		}
+	}
+
+	return usbi_add_pollfd(HANDLE_CTX(handle), hpriv->fd, POLLOUT);
+}
+
+static void op_close(struct libusb_device_handle *dev_handle)
+{
+	int fd = __device_handle_priv(dev_handle)->fd;
+	usbi_remove_pollfd(HANDLE_CTX(dev_handle), fd);
+	close(fd);
+}
+
+static int op_get_configuration(struct libusb_device_handle *handle,
+	int *config)
+{
+	int r;
+	if (sysfs_can_relate_devices != 1)
+		return LIBUSB_ERROR_NOT_SUPPORTED;
+
+	r = sysfs_get_active_config(handle->dev, config);
+	if (*config == -1)
+		*config = 0;
+
+	return 0;
+}
+
+static int op_set_configuration(struct libusb_device_handle *handle, int config)
+{
+	struct linux_device_priv *priv = __device_priv(handle->dev);
+	int fd = __device_handle_priv(handle)->fd;
+	int r = ioctl(fd, IOCTL_USBFS_SETCONFIG, &config);
+	if (r) {
+		if (errno == EINVAL)
+			return LIBUSB_ERROR_NOT_FOUND;
+		else if (errno == EBUSY)
+			return LIBUSB_ERROR_BUSY;
+		else if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+
+		usbi_err(HANDLE_CTX(handle), "failed, error %d errno %d", r, errno);
+		return LIBUSB_ERROR_OTHER;
+	}
+
+	if (!sysfs_has_descriptors) {
+		/* update our cached active config descriptor */
+		if (config == -1) {
+			if (priv->config_descriptor) {
+				free(priv->config_descriptor);
+				priv->config_descriptor = NULL;
+			}
+		} else {
+			r = cache_active_config(handle->dev, fd, config);
+			if (r < 0)
+				usbi_warn(HANDLE_CTX(handle),
+					"failed to update cached config descriptor, error %d", r);
+		}
+	}
+
+	return 0;
+}
+
+static int op_claim_interface(struct libusb_device_handle *handle, int iface)
+{
+	int fd = __device_handle_priv(handle)->fd;
+	int r = ioctl(fd, IOCTL_USBFS_CLAIMINTF, &iface);
+	if (r) {
+		if (errno == ENOENT)
+			return LIBUSB_ERROR_NOT_FOUND;
+		else if (errno == EBUSY)
+			return LIBUSB_ERROR_BUSY;
+		else if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+
+		usbi_err(HANDLE_CTX(handle),
+			"claim interface failed, error %d errno %d", r, errno);
+		return LIBUSB_ERROR_OTHER;
+	}
+	return 0;
+}
+
+static int op_release_interface(struct libusb_device_handle *handle, int iface)
+{
+	int fd = __device_handle_priv(handle)->fd;
+	int r = ioctl(fd, IOCTL_USBFS_RELEASEINTF, &iface);
+	if (r) {
+		if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+
+		usbi_err(HANDLE_CTX(handle),
+			"release interface failed, error %d errno %d", r, errno);
+		return LIBUSB_ERROR_OTHER;
+	}
+	return 0;
+}
+
+static int op_set_interface(struct libusb_device_handle *handle, int iface,
+	int altsetting)
+{
+	int fd = __device_handle_priv(handle)->fd;
+	struct usbfs_setinterface setintf;
+	int r;
+
+	setintf.interface = iface;
+	setintf.altsetting = altsetting;
+	r = ioctl(fd, IOCTL_USBFS_SETINTF, &setintf);
+	if (r) {
+		if (errno == EINVAL)
+			return LIBUSB_ERROR_NOT_FOUND;
+		else if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+
+		usbi_err(HANDLE_CTX(handle),
+			"setintf failed error %d errno %d", r, errno);
+		return LIBUSB_ERROR_OTHER;
+	}
+
+	return 0;
+}
+
+static int op_clear_halt(struct libusb_device_handle *handle,
+	unsigned char endpoint)
+{
+	int fd = __device_handle_priv(handle)->fd;
+	unsigned int _endpoint = endpoint;
+	int r = ioctl(fd, IOCTL_USBFS_CLEAR_HALT, &_endpoint);
+	if (r) {
+		if (errno == ENOENT)
+			return LIBUSB_ERROR_NOT_FOUND;
+		else if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+
+		usbi_err(HANDLE_CTX(handle),
+			"clear_halt failed error %d errno %d", r, errno);
+		return LIBUSB_ERROR_OTHER;
+	}
+
+	return 0;
+}
+
+static int op_reset_device(struct libusb_device_handle *handle)
+{
+	int fd = __device_handle_priv(handle)->fd;
+	int r = ioctl(fd, IOCTL_USBFS_RESET, NULL);
+	if (r) {
+		if (errno == ENODEV)
+			return LIBUSB_ERROR_NOT_FOUND;
+
+		usbi_err(HANDLE_CTX(handle),
+			"reset failed error %d errno %d", r, errno);
+		return LIBUSB_ERROR_OTHER;
+	}
+
+	return 0;
+}
+
+static int op_kernel_driver_active(struct libusb_device_handle *handle,
+	int interface)
+{
+	int fd = __device_handle_priv(handle)->fd;
+	struct usbfs_getdriver getdrv;
+	int r;
+
+	getdrv.interface = interface;
+	r = ioctl(fd, IOCTL_USBFS_GETDRIVER, &getdrv);
+	if (r) {
+		if (errno == ENODATA)
+			return 0;
+		else if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+
+		usbi_err(HANDLE_CTX(handle),
+			"get driver failed error %d errno %d", r, errno);
+		return LIBUSB_ERROR_OTHER;
+	}
+
+	return 1;
+}
+
+static int op_detach_kernel_driver(struct libusb_device_handle *handle,
+	int interface)
+{
+	int fd = __device_handle_priv(handle)->fd;
+	struct usbfs_ioctl command;
+	int r;
+
+	command.ifno = interface;
+	command.ioctl_code = IOCTL_USBFS_DISCONNECT;
+	command.data = NULL;
+
+	r = ioctl(fd, IOCTL_USBFS_IOCTL, &command);
+	if (r) {
+		if (errno == ENODATA)
+			return LIBUSB_ERROR_NOT_FOUND;
+		else if (errno == EINVAL)
+			return LIBUSB_ERROR_INVALID_PARAM;
+		else if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+
+		usbi_err(HANDLE_CTX(handle),
+			"detach failed error %d errno %d", r, errno);
+		return LIBUSB_ERROR_OTHER;
+	}
+
+	return 0;
+}
+
+static int op_attach_kernel_driver(struct libusb_device_handle *handle,
+	int interface)
+{
+	int fd = __device_handle_priv(handle)->fd;
+	struct usbfs_ioctl command;
+	int r;
+
+	command.ifno = interface;
+	command.ioctl_code = IOCTL_USBFS_CONNECT;
+	command.data = NULL;
+
+	r = ioctl(fd, IOCTL_USBFS_IOCTL, &command);
+	if (r < 0) {
+		if (errno == ENODATA)
+			return LIBUSB_ERROR_NOT_FOUND;
+		else if (errno == EINVAL)
+			return LIBUSB_ERROR_INVALID_PARAM;
+		else if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+		else if (errno == EBUSY)
+			return LIBUSB_ERROR_BUSY;
+
+		usbi_err(HANDLE_CTX(handle),
+			"attach failed error %d errno %d", r, errno);
+		return LIBUSB_ERROR_OTHER;
+	} else if (r == 0) {
+		return LIBUSB_ERROR_NOT_FOUND;
+	}
+
+	return 0;
+}
+
+static void op_destroy_device(struct libusb_device *dev)
+{
+	struct linux_device_priv *priv = __device_priv(dev);
+	if (!sysfs_has_descriptors) {
+		if (priv->dev_descriptor)
+			free(priv->dev_descriptor);
+		if (priv->config_descriptor)
+			free(priv->config_descriptor);
+	}
+	if (priv->sysfs_dir)
+		free(priv->sysfs_dir);
+}
+
+static void free_iso_urbs(struct linux_transfer_priv *tpriv)
+{
+	int i;
+	for (i = 0; i < tpriv->num_urbs; i++) {
+		struct usbfs_urb *urb = tpriv->iso_urbs[i];
+		if (!urb)
+			break;
+		free(urb);
+	}
+
+	free(tpriv->iso_urbs);
+	tpriv->iso_urbs = NULL;
+}
+
+static int submit_bulk_transfer(struct usbi_transfer *itransfer,
+	unsigned char urb_type)
+{
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+	struct linux_device_handle_priv *dpriv =
+		__device_handle_priv(transfer->dev_handle);
+	struct usbfs_urb *urbs;
+	int is_out = (transfer->endpoint & LIBUSB_ENDPOINT_DIR_MASK)
+		== LIBUSB_ENDPOINT_OUT;
+	int r;
+	int i;
+	size_t alloc_size;
+
+	if (tpriv->urbs)
+		return LIBUSB_ERROR_BUSY;
+
+	/* usbfs places a 16kb limit on bulk URBs. we divide up larger requests
+	 * into smaller units to meet such restriction, then fire off all the
+	 * units at once. it would be simpler if we just fired one unit at a time,
+	 * but there is a big performance gain through doing it this way. */
+	int num_urbs = transfer->length / MAX_BULK_BUFFER_LENGTH;
+	int last_urb_partial = 0;
+
+	if (transfer->length == 0) {
+		num_urbs = 1;
+	} else if ((transfer->length % MAX_BULK_BUFFER_LENGTH) > 0) {
+		last_urb_partial = 1;
+		num_urbs++;
+	}
+	usbi_dbg("need %d urbs for new transfer with length %d", num_urbs,
+		transfer->length);
+	alloc_size = num_urbs * sizeof(struct usbfs_urb);
+	urbs = malloc(alloc_size);
+	if (!urbs)
+		return LIBUSB_ERROR_NO_MEM;
+	memset(urbs, 0, alloc_size);
+	tpriv->urbs = urbs;
+	tpriv->num_urbs = num_urbs;
+	tpriv->num_retired = 0;
+	tpriv->reap_action = NORMAL;
+
+	for (i = 0; i < num_urbs; i++) {
+		struct usbfs_urb *urb = &urbs[i];
+		urb->usercontext = itransfer;
+		urb->type = urb_type;
+		urb->endpoint = transfer->endpoint;
+		urb->buffer = transfer->buffer + (i * MAX_BULK_BUFFER_LENGTH);
+		if (supports_flag_bulk_continuation && !is_out)
+			urb->flags = USBFS_URB_SHORT_NOT_OK;
+		if (i == num_urbs - 1 && last_urb_partial)
+			urb->buffer_length = transfer->length % MAX_BULK_BUFFER_LENGTH;
+		else if (transfer->length == 0)
+			urb->buffer_length = 0;
+		else
+			urb->buffer_length = MAX_BULK_BUFFER_LENGTH;
+
+		if (i > 0 && supports_flag_bulk_continuation)
+			urb->flags |= USBFS_URB_BULK_CONTINUATION;
+
+		r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urb);
+		if (r < 0) {
+			int j;
+
+			if (errno == ENODEV) {
+				r = LIBUSB_ERROR_NO_DEVICE;
+			} else {
+				usbi_err(TRANSFER_CTX(transfer),
+					"submiturb failed error %d errno=%d", r, errno);
+				r = LIBUSB_ERROR_IO;
+			}
+	
+			/* if the first URB submission fails, we can simply free up and
+			 * return failure immediately. */
+			if (i == 0) {
+				usbi_dbg("first URB failed, easy peasy");
+				free(urbs);
+				tpriv->urbs = NULL;
+				return r;
+			}
+
+			/* if it's not the first URB that failed, the situation is a bit
+			 * tricky. we must discard all previous URBs. there are
+			 * complications:
+			 *  - discarding is asynchronous - discarded urbs will be reaped
+			 *    later. the user must not have freed the transfer when the
+			 *    discarded URBs are reaped, otherwise libusb will be using
+			 *    freed memory.
+			 *  - the earlier URBs may have completed successfully and we do
+			 *    not want to throw away any data.
+			 * so, in this case we discard all the previous URBs BUT we report
+			 * that the transfer was submitted successfully. then later when
+			 * the final discard completes we can report error to the user.
+			 */
+			tpriv->reap_action = SUBMIT_FAILED;
+
+			/* The URBs we haven't submitted yet we count as already
+			 * retired. */
+			tpriv->num_retired += num_urbs - i;
+			for (j = 0; j < i; j++) {
+				int tmp = ioctl(dpriv->fd, IOCTL_USBFS_DISCARDURB, &urbs[j]);
+				if (tmp && errno != EINVAL)
+					usbi_warn(TRANSFER_CTX(transfer),
+						"unrecognised discard errno %d", errno);
+			}
+
+			usbi_dbg("reporting successful submission but waiting for %d "
+				"discards before reporting error", i);
+			return 0;
+		}
+	}
+
+	return 0;
+}
+
+static int submit_iso_transfer(struct usbi_transfer *itransfer)
+{
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+	struct linux_device_handle_priv *dpriv =
+		__device_handle_priv(transfer->dev_handle);
+	struct usbfs_urb **urbs;
+	size_t alloc_size;
+	int num_packets = transfer->num_iso_packets;
+	int i;
+	int this_urb_len = 0;
+	int num_urbs = 1;
+	int packet_offset = 0;
+	unsigned int packet_len;
+	unsigned char *urb_buffer = transfer->buffer;
+
+	if (tpriv->iso_urbs)
+		return LIBUSB_ERROR_BUSY;
+
+	/* usbfs places a 32kb limit on iso URBs. we divide up larger requests
+	 * into smaller units to meet such restriction, then fire off all the
+	 * units at once. it would be simpler if we just fired one unit at a time,
+	 * but there is a big performance gain through doing it this way. */
+
+	/* calculate how many URBs we need */
+	for (i = 0; i < num_packets; i++) {
+		int space_remaining = MAX_ISO_BUFFER_LENGTH - this_urb_len;
+		packet_len = transfer->iso_packet_desc[i].length;
+
+		if (packet_len > space_remaining) {
+			num_urbs++;
+			this_urb_len = packet_len;
+		} else {
+			this_urb_len += packet_len;
+		}
+	}
+	usbi_dbg("need %d 32k URBs for transfer", num_urbs);
+
+	alloc_size = num_urbs * sizeof(*urbs);
+	urbs = malloc(alloc_size);
+	if (!urbs)
+		return LIBUSB_ERROR_NO_MEM;
+	memset(urbs, 0, alloc_size);
+
+	tpriv->iso_urbs = urbs;
+	tpriv->num_urbs = num_urbs;
+	tpriv->num_retired = 0;
+	tpriv->reap_action = NORMAL;
+	tpriv->iso_packet_offset = 0;
+
+	/* allocate + initialize each URB with the correct number of packets */
+	for (i = 0; i < num_urbs; i++) {
+		struct usbfs_urb *urb;
+		int space_remaining_in_urb = MAX_ISO_BUFFER_LENGTH;
+		int urb_packet_offset = 0;
+		unsigned char *urb_buffer_orig = urb_buffer;
+		int j;
+		int k;
+
+		/* swallow up all the packets we can fit into this URB */
+		while (packet_offset < transfer->num_iso_packets) {
+			packet_len = transfer->iso_packet_desc[packet_offset].length;
+			if (packet_len <= space_remaining_in_urb) {
+				/* throw it in */
+				urb_packet_offset++;
+				packet_offset++;
+				space_remaining_in_urb -= packet_len;
+				urb_buffer += packet_len;
+			} else {
+				/* it can't fit, save it for the next URB */
+				break;
+			}
+		}
+
+		alloc_size = sizeof(*urb)
+			+ (urb_packet_offset * sizeof(struct usbfs_iso_packet_desc));
+		urb = malloc(alloc_size);
+		if (!urb) {
+			free_iso_urbs(tpriv);
+			return LIBUSB_ERROR_NO_MEM;
+		}
+		memset(urb, 0, alloc_size);
+		urbs[i] = urb;
+
+		/* populate packet lengths */
+		for (j = 0, k = packet_offset - urb_packet_offset;
+				k < packet_offset; k++, j++) {
+			packet_len = transfer->iso_packet_desc[k].length;
+			urb->iso_frame_desc[j].length = packet_len;
+		}
+
+		urb->usercontext = itransfer;
+		urb->type = USBFS_URB_TYPE_ISO;
+		/* FIXME: interface for non-ASAP data? */
+		urb->flags = USBFS_URB_ISO_ASAP;
+		urb->endpoint = transfer->endpoint;
+		urb->number_of_packets = urb_packet_offset;
+		urb->buffer = urb_buffer_orig;
+	}
+
+	/* submit URBs */
+	for (i = 0; i < num_urbs; i++) {
+		int r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urbs[i]);
+		if (r < 0) {
+			int j;
+
+			if (errno == ENODEV) {
+				r = LIBUSB_ERROR_NO_DEVICE;
+			} else {
+				usbi_err(TRANSFER_CTX(transfer),
+					"submiturb failed error %d errno=%d", r, errno);
+				r = LIBUSB_ERROR_IO;
+			}
+
+			/* if the first URB submission fails, we can simply free up and
+			 * return failure immediately. */
+			if (i == 0) {
+				usbi_dbg("first URB failed, easy peasy");
+				free_iso_urbs(tpriv);
+				return r;
+			}
+
+			/* if it's not the first URB that failed, the situation is a bit
+			 * tricky. we must discard all previous URBs. there are
+			 * complications:
+			 *  - discarding is asynchronous - discarded urbs will be reaped
+			 *    later. the user must not have freed the transfer when the
+			 *    discarded URBs are reaped, otherwise libusb will be using
+			 *    freed memory.
+			 *  - the earlier URBs may have completed successfully and we do
+			 *    not want to throw away any data.
+			 * so, in this case we discard all the previous URBs BUT we report
+			 * that the transfer was submitted successfully. then later when
+			 * the final discard completes we can report error to the user.
+			 */
+			tpriv->reap_action = SUBMIT_FAILED;
+
+			/* The URBs we haven't submitted yet we count as already
+			 * retired. */
+			tpriv->num_retired = num_urbs - i;
+			for (j = 0; j < i; j++) {
+				int tmp = ioctl(dpriv->fd, IOCTL_USBFS_DISCARDURB, urbs[j]);
+				if (tmp && errno != EINVAL)
+					usbi_warn(TRANSFER_CTX(transfer),
+						"unrecognised discard errno %d", errno);
+			}
+
+			usbi_dbg("reporting successful submission but waiting for %d "
+				"discards before reporting error", i);
+			return 0;
+		}
+	}
+
+	return 0;
+}
+
+static int submit_control_transfer(struct usbi_transfer *itransfer)
+{
+	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+	struct linux_device_handle_priv *dpriv =
+		__device_handle_priv(transfer->dev_handle);
+	struct usbfs_urb *urb;
+	int r;
+
+	if (tpriv->urbs)
+		return LIBUSB_ERROR_BUSY;
+
+	if (transfer->length - LIBUSB_CONTROL_SETUP_SIZE > MAX_CTRL_BUFFER_LENGTH)
+		return LIBUSB_ERROR_INVALID_PARAM;
+
+	urb = malloc(sizeof(struct usbfs_urb));
+	if (!urb)
+		return LIBUSB_ERROR_NO_MEM;
+	memset(urb, 0, sizeof(struct usbfs_urb));
+	tpriv->urbs = urb;
+	tpriv->reap_action = NORMAL;
+
+	urb->usercontext = itransfer;
+	urb->type = USBFS_URB_TYPE_CONTROL;
+	urb->endpoint = transfer->endpoint;
+	urb->buffer = transfer->buffer;
+	urb->buffer_length = transfer->length;
+
+	r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urb);
+	if (r < 0) {
+		free(urb);
+		tpriv->urbs = NULL;
+		if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+
+		usbi_err(TRANSFER_CTX(transfer),
+			"submiturb failed error %d errno=%d", r, errno);
+		return LIBUSB_ERROR_IO;
+	}
+	return 0;
+}
+
+static int op_submit_transfer(struct usbi_transfer *itransfer)
+{
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+
+	switch (transfer->type) {
+	case LIBUSB_TRANSFER_TYPE_CONTROL:
+		return submit_control_transfer(itransfer);
+	case LIBUSB_TRANSFER_TYPE_BULK:
+		return submit_bulk_transfer(itransfer, USBFS_URB_TYPE_BULK);
+	case LIBUSB_TRANSFER_TYPE_INTERRUPT:
+		return submit_bulk_transfer(itransfer, USBFS_URB_TYPE_INTERRUPT);
+	case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
+		return submit_iso_transfer(itransfer);
+	default:
+		usbi_err(TRANSFER_CTX(transfer),
+			"unknown endpoint type %d", transfer->type);
+		return LIBUSB_ERROR_INVALID_PARAM;
+	}
+}
+
+static int cancel_control_transfer(struct usbi_transfer *itransfer)
+{
+	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+	struct linux_device_handle_priv *dpriv =
+		__device_handle_priv(transfer->dev_handle);
+	int r;
+
+	if (!tpriv->urbs)
+		return LIBUSB_ERROR_NOT_FOUND;
+
+	tpriv->reap_action = CANCELLED;
+	r = ioctl(dpriv->fd, IOCTL_USBFS_DISCARDURB, tpriv->urbs);
+	if(r) {
+		if (errno == EINVAL) {
+			usbi_dbg("URB not found --> assuming ready to be reaped");
+			return 0;
+		} else {
+			usbi_err(TRANSFER_CTX(transfer),
+				"unrecognised DISCARD code %d", errno);
+			return LIBUSB_ERROR_OTHER;
+		}
+	}
+
+	return 0;
+}
+
+static int cancel_bulk_transfer(struct usbi_transfer *itransfer)
+{
+	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+	struct linux_device_handle_priv *dpriv =
+		__device_handle_priv(transfer->dev_handle);
+	int i;
+
+	if (!tpriv->urbs)
+		return LIBUSB_ERROR_NOT_FOUND;
+
+	tpriv->reap_action = CANCELLED;
+	for (i = 0; i < tpriv->num_urbs; i++) {
+		int tmp = ioctl(dpriv->fd, IOCTL_USBFS_DISCARDURB, &tpriv->urbs[i]);
+		if (tmp && errno != EINVAL)
+			usbi_warn(TRANSFER_CTX(transfer),
+				"unrecognised discard errno %d", errno);
+	}
+	return 0;
+}
+
+static int cancel_iso_transfer(struct usbi_transfer *itransfer)
+{
+	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+	struct linux_device_handle_priv *dpriv =
+		__device_handle_priv(transfer->dev_handle);
+	int i;
+
+	if (!tpriv->iso_urbs)
+		return LIBUSB_ERROR_NOT_FOUND;
+
+	tpriv->reap_action = CANCELLED;
+	for (i = 0; i < tpriv->num_urbs; i++) {
+		int tmp = ioctl(dpriv->fd, IOCTL_USBFS_DISCARDURB, tpriv->iso_urbs[i]);
+		if (tmp && errno != EINVAL)
+			usbi_warn(TRANSFER_CTX(transfer),
+				"unrecognised discard errno %d", errno);
+	}
+	return 0;
+}
+
+static int op_cancel_transfer(struct usbi_transfer *itransfer)
+{
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+
+	switch (transfer->type) {
+	case LIBUSB_TRANSFER_TYPE_CONTROL:
+		return cancel_control_transfer(itransfer);
+	case LIBUSB_TRANSFER_TYPE_BULK:
+	case LIBUSB_TRANSFER_TYPE_INTERRUPT:
+		return cancel_bulk_transfer(itransfer);
+	case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
+		return cancel_iso_transfer(itransfer);
+	default:
+		usbi_err(TRANSFER_CTX(transfer),
+			"unknown endpoint type %d", transfer->type);
+		return LIBUSB_ERROR_INVALID_PARAM;
+	}
+}
+
+static void op_clear_transfer_priv(struct usbi_transfer *itransfer)
+{
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+
+	switch (transfer->type) {
+	case LIBUSB_TRANSFER_TYPE_CONTROL:
+	case LIBUSB_TRANSFER_TYPE_BULK:
+	case LIBUSB_TRANSFER_TYPE_INTERRUPT:
+		free(tpriv->urbs);
+		tpriv->urbs = NULL;
+		break;
+	case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
+		free_iso_urbs(tpriv);
+		break;
+	default:
+		usbi_err(TRANSFER_CTX(transfer),
+			"unknown endpoint type %d", transfer->type);
+	}
+}
+
+static int handle_bulk_completion(struct usbi_transfer *itransfer,
+	struct usbfs_urb *urb)
+{
+	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+	int num_urbs = tpriv->num_urbs;
+	int urb_idx = urb - tpriv->urbs;
+	enum libusb_transfer_status status = LIBUSB_TRANSFER_COMPLETED;
+	int r = 0;
+
+	pthread_mutex_lock(&itransfer->lock);
+	usbi_dbg("handling completion status %d of bulk urb %d/%d", urb->status,
+		urb_idx + 1, num_urbs);
+
+	tpriv->num_retired++;
+
+	if (tpriv->reap_action != NORMAL) {
+		/* cancelled, submit_fail, or completed early */
+		usbi_dbg("abnormal reap: urb status %d", urb->status);
+
+		/* even though we're in the process of cancelling, it's possible that
+		 * we may receive some data in these URBs that we don't want to lose.
+		 * examples:
+		 * 1. while the kernel is cancelling all the packets that make up an
+		 *    URB, a few of them might complete. so we get back a successful
+		 *    cancellation *and* some data.
+		 * 2. we receive a short URB which marks the early completion condition,
+		 *    so we start cancelling the remaining URBs. however, we're too
+		 *    slow and another URB completes (or at least completes partially).
+		 *
+		 * When this happens, our objectives are not to lose any "surplus" data,
+		 * and also to stick it at the end of the previously-received data
+		 * (closing any holes), so that libusb reports the total amount of
+		 * transferred data and presents it in a contiguous chunk.
+		 */
+		if (urb->actual_length > 0) {
+			struct libusb_transfer *transfer =
+				__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+			unsigned char *target = transfer->buffer + itransfer->transferred;
+			usbi_dbg("received %d bytes of surplus data", urb->actual_length);
+			if (urb->buffer != target) {
+				usbi_dbg("moving surplus data from offset %d to offset %d",
+					(unsigned char *) urb->buffer - transfer->buffer,
+					target - transfer->buffer);
+				memmove(target, urb->buffer, urb->actual_length);
+			}
+			itransfer->transferred += urb->actual_length;
+		}
+
+		if (tpriv->num_retired == num_urbs) {
+			usbi_dbg("abnormal reap: last URB handled, reporting");
+			if (tpriv->reap_action == CANCELLED) {
+				free(tpriv->urbs);
+				tpriv->urbs = NULL;
+				pthread_mutex_unlock(&itransfer->lock);
+				r = usbi_handle_transfer_cancellation(itransfer);
+				goto out_unlock;
+			}
+			if (tpriv->reap_action != COMPLETED_EARLY)
+				status = LIBUSB_TRANSFER_ERROR;
+			goto completed;
+		}
+		goto out_unlock;
+	}
+
+	if (urb->status == 0 || urb->status == -EREMOTEIO ||
+			(urb->status == -EOVERFLOW && urb->actual_length > 0))
+		itransfer->transferred += urb->actual_length;
+
+
+	switch (urb->status) {
+	case 0:
+		break;
+	case -EREMOTEIO: /* short transfer */
+		break;
+	case -EPIPE:
+		usbi_dbg("detected endpoint stall");
+		status = LIBUSB_TRANSFER_STALL;
+		goto completed;
+	case -EOVERFLOW:
+		/* overflow can only ever occur in the last urb */
+		usbi_dbg("overflow, actual_length=%d", urb->actual_length);
+		status = LIBUSB_TRANSFER_OVERFLOW;
+		goto completed;
+	case -ETIME:
+	case -EPROTO:
+	case -EILSEQ:
+     
+		usbi_dbg("low level error %d", urb->status);
+		status = LIBUSB_TRANSFER_ERROR;
+		goto completed;
+	default:
+		usbi_warn(ITRANSFER_CTX(itransfer),
+			"unrecognised urb status %d", urb->status);
+		status = LIBUSB_TRANSFER_ERROR;
+		goto completed;
+	}
+
+	/* if we're the last urb or we got less data than requested then we're
+	 * done */
+	if (urb_idx == num_urbs - 1) {
+		usbi_dbg("last URB in transfer --> complete!");
+	} else if (urb->actual_length < urb->buffer_length) {
+		struct libusb_transfer *transfer =
+			__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+		struct linux_device_handle_priv *dpriv =
+			__device_handle_priv(transfer->dev_handle);
+		int i;
+
+		usbi_dbg("short transfer %d/%d --> complete!", urb->actual_length,
+			urb->buffer_length);
+
+		/* we have to cancel the remaining urbs and wait for their completion
+		 * before reporting results */
+		tpriv->reap_action = COMPLETED_EARLY;
+		for (i = urb_idx + 1; i < tpriv->num_urbs; i++) {
+			/* remaining URBs with continuation flag are automatically
+			 * cancelled by the kernel */
+			if (tpriv->urbs[i].flags & USBFS_URB_BULK_CONTINUATION)
+				continue;
+			int tmp = ioctl(dpriv->fd, IOCTL_USBFS_DISCARDURB, &tpriv->urbs[i]);
+			if (tmp && errno != EINVAL)
+				usbi_warn(TRANSFER_CTX(transfer),
+					"unrecognised discard errno %d", errno);
+		}
+		goto out_unlock;
+	} else {
+		goto out_unlock;
+	}
+
+completed:
+	free(tpriv->urbs);
+	tpriv->urbs = NULL;
+	pthread_mutex_unlock(&itransfer->lock);
+	return usbi_handle_transfer_completion(itransfer, status);
+out_unlock:
+	pthread_mutex_unlock(&itransfer->lock);
+	return r;
+}
+
+static int handle_iso_completion(struct usbi_transfer *itransfer,
+	struct usbfs_urb *urb)
+{
+	struct libusb_transfer *transfer =
+		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+	int num_urbs = tpriv->num_urbs;
+	int urb_idx = 0;
+	int i;
+
+	pthread_mutex_lock(&itransfer->lock);
+	for (i = 0; i < num_urbs; i++) {
+		if (urb == tpriv->iso_urbs[i]) {
+			urb_idx = i + 1;
+			break;
+		}
+	}
+	if (urb_idx == 0) {
+		usbi_err(TRANSFER_CTX(transfer), "could not locate urb!");
+		pthread_mutex_unlock(&itransfer->lock);
+		return LIBUSB_ERROR_NOT_FOUND;
+	}
+
+	usbi_dbg("handling completion status %d of iso urb %d/%d", urb->status,
+		urb_idx, num_urbs);
+
+	if (urb->status == 0) {
+		/* copy isochronous results back in */
+
+		for (i = 0; i < urb->number_of_packets; i++) {
+			struct usbfs_iso_packet_desc *urb_desc = &urb->iso_frame_desc[i];
+			struct libusb_iso_packet_descriptor *lib_desc =
+				&transfer->iso_packet_desc[tpriv->iso_packet_offset++];
+			lib_desc->status = urb_desc->status;
+			lib_desc->actual_length = urb_desc->actual_length;
+		}
+	}
+
+	tpriv->num_retired++;
+
+	if (tpriv->reap_action != NORMAL) { /* cancelled or submit_fail */
+		usbi_dbg("CANCEL: urb status %d", urb->status);
+
+		if (tpriv->num_retired == num_urbs) {
+			usbi_dbg("CANCEL: last URB handled, reporting");
+			free_iso_urbs(tpriv);
+			if (tpriv->reap_action == CANCELLED) {
+				pthread_mutex_unlock(&itransfer->lock);
+				return usbi_handle_transfer_cancellation(itransfer);
+			} else {
+				pthread_mutex_unlock(&itransfer->lock);
+				return usbi_handle_transfer_completion(itransfer,
+					LIBUSB_TRANSFER_ERROR);
+			}
+		}
+		goto out;
+	}
+
+	switch (urb->status) {
+	case 0:
+		break;
+	case -ETIME:
+	case -EPROTO:
+	case -EILSEQ:
+		usbi_dbg("low-level USB error %d", urb->status);
+		break;
+	default:
+		usbi_warn(TRANSFER_CTX(transfer),
+			"unrecognised urb status %d", urb->status);
+		break;
+	}
+
+	/* if we're the last urb or we got less data than requested then we're
+	 * done */
+	if (urb_idx == num_urbs) {
+		usbi_dbg("last URB in transfer --> complete!");
+		free_iso_urbs(tpriv);
+		pthread_mutex_unlock(&itransfer->lock);
+		return usbi_handle_transfer_completion(itransfer, LIBUSB_TRANSFER_COMPLETED);
+	}
+
+out:
+	pthread_mutex_unlock(&itransfer->lock);
+	return 0;
+}
+
+static int handle_control_completion(struct usbi_transfer *itransfer,
+	struct usbfs_urb *urb)
+{
+	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
+	int status;
+
+	pthread_mutex_lock(&itransfer->lock);
+	usbi_dbg("handling completion status %d", urb->status);
+
+	if (urb->status == 0)
+		itransfer->transferred += urb->actual_length;
+
+	if (tpriv->reap_action == CANCELLED) {
+		if (urb->status != 0 && urb->status != -ENOENT)
+			usbi_warn(ITRANSFER_CTX(itransfer),
+				"cancel: unrecognised urb status %d", urb->status);
+		free(tpriv->urbs);
+		tpriv->urbs = NULL;
+		pthread_mutex_unlock(&itransfer->lock);
+		return usbi_handle_transfer_cancellation(itransfer);
+	}
+
+	switch (urb->status) {
+	case 0:
+		itransfer->transferred = urb->actual_length;
+		status = LIBUSB_TRANSFER_COMPLETED;
+		break;
+	case -EPIPE:
+		usbi_dbg("unsupported control request");
+		status = LIBUSB_TRANSFER_STALL;
+		break;
+	case -ETIME:
+	case -EPROTO:
+	case -EILSEQ:
+		usbi_dbg("low-level bus error occurred");
+		status = LIBUSB_TRANSFER_ERROR;
+		break;
+	default:
+		usbi_warn(ITRANSFER_CTX(itransfer),
+			"unrecognised urb status %d", urb->status);
+		status = LIBUSB_TRANSFER_ERROR;
+		break;
+	}
+
+	free(tpriv->urbs);
+	tpriv->urbs = NULL;
+	pthread_mutex_unlock(&itransfer->lock);
+	return usbi_handle_transfer_completion(itransfer, status);
+}
+
+static int reap_for_handle(struct libusb_device_handle *handle)
+{
+	struct linux_device_handle_priv *hpriv = __device_handle_priv(handle);
+	int r;
+	struct usbfs_urb *urb;
+	struct usbi_transfer *itransfer;
+	struct libusb_transfer *transfer;
+
+	r = ioctl(hpriv->fd, IOCTL_USBFS_REAPURBNDELAY, &urb);
+	if (r == -1 && errno == EAGAIN)
+		return 1;
+	if (r < 0) {
+		if (errno == ENODEV)
+			return LIBUSB_ERROR_NO_DEVICE;
+
+		usbi_err(HANDLE_CTX(handle), "reap failed error %d errno=%d",
+			r, errno);
+		return LIBUSB_ERROR_IO;
+	}
+
+	itransfer = urb->usercontext;
+	transfer = __USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+
+	usbi_dbg("urb type=%d status=%d transferred=%d", urb->type, urb->status,
+		urb->actual_length);
+
+	switch (transfer->type) {
+	case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:
+		return handle_iso_completion(itransfer, urb);
+	case LIBUSB_TRANSFER_TYPE_BULK:
+	case LIBUSB_TRANSFER_TYPE_INTERRUPT:
+		return handle_bulk_completion(itransfer, urb);
+	case LIBUSB_TRANSFER_TYPE_CONTROL:
+		return handle_control_completion(itransfer, urb);
+	default:
+		usbi_err(HANDLE_CTX(handle), "unrecognised endpoint type %x",
+			transfer->type);
+		return LIBUSB_ERROR_OTHER;
+	}
+}
+
+static int op_handle_events(struct libusb_context *ctx,
+	struct pollfd *fds, nfds_t nfds, int num_ready)
+{
+	int r;
+	int i = 0;
+
+	pthread_mutex_lock(&ctx->open_devs_lock);
+	for (i = 0; i < nfds && num_ready > 0; i++) {
+		struct pollfd *pollfd = &fds[i];
+		struct libusb_device_handle *handle;
+		struct linux_device_handle_priv *hpriv = NULL;
+
+		if (!pollfd->revents)
+			continue;
+
+		num_ready--;
+		list_for_each_entry(handle, &ctx->open_devs, list) {
+			hpriv =  __device_handle_priv(handle);
+			if (hpriv->fd == pollfd->fd)
+				break;
+		}
+
+		if (pollfd->revents & POLLERR) {
+			usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->fd);
+			usbi_handle_disconnect(handle);
+			continue;
+		}
+
+		r = reap_for_handle(handle);
+		if (r == 1 || r == LIBUSB_ERROR_NO_DEVICE)
+			continue;
+		else if (r < 0)
+			goto out;
+	}
+
+	r = 0;
+out:
+	pthread_mutex_unlock(&ctx->open_devs_lock);
+	return r;
+}
+
+static int op_clock_gettime(int clk_id, struct timespec *tp)
+{
+	switch (clk_id) {
+	case USBI_CLOCK_MONOTONIC:
+		return clock_gettime(monotonic_clkid, tp);
+	case USBI_CLOCK_REALTIME:
+		return clock_gettime(CLOCK_REALTIME, tp);
+	default:
+		return LIBUSB_ERROR_INVALID_PARAM;
+  }
+}
+
+#ifdef USBI_TIMERFD_AVAILABLE
+static clockid_t op_get_timerfd_clockid(void)
+{
+	return monotonic_clkid;
+
+}
+#endif
+
+const struct usbi_os_backend linux_usbfs_backend = {
+	.name = "Linux usbfs",
+	.init = op_init,
+	.exit = NULL,
+	.get_device_list = op_get_device_list,
+	.get_device_descriptor = op_get_device_descriptor,
+	.get_active_config_descriptor = op_get_active_config_descriptor,
+	.get_config_descriptor = op_get_config_descriptor,
+
+	.open = op_open,
+	.close = op_close,
+	.get_configuration = op_get_configuration,
+	.set_configuration = op_set_configuration,
+	.claim_interface = op_claim_interface,
+	.release_interface = op_release_interface,
+
+	.set_interface_altsetting = op_set_interface,
+	.clear_halt = op_clear_halt,
+	.reset_device = op_reset_device,
+
+	.kernel_driver_active = op_kernel_driver_active,
+	.detach_kernel_driver = op_detach_kernel_driver,
+	.attach_kernel_driver = op_attach_kernel_driver,
+
+	.destroy_device = op_destroy_device,
+
+	.submit_transfer = op_submit_transfer,
+	.cancel_transfer = op_cancel_transfer,
+	.clear_transfer_priv = op_clear_transfer_priv,
+
+	.handle_events = op_handle_events,
+
+	.clock_gettime = op_clock_gettime,
+
+#ifdef USBI_TIMERFD_AVAILABLE
+	.get_timerfd_clockid = op_get_timerfd_clockid,
+#endif
+
+	.device_priv_size = sizeof(struct linux_device_priv),
+	.device_handle_priv_size = sizeof(struct linux_device_handle_priv),
+	.transfer_priv_size = sizeof(struct linux_transfer_priv),
+	.add_iso_packet_size = 0,
+};
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/os/linux_usbfs.h b/Platform/Android/jni/External/libusb-1.0.8/libusb/os/linux_usbfs.h
new file mode 100644
index 0000000..e311caf
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/os/linux_usbfs.h
@@ -0,0 +1,138 @@
+/*
+ * usbfs header structures
+ * Copyright (C) 2007 Daniel Drake <dsd at gentoo.org>
+ * Copyright (c) 2001 Johannes Erdfelt <johannes at erdfelt.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __LIBUSB_USBFS_H__
+#define __LIBUSB_USBFS_H__
+
+#define SYSFS_DEVICE_PATH "/sys/bus/usb/devices"
+
+struct usbfs_ctrltransfer {
+	/* keep in sync with usbdevice_fs.h:usbdevfs_ctrltransfer */
+	uint8_t  bmRequestType;
+	uint8_t  bRequest;
+	uint16_t wValue;
+	uint16_t wIndex;
+	uint16_t wLength;
+
+	uint32_t timeout;	/* in milliseconds */
+
+	/* pointer to data */
+	void *data;
+};
+
+struct usbfs_bulktransfer {
+	/* keep in sync with usbdevice_fs.h:usbdevfs_bulktransfer */
+	unsigned int ep;
+	unsigned int len;
+	unsigned int timeout;	/* in milliseconds */
+
+	/* pointer to data */
+	void *data;
+};
+
+struct usbfs_setinterface {
+	/* keep in sync with usbdevice_fs.h:usbdevfs_setinterface */
+	unsigned int interface;
+	unsigned int altsetting;
+};
+
+#define USBFS_MAXDRIVERNAME 255
+
+struct usbfs_getdriver {
+	unsigned int interface;
+	char driver[USBFS_MAXDRIVERNAME + 1];
+};
+
+#define USBFS_URB_SHORT_NOT_OK		0x01
+#define USBFS_URB_ISO_ASAP			0x02
+#define USBFS_URB_BULK_CONTINUATION	0x04
+#define USBFS_URB_QUEUE_BULK		0x10
+
+enum usbfs_urb_type {
+	USBFS_URB_TYPE_ISO = 0,
+	USBFS_URB_TYPE_INTERRUPT = 1,
+	USBFS_URB_TYPE_CONTROL = 2,
+	USBFS_URB_TYPE_BULK = 3,
+};
+
+struct usbfs_iso_packet_desc {
+	unsigned int length;
+	unsigned int actual_length;
+	unsigned int status;
+};
+
+#define MAX_ISO_BUFFER_LENGTH		32768
+#define MAX_BULK_BUFFER_LENGTH		16384
+#define MAX_CTRL_BUFFER_LENGTH		4096
+
+struct usbfs_urb {
+	unsigned char type;
+	unsigned char endpoint;
+	int status;
+	unsigned int flags;
+	void *buffer;
+	int buffer_length;
+	int actual_length;
+	int start_frame;
+	int number_of_packets;
+	int error_count;
+	unsigned int signr;
+	void *usercontext;
+	struct usbfs_iso_packet_desc iso_frame_desc[0];
+};
+
+struct usbfs_connectinfo {
+	unsigned int devnum;
+	unsigned char slow;
+};
+
+struct usbfs_ioctl {
+	int ifno;	/* interface 0..N ; negative numbers reserved */
+	int ioctl_code;	/* MUST encode size + direction of data so the
+			 * macros in <asm/ioctl.h> give correct values */
+	void *data;	/* param buffer (in, or out) */
+};
+
+struct usbfs_hub_portinfo {
+	unsigned char numports;
+	unsigned char port[127];	/* port to device num mapping */
+};
+
+#define IOCTL_USBFS_CONTROL	_IOWR('U', 0, struct usbfs_ctrltransfer)
+#define IOCTL_USBFS_BULK		_IOWR('U', 2, struct usbfs_bulktransfer)
+#define IOCTL_USBFS_RESETEP	_IOR('U', 3, unsigned int)
+#define IOCTL_USBFS_SETINTF	_IOR('U', 4, struct usbfs_setinterface)
+#define IOCTL_USBFS_SETCONFIG	_IOR('U', 5, unsigned int)
+#define IOCTL_USBFS_GETDRIVER	_IOW('U', 8, struct usbfs_getdriver)
+#define IOCTL_USBFS_SUBMITURB	_IOR('U', 10, struct usbfs_urb)
+#define IOCTL_USBFS_DISCARDURB	_IO('U', 11)
+#define IOCTL_USBFS_REAPURB	_IOW('U', 12, void *)
+#define IOCTL_USBFS_REAPURBNDELAY	_IOW('U', 13, void *)
+#define IOCTL_USBFS_CLAIMINTF	_IOR('U', 15, unsigned int)
+#define IOCTL_USBFS_RELEASEINTF	_IOR('U', 16, unsigned int)
+#define IOCTL_USBFS_CONNECTINFO	_IOW('U', 17, struct usbfs_connectinfo)
+#define IOCTL_USBFS_IOCTL         _IOWR('U', 18, struct usbfs_ioctl)
+#define IOCTL_USBFS_HUB_PORTINFO	_IOR('U', 19, struct usbfs_hub_portinfo)
+#define IOCTL_USBFS_RESET		_IO('U', 20)
+#define IOCTL_USBFS_CLEAR_HALT	_IOR('U', 21, unsigned int)
+#define IOCTL_USBFS_DISCONNECT	_IO('U', 22)
+#define IOCTL_USBFS_CONNECT	_IO('U', 23)
+
+#endif
diff --git a/Platform/Android/jni/External/libusb-1.0.8/libusb/sync.c b/Platform/Android/jni/External/libusb-1.0.8/libusb/sync.c
new file mode 100644
index 0000000..f66de90
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/libusb/sync.c
@@ -0,0 +1,311 @@
+/*
+ * Synchronous I/O functions for libusb
+ * Copyright (C) 2007-2008 Daniel Drake <dsd at gentoo.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libusbi.h"
+
+/**
+ * @defgroup syncio Synchronous device I/O
+ *
+ * This page documents libusb's synchronous (blocking) API for USB device I/O.
+ * This interface is easy to use but has some limitations. More advanced users
+ * may wish to consider using the \ref asyncio "asynchronous I/O API" instead.
+ */
+
+static void ctrl_transfer_cb(struct libusb_transfer *transfer)
+{
+	int *completed = transfer->user_data;
+	*completed = 1;
+	usbi_dbg("actual_length=%d", transfer->actual_length);
+	/* caller interprets result and frees transfer */
+}
+
+/** \ingroup syncio
+ * Perform a USB control transfer.
+ *
+ * The direction of the transfer is inferred from the bmRequestType field of
+ * the setup packet.
+ *
+ * The wValue, wIndex and wLength fields values should be given in host-endian
+ * byte order.
+ *
+ * \param dev_handle a handle for the device to communicate with
+ * \param bmRequestType the request type field for the setup packet
+ * \param bRequest the request field for the setup packet
+ * \param wValue the value field for the setup packet
+ * \param wIndex the index field for the setup packet
+ * \param data a suitably-sized data buffer for either input or output
+ * (depending on direction bits within bmRequestType)
+ * \param wLength the length field for the setup packet. The data buffer should
+ * be at least this size.
+ * \param timeout timeout (in millseconds) that this function should wait
+ * before giving up due to no response being received. For an unlimited
+ * timeout, use value 0.
+ * \returns on success, the number of bytes actually transferred
+ * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out
+ * \returns LIBUSB_ERROR_PIPE if the control request was not supported by the
+ * device
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failures
+ */
+API_EXPORTED int libusb_control_transfer(libusb_device_handle *dev_handle,
+	uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
+	unsigned char *data, uint16_t wLength, unsigned int timeout)
+{
+	struct libusb_transfer *transfer = libusb_alloc_transfer(0);
+	unsigned char *buffer;
+	int completed = 0;
+	int r;
+
+	if (!transfer)
+		return LIBUSB_ERROR_NO_MEM;
+	
+	buffer = malloc(LIBUSB_CONTROL_SETUP_SIZE + wLength);
+	if (!buffer) {
+		libusb_free_transfer(transfer);
+		return LIBUSB_ERROR_NO_MEM;
+	}
+
+	libusb_fill_control_setup(buffer, bmRequestType, bRequest, wValue, wIndex,
+		wLength);
+	if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)
+		memcpy(buffer + LIBUSB_CONTROL_SETUP_SIZE, data, wLength);
+
+	libusb_fill_control_transfer(transfer, dev_handle, buffer,
+		ctrl_transfer_cb, &completed, timeout);
+	transfer->flags = LIBUSB_TRANSFER_FREE_BUFFER;
+	r = libusb_submit_transfer(transfer);
+	if (r < 0) {
+		libusb_free_transfer(transfer);
+		return r;
+	}
+
+	while (!completed) {
+		r = libusb_handle_events(HANDLE_CTX(dev_handle));
+		if (r < 0) {
+			if (r == LIBUSB_ERROR_INTERRUPTED)
+				continue;
+			libusb_cancel_transfer(transfer);
+			while (!completed)
+				if (libusb_handle_events(HANDLE_CTX(dev_handle)) < 0)
+					break;
+			libusb_free_transfer(transfer);
+			return r;
+		}
+	}
+
+	if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)
+		memcpy(data, libusb_control_transfer_get_data(transfer),
+			transfer->actual_length);
+
+	switch (transfer->status) {
+	case LIBUSB_TRANSFER_COMPLETED:
+		r = transfer->actual_length;
+		break;
+	case LIBUSB_TRANSFER_TIMED_OUT:
+		r = LIBUSB_ERROR_TIMEOUT;
+		break;
+	case LIBUSB_TRANSFER_STALL:
+		r = LIBUSB_ERROR_PIPE;
+		break;
+	case LIBUSB_TRANSFER_NO_DEVICE:
+		r = LIBUSB_ERROR_NO_DEVICE;
+		break;
+	default:
+		usbi_warn(HANDLE_CTX(dev_handle),
+			"unrecognised status code %d", transfer->status);
+		r = LIBUSB_ERROR_OTHER;
+	}
+
+	libusb_free_transfer(transfer);
+	return r;
+}
+
+static void bulk_transfer_cb(struct libusb_transfer *transfer)
+{
+	int *completed = transfer->user_data;
+	*completed = 1;
+	usbi_dbg("actual_length=%d", transfer->actual_length);
+	/* caller interprets results and frees transfer */
+}
+
+static int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle,
+	unsigned char endpoint, unsigned char *buffer, int length,
+	int *transferred, unsigned int timeout, unsigned char type)
+{
+	struct libusb_transfer *transfer = libusb_alloc_transfer(0);
+	int completed = 0;
+	int r;
+
+	if (!transfer)
+		return LIBUSB_ERROR_NO_MEM;
+
+	libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, length,
+		bulk_transfer_cb, &completed, timeout);
+	transfer->type = type;
+
+	r = libusb_submit_transfer(transfer);
+	if (r < 0) {
+		libusb_free_transfer(transfer);
+		return r;
+	}
+
+	while (!completed) {
+		r = libusb_handle_events(HANDLE_CTX(dev_handle));
+		if (r < 0) {
+			if (r == LIBUSB_ERROR_INTERRUPTED)
+				continue;
+			libusb_cancel_transfer(transfer);
+			while (!completed)
+				if (libusb_handle_events(HANDLE_CTX(dev_handle)) < 0)
+					break;
+			libusb_free_transfer(transfer);
+			return r;
+		}
+	}
+
+	*transferred = transfer->actual_length;
+	switch (transfer->status) {
+	case LIBUSB_TRANSFER_COMPLETED:
+		r = 0;
+		break;
+	case LIBUSB_TRANSFER_TIMED_OUT:
+		r = LIBUSB_ERROR_TIMEOUT;
+		break;
+	case LIBUSB_TRANSFER_STALL:
+		r = LIBUSB_ERROR_PIPE;
+		break;
+	case LIBUSB_TRANSFER_OVERFLOW:
+		r = LIBUSB_ERROR_OVERFLOW;
+		break;
+	case LIBUSB_TRANSFER_NO_DEVICE:
+		r = LIBUSB_ERROR_NO_DEVICE;
+		break;
+	default:
+		usbi_warn(HANDLE_CTX(dev_handle),
+			"unrecognised status code %d", transfer->status);
+		r = LIBUSB_ERROR_OTHER;
+	}
+
+	libusb_free_transfer(transfer);
+	return r;
+}
+
+/** \ingroup syncio
+ * Perform a USB bulk transfer. The direction of the transfer is inferred from
+ * the direction bits of the endpoint address.
+ *
+ * For bulk reads, the <tt>length</tt> field indicates the maximum length of
+ * data you are expecting to receive. If less data arrives than expected,
+ * this function will return that data, so be sure to check the
+ * <tt>transferred</tt> output parameter.
+ *
+ * You should also check the <tt>transferred</tt> parameter for bulk writes.
+ * Not all of the data may have been written.
+ *
+ * Also check <tt>transferred</tt> when dealing with a timeout error code.
+ * libusb may have to split your transfer into a number of chunks to satisfy
+ * underlying O/S requirements, meaning that the timeout may expire after
+ * the first few chunks have completed. libusb is careful not to lose any data
+ * that may have been transferred; do not assume that timeout conditions
+ * indicate a complete lack of I/O.
+ *
+ * \param dev_handle a handle for the device to communicate with
+ * \param endpoint the address of a valid endpoint to communicate with
+ * \param data a suitably-sized data buffer for either input or output
+ * (depending on endpoint)
+ * \param length for bulk writes, the number of bytes from data to be sent. for
+ * bulk reads, the maximum number of bytes to receive into the data buffer.
+ * \param transferred output location for the number of bytes actually
+ * transferred.
+ * \param timeout timeout (in millseconds) that this function should wait
+ * before giving up due to no response being received. For an unlimited
+ * timeout, use value 0.
+ *
+ * \returns 0 on success (and populates <tt>transferred</tt>)
+ * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out (and populates
+ * <tt>transferred</tt>)
+ * \returns LIBUSB_ERROR_PIPE if the endpoint halted
+ * \returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see
+ * \ref packetoverflow
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other failures
+ */
+API_EXPORTED int libusb_bulk_transfer(struct libusb_device_handle *dev_handle,
+	unsigned char endpoint, unsigned char *data, int length, int *transferred,
+	unsigned int timeout)
+{
+	return do_sync_bulk_transfer(dev_handle, endpoint, data, length,
+		transferred, timeout, LIBUSB_TRANSFER_TYPE_BULK);
+}
+
+/** \ingroup syncio
+ * Perform a USB interrupt transfer. The direction of the transfer is inferred
+ * from the direction bits of the endpoint address.
+ *
+ * For interrupt reads, the <tt>length</tt> field indicates the maximum length
+ * of data you are expecting to receive. If less data arrives than expected,
+ * this function will return that data, so be sure to check the
+ * <tt>transferred</tt> output parameter.
+ *
+ * You should also check the <tt>transferred</tt> parameter for interrupt
+ * writes. Not all of the data may have been written.
+ *
+ * Also check <tt>transferred</tt> when dealing with a timeout error code.
+ * libusb may have to split your transfer into a number of chunks to satisfy
+ * underlying O/S requirements, meaning that the timeout may expire after
+ * the first few chunks have completed. libusb is careful not to lose any data
+ * that may have been transferred; do not assume that timeout conditions
+ * indicate a complete lack of I/O.
+ *
+ * The default endpoint bInterval value is used as the polling interval.
+ *
+ * \param dev_handle a handle for the device to communicate with
+ * \param endpoint the address of a valid endpoint to communicate with
+ * \param data a suitably-sized data buffer for either input or output
+ * (depending on endpoint)
+ * \param length for bulk writes, the number of bytes from data to be sent. for
+ * bulk reads, the maximum number of bytes to receive into the data buffer.
+ * \param transferred output location for the number of bytes actually
+ * transferred.
+ * \param timeout timeout (in millseconds) that this function should wait
+ * before giving up due to no response being received. For an unlimited
+ * timeout, use value 0.
+ *
+ * \returns 0 on success (and populates <tt>transferred</tt>)
+ * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out
+ * \returns LIBUSB_ERROR_PIPE if the endpoint halted
+ * \returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see
+ * \ref packetoverflow
+ * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
+ * \returns another LIBUSB_ERROR code on other error
+ */
+API_EXPORTED int libusb_interrupt_transfer(
+	struct libusb_device_handle *dev_handle, unsigned char endpoint,
+	unsigned char *data, int length, int *transferred, unsigned int timeout)
+{
+	return do_sync_bulk_transfer(dev_handle, endpoint, data, length,
+		transferred, timeout, LIBUSB_TRANSFER_TYPE_INTERRUPT);
+}
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/ltmain.sh b/Platform/Android/jni/External/libusb-1.0.8/ltmain.sh
new file mode 100644
index 0000000..316484d
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/ltmain.sh
@@ -0,0 +1,8406 @@
+# Generated from ltmain.m4sh.
+
+# ltmain.sh (GNU libtool) 2.2.6b
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+#     --config             show all configuration variables
+#     --debug              enable verbose shell tracing
+# -n, --dry-run            display commands without modifying any files
+#     --features           display basic configuration information and exit
+#     --mode=MODE          use operation mode MODE
+#     --preserve-dup-deps  don't remove duplicate dependency libraries
+#     --quiet, --silent    don't print informational messages
+#     --tag=TAG            use configuration variables from tag TAG
+# -v, --verbose            print informational messages (default)
+#     --version            print version information
+# -h, --help               print short or long help message
+#
+# MODE must be one of the following:
+#
+#       clean              remove files from the build directory
+#       compile            compile a source file into a libtool object
+#       execute            automatically set library path, then run a program
+#       finish             complete the installation of libtool libraries
+#       install            install libraries or executables
+#       link               create a library or an executable
+#       uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#       host-triplet:	$host
+#       shell:		$SHELL
+#       compiler:		$LTCC
+#       compiler flags:		$LTCFLAGS
+#       linker:		$LD (gnu? $with_gnu_ld)
+#       $progname:		(GNU libtool) 2.2.6b
+#       automake:		$automake_version
+#       autoconf:		$autoconf_version
+#
+# Report bugs to <bug-libtool at gnu.org>.
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=2.2.6b
+TIMESTAMP=""
+package_revision=1.3017
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# NLS nuisances: We save the old values to restore during execute mode.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+          save_$lt_var=\$$lt_var
+          $lt_var=C
+	  export $lt_var
+	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+	fi"
+done
+
+$lt_unset CDPATH
+
+
+
+
+
+: ${CP="cp -f"}
+: ${ECHO="echo"}
+: ${EGREP="/bin/grep -E"}
+: ${FGREP="/bin/grep -F"}
+: ${GREP="/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/bin/sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" 	$lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+# Generated shell functions inserted here.
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+# In the unlikely event $progname began with a '-', it would play havoc with
+# func_echo (imagine progname=-n), so we prepend ./ in that case:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+case $progname in
+  -*) progname=./$progname ;;
+esac
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=:
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname${mode+: }$mode: $*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+
+    # bash bug again:
+    :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+	IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$opt_dry_run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+    fi
+
+    $ECHO "X$my_tmpdir" | $Xsed
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+    case $1 in
+      *[\\\`\"\$]*)
+	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+    esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    case $1 in
+      *[\\\`\"]*)
+	my_arg=`$ECHO "X$1" | $Xsed \
+	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        my_arg="$1" ;;
+    esac
+
+    case $my_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        my_arg="\"$my_arg\""
+        ;;
+    esac
+
+    func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+	    $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+	s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $SED -n '/^# Usage:/,/# -h/ {
+        s/^# //
+	s/^# *$//
+	s/\$progname/'$progname'/
+	p
+    }' < "$progpath"
+    $ECHO
+    $ECHO "run \`$progname --help | more' for full usage"
+    exit $?
+}
+
+# func_help
+# Echo long help message to standard output and exit.
+func_help ()
+{
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+        s/^# //
+	s/^# *$//
+	s*\$progname*'$progname'*
+	s*\$host*'"$host"'*
+	s*\$SHELL*'"$SHELL"'*
+	s*\$LTCC*'"$LTCC"'*
+	s*\$LTCFLAGS*'"$LTCFLAGS"'*
+	s*\$LD*'"$LD"'*
+	s/\$with_gnu_ld/'"$with_gnu_ld"'/
+	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+	p
+     }' < "$progpath"
+    exit $?
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    func_error "missing argument for $1"
+    exit_cmd=exit
+}
+
+exit_cmd=:
+
+
+
+
+
+# Check that we have a working $ECHO.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+  # Yippee, $ECHO works!
+  :
+else
+  # Restart under the correct shell, and then maybe $ECHO will work.
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit $EXIT_SUCCESS
+fi
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+    done
+
+    exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+    $ECHO "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      $ECHO "enable shared libraries"
+    else
+      $ECHO "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      $ECHO "enable static libraries"
+    else
+      $ECHO "disable static libraries"
+    fi
+
+    exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+  # Global variable:
+  tagname="$1"
+
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
+      ;;
+  esac
+
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
+    *)
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	taglist="$taglist $tagname"
+
+	# Evaluate the configuration.  Be careful to quote the path
+	# and the sed script, to avoid splitting on whitespace, but
+	# also don't use non-portable quotes within backquotes within
+	# quotes we have to do it in 2 steps:
+	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	eval "$extractedcf"
+      else
+	func_error "ignoring unknown tag $tagname"
+      fi
+      ;;
+  esac
+}
+
+# Parse options once, thoroughly.  This comes as soon as possible in
+# the script to make things like `libtool --version' happen quickly.
+{
+
+  # Shorthand for --mode=foo, only valid as the first argument
+  case $1 in
+  clean|clea|cle|cl)
+    shift; set dummy --mode clean ${1+"$@"}; shift
+    ;;
+  compile|compil|compi|comp|com|co|c)
+    shift; set dummy --mode compile ${1+"$@"}; shift
+    ;;
+  execute|execut|execu|exec|exe|ex|e)
+    shift; set dummy --mode execute ${1+"$@"}; shift
+    ;;
+  finish|finis|fini|fin|fi|f)
+    shift; set dummy --mode finish ${1+"$@"}; shift
+    ;;
+  install|instal|insta|inst|ins|in|i)
+    shift; set dummy --mode install ${1+"$@"}; shift
+    ;;
+  link|lin|li|l)
+    shift; set dummy --mode link ${1+"$@"}; shift
+    ;;
+  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+    shift; set dummy --mode uninstall ${1+"$@"}; shift
+    ;;
+  esac
+
+  # Parse non-mode specific arguments:
+  while test "$#" -gt 0; do
+    opt="$1"
+    shift
+
+    case $opt in
+      --config)		func_config					;;
+
+      --debug)		preserve_args="$preserve_args $opt"
+			func_echo "enabling shell trace mode"
+			opt_debug='set -x'
+			$opt_debug
+			;;
+
+      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			execute_dlfiles="$execute_dlfiles $1"
+			shift
+			;;
+
+      --dry-run | -n)	opt_dry_run=:					;;
+      --features)       func_features					;;
+      --finish)		mode="finish"					;;
+
+      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			case $1 in
+			  # Valid mode arguments:
+			  clean)	;;
+			  compile)	;;
+			  execute)	;;
+			  finish)	;;
+			  install)	;;
+			  link)		;;
+			  relink)	;;
+			  uninstall)	;;
+
+			  # Catch anything else as an error
+			  *) func_error "invalid argument for $opt"
+			     exit_cmd=exit
+			     break
+			     ;;
+		        esac
+
+			mode="$1"
+			shift
+			;;
+
+      --preserve-dup-deps)
+			opt_duplicate_deps=:				;;
+
+      --quiet|--silent)	preserve_args="$preserve_args $opt"
+			opt_silent=:
+			;;
+
+      --verbose| -v)	preserve_args="$preserve_args $opt"
+			opt_silent=false
+			;;
+
+      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			preserve_args="$preserve_args $opt $1"
+			func_enable_tag "$1"	# tagname is set here
+			shift
+			;;
+
+      # Separate optargs to long options:
+      -dlopen=*|--mode=*|--tag=*)
+			func_opt_split "$opt"
+			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+			shift
+			;;
+
+      -\?|-h)		func_usage					;;
+      --help)		opt_help=:					;;
+      --version)	func_version					;;
+
+      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
+
+      *)		nonopt="$opt"
+			break
+			;;
+    esac
+  done
+
+
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
+      ;;
+    *)
+      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+      ;;
+  esac
+
+  # Having warned about all mis-specified options, bail out if
+  # anything was wrong.
+  $exit_cmd $EXIT_FAILURE
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      fi
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+$opt_help || {
+  # Sanity checks first:
+  func_check_version_match
+
+  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+    func_fatal_configuration "not configured to build any kind of library"
+  fi
+
+  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+
+
+  # Darwin sucks
+  eval std_shrext=\"$shrext_cmds\"
+
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    func_error "unrecognized option \`-dlopen'"
+    $ECHO "$help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$progname --help --mode=$mode' for more information."
+}
+
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+	for lalib_p_l in 1 2 3 4
+	do
+	    read lalib_p_line
+	    case "$lalib_p_line" in
+		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+	    esac
+	done
+	exec 0<&5 5<&-
+    fi
+    test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_ltwrapper_scriptname_result=""
+    if func_ltwrapper_executable_p "$1"; then
+	func_dirname_and_basename "$1" "" "."
+	func_stripname '' '.exe' "$func_basename_result"
+	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    fi
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $opt_debug
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$save_ifs
+      eval cmd=\"$cmd\"
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)	. "$1" ;;
+    *)		. "./$1" ;;
+    esac
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $opt_debug
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+        func_quote_for_eval "$arg"
+	CC_quoted="$CC_quoted $func_quote_for_eval_result"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	      # Double-quote args containing other shell metacharacters.
+	      func_quote_for_eval "$arg"
+	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
+	    done
+	    case "$@ " in
+	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  func_echo "unable to infer tagged configuration"
+	  func_fatal_error "specify a tag with \`--tag'"
+#	else
+#	  func_verbose "using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
+    else
+      write_lobj=none
+    fi
+
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "${write_libobj}"
+    }
+}
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $opt_debug
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
+	;;
+
+      target )
+	libobj="$arg"
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  test -n "$libobj" && \
+	    func_fatal_error "you cannot specify \`-o' more than once"
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-pie | -fpie | -fPIE)
+          pie_flag="$pie_flag $arg"
+	  continue
+	  ;;
+
+	-shared | -static | -prefer-pic | -prefer-non-pic)
+	  later="$later $arg"
+	  continue
+	  ;;
+
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  func_stripname '-Wc,' '' "$arg"
+	  args=$func_stripname_result
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+	  for arg in $args; do
+	    IFS="$save_ifs"
+	    func_quote_for_eval "$arg"
+	    lastarg="$lastarg $func_quote_for_eval_result"
+	  done
+	  IFS="$save_ifs"
+	  func_stripname ' ' '' "$lastarg"
+	  lastarg=$func_stripname_result
+
+	  # Add the arguments to base_compile.
+	  base_compile="$base_compile $lastarg"
+	  continue
+	  ;;
+
+	*)
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      func_quote_for_eval "$lastarg"
+      base_compile="$base_compile $func_quote_for_eval_result"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with \`-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+	func_basename "$srcfile"
+	libobj="$func_basename_result"
+      }
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
+
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	continue
+	;;
+
+      -static)
+	build_libtool_libs=no
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+      esac
+    done
+
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
+    lobj=${xdir}$objdir/$objname
+
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+      removelist="$removelist $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
+    fi
+
+    $opt_dry_run || $RM $removelist
+    removelist="$removelist $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $qsrcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      fi
+
+      func_mkdir_p "$xdir$objdir"
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	command="$command -o $lobj"
+      fi
+
+      func_show_eval_locale "$command"	\
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	func_show_eval '$MV "$output_obj" "$lobj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+	suppress_output=' >/dev/null 2>&1'
+      fi
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $qsrcfile$pie_flag"
+      else
+	command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	func_show_eval '$MV "$output_obj" "$obj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test "$need_locks" != no; then
+	removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+test "$mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode \`$mode'"
+        ;;
+    esac
+
+    $ECHO
+    $ECHO "Try \`$progname --help' for more information about other modes."
+
+    exit $?
+}
+
+  # Now that we've collected a possible --mode arg, show help if necessary
+  $opt_help && func_mode_help
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $opt_debug
+    # The first argument is the command name.
+    cmd="$nonopt"
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      test -f "$file" \
+	|| func_fatal_help "\`$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+	func_source "$file"
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && \
+	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
+	else
+	  if test ! -f "$dir/$dlname"; then
+	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+	;;
+
+      *)
+	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if func_ltwrapper_script_p "$file"; then
+	  func_source "$file"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	elif func_ltwrapper_executable_p "$file"; then
+	  func_ltwrapper_scriptname "$file"
+	  func_source "$func_ltwrapper_scriptname_result"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_quote_for_eval "$file"
+      args="$args $func_quote_for_eval_result"
+    done
+
+    if test "X$opt_dry_run" = Xfalse; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+	eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+	      else
+		$lt_unset $lt_var
+	      fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	$ECHO "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $opt_debug
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    $opt_silent && exit $EXIT_SUCCESS
+
+    $ECHO "X----------------------------------------------------------------------" | $Xsed
+    $ECHO "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $ECHO "   $libdir"
+    done
+    $ECHO
+    $ECHO "If you ever happen to want to link against installed libraries"
+    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
+    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $ECHO "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $ECHO "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $ECHO "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $ECHO "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $ECHO "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $ECHO
+
+    $ECHO "See any operating system documentation about shared libraries for"
+    case $host in
+      solaris2.[6789]|solaris2.1[0-9])
+        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	$ECHO "pages."
+	;;
+      *)
+        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
+        ;;
+    esac
+    $ECHO "X----------------------------------------------------------------------" | $Xsed
+    exit $EXIT_SUCCESS
+}
+
+test "$mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $opt_debug
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    install_prog="$install_prog$func_quote_for_eval_result"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f)
+	case " $install_prog " in
+	*[\\\ /]cp\ *) ;;
+	*) prev=$arg ;;
+	esac
+	;;
+      -g | -m | -o)
+	prev=$arg
+	;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      install_prog="$install_prog $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prev' option requires an argument"
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	func_fatal_help "no file or destination specified"
+      else
+	func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+	func_fatal_help "\`$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$file' is not a valid libtool archive"
+
+	library_names=
+	old_library=
+	relink_command=
+	func_source "$file"
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	func_dirname "$file" "/" ""
+	dir="$func_dirname_result"
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  test "$inst_prefix_dir" = "$destdir" && \
+	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  func_warning "relinking \`$file'"
+	  func_show_eval "$relink_command" \
+	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names; shift
+	if test -n "$1"; then
+	  realname="$1"
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+	      'exit $?'
+	  tstripme="$stripme"
+	  case $host_os in
+	  cygwin* | mingw* | pw32* | cegcc*)
+	    case $realname in
+	    *.dll.a)
+	      tstripme=""
+	      ;;
+	    esac
+	    ;;
+	  esac
+	  if test -n "$tstripme" && test -n "$striplib"; then
+	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      test "$linkname" != "$realname" \
+		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  func_execute_cmds "$postinstall_cmds" 'exit $?'
+	fi
+
+	# Install the pseudo-library for information purposes.
+	func_basename "$file"
+	name="$func_basename_result"
+	instname="$dir/$name"i
+	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  func_lo2o "$destfile"
+	  staticdest=$func_lo2o_result
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	test -n "$destfile" && \
+	  func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  func_lo2o "$file"
+	  staticobj=$func_lo2o_result
+	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      func_stripname '' '.exe' "$file"
+	      file=$func_stripname_result
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin* | *mingw*)
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      wrapper=$func_ltwrapper_scriptname_result
+	    else
+	      func_stripname '' '.exe' "$file"
+	      wrapper=$func_stripname_result
+	    fi
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if func_ltwrapper_script_p "$wrapper"; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  func_source "$wrapper"
+
+	  # Check the variables that should have been set.
+	  test -z "$generated_by_libtool_version" && \
+	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      func_source "$lib"
+	    fi
+	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      func_warning "\`$lib' has not been installed in \`$libdir'"
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  func_source "$wrapper"
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    $opt_dry_run || {
+	      if test "$finalize" = yes; then
+	        tmpdir=`func_mktempdir`
+		func_basename "$file$stripped_ext"
+		file="$func_basename_result"
+	        outputname="$tmpdir/$file"
+	        # Replace the output file specification.
+	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	        $opt_silent || {
+	          func_quote_for_expand "$relink_command"
+		  eval "func_echo $func_quote_for_expand_result"
+	        }
+	        if eval "$relink_command"; then :
+	          else
+		  func_error "error: relink \`$file' with the above command before installing it"
+		  $opt_dry_run || ${RM}r "$tmpdir"
+		  continue
+	        fi
+	        file="$outputname"
+	      else
+	        func_warning "cannot relink \`$file'"
+	      fi
+	    }
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    func_stripname '' '.exe' "$destfile"
+	    destfile=$func_stripname_result
+	    ;;
+	  esac
+	  ;;
+	esac
+	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+	$opt_dry_run || if test -n "$outputname"; then
+	  ${RM}r "$tmpdir"
+	fi
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name="$func_basename_result"
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	func_show_eval "$old_striplib $oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	my_dlsyms="${my_outputname}S.c"
+      else
+	func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+	# Discover the nlist of each of the dlfiles.
+	nlist="$output_objdir/${my_outputname}.nm"
+
+	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+	# Parse the name list into a source file.
+	func_verbose "creating $output_objdir/$my_dlsyms"
+
+	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+	if test "$dlself" = yes; then
+	  func_verbose "generating symbol list for \`$output'"
+
+	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+	  # Add our own program objects to the symbol list.
+	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	  for progfile in $progfiles; do
+	    func_verbose "extracting global C symbols from \`$progfile'"
+	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -n "$exclude_expsyms"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  if test -n "$export_symbols_regex"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  # Prepare the list of exported symbols
+	  if test -z "$export_symbols"; then
+	    export_symbols="$output_objdir/$outputname.exp"
+	    $opt_dry_run || {
+	      $RM $export_symbols
+	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      case $host in
+	      *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+	        ;;
+	      esac
+	    }
+	  else
+	    $opt_dry_run || {
+	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	      case $host in
+	        *cygwin | *mingw* | *cegcc* )
+	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+	          ;;
+	      esac
+	    }
+	  fi
+	fi
+
+	for dlprefile in $dlprefiles; do
+	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_basename "$dlprefile"
+	  name="$func_basename_result"
+	  $opt_dry_run || {
+	    eval '$ECHO ": $name " >> "$nlist"'
+	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	  }
+	done
+
+	$opt_dry_run || {
+	  # Make sure we have at least an empty file.
+	  test -f "$nlist" || : > "$nlist"
+
+	  if test -n "$exclude_expsyms"; then
+	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	    $MV "$nlist"T "$nlist"
+	  fi
+
+	  # Try sorting and uniquifying the output.
+	  if $GREP -v "^: " < "$nlist" |
+	      if sort -k 3 </dev/null >/dev/null 2>&1; then
+		sort -k 3
+	      else
+		sort +2
+	      fi |
+	      uniq > "$nlist"S; then
+	    :
+	  else
+	    $GREP -v "^: " < "$nlist" > "$nlist"S
+	  fi
+
+	  if test -f "$nlist"S; then
+	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+	  else
+	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	  fi
+
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+"
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc* )
+	    $ECHO >> "$output_objdir/$my_dlsyms" "\
+/* DATA imports from DLLs on WIN32 con't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs.  */"
+	    lt_dlsym_const= ;;
+	  *osf5*)
+	    echo >> "$output_objdir/$my_dlsyms" "\
+/* This system does not cope well with relocations in const data */"
+	    lt_dlsym_const= ;;
+	  *)
+	    lt_dlsym_const=const ;;
+	  esac
+
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+extern $lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+$lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+  { \"$my_originator\", (void *) 0 },"
+
+	  case $need_lib_prefix in
+	  no)
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  *)
+	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  esac
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	} # !$opt_dry_run
+
+	pic_flag_for_symtable=
+	case "$compile_command " in
+	*" -static "*) ;;
+	*)
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+	  *-*-hpux*)
+	    pic_flag_for_symtable=" $pic_flag"  ;;
+	  *)
+	    if test "X$my_pic_p" != Xno; then
+	      pic_flag_for_symtable=" $pic_flag"
+	    fi
+	    ;;
+	  esac
+	  ;;
+	esac
+	symtab_cflags=
+	for arg in $LTCFLAGS; do
+	  case $arg in
+	  -pie | -fpie | -fPIE) ;;
+	  *) symtab_cflags="$symtab_cflags $arg" ;;
+	  esac
+	done
+
+	# Now compile the dynamic symbol file.
+	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+	# Clean up the generated files.
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+	# Transform the symbol file into the correct name.
+	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	case $host in
+	*cygwin* | *mingw* | *cegcc* )
+	  if test -f "$output_objdir/$my_outputname.def"; then
+	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	  else
+	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  fi
+	  ;;
+	*)
+	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  ;;
+	esac
+	;;
+      *)
+	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+  $opt_debug
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 |
+	$SED -n -e '
+	    1,100{
+		/ I /{
+		    s,.*,import,
+		    p
+		    q
+		}
+	    }'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $opt_debug
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib="$func_basename_result"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+	*" $my_xlib_u "*)
+	  func_arith $extracted_serial + 1
+	  extracted_serial=$func_arith_result
+	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
+	*) break ;;
+	esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+	func_verbose "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	$opt_dry_run || {
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`basename "$darwin_archive"`
+	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+	  if test -n "$darwin_arches"; then
+	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      $LIPO -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    $RM -rf unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd $darwin_orig_dir
+	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	} # !$opt_dry_run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+	;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+
+    func_extract_archives_result="$my_oldobjs"
+}
+
+
+
+# func_emit_wrapper_part1 [arg=no]
+#
+# Emit the first part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part1 ()
+{
+	func_emit_wrapper_part1_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_part1_arg1=$1
+	fi
+
+	$ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    ECHO=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$ECHO works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$ECHO will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$ECHO "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+"
+}
+# end: func_emit_wrapper_part1
+
+# func_emit_wrapper_part2 [arg=no]
+#
+# Emit the second part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part2 ()
+{
+	func_emit_wrapper_part2_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_part2_arg1=$1
+	fi
+
+	$ECHO "\
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+	  $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$ECHO \"\$relink_command_output\" >&2
+	$RM \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+	else
+	  $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2* | *-cegcc*)
+	  $ECHO "\
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  $ECHO "\
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+# end: func_emit_wrapper_part2
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+	func_emit_wrapper_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_arg1=$1
+	fi
+
+	# split this up so that func_emit_cwrapperexe_src
+	# can call each part independently.
+	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
+}
+
+
+# func_to_host_path arg
+#
+# Convert paths to host format when used with build tools.
+# Intended for use with "native" mingw (where libtool itself
+# is running under the msys shell), or in the following cross-
+# build environments:
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+# where wine is equipped with the `winepath' executable.
+# In the native mingw case, the (msys) shell automatically
+# converts paths for any non-msys applications it launches,
+# but that facility isn't available from inside the cwrapper.
+# Similar accommodations are necessary for $host mingw and
+# $build cygwin.  Calling this function does no harm for other
+# $host/$build combinations not listed above.
+#
+# ARG is the path (on $build) that should be converted to
+# the proper representation for $host. The result is stored
+# in $func_to_host_path_result.
+func_to_host_path ()
+{
+  func_to_host_path_result="$1"
+  if test -n "$1" ; then
+    case $host in
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        case $build in
+          *mingw* ) # actually, msys
+            # awkward: cmd appends spaces to result
+            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
+              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_path_tmp1=`cygpath -w "$1"`
+            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # Unfortunately, winepath does not exit with a non-zero
+            # error code, so we are forced to check the contents of
+            # stdout. On the other hand, if the command is not
+            # found, the shell will set an exit code of 127 and print
+            # *an error message* to stdout. So we must check for both
+            # error code of zero AND non-empty stdout, which explains
+            # the odd construction:
+            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+                $SED -e "$lt_sed_naive_backslashify"`
+            else
+              # Allow warning below.
+              func_to_host_path_result=""
+            fi
+            ;;
+        esac
+        if test -z "$func_to_host_path_result" ; then
+          func_error "Could not determine host path corresponding to"
+          func_error "  '$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback:
+          func_to_host_path_result="$1"
+        fi
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_path
+
+# func_to_host_pathlist arg
+#
+# Convert pathlists to host format when used with build tools.
+# See func_to_host_path(), above. This function supports the
+# following $build/$host combinations (but does no harm for
+# combinations not listed here):
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+#
+# Path separators are also converted from $build format to
+# $host format. If ARG begins or ends with a path separator
+# character, it is preserved (but converted to $host format)
+# on output.
+#
+# ARG is a pathlist (on $build) that should be converted to
+# the proper representation on $host. The result is stored
+# in $func_to_host_pathlist_result.
+func_to_host_pathlist ()
+{
+  func_to_host_pathlist_result="$1"
+  if test -n "$1" ; then
+    case $host in
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        # Remove leading and trailing path separator characters from
+        # ARG. msys behavior is inconsistent here, cygpath turns them
+        # into '.;' and ';.', and winepath ignores them completely.
+        func_to_host_pathlist_tmp2="$1"
+        # Once set for this call, this variable should not be
+        # reassigned. It is used in tha fallback case.
+        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
+          $SED -e 's|^:*||' -e 's|:*$||'`
+        case $build in
+          *mingw* ) # Actually, msys.
+            # Awkward: cmd appends spaces to result.
+            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
+              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
+            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # unfortunately, winepath doesn't convert pathlists
+            func_to_host_pathlist_result=""
+            func_to_host_pathlist_oldIFS=$IFS
+            IFS=:
+            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+              IFS=$func_to_host_pathlist_oldIFS
+              if test -n "$func_to_host_pathlist_f" ; then
+                func_to_host_path "$func_to_host_pathlist_f"
+                if test -n "$func_to_host_path_result" ; then
+                  if test -z "$func_to_host_pathlist_result" ; then
+                    func_to_host_pathlist_result="$func_to_host_path_result"
+                  else
+                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
+                  fi
+                fi
+              fi
+              IFS=:
+            done
+            IFS=$func_to_host_pathlist_oldIFS
+            ;;
+        esac
+        if test -z "$func_to_host_pathlist_result" ; then
+          func_error "Could not determine the host path(s) corresponding to"
+          func_error "  '$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback. This may break if $1 contains DOS-style drive
+          # specifications. The fix is not to complicate the expression
+          # below, but for the user to provide a working wine installation
+          # with winepath so that path translation in the cross-to-mingw
+          # case works properly.
+          lt_replace_pathsep_nix_to_dos="s|:|;|g"
+          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+            $SED -e "$lt_replace_pathsep_nix_to_dos"`
+        fi
+        # Now, add the leading and trailing path separators back
+        case "$1" in
+          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+            ;;
+        esac
+        case "$1" in
+          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
+            ;;
+        esac
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_pathlist
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+	cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "$SHELL $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+	    cat <<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+# define setmode _setmode
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+#  define HAVE_SETENV
+#  ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+#  endif
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+#ifdef _MSC_VER
+# define S_IXUSR _S_IEXEC
+# define stat _stat
+# ifndef _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifdef __CYGWIN__
+# define FOPEN_WB "wb"
+#endif
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#undef LTWRAPPER_DEBUGPRINTF
+#if defined DEBUGWRAPPER
+# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+static void
+ltwrapper_debugprintf (const char *fmt, ...)
+{
+    va_list args;
+    va_start (args, fmt);
+    (void) vfprintf (stderr, fmt, args);
+    va_end (args);
+}
+#else
+# define LTWRAPPER_DEBUGPRINTF(args)
+#endif
+
+const char *program_name = NULL;
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_opt_process_env_set (const char *arg);
+void lt_opt_process_env_prepend (const char *arg);
+void lt_opt_process_env_append (const char *arg);
+int lt_split_name_value (const char *arg, char** name, char** value);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+
+static const char *script_text_part1 =
+EOF
+
+	    func_emit_wrapper_part1 yes |
+	        $SED -e 's/\([\\"]\)/\\\1/g' \
+	             -e 's/^/  "/' -e 's/$/\\n"/'
+	    echo ";"
+	    cat <<EOF
+
+static const char *script_text_part2 =
+EOF
+	    func_emit_wrapper_part2 yes |
+	        $SED -e 's/\([\\"]\)/\\\1/g' \
+	             -e 's/^/  "/' -e 's/$/\\n"/'
+	    echo ";"
+
+	    cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_pathlist "$temp_rpath"
+	      cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test -n "$dllsearchpath"; then
+              func_to_host_pathlist "$dllsearchpath:"
+	      cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test "$fast_install" = yes; then
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+	    else
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+	    fi
+
+
+	    cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
+
+static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+
+static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
+static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
+  /* argument is putenv-style "foo=bar", value of foo is set to bar */
+
+static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
+static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
+  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
+
+static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
+static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
+  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  intptr_t rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
+  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+
+  /* very simple arg parsing; don't want to rely on getopt */
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], dumpscript_opt) == 0)
+	{
+EOF
+	    case "$host" in
+	      *mingw* | *cygwin* )
+		# make stdout use "unix" line endings
+		echo "          setmode(1,_O_BINARY);"
+		;;
+	      esac
+
+	    cat <<"EOF"
+	  printf ("%s", script_text_part1);
+	  printf ("%s", script_text_part2);
+	  return 0;
+	}
+    }
+
+  newargz = XMALLOC (char *, argc + 1);
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal ("Couldn't find %s", argv[0]);
+  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+			  tmp_pathspec));
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+			  actual_cwrapper_path));
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+			  target_name));
+EOF
+
+	    cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+	    cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+	    case $host_os in
+	      mingw*)
+	    cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+	*p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+	*p = '/';
+      }
+  }
+EOF
+	    ;;
+	    esac
+
+	    cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
+        {
+          if (argv[i][env_set_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_set_opt_len + 1;
+              lt_opt_process_env_set (p);
+            }
+          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_set (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_set_opt);
+          continue;
+        }
+      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
+        {
+          if (argv[i][env_prepend_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_prepend_opt_len + 1;
+              lt_opt_process_env_prepend (p);
+            }
+          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_prepend_opt);
+          continue;
+        }
+      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
+        {
+          if (argv[i][env_append_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_append_opt_len + 1;
+              lt_opt_process_env_append (p);
+            }
+          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_append (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_append_opt);
+          continue;
+        }
+      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal ("Unrecognized option in %s namespace: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+  for (i = 0; i < newargc; i++)
+    {
+      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+    }
+
+EOF
+
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+      return 127;
+    }
+  return rval;
+EOF
+		;;
+	      *)
+		cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+		;;
+	    esac
+
+	    cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+			  string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
+			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
+			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char *concat_name;
+
+  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
+			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+	return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+	{
+	  concat_name = xstrdup (wrapper);
+	  if (check_executable (concat_name))
+	    return concat_name;
+	  XFREE (concat_name);
+	}
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+	has_slash = 1;
+	break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+	{
+	  for (p = path; *p; p = p_next)
+	    {
+	      const char *q;
+	      size_t p_len;
+	      for (q = p; *q; q++)
+		if (IS_PATH_SEPARATOR (*q))
+		  break;
+	      p_len = q - p;
+	      p_next = (*q == '\0' ? q : q + 1);
+	      if (p_len == 0)
+		{
+		  /* empty path: current directory */
+		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+		    lt_fatal ("getcwd failed");
+		  tmp_len = strlen (tmp);
+		  concat_name =
+		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, tmp, tmp_len);
+		  concat_name[tmp_len] = '/';
+		  strcpy (concat_name + tmp_len + 1, wrapper);
+		}
+	      else
+		{
+		  concat_name =
+		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, p, p_len);
+		  concat_name[p_len] = '/';
+		  strcpy (concat_name + p_len + 1, wrapper);
+		}
+	      if (check_executable (concat_name))
+		return concat_name;
+	      XFREE (concat_name);
+	    }
+	}
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+			      tmp_pathspec));
+      if (lstat (tmp_pathspec, &s) == 0)
+	{
+	  if (S_ISLNK (s.st_mode) != 0)
+	    {
+	      has_symlinks = 1;
+	      break;
+	    }
+
+	  /* search backwards for last DIR_SEPARATOR */
+	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    p--;
+	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    {
+	      /* no more DIR_SEPARATORS left */
+	      break;
+	    }
+	  *p = '\0';
+	}
+      else
+	{
+	  char *errstr = strerror (errno);
+	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+	}
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal ("Could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (strcmp (str, pat) == 0)
+	*str = '\0';
+    }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char *mode,
+	       const char *message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    int len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+int
+lt_split_name_value (const char *arg, char** name, char** value)
+{
+  const char *p;
+  int len;
+  if (!arg || !*arg)
+    return 1;
+
+  p = strchr (arg, (int)'=');
+
+  if (!p)
+    return 1;
+
+  *value = xstrdup (++p);
+
+  len = strlen (arg) - strlen (*value);
+  *name = XMALLOC (char, len);
+  strncpy (*name, arg, len-1);
+  (*name)[len - 1] = '\0';
+
+  return 0;
+}
+
+void
+lt_opt_process_env_set (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
+    }
+
+  lt_setenv (name, value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_opt_process_env_prepend (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+  char *new_value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
+    }
+
+  new_value = lt_extend_str (getenv (name), value, 0);
+  lt_setenv (name, new_value);
+  XFREE (new_value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_opt_process_env_append (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+  char *new_value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
+    }
+
+  new_value = lt_extend_str (getenv (name), value, 1);
+  lt_setenv (name, new_value);
+  XFREE (new_value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[len-1] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $opt_debug
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args=$nonopt
+    base_compile="$nonopt $@"
+    compile_command=$nonopt
+    finalize_command=$nonopt
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+    new_inherited_linker_flags=
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+    weak_libs=
+    single_module="${wl}-single_module"
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	break
+	;;
+      -all-static | -static | -static-libtool-libs)
+	case $arg in
+	-all-static)
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    func_warning "complete static linking is impossible in this configuration"
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	-static)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=built
+	  ;;
+	-static-libtool-libs)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	esac
+	build_libtool_libs=no
+	build_old_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  func_append compile_command " @OUTPUT@"
+	  func_append finalize_command " @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    func_append compile_command " @SYMFILE@"
+	    func_append finalize_command " @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  test -f "$arg" \
+	    || func_fatal_error "symbol file \`$arg' does not exist"
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+		*" $qarg.ltframework "*) ;;
+		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+		   ;;
+	      esac
+	      ;;
+	  esac
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat "$save_arg"`
+	    do
+#	      moreargs="$moreargs $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if func_lalib_unsafe_p "$arg"; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		func_source "$arg"
+
+		if test -z "$pic_object" ||
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none &&
+		   test "$non_pic_object" = none; then
+		  func_fatal_error "cannot find name of object for \`$arg'"
+		fi
+
+		# Extract subdirectory from the argument.
+		func_dirname "$arg" "/" ""
+		xdir="$func_dirname_result"
+
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
+
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      dlfiles="$dlfiles $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    dlprefiles="$dlprefiles $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  func_append libobjs " $pic_object"
+		  arg="$pic_object"
+		fi
+
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
+
+		  # A standard non-PIC object
+		  func_append non_pic_objects " $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object="$pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if $opt_dry_run; then
+		  # Extract subdirectory from the argument.
+		  func_dirname "$arg" "/" ""
+		  xdir="$func_dirname_result"
+
+		  func_lo2o "$arg"
+		  pic_object=$xdir$objdir/$func_lo2o_result
+		  non_pic_object=$xdir$func_lo2o_result
+		  func_append libobjs " $pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+	        else
+		  func_fatal_error "\`$arg' is not a valid libtool object"
+		fi
+	      fi
+	    done
+	  else
+	    func_fatal_error "link input file \`$arg' does not exist"
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    func_fatal_error "only absolute run-paths are allowed"
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) rpath="$rpath $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) xrpath="$xrpath $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	shrext)
+	  shrext_cmds="$arg"
+	  prev=
+	  continue
+	  ;;
+	weak)
+	  weak_libs="$weak_libs $arg"
+	  prev=
+	  continue
+	  ;;
+	xcclinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
+	  prev=
+	  func_append compile_command " $wl$qarg"
+	  func_append finalize_command " $wl$qarg"
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  # See comment for -static flag below, for more details.
+	  func_append compile_command " $link_static_flag"
+	  func_append finalize_command " $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  func_fatal_error "more than one -exported-symbols argument is not allowed"
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -framework)
+	prev=framework
+	continue
+	;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	func_stripname '-L' '' "$arg"
+	dir=$func_stripname_result
+	if test -z "$dir"; then
+	  if test "$#" -gt 0; then
+	    func_fatal_error "require no space between \`-L' and \`$1'"
+	  else
+	    func_fatal_error "need path for \`-L' option"
+	  fi
+	fi
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  test -z "$absdir" && \
+	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  ::) dllsearchpath=$dir;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    deplibs="$deplibs System.ltframework"
+	    continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot)
+	compiler_flags="$compiler_flags $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	prev=xcompiler
+	continue
+	;;
+
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+	compiler_flags="$compiler_flags $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	case "$new_inherited_linker_flags " in
+	    *" $arg "*) ;;
+	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+	esac
+	continue
+	;;
+
+      -multi_module)
+	single_module="${wl}-multi_module"
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # and Darwin in order for the loader to find any dlls it needs.
+	  func_warning "\`-no-install' is ignored for $host"
+	  func_warning "assuming \`-no-fast-install' instead"
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	func_stripname '-R' '' "$arg"
+	dir=$func_stripname_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  func_fatal_error "only absolute run-paths are allowed"
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -shared)
+	# The effects of -shared are defined in a previous loop.
+	continue
+	;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -static | -static-libtool-libs)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -weak)
+        prev=weak
+	continue
+	;;
+
+      -Wc,*)
+	func_stripname '-Wc,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+	  arg="$arg $wl$func_quote_for_eval_result"
+	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
+	done
+	IFS="$save_ifs"
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Wl,*)
+	func_stripname '-Wl,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+	  arg="$arg $wl$func_quote_for_eval_result"
+	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+	  linker_flags="$linker_flags $func_quote_for_eval_result"
+	done
+	IFS="$save_ifs"
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # -msg_* for osf cc
+      -msg_*)
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* pass through architecture-specific
+      # compiler args for GCC
+      # -F/path gives path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+      # @file GCC response files
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        compiler_flags="$compiler_flags $arg"
+        continue
+        ;;
+
+      # Some other compiler flag.
+      -* | +*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      *.$objext)
+	# A standard object.
+	objs="$objs $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if func_lalib_unsafe_p "$arg"; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  func_source "$arg"
+
+	  if test -z "$pic_object" ||
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none &&
+	     test "$non_pic_object" = none; then
+	    func_fatal_error "cannot find name of object for \`$arg'"
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  func_dirname "$arg" "/" ""
+	  xdir="$func_dirname_result"
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		dlfiles="$dlfiles $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      dlprefiles="$dlprefiles $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    func_append libobjs " $pic_object"
+	    arg="$pic_object"
+	  fi
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    func_append non_pic_objects " $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object="$pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if $opt_dry_run; then
+	    # Extract subdirectory from the argument.
+	    func_dirname "$arg" "/" ""
+	    xdir="$func_dirname_result"
+
+	    func_lo2o "$arg"
+	    pic_object=$xdir$objdir/$func_lo2o_result
+	    non_pic_object=$xdir$func_lo2o_result
+	    func_append libobjs " $pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  else
+	    func_fatal_error "\`$arg' is not a valid libtool object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	deplibs="$deplibs $arg"
+	old_deplibs="$old_deplibs $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  dlfiles="$dlfiles $arg"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  dlprefiles="$dlprefiles $arg"
+	  prev=
+	else
+	  deplibs="$deplibs $arg"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+      fi
+    done # argument parsing loop
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prevarg' option requires an argument"
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    func_basename "$output"
+    outputname="$func_basename_result"
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    func_dirname "$output" "/" ""
+    output_objdir="$func_dirname_result$objdir"
+    # Create the object directory.
+    func_mkdir_p "$output_objdir"
+
+    # Determine the type of output
+    case $output in
+    "")
+      func_fatal_help "you must specify an output file"
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if $opt_duplicate_deps ; then
+	case "$libs " in
+	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if $opt_duplicate_compiler_generated_deps; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  esac
+	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
+    case $linkmode in
+    lib)
+	passes="conv dlpreopen link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+
+    for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+	## FIXME: Find the place where the list is rebuilt in the wrong
+	##        order, and fix it there properly
+        tmp_deplibs=
+	for deplib in $deplibs; do
+	  tmp_deplibs="$deplib $tmp_deplibs"
+	done
+	deplibs="$tmp_deplibs"
+      fi
+
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+	# Collect and forward deplibs of preopened libtool libs
+	for lib in $dlprefiles; do
+	  # Ignore non-libtool-libs
+	  dependency_libs=
+	  case $lib in
+	  *.la)	func_source "$lib" ;;
+	  esac
+
+	  # Collect preopened libtool deplibs, except any this library
+	  # has declared as weak libs
+	  for deplib in $dependency_libs; do
+            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+	    case " $weak_libs " in
+	    *" $deplib_base "*) ;;
+	    *) deplibs="$deplibs $deplib" ;;
+	    esac
+	  done
+	done
+	libs="$dlprefiles"
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    compiler_flags="$compiler_flags $deplib"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    func_warning "\`-l' is ignored for archives/objects"
+	    continue
+	  fi
+	  func_stripname '-l' '' "$deplib"
+	  name=$func_stripname_result
+	  if test "$linkmode" = lib; then
+	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+	  else
+	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+	  fi
+	  for searchdir in $searchdirs; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if func_lalib_p "$lib"; then
+		  library_names=
+		  old_library=
+		  func_source "$lib"
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    func_dirname "$lib" "" "."
+		    ladir="$func_dirname_result"
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+		;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	*.ltframework)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    func_stripname '-L' '' "$deplib"
+	    newlib_search_path="$newlib_search_path $func_stripname_result"
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    func_stripname '-L' '' "$deplib"
+	    newlib_search_path="$newlib_search_path $func_stripname_result"
+	    ;;
+	  *)
+	    func_warning "\`-L' is ignored for archives/objects"
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    func_stripname '-R' '' "$deplib"
+	    dir=$func_stripname_result
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    # Linking convenience modules into shared libraries is allowed,
+	    # but linking other static libraries is non-portable.
+	    case " $dlpreconveniencelibs " in
+	    *" $deplib "*) ;;
+	    *)
+	      valid_a_lib=no
+	      case $deplibs_check_method in
+		match_pattern*)
+		  set dummy $deplibs_check_method; shift
+		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		    valid_a_lib=yes
+		  fi
+		;;
+		pass_all)
+		  valid_a_lib=yes
+		;;
+	      esac
+	      if test "$valid_a_lib" != yes; then
+		$ECHO
+		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
+		$ECHO "*** that it is just a static archive that I should not use here."
+	      else
+		$ECHO
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      fi
+	      ;;
+	    esac
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      newdlprefiles="$newdlprefiles $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      newdlfiles="$newdlfiles $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+	fi
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$lib" \
+	  || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+	func_dirname "$lib" "" "."
+	ladir="$func_dirname_result"
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	inherited_linker_flags=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+	avoidtemprpath=
+
+
+	# Read the .la file
+	func_source "$lib"
+
+	# Convert "-framework foo" to "foo.ltframework"
+	if test -n "$inherited_linker_flags"; then
+	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+	    case " $new_inherited_linker_flags " in
+	      *" $tmp_inherited_linker_flag "*) ;;
+	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+	    esac
+	  done
+	fi
+	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	fi
+
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      func_fatal_error "cannot find name of link library for \`$lib'"
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    convenience="$convenience $ladir/$objdir/$old_library"
+	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    func_fatal_error "\`$lib' is not a convenience library"
+	  fi
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    deplibs="$deplib $deplibs"
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+	  continue
+	fi # $pass = conv
+
+
+	# Get the name of the library we link against.
+	linklib=
+	for l in $old_library $library_names; do
+	  linklib="$l"
+	done
+	if test -z "$linklib"; then
+	  func_fatal_error "cannot find name of link library for \`$lib'"
+	fi
+
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+	  fi
+	  if test -z "$dlname" ||
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "passing it literally to the linker, although it might fail"
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	func_basename "$lib"
+	laname="$func_basename_result"
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    func_warning "library \`$lib' was moved."
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	else
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  else
+	    dir="$ladir/$objdir"
+	    absdir="$abs_ladir/$objdir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  fi
+	fi # $installed = yes
+	func_stripname 'lib' '.la' "$laname"
+	name=$func_stripname_result
+
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir" && test "$linkmode" = prog; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	  fi
+	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+	  # are required to link).
+	  if test -n "$old_library"; then
+	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	    # Keep a list of preopened convenience libraries to check
+	    # that they are being used correctly in the link pass.
+	    test -z "$libdir" && \
+		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+	  elif test -n "$dlname"; then
+	    newdlprefiles="$newdlprefiles $dir/$dlname"
+	  else
+	    newdlprefiles="$newdlprefiles $dir/$linklib"
+	  fi
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  newlib_search_path="$newlib_search_path $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) func_stripname '-L' '' "$deplib"
+	         newlib_search_path="$newlib_search_path $func_stripname_result"
+		 ;;
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { { test "$prefer_static_libs" = no ||
+	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	       test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath:" in
+	      *"$absdir:"*) ;;
+	      *) temp_rpath="$temp_rpath$absdir:" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test "$use_static_libs" = built && test "$installed" = yes; then
+	  use_static_libs=no
+	fi
+	if test -n "$library_names" &&
+	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc*)
+	      # No point in relinking DLLs because paths are not encoded
+	      notinst_deplibs="$notinst_deplibs $lib"
+	      need_relink=no
+	    ;;
+	  *)
+	    if test "$installed" = no; then
+	      notinst_deplibs="$notinst_deplibs $lib"
+	      need_relink=yes
+	    fi
+	    ;;
+	  esac
+	  # This is a shared library
+
+	  # Warn about portability, can't link against -module's on some
+	  # systems (darwin).  Don't bleat about dlopened modules though!
+	  dlopenmodule=""
+	  for dlpremoduletest in $dlprefiles; do
+	    if test "X$dlpremoduletest" = "X$lib"; then
+	      dlopenmodule="$dlpremoduletest"
+	      break
+	    fi
+	  done
+	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	    $ECHO
+	    if test "$linkmode" = prog; then
+	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $ECHO "*** $linklib is not portable!"
+	  fi
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    shift
+	    realname="$1"
+	    shift
+	    libname=`eval "\\$ECHO \"$libname_spec\""`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw* | *cegcc*)
+	        func_arith $current - $age
+		major=$func_arith_result
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    func_basename "$soroot"
+	    soname="$func_basename_result"
+	    func_stripname 'lib' '.dll' "$soname"
+	    newlib=libimp-$func_stripname_result.a
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      func_verbose "generating import library for \`$soname'"
+	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test "$linkmode" = prog || test "$mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a (non-dlopened) module then we can not
+		    # link against it, someone is ignoring the earlier warnings
+		    if /usr/bin/file -L $add 2> /dev/null |
+			 $GREP ": [^:]* bundle" >/dev/null ; then
+		      if test "X$dlopenmodule" != "X$lib"; then
+			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
+			if test -z "$old_library" ; then
+			  $ECHO
+			  $ECHO "*** And there doesn't seem to be a static archive available"
+			  $ECHO "*** The link will probably fail, sorry"
+			else
+			  add="$dir/$old_library"
+			fi
+		      elif test -n "$old_library"; then
+			add="$dir/$old_library"
+		      fi
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes &&
+	         test "$hardcode_direct_absolute" = no; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$dir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case $libdir in
+		    [\\/]*)
+		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      func_fatal_configuration "unsupported hardcode properties"
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes &&
+		 test "$hardcode_minus_L" != yes &&
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test "$linkmode" = prog || test "$mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes &&
+	       test "$hardcode_direct_absolute" = no; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
+		add="$inst_prefix_dir$libdir/$linklib"
+	      else
+		add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case $libdir in
+		  [\\/]*)
+		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
+	    fi
+
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    $ECHO
+	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    $ECHO "*** I have the capability to make that library automatically link in when"
+	    $ECHO "*** you link to this library.  But I can only do this if you have a"
+	    $ECHO "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      $ECHO "*** But as you try to build a module library, libtool will still create "
+	      $ECHO "*** a static module, that should work as long as the dlopening application"
+	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		$ECHO
+		$ECHO "*** However, this would only work if libtool was able to extract symbol"
+		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		$ECHO "*** not find such a program.  So, this module is probably useless."
+		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test "$linkmode" = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
+	       test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) func_stripname '-R' '' "$libdir"
+	           temp_xrpath=$func_stripname_result
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+	        func_dirname "$deplib" "" "."
+		dir="$func_dirname_result"
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    func_warning "cannot determine absolute directory name of \`$dir'"
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if $GREP "^installed=no" $deplib > /dev/null; then
+		case $host in
+		*-*-darwin*)
+		  depdepl=
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$absdir/$objdir/$depdepl" ; then
+		      depdepl="$absdir/$objdir/$depdepl"
+		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+		      path=
+		    fi
+		  fi
+		  ;;
+		*)
+		  path="-L$absdir/$objdir"
+		  ;;
+		esac
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  test -z "$libdir" && \
+		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  test "$absdir" != "$libdir" && \
+		    func_warning "\`$deplib' seems to be moved"
+
+		  path="-L$absdir"
+		fi
+		;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      if test "$pass" = link; then
+	if test "$linkmode" = "prog"; then
+	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+	else
+	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	fi
+      fi
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) lib_search_path="$lib_search_path $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      esac
+	      ;;
+	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  tmp_libs="$tmp_libs $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+    fi
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for archives"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for archives"
+
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for archives"
+
+      test -n "$vinfo" && \
+	func_warning "\`-version-info/-version-number' is ignored for archives"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for archives"
+
+      test -n "$export_symbols$export_symbols_regex" && \
+	func_warning "\`-export-symbols' is ignored for archives"
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	func_stripname 'lib' '.la' "$outputname"
+	name=$func_stripname_result
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	test "$module" = no && \
+	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  func_stripname '' '.la' "$outputname"
+	  name=$func_stripname_result
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  func_stripname '' '.la' "$outputname"
+	  libname=$func_stripname_result
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	else
+	  $ECHO
+	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+	  $ECHO "*** objects $objs is not portable!"
+	  libobjs="$libobjs $objs"
+	fi
+      fi
+
+      test "$dlself" != no && \
+	func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+      set dummy $rpath
+      shift
+      test "$#" -gt 1 && \
+	func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+      install_libdir="$1"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	test -n "$vinfo" && \
+	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+	test -n "$release" && \
+	  func_warning "\`-release' is ignored for convenience libraries"
+      else
+
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	shift
+	IFS="$save_ifs"
+
+	test -n "$7" && \
+	  func_fatal_help "too many parameters to \`-version-info'"
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+
+	case $vinfo_number in
+	yes)
+	  number_major="$1"
+	  number_minor="$2"
+	  number_revision="$3"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  darwin|linux|osf|windows|none)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age="$number_minor"
+	    revision="$number_minor"
+	    lt_irix_increment=no
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$1"
+	  revision="$2"
+	  age="$3"
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "CURRENT \`$current' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $revision in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "REVISION \`$revision' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $age in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "AGE \`$age' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  func_arith $current + 1
+	  minor_current=$func_arith_result
+	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
+
+	irix | nonstopux)
+	  if test "X$lt_irix_increment" = "Xno"; then
+	    func_arith $current - $age
+	  else
+	    func_arith $current - $age + 1
+	  fi
+	  major=$func_arith_result
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    func_arith $revision - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    func_arith $current - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  verstring="$verstring:${current}.0"
+	  ;;
+
+	qnx)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  func_arith $current - $age
+	  major=$func_arith_result
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    func_warning "undefined symbols not allowed in $host shared libraries"
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+
+      fi
+
+      func_generate_dlsyms "$libname" "$libname" "yes"
+      libobjs="$libobjs $symfileobj"
+      test "X$libobjs" = "X " && libobjs=
+
+      if test "$mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$ECHO "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext | *.gcno)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       if test "X$precious_files_regex" != "X"; then
+		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+		 then
+		   continue
+		 fi
+	       fi
+	       removelist="$removelist $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	test -n "$removelist" && \
+	  func_show_eval "${RM}r \$removelist"
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      #for path in $notinst_path; do
+      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
+      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
+      #done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    deplibs="$deplibs System.ltframework"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    ;;
+	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      deplibs="$deplibs -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $opt_dry_run || $RM conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $opt_dry_run || $RM conftest
+	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    newdeplibs="$newdeplibs $i"
+		    i=""
+		    ;;
+		  esac
+		fi
+		if test -n "$i" ; then
+		  libname=`eval "\\$ECHO \"$libname_spec\""`
+		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		  set dummy $deplib_matches; shift
+		  deplib_match=$1
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    $ECHO
+		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		    $ECHO "*** I have the capability to make that library automatically link in when"
+		    $ECHO "*** you link to this library.  But I can only do this if you have a"
+		    $ECHO "*** shared version of the library, which I believe you do not have"
+		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
+		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+		;;
+	      *)
+		newdeplibs="$newdeplibs $i"
+		;;
+	      esac
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		$opt_dry_run || $RM conftest
+		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      newdeplibs="$newdeplibs $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval "\\$ECHO \"$libname_spec\""`
+		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		    set dummy $deplib_matches; shift
+		    deplib_match=$1
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      newdeplibs="$newdeplibs $i"
+		    else
+		      droppeddeps=yes
+		      $ECHO
+		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		      $ECHO "*** I have the capability to make that library automatically link in when"
+		      $ECHO "*** you link to this library.  But I can only do this if you have a"
+		      $ECHO "*** shared version of the library, which you do not appear to have"
+		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
+		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  $ECHO
+		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+		  $ECHO "*** make it link in!  You will probably need to install it or some"
+		  $ECHO "*** library that it depends on before this library will be fully"
+		  $ECHO "*** functional.  Installing it before continuing would be even better."
+		fi
+		;;
+	      *)
+		newdeplibs="$newdeplibs $i"
+		;;
+	      esac
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method; shift
+	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null |
+			 $GREP " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+			 $SED -e 10q |
+			 $EGREP "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$ECHO
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method; shift
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+		       $EGREP "$match_pattern_regex" > /dev/null; then
+		      newdeplibs="$newdeplibs $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$ECHO
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
+	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
+	    done
+	  fi
+	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
+	     $GREP . >/dev/null; then
+	    $ECHO
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    $ECHO "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	  fi
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library with the System framework
+	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    $ECHO
+	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+	    $ECHO "*** a static module, that should work as long as the dlopening"
+	    $ECHO "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      $ECHO
+	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
+	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      $ECHO "*** not find such a program.  So, this module is probably useless."
+	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
+	    $ECHO "*** automatically added whenever a program is linked with this library"
+	    $ECHO "*** or is declared to -dlopen it."
+
+	    if test "$allow_undefined" = no; then
+	      $ECHO
+	      $ECHO "*** Since this library must not contain undefined symbols,"
+	      $ECHO "*** because either the platform does not support them or"
+	      $ECHO "*** it was explicitly requested with -no-undefined,"
+	      $ECHO "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+	*-*-darwin*)
+	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  ;;
+      esac
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      deplibs="$new_libs"
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	if test "$hardcode_into_libs" = yes; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		dep_rpath="$dep_rpath $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    if test -n "$hardcode_libdir_flag_spec_ld"; then
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+	    else
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	    fi
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      rpath="$rpath$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath="$finalize_shlibpath"
+	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext_cmds\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	shift
+	realname="$1"
+	shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib="$output_objdir/$realname"
+	linknames=
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	test "X$libobjs" = "X " && libobjs=
+
+	delfiles=
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+	  export_symbols="$output_objdir/$libname.uexp"
+	  delfiles="$delfiles $export_symbols"
+	fi
+
+	orig_export_symbols=
+	case $host_os in
+	cygwin* | mingw* | cegcc*)
+	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+	    # exporting using user supplied symfile
+	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	      # and it's NOT already a .def file. Must figure out
+	      # which of the given symbols are data symbols and tag
+	      # them as such. So, trigger use of export_symbols_cmds.
+	      # export_symbols gets reassigned inside the "prepare
+	      # the list of exported symbols" if statement, so the
+	      # include_expsyms logic still works.
+	      orig_export_symbols="$export_symbols"
+	      export_symbols=
+	      always_export_symbols=yes
+	    fi
+	  fi
+	  ;;
+	esac
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $opt_dry_run || $RM $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      eval cmd=\"$cmd\"
+	      func_len " $cmd"
+	      len=$func_len_result
+	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
+	      else
+		# The command line is too long to execute in one step.
+		func_verbose "using reloadable object file for export list..."
+		skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  tmp_export_symbols="$export_symbols"
+	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	fi
+
+	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	  # The given exports_symbols file has to be filtered, so filter it.
+	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # though. Also, the filter scales superlinearly with the number of
+	  # global variables. join(1) would be nice here, but unfortunately
+	  # isn't a blessed tool.
+	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	  export_symbols=$output_objdir/$libname.def
+	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+	  case " $convenience " in
+	  *" $test_deplib "*) ;;
+	  *)
+	    tmp_deplibs="$tmp_deplibs $test_deplib"
+	    ;;
+	  esac
+	done
+	deplibs="$tmp_deplibs"
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec" &&
+	    test "$compiler_needs_object" = yes &&
+	    test -z "$libobjs"; then
+	    # extract the archives, so we have objects to list.
+	    # TODO: could optimize this to just extract one archive.
+	    whole_archive_flag_spec=
+	  fi
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    func_extract_archives $gentop $convenience
+	    libobjs="$libobjs $func_extract_archives_result"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	fi
+
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
+	else
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval test_cmds=\"$archive_expsym_cmds\"
+	    cmds=$archive_expsym_cmds
+	  else
+	    eval test_cmds=\"$archive_cmds\"
+	    cmds=$archive_cmds
+	  fi
+	fi
+
+	if test "X$skipped_export" != "X:" &&
+	   func_len " $test_cmds" &&
+	   len=$func_len_result &&
+	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise
+	  # or, if using GNU ld and skipped_export is not :, use a linker
+	  # script.
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  last_robj=
+	  k=1
+
+	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+	    output=${output_objdir}/${output_la}.lnkscript
+	    func_verbose "creating GNU ld script: $output"
+	    $ECHO 'INPUT (' > $output
+	    for obj in $save_libobjs
+	    do
+	      $ECHO "$obj" >> $output
+	    done
+	    $ECHO ')' >> $output
+	    delfiles="$delfiles $output"
+	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+	    output=${output_objdir}/${output_la}.lnk
+	    func_verbose "creating linker input file list: $output"
+	    : > $output
+	    set x $save_libobjs
+	    shift
+	    firstobj=
+	    if test "$compiler_needs_object" = yes; then
+	      firstobj="$1 "
+	      shift
+	    fi
+	    for obj
+	    do
+	      $ECHO "$obj" >> $output
+	    done
+	    delfiles="$delfiles $output"
+	    output=$firstobj\"$file_list_spec$output\"
+	  else
+	    if test -n "$save_libobjs"; then
+	      func_verbose "creating reloadable object files..."
+	      output=$output_objdir/$output_la-${k}.$objext
+	      eval test_cmds=\"$reload_cmds\"
+	      func_len " $test_cmds"
+	      len0=$func_len_result
+	      len=$len0
+
+	      # Loop over the list of objects to be linked.
+	      for obj in $save_libobjs
+	      do
+		func_len " $obj"
+		func_arith $len + $func_len_result
+		len=$func_arith_result
+		if test "X$objlist" = X ||
+		   test "$len" -lt "$max_cmd_len"; then
+		  func_append objlist " $obj"
+		else
+		  # The command $test_cmds is almost too long, add a
+		  # command to the queue.
+		  if test "$k" -eq 1 ; then
+		    # The first file doesn't have a previous command to add.
+		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+		  else
+		    # All subsequent reloadable object files will link in
+		    # the last one created.
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+		  fi
+		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  func_arith $k + 1
+		  k=$func_arith_result
+		  output=$output_objdir/$output_la-${k}.$objext
+		  objlist=$obj
+		  func_len " $last_robj"
+		  func_arith $len0 + $func_len_result
+		  len=$func_arith_result
+		fi
+	      done
+	      # Handle the remaining objects by creating one last
+	      # reloadable object file.  All subsequent reloadable object
+	      # files will link in the last one created.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+	      if test -n "$last_robj"; then
+	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	      fi
+	      delfiles="$delfiles $output"
+
+	    else
+	      output=
+	    fi
+
+	    if ${skipped_export-false}; then
+	      func_verbose "generating symbol list for \`$libname.la'"
+	      export_symbols="$output_objdir/$libname.exp"
+	      $opt_dry_run || $RM $export_symbols
+	      libobjs=$output
+	      # Append the command to create the export file.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+	      if test -n "$last_robj"; then
+		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+	      fi
+	    fi
+
+	    test -n "$save_libobjs" &&
+	      func_verbose "creating a temporary reloadable object file: $output"
+
+	    # Loop through the commands generated above and execute them.
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $concat_cmds; do
+	      IFS="$save_ifs"
+	      $opt_silent || {
+		  func_quote_for_expand "$cmd"
+		  eval "func_echo $func_quote_for_expand_result"
+	      }
+	      $opt_dry_run || eval "$cmd" || {
+		lt_exit=$?
+
+		# Restore the uninstalled library and exit
+		if test "$mode" = relink; then
+		  ( cd "$output_objdir" && \
+		    $RM "${realname}T" && \
+		    $MV "${realname}U" "$realname" )
+		fi
+
+		exit $lt_exit
+	      }
+	    done
+	    IFS="$save_ifs"
+
+	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+
+          if ${skipped_export-false}; then
+	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	      tmp_export_symbols="$export_symbols"
+	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	    fi
+
+	    if test -n "$orig_export_symbols"; then
+	      # The given exports_symbols file has to be filtered, so filter it.
+	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # though. Also, the filter scales superlinearly with the number of
+	      # global variables. join(1) would be nice here, but unfortunately
+	      # isn't a blessed tool.
+	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	      export_symbols=$output_objdir/$libname.def
+	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	    fi
+	  fi
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test "$module" = yes && test -n "$module_cmds" ; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
+	  else
+	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	      cmds=$archive_expsym_cmds
+	    else
+	      cmds=$archive_cmds
+	    fi
+	  fi
+	fi
+
+	if test -n "$delfiles"; then
+	  # Append the command to remove temporary files to $cmds.
+	  eval cmds=\"\$cmds~\$RM $delfiles\"
+	fi
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  libobjs="$libobjs $func_extract_archives_result"
+	  test "X$libobjs" = "X " && libobjs=
+	fi
+
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $opt_silent || {
+	    func_quote_for_expand "$cmd"
+	    eval "func_echo $func_quote_for_expand_result"
+	  }
+	  $opt_dry_run || eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test "$mode" = relink; then
+	      ( cd "$output_objdir" && \
+	        $RM "${realname}T" && \
+		$MV "${realname}U" "$realname" )
+	    fi
+
+	    exit $lt_exit
+	  }
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      func_show_eval '${RM}r "$gentop"'
+	    fi
+	  fi
+
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for objects"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "\`-l' and \`-L' are ignored for objects" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for objects"
+
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for objects"
+
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for objects"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for objects"
+
+      case $output in
+      *.lo)
+	test -n "$objs$old_deplibs" && \
+	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+	libobj=$output
+	func_lo2o "$libobj"
+	obj=$func_lo2o_result
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $opt_dry_run || $RM $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+	else
+	  gentop="$output_objdir/${obj}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      func_execute_cmds "$reload_cmds" 'exit $?'
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	func_execute_cmds "$reload_cmds" 'exit $?'
+      fi
+
+      if test -n "$gentop"; then
+	func_show_eval '${RM}r "$gentop"'
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) func_stripname '' '.exe' "$output"
+	          output=$func_stripname_result.exe;;
+      esac
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for programs"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for programs"
+
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+	&& test "$dlopen_self" = unknown \
+	&& test "$dlopen_self_static" = unknown && \
+	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+	# Don't allow lazy linking, it breaks C++ global constructors
+	# But is supposedly fixed on 10.4 or later (yay!).
+	if test "$tagname" = CXX ; then
+	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+	    10.[0123])
+	      compile_command="$compile_command ${wl}-bind_at_load"
+	      finalize_command="$finalize_command ${wl}-bind_at_load"
+	    ;;
+	  esac
+	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      compile_deplibs="$new_libs"
+
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  ::) dllsearchpath=$libdir;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      fi
+
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+	func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
+
+      wrappers_required=yes
+      case $host in
+      *cygwin* | *mingw* )
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      *cegcc)
+        # Disable wrappers for cegcc, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
+      *)
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      esac
+      if test "$wrappers_required" = no; then
+	# Replace the output file specification.
+	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command="$compile_command$compile_rpath"
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	exit_status=0
+	func_show_eval "$link_command" 'exit_status=$?'
+
+	# Delete the generated files.
+	if test -f "$output_objdir/${outputname}S.${objext}"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	fi
+
+	exit $exit_status
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$opt_dry_run || $RM $output
+	# Link the executable and exit
+	func_show_eval "$link_command" 'exit $?'
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	func_warning "this platform does not like uninstalled shared libraries"
+	func_warning "\`$output' will be relinked during installation"
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      func_show_eval "$link_command" 'exit $?'
+
+      # Now create the wrapper script.
+      func_verbose "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    func_quote_for_eval "$var_value"
+	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Quote $ECHO for shipping.
+      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
+	case $progpath in
+	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+	esac
+	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
+      else
+	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) func_stripname '' '.exe' "$output"
+	         output=$func_stripname_result ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    func_stripname '' '.exe' "$outputname"
+	    outputname=$func_stripname_result ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+	    func_dirname_and_basename "$output" "" "."
+	    output_name=$func_basename_result
+	    output_path=$func_dirname_result
+	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
+	    cwrapper="$output_path/$output_name.exe"
+	    $RM $cwrappersource $cwrapper
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_cwrapperexe_src > $cwrappersource
+
+	    # The wrapper executable is built using the $host compiler,
+	    # because it contains $host paths and files. If cross-
+	    # compiling, it, like the target executable, must be
+	    # executed on the $host or under an emulation environment.
+	    $opt_dry_run || {
+	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+	      $STRIP $cwrapper
+	    }
+
+	    # Now, create the wrapper script for func_source use:
+	    func_ltwrapper_scriptname $cwrapper
+	    $RM $func_ltwrapper_scriptname_result
+	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+	    $opt_dry_run || {
+	      # note: this script will not be executed, so do not chmod.
+	      if test "x$build" = "x$host" ; then
+		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+	      else
+		func_emit_wrapper no > $func_ltwrapper_scriptname_result
+	      fi
+	    }
+	  ;;
+	  * )
+	    $RM $output
+	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_wrapper no > $output
+	    chmod +x $output
+	  ;;
+	esac
+      }
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save $symfileobj"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	  if test "$preload" = yes && test -f "$symfileobj"; then
+	    oldobjs="$oldobjs $symfileobj"
+	  fi
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	generated="$generated $gentop"
+
+	func_extract_archives $gentop $addlibs
+	oldobjs="$oldobjs $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+	cmds=$old_archive_from_new_cmds
+      else
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  oldobjs="$oldobjs $func_extract_archives_result"
+	fi
+
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      func_basename "$obj"
+	      $ECHO "$func_basename_result"
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  $ECHO "copying selected object files to avoid basename conflicts..."
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+	  func_mkdir_p "$gentop"
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    func_basename "$obj"
+	    objbase="$func_basename_result"
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		func_arith $counter + 1
+		counter=$func_arith_result
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      oldobjs="$oldobjs $gentop/$newobj"
+	      ;;
+	    *) oldobjs="$oldobjs $obj" ;;
+	    esac
+	  done
+	fi
+	eval cmds=\"$old_archive_cmds\"
+
+	func_len " $cmds"
+	len=$func_len_result
+	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  func_verbose "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  eval test_cmds=\"$old_archive_cmds\"
+	  func_len " $test_cmds"
+	  len0=$func_len_result
+	  len=$len0
+	  for obj in $save_oldobjs
+	  do
+	    func_len " $obj"
+	    func_arith $len + $func_len_result
+	    len=$func_arith_result
+	    func_append objlist " $obj"
+	    if test "$len" -lt "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+		RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	      len=$len0
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      func_execute_cmds "$cmds" 'exit $?'
+    done
+
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      func_verbose "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  func_quote_for_eval "$var_value"
+	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+	relink_command=
+      fi
+
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		func_basename "$deplib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+		newdependency_libs="$newdependency_libs $libdir/$name"
+		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+
+	    for lib in $dlfiles; do
+	      case $lib in
+	      *.la)
+	        func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		newdlfiles="$newdlfiles $libdir/$name"
+		;;
+	      *) newdlfiles="$newdlfiles $lib" ;;
+	      esac
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+	      *.la)
+		# Only pass preopened files to the pseudo-archive (for
+		# eventual linking with the app. that links it) if we
+		# didn't already link the preopened objects directly into
+		# the library:
+		func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		newdlprefiles="$newdlprefiles $libdir/$name"
+		;;
+	      esac
+	    done
+	    dlprefiles="$newdlprefiles"
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlfiles="$newdlfiles $abs"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlprefiles="$newdlprefiles $abs"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $RM $output
+	  # place dlname in correct position for cygwin
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	  esac
+	  $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes; then
+	    $ECHO >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      }
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+}
+
+{ test "$mode" = link || test "$mode" = relink; } &&
+    func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $opt_debug
+    RM="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) RM="$RM $arg"; rmforce=yes ;;
+      -*) RM="$RM $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      func_dirname "$file" "" "."
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
+	objdir="$origobjdir"
+      else
+	objdir="$dir/$origobjdir"
+      fi
+      func_basename "$file"
+      name="$func_basename_result"
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+	case " $rmdirs " in
+	  *" $objdir "*) ;;
+	  *) rmdirs="$rmdirs $objdir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+	 { test -h "$file"; } >/dev/null 2>&1 ||
+	 test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif test "$rmforce" = yes; then
+	continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if func_lalib_p "$file"; then
+	  func_source $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+	  case "$mode" in
+	  clean)
+	    case "  $library_names " in
+	    # "  " in the beginning catches empty $dlname
+	    *" $dlname "*) ;;
+	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
+	    esac
+	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    ;;
+	  uninstall)
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	    ;;
+	  esac
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if func_lalib_p "$file"; then
+
+	  # Read the .lo file
+	  func_source $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" &&
+	     test "$pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" &&
+	     test "$non_pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test "$mode" = clean ; then
+	  noexename=$name
+	  case $file in
+	  *.exe)
+	    func_stripname '' '.exe' "$file"
+	    file=$func_stripname_result
+	    func_stripname '' '.exe' "$name"
+	    noexename=$func_stripname_result
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    rmfiles="$rmfiles $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if func_ltwrapper_p "$file"; then
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      relink_command=
+	      func_source $func_ltwrapper_scriptname_result
+	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+	    else
+	      relink_command=
+	      func_source $dir/$noexename
+	    fi
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	      rmfiles="$rmfiles $objdir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name" ; then
+	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	func_show_eval "rmdir $dir >/dev/null 2>&1"
+      fi
+    done
+
+    exit $exit_status
+}
+
+{ test "$mode" = uninstall || test "$mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
+
+test -z "$mode" && {
+  help="$generic_help"
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode \`$mode'"
+
+if test -n "$exec_cmd"; then
+  eval exec "$exec_cmd"
+  exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/Platform/Android/jni/External/libusb-1.0.8/missing b/Platform/Android/jni/External/libusb-1.0.8/missing
new file mode 100644
index 0000000..1c8ff70
--- /dev/null
+++ b/Platform/Android/jni/External/libusb-1.0.8/missing
@@ -0,0 +1,367 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake at gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case $f in
+      *:*) touch_files="$touch_files "`echo "$f" |
+				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+	   sed 's/\.am$/.in/' |
+	   while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo "#! /bin/sh"
+	echo "# Created by GNU Automake missing as a replacement of"
+	echo "#  $ $@"
+	echo "exit 0"
+	chmod +x $file
+	exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if test $# -ne 1; then
+        eval LASTARG="\${$#}"
+	case $LASTARG in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if test ! -f y.tab.h; then
+	echo >y.tab.h
+    fi
+    if test ! -f y.tab.c; then
+	echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if test $# -ne 1; then
+        eval LASTARG="\${$#}"
+	case $LASTARG in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if test ! -f lex.yy.c; then
+	echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+	 you modified a dependency of a manual page.  You may need the
+	 \`Help2man' package in order for those modifications to take
+	 effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+	/^@setfilename/{
+	  s/.* \([^ ]*\) *$/\1/
+	  p
+	  q
+	}' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+	case $firstarg in
+	*o*)
+	    firstarg=`echo "$firstarg" | sed s/o//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+	case $firstarg in
+	*h*)
+	    firstarg=`echo "$firstarg" | sed s/h//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/Platform/Android/jni/Modules/Android.mk b/Platform/Android/jni/Modules/Android.mk
new file mode 100644
index 0000000..835b0ff
--- /dev/null
+++ b/Platform/Android/jni/Modules/Android.mk
@@ -0,0 +1,5 @@
+# OpenNI Android makefile.
+#
+
+include $(call all-subdir-makefiles)
+
diff --git a/Platform/Android/jni/Modules/nimCodecs/Android.mk b/Platform/Android/jni/Modules/nimCodecs/Android.mk
new file mode 100644
index 0000000..38526b0
--- /dev/null
+++ b/Platform/Android/jni/Modules/nimCodecs/Android.mk
@@ -0,0 +1,32 @@
+# OpenNI Android makefile.
+# libnimCodecs.so
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS) 
+
+# set path to source
+MY_PREFIX := $(LOCAL_PATH)/../../../../../Source/
+
+# list all source files
+MY_SRC_FILES := \
+	$(MY_PREFIX)Modules/nimCodecs/*.cpp \
+	$(MY_PREFIX)External/LibJPEG/*.c
+
+# expand the wildcards
+MY_SRC_FILE_EXPANDED := $(wildcard $(MY_SRC_FILES))
+
+# make those paths relative to here
+LOCAL_SRC_FILES := $(MY_SRC_FILE_EXPANDED:$(LOCAL_PATH)/%=%)
+
+LOCAL_C_INCLUDES := \
+        $(LOCAL_PATH)/../../../../../Source/External/LibJPEG
+
+LOCAL_CFLAGS := -fvisibility=hidden
+
+LOCAL_SHARED_LIBRARIES := OpenNI 
+
+LOCAL_MODULE := nimCodecs
+
+include $(BUILD_SHARED_LIBRARY)
+
diff --git a/Platform/Android/jni/Modules/nimMockNodes/Android.mk b/Platform/Android/jni/Modules/nimMockNodes/Android.mk
new file mode 100644
index 0000000..fdd1c66
--- /dev/null
+++ b/Platform/Android/jni/Modules/nimMockNodes/Android.mk
@@ -0,0 +1,29 @@
+# OpenNI Android makefile.
+# libnimMockNodes.so
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS) 
+
+# set path to source
+MY_PREFIX := $(LOCAL_PATH)/../../../../../Source/Modules/nimMockNodes/
+
+# list all source files
+MY_SRC_FILES := $(MY_PREFIX)*.cpp
+
+# expand the wildcards
+MY_SRC_FILE_EXPANDED := $(wildcard $(MY_SRC_FILES))
+
+# make those paths relative to here
+LOCAL_SRC_FILES := $(MY_SRC_FILE_EXPANDED:$(LOCAL_PATH)/%=%)
+
+LOCAL_C_INCLUDES := 
+
+LOCAL_CFLAGS := -fvisibility=hidden
+
+LOCAL_SHARED_LIBRARIES := OpenNI
+
+LOCAL_MODULE := nimMockNodes
+
+include $(BUILD_SHARED_LIBRARY)
+
diff --git a/Platform/Android/jni/Modules/nimRecorder/Android.mk b/Platform/Android/jni/Modules/nimRecorder/Android.mk
new file mode 100644
index 0000000..62bc9bc
--- /dev/null
+++ b/Platform/Android/jni/Modules/nimRecorder/Android.mk
@@ -0,0 +1,32 @@
+# OpenNI Android makefile.
+# libnimRecorder.so
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS) 
+
+# set path to source
+MY_PREFIX := $(LOCAL_PATH)/../../../../../Source/Modules/
+
+# list all source files
+MY_SRC_FILES := \
+	$(MY_PREFIX)nimRecorder/*.cpp \
+	$(MY_PREFIX)Common/*.cpp
+
+# expand the wildcards
+MY_SRC_FILE_EXPANDED := $(wildcard $(MY_SRC_FILES))
+
+# make those paths relative to here
+LOCAL_SRC_FILES := $(MY_SRC_FILE_EXPANDED:$(LOCAL_PATH)/%=%)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/../../../../../Source/Modules/Common
+
+LOCAL_CFLAGS := -fvisibility=hidden
+
+LOCAL_SHARED_LIBRARIES := OpenNI 
+
+LOCAL_MODULE := nimRecorder
+
+include $(BUILD_SHARED_LIBRARY)
+
diff --git a/Platform/Android/jni/OpenNI.jni/Android.mk b/Platform/Android/jni/OpenNI.jni/Android.mk
new file mode 100644
index 0000000..30b332c
--- /dev/null
+++ b/Platform/Android/jni/OpenNI.jni/Android.mk
@@ -0,0 +1,36 @@
+# OpenNI.jni Android makefile.
+# libOpenNI.jni.so
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS) 
+
+# set path to source
+MY_PREFIX := $(LOCAL_PATH)/../../../../Wrappers/OpenNI.jni/
+
+# list all source files
+MY_SRC_FILES := $(MY_PREFIX)*.cpp
+
+# expand the wildcards
+MY_SRC_FILE_EXPANDED := $(wildcard $(MY_SRC_FILES))
+
+# make those paths relative to here
+LOCAL_SRC_FILES := $(MY_SRC_FILE_EXPANDED:$(LOCAL_PATH)/%=%)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/../../../../Wrappers/OpenNI.jni/ 
+
+LOCAL_CFLAGS:= -fvisibility=hidden -DXN_EXPORTS
+
+LOCAL_LDFLAGS += -Wl,--export-dynamic --dynamic-linker
+
+LOCAL_LDLIBS := -llog
+
+LOCAL_SHARED_LIBRARIES := OpenNI
+
+LOCAL_PREBUILT_LIBS := libc 
+
+LOCAL_MODULE:= OpenNI.jni
+
+include $(BUILD_SHARED_LIBRARY)
+
diff --git a/Platform/Android/jni/OpenNI/Android.mk b/Platform/Android/jni/OpenNI/Android.mk
new file mode 100644
index 0000000..06acac6
--- /dev/null
+++ b/Platform/Android/jni/OpenNI/Android.mk
@@ -0,0 +1,50 @@
+# OpenNI Android makefile.
+# libOpenNI.so
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS) 
+
+# set path to source
+MY_PREFIX := $(LOCAL_PATH)/../../../../Source/OpenNI/
+
+# list all source files
+MY_SRC_FILES := \
+	$(MY_PREFIX)*.cpp \
+	$(MY_PREFIX)Linux/*.cpp \
+	$(MY_PREFIX)../External/TinyXml/*.cpp
+
+# expand the wildcards
+MY_SRC_FILE_EXPANDED := $(wildcard $(MY_SRC_FILES))
+
+# make those paths relative to here
+LOCAL_SRC_FILES := $(MY_SRC_FILE_EXPANDED:$(LOCAL_PATH)/%=%)
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/../../../../Include/ \
+	$(LOCAL_PATH)/../../../../Source/ \
+	$(LOCAL_PATH)/../../../../Source/External/TinyXml/ \
+	$(LOCAL_PATH)/../External/libusb-1.0.8/libusb \
+
+LOCAL_CFLAGS:= -fvisibility=hidden -DXN_EXPORTS
+
+LOCAL_LDFLAGS += -Wl,--export-dynamic --dynamic-linker 
+
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../Include
+LOCAL_SHARED_LIBRARIES := libusb 
+
+LOCAL_PREBUILT_LIBS := libc 
+
+LOCAL_MODULE:= OpenNI
+
+include $(BUILD_SHARED_LIBRARY)
+
+# external Android build trees that import OpenNI must also have libusb, at least so they can build libOpenNI.so locally.
+# this line is unwanted, though, when building locally from OpenNI's Android tree
+ifdef NDK_MODULE_PATH
+$(if $(call set_is_member,$(__ndk_modules),usb),\
+	$(call __ndk_info,Don't use NDK_MODULE_PATH when building OpenNI locally. Ignoring.)\
+	,\
+	$(call import-module,External/libusb*) \
+	)
+endif
diff --git a/Platform/Android/jni/Samples/Android.mk b/Platform/Android/jni/Samples/Android.mk
new file mode 100644
index 0000000..dd817bc
--- /dev/null
+++ b/Platform/Android/jni/Samples/Android.mk
@@ -0,0 +1,5 @@
+# OpenNI Samples Android makefile.
+#
+
+include $(call all-subdir-makefiles)
+
diff --git a/Platform/Android/jni/Samples/NiSimpleRead/Android.mk b/Platform/Android/jni/Samples/NiSimpleRead/Android.mk
new file mode 100644
index 0000000..5c43cb0
--- /dev/null
+++ b/Platform/Android/jni/Samples/NiSimpleRead/Android.mk
@@ -0,0 +1,18 @@
+# OpenNI Samples Android makefile.
+# Sample-SimpleRead
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= ../../../../../Samples/NiSimpleRead/NiSimpleRead.cpp
+
+LOCAL_C_INCLUDES := 
+
+LOCAL_CFLAGS:= -fvisibility=hidden -DXN_EXPORTS
+
+LOCAL_SHARED_LIBRARIES := libc libusb OpenNI
+
+LOCAL_MODULE := Sample-SimpleRead
+
+include $(BUILD_EXECUTABLE)
diff --git a/Platform/Android/jni/Samples/NiSimpleSkeleton/Android.mk b/Platform/Android/jni/Samples/NiSimpleSkeleton/Android.mk
new file mode 100644
index 0000000..31f8584
--- /dev/null
+++ b/Platform/Android/jni/Samples/NiSimpleSkeleton/Android.mk
@@ -0,0 +1,18 @@
+# OpenNI Samples Android makefile.
+# Sample-SimpleRead
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= ../../../../../Samples/NiSimpleSkeleton/NiSimpleSkeleton.cpp
+
+LOCAL_C_INCLUDES := 
+
+LOCAL_CFLAGS:= -fvisibility=hidden -DXN_EXPORTS
+
+LOCAL_SHARED_LIBRARIES := libc libusb OpenNI
+
+LOCAL_MODULE := Sample-SimpleSkeleton
+
+include $(BUILD_EXECUTABLE)
diff --git a/Platform/Android/jni/Utils/Android.mk b/Platform/Android/jni/Utils/Android.mk
new file mode 100644
index 0000000..835b0ff
--- /dev/null
+++ b/Platform/Android/jni/Utils/Android.mk
@@ -0,0 +1,5 @@
+# OpenNI Android makefile.
+#
+
+include $(call all-subdir-makefiles)
+
diff --git a/Platform/Android/jni/Utils/niLicense/Android.mk b/Platform/Android/jni/Utils/niLicense/Android.mk
new file mode 100644
index 0000000..176837f
--- /dev/null
+++ b/Platform/Android/jni/Utils/niLicense/Android.mk
@@ -0,0 +1,18 @@
+# OpenNI Android makefile.
+# niLicense
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= ../../../../../Source/Utils/niLicense/niLicense.cpp
+
+LOCAL_C_INCLUDES := 
+
+LOCAL_CFLAGS := -fvisibility=hidden -DXN_FORMATS_EXPORTS 
+
+LOCAL_SHARED_LIBRARIES := libusb OpenNI 
+
+LOCAL_MODULE := niLicense
+
+include $(BUILD_EXECUTABLE)
diff --git a/Platform/Android/jni/Utils/niReg/Android.mk b/Platform/Android/jni/Utils/niReg/Android.mk
new file mode 100644
index 0000000..14ddbfd
--- /dev/null
+++ b/Platform/Android/jni/Utils/niReg/Android.mk
@@ -0,0 +1,18 @@
+# OpenNI Android makefile.
+# niReg
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= ../../../../../Source/Utils/niReg/niReg.cpp
+
+LOCAL_C_INCLUDES := 
+
+LOCAL_CFLAGS := -fvisibility=hidden -DXN_FORMATS_EXPORTS 
+
+LOCAL_SHARED_LIBRARIES := libusb OpenNI 
+
+LOCAL_MODULE := niReg
+
+include $(BUILD_EXECUTABLE)
diff --git a/Platform/Linux-x86/Build/CommonMakefile b/Platform/Linux-x86/Build/CommonMakefile
deleted file mode 100644
index 0cb6fc6..0000000
--- a/Platform/Linux-x86/Build/CommonMakefile
+++ /dev/null
@@ -1,207 +0,0 @@
-#############################################################################
-# Primesense template makefile.
-# This file should not be made, but only included from other makefiles.
-# By default, this makefile compiles in release. To compile a debug version:
-#    make CFG=Debug
-#
-# Project makefile should define the following BEFORE including this file:
-# SRC_FILES - a list of all source files
-# Output name under one of the following:
-#     EXE_NAME (executable), 
-#     LIB_NAME (dynamic library) or 
-#     SLIB_NAME (static library) or
-#     NETLIB_NAME (.net module) or
-#     NETEXE_NAME (.net executable)
-# BIN_DIR - Bin directory (output dir)
-# INC_DIRS - a list of additional include directories
-# LIB_DIRS - a list of additional library directories
-# USED_LIBS - a list of libraries to link with
-# DEFINES - [Optional] additional preprocessor defines
-# CFLAGS - [Optional] additional flags for the compiler
-# LDFLAGS - [Optional] additional flags for the linker
-# CSFLAGS - [Optional] additional flags for mono compiler
-# NET_WIN_FORMS - [Optional] when 1, application uses WinForms
-# SSE_GENERATION - [Optional] The SSE generation to use (default is 3)
-# TARGET_SYS_ROOT - [Optional] The path to the root of the target
-# NI_CONF_DIR - [Optional] configuration dir to be registered with OpenNI
-#############################################################################
-
-# some defaults
-ifndef SSE_GENERATION
-	SSE_GENERATION = 3
-endif
-
-ifndef CFG
-	CFG = Release
-endif
-
-ifndef TARGET_SYS_ROOT
-	TARGET_SYS_ROOT = /
-endif
-
-# tools
-RM = rm -rf
-CP = cp
-
-# expand file list
-SRC_FILES_LIST = $(wildcard $(SRC_FILES))
-
-OSTYPE := $(shell uname -s)
-
-# change c struct alignment options to be compatable with Win32
-ifneq ("$(OSTYPE)","Darwin")
-	CFLAGS += -malign-double
-else
-	CFLAGS += -arch i386 -arch x86_64
-	LDFLAGS += -arch i386 -arch x86_64
-endif
-
-# tell compiler to use the target system root
-ifneq ("$(TARGET_SYS_ROOT)","/")
-	CFLAGS += --sysroot=$(TARGET_SYS_ROOT)
-	LDFLAGS += --sysroot=$(TARGET_SYS_ROOT)
-endif
-
-# define the intermediate directory
-INT_DIR = $(CFG)
-
-# define output directory
-OUT_DIR = $(BIN_DIR)/$(CFG)
-
-# define a function to figure .o file for each source file (placed under intermediate directory)
-SRC_TO_OBJ = $(addprefix ./$(INT_DIR)/,$(addsuffix .o,$(notdir $(basename $1))))
-
-# create a list of all object files
-OBJ_FILES = $(call SRC_TO_OBJ,$(SRC_FILES_LIST))
-
-# define a function to translate any source file to its dependency file (note that the way we create
-# dep files, as a side affect of compilation, always puts the files in the INT_DIR with suffix .d)
-SRC_TO_DEP = $(addprefix ./$(INT_DIR)/,$(addsuffix .d,$(notdir $(basename $1))))
-
-# create a list of all dependency files
-DEP_FILES = $(call SRC_TO_DEP,$(SRC_FILES_LIST))
-
-# append the -I switch to each include directory
-INC_DIRS_OPTION = $(foreach dir,$(INC_DIRS),-I$(dir))
-
-# append the -L switch to each library directory
-LIB_DIRS_OPTION = $(foreach dir,$(LIB_DIRS),-L$(dir)) -L$(OUT_DIR)
-
-# append the -l switch to each library used
-USED_LIBS_OPTION = $(foreach lib,$(USED_LIBS),-l$(lib))
-
-# create -r option to mcs
-USED_NETLIBS_OPTION = $(foreach lib,$(USED_LIBS),-r:$(OUT_DIR)/$(lib).dll)
-
-ifeq "$(NET_WIN_FORMS)" "1"
-	USED_NETLIBS_OPTION += -r:System.Windows.Forms.dll -r:System.Drawing.dll
-endif
-
-# append the -D switch to each define
-DEFINES_OPTION = $(foreach def,$(DEFINES),-D$(def))
-
-# some lib / exe specifics
-ifneq "$(LIB_NAME)" ""
-	OUTPUT_NAME = lib$(LIB_NAME).so
-	CFLAGS += -fPIC -fvisibility=hidden
-	ifneq ("$(OSTYPE)","Darwin")
-		OUTPUT_NAME = lib$(LIB_NAME).so
-		OUTPUT_COMMAND = $(CXX) -o $(OUTPUT_FILE) $(OBJ_FILES) $(LDFLAGS) -shared
-	else
-		OUTPUT_NAME = lib$(LIB_NAME).dylib
-		OUTPUT_COMMAND = $(CXX) -o $(OUTPUT_FILE) $(OBJ_FILES) $(LDFLAGS) -dynamiclib -headerpad_max_install_names
-	endif
-endif
-ifneq "$(EXE_NAME)" ""
-	OUTPUT_NAME = $(EXE_NAME)
-	OUTPUT_COMMAND = $(CXX) -o $(OUTPUT_FILE) $(OBJ_FILES) $(LDFLAGS)
-endif
-ifneq "$(SLIB_NAME)" ""
-	OUTPUT_NAME = lib$(SLIB_NAME).a
-	OUTPUT_COMMAND = $(AR) $(OUTPUT_FILE) $(OBJ_FILES)
-endif
-ifneq "$(NETLIB_NAME)" ""
-	OUTPUT_NAME = $(NETLIB_NAME).dll
-	OUTPUT_COMMAND = gmcs -out:$(OUTPUT_FILE) -target:library $(CSFLAGS) $(USED_NETLIBS_OPTION) $(SRC_FILES)
-	NET = 1
-endif
-ifneq "$(NETEXE_NAME)" ""
-	OUTPUT_NAME = $(NETEXE_NAME).exe
-	OUTPUT_COMMAND = gmcs -out:$(OUTPUT_FILE) -target:winexe $(CSFLAGS) $(USED_NETLIBS_OPTION) $(SRC_FILES)
-	NET = 1
-endif
-
-# full path to output file
-OUTPUT_FILE = $(OUT_DIR)/$(OUTPUT_NAME)
-
-# set Debug / Release flags
-ifeq "$(CFG)" "Debug"
-	CFLAGS += -g
-endif
-ifeq "$(CFG)" "Release"
-	CFLAGS += -O2 -DNDEBUG
-
-	ifeq ($(SSE_GENERATION), 2)
-		CFLAGS += -msse2
-	else
-		ifeq ($(SSE_GENERATION), 3)
-			CFLAGS += -msse3
-		else
-			($error "Only SSE2 and SSE3 are supported")
-		endif
-	endif
-	
-	CSFLAGS += -o+
-endif
-
-CFLAGS += $(INC_DIRS_OPTION) $(DEFINES_OPTION)
-LDFLAGS += $(LIB_DIRS_OPTION) $(USED_LIBS_OPTION)
-
-ifeq "$(NET)" "1"
-define CREATE_SRC_TARGETS
-$(call SRC_TO_OBJ,$1) : $1 | $(INT_DIR)
-	touch $(call SRC_TO_OBJ,$1)
-endef
-else
-define CREATE_SRC_TARGETS
-# create a target for the object file (the CXX command creates both an .o file
-# and a .d file)
-ifneq ("$(OSTYPE)","Darwin")
-$(call SRC_TO_OBJ,$1) : $1 | $(INT_DIR)
-	$(CXX) -MD -MP -MT "$(call SRC_TO_DEP,$1) $$@" -c $(CFLAGS) -o $$@ $$<
-else
-$(call SRC_TO_OBJ,$1) : $1 | $(INT_DIR)
-	$(CXX) -c $(CFLAGS) -o $$@ $$<	
-endif
-endef
-endif
-
-#############################################################################
-# Targets
-#############################################################################
-.PHONY: all clean
-
-# define the target 'all' (it is first, and so, default)
-all: $(OUTPUT_FILE)
-
-# Intermediate directory
-$(INT_DIR):
-	mkdir -p $(INT_DIR)
-
-# create targets for each source file
-$(foreach src,$(SRC_FILES_LIST),$(eval $(call CREATE_SRC_TARGETS,$(src))))
-
-# include all dependency files (we don't need them the first time, so we can use -include)
--include $(DEP_FILES)
-
-# Output directory
-$(OUT_DIR):
-	mkdir -p $(OUT_DIR)
-
-# Final output file
-$(OUTPUT_FILE): $(OBJ_FILES) | $(OUT_DIR)
-	$(OUTPUT_COMMAND)
-
-clean:
-	$(RM) $(OUTPUT_FILE) $(OBJ_FILES) $(DEP_FILES)
-	
diff --git a/Platform/Linux-x86/Build/Make.CE4100 b/Platform/Linux-x86/Build/Make.CE4100
deleted file mode 100644
index 9124f9e..0000000
--- a/Platform/Linux-x86/Build/Make.CE4100
+++ /dev/null
@@ -1 +0,0 @@
-make PLATFORM=CE4100
diff --git a/Platform/Linux-x86/Build/Makefile b/Platform/Linux-x86/Build/Makefile
deleted file mode 100644
index 616369f..0000000
--- a/Platform/Linux-x86/Build/Makefile
+++ /dev/null
@@ -1,167 +0,0 @@
-#############################################################################
-# OpenNI makefile.
-# 
-# default configuration is Release. for a debug version use:
-# 	make CFG=Debug
-#
-# default compiler is g++. for another one use:
-#   make CXX=<comp>
-#
-# default platform is x86. for CE4100 use:
-#   make PLATFORM=CE4100
-#
-#############################################################################
-
-# default config is Release
-ifndef CFG
-	CFG = Release
-endif
-export CFG
-
-# default platform is x86
-ifndef PLATFORM
-	PLATFORM = x86
-endif
-
-# tools
-CP = cp
-RM = rm
-
-# Bin directory
-BIN_DIR = ../Bin
-# output directory
-OUT_DIR = $(BIN_DIR)/$(CFG)
-
-# platform specific args
--include Platform.$(PLATFORM)
-
-# list all modules
-ALL_MODULES = \
-	Modules/nimCodecs \
-	Modules/nimMockNodes \
-	Modules/nimRecorder
-
-# list all utils
-ALL_UTILS = \
-	Utils/niReg \
-	Utils/niLicense
-
-ALL_MONO_PROJS = \
-	Wrappers/OpenNI.net
-
-# list all core projects
-ALL_CORE_PROJS = \
-	OpenNI \
-	$(ALL_MODULES) \
-	$(ALL_UTILS)
-
-# list all samples
-CORE_SAMPLES = \
-	Samples/NiSimpleRead \
-	Samples/NiBackRecorder \
-	Samples/NiConvertXToONI \
-	Samples/NiRecordSynthetic \
-	Samples/NiSampleModule \
-	Samples/NiSimpleCreate \
-	Samples/NiCRead \
-	Samples/NiAudioSample \
-	Samples/NiUserTracker
-	
-ifneq "$(PLATFORM)" "CE4100"	
-	CORE_SAMPLES += \
-		Samples/NiViewer \
-		Samples/NiSimpleViewer
-endif
-
-MONO_SAMPLES = \
-	Samples/SimpleRead.net
-
-MONO_FORMS_SAMPLES = \
-	Samples/SimpleViewer.net \
-	Samples/UserTracker.net
-
-ALL_SAMPLES = \
-	$(CORE_SAMPLES)
-
-# list all projects that are build
-ALL_BUILD_PROJS = \
-	$(ALL_CORE_PROJS) \
-	$(ALL_SAMPLES)
-
-ALL_PROJS = \
-	$(ALL_BUILD_PROJS)
-
-ifneq "$(PLATFORM)" "CE4100"
-	# check if mono is installed
-	ifneq "$(realpath /usr/bin/gmcs)" ""
-		ALL_PROJS += $(ALL_MONO_PROJS)
-		ALL_PROJS += $(MONO_SAMPLES)
-		ALL_PROJS += $(MONO_FORMS_SAMPLES)
-	endif
-endif
-
-ALL_PROJS_CLEAN = $(foreach proj,$(ALL_PROJS),$(proj)-clean)
-
-# define a function which creates a target for each proj
-define CREATE_PROJ_TARGET
-$1: 
-	$(MAKE) -C $1
-
-$1-clean: 
-	$(MAKE) -C $1 clean
-endef
-
-################ TARGETS ##################
-
-.PHONY: all $(ALL_PROJS) $(ALL_PROJS_CLEAN) install uninstall clean 
-
-# make all makefiles
-all: $(ALL_PROJS)
-
-core: $(ALL_CORE_PROJS)
-
-samples: $(ALL_SAMPLES)
-
-mono_wrapper: Wrappers/OpenNI.net
-
-mono_samples: $(MONO_SAMPLES) $(MONO_FORMS_SAMPLES)
-
-# create projects targets
-$(foreach proj,$(ALL_PROJS),$(eval $(call CREATE_PROJ_TARGET,$(proj))))
-
-# additional dependencies
-Modules/nimCodecs: OpenNI
-Modules/nimMockNodes: OpenNI
-Modules/nimRecorder: OpenNI
-Utils/niReg: OpenNI
-Utils/niLicense: OpenNI
-Wrappers/OpenNI.net: OpenNI
-Samples/NiSimpleRead: OpenNI
-Samples/NiViewer: OpenNI
-Samples/NiBackRecorder: OpenNI
-Samples/NiConvertXToONI: OpenNI
-Samples/NiRecordSynthetic: OpenNI
-Samples/NiSampleModule: OpenNI
-Samples/NiSimpleCreate: OpenNI
-Samples/NiCRead: OpenNI
-Samples/NiSimpleViewer: OpenNI
-Samples/SimpleRead.net: Wrappers/OpenNI.net
-Samples/SimpleViewer.net: Wrappers/OpenNI.net
-Samples/UserTracker.net: Wrappers/OpenNI.net
-
-# clean is cleaning all projects
-clean: $(ALL_PROJS_CLEAN)
-
-# redist target
-redist: all
-	cd ../CreateRedist; ./RedistMaker; cd -
-
-# install target
-install: redist
-	cd ../Redist; ./install.sh; cd -
-
-# uninstall target
-uninstall:
-	cd ../Redist; ./install.sh -u; cd -
-
-
diff --git a/Platform/Linux-x86/Build/Modules/nimCodecs/Makefile b/Platform/Linux-x86/Build/Modules/nimCodecs/Makefile
deleted file mode 100644
index a6ff666..0000000
--- a/Platform/Linux-x86/Build/Modules/nimCodecs/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = \
-	../../../../../Include \
-	../../../../../Source \
-	../../../../../Source/External/LibJPEG
-
-SRC_FILES = \
-	../../../../../Source/Modules/nimCodecs/*.cpp \
-	../../../../../Source/External/LibJPEG/*.c
-
-LIB_NAME = nimCodecs
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
-
-
diff --git a/Platform/Linux-x86/Build/Modules/nimMockNodes/Makefile b/Platform/Linux-x86/Build/Modules/nimMockNodes/Makefile
deleted file mode 100644
index ae8e4c9..0000000
--- a/Platform/Linux-x86/Build/Modules/nimMockNodes/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = \
-	../../../../../Include \
-	../../../../../Source
-
-SRC_FILES = \
-	../../../../../Source/Modules/nimMockNodes/*.cpp
-
-LIB_NAME = nimMockNodes
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Modules/nimRecorder/Makefile b/Platform/Linux-x86/Build/Modules/nimRecorder/Makefile
deleted file mode 100644
index c33789c..0000000
--- a/Platform/Linux-x86/Build/Modules/nimRecorder/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = \
-	../../../../../Include \
-	../../../../../Source \
-	../../../../../Source/Modules/Common
-
-SRC_FILES = \
-	../../../../../Source/Modules/nimRecorder/*.cpp \
-	../../../../../Source/Modules/Common/*.cpp
-
-LIB_NAME = nimRecorder
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
-
diff --git a/Platform/Linux-x86/Build/OpenNI.vpw b/Platform/Linux-x86/Build/OpenNI.vpw
deleted file mode 100644
index 7dd5705..0000000
--- a/Platform/Linux-x86/Build/OpenNI.vpw
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd">
-<Workspace Version="10.0" VendorName="SlickEdit">
-	<Projects>
-		<Project File="Modules/nimCodecs/nimCodecs.vpj" />
-		<Project File="Modules/nimMockNodes/nimMockNodes.vpj" />
-		<Project File="Modules/nimRecorder/nimRecorder.vpj" />
-		<Project File="Utils/niReg/niReg.vpj" />
-		<Project File="Samples/NiSimpleRead/NiSimpleRead.vpj" />
-		<Project File="Samples/NiViewer/NiViewer.vpj" />
-		<Project File="OpenNI/OpenNI.vpj" />
-	</Projects>
-</Workspace>
diff --git a/Platform/Linux-x86/Build/OpenNI/Makefile b/Platform/Linux-x86/Build/OpenNI/Makefile
deleted file mode 100644
index 563e876..0000000
--- a/Platform/Linux-x86/Build/OpenNI/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-OSTYPE := $(shell uname -s)
-
-BIN_DIR = ../../Bin
-
-INC_DIRS = \
-	../../../../Include \
-	../../../../Source \
-	../../../../Source/External/TinyXml
-
-SRC_FILES = \
-	../../../../Source/OpenNI/*.cpp \
-	../../../../Source/OpenNI/Linux-x86/*.cpp \
-	../../../../Source/External/TinyXml/*.cpp
-
-ifeq ("$(OSTYPE)","Darwin")
-	INC_DIRS += /opt/local/include
-	LIB_DIRS += /opt/local/lib
-	LDFLAGS += -framework CoreFoundation -framework IOKit
-endif
-
-LIB_NAME = OpenNI
-USED_LIBS = usb-1.0 dl
-ifneq ("$(OSTYPE)","Darwin")
-	USED_LIBS += rt
-endif
-DEFINES = XN_EXPORTS
-
-include ../CommonMakefile
-
-
diff --git a/Platform/Linux-x86/Build/Platform.CE4100 b/Platform/Linux-x86/Build/Platform.CE4100
deleted file mode 100644
index 78e8c09..0000000
--- a/Platform/Linux-x86/Build/Platform.CE4100
+++ /dev/null
@@ -1,3 +0,0 @@
-export TARGET_SYS_ROOT=/home/primesense/IntelCE-20/IntelCE-20.0.11052.243195/build_i686/staging_dir
-export CXX=/home/primesense/IntelCE-20/IntelCE-20.0.11052.243195/build_i686/staging_dir/bin/i686-cm-linux-g++ -DCE4100
-export GLES=1
\ No newline at end of file
diff --git a/Platform/Linux-x86/Build/Res/AssemblyInfo-OpenNI.cs b/Platform/Linux-x86/Build/Res/AssemblyInfo-OpenNI.cs
deleted file mode 100644
index 8af41e8..0000000
--- a/Platform/Linux-x86/Build/Res/AssemblyInfo-OpenNI.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("PrimeSense Ltd.")]
-[assembly: AssemblyProduct("OpenNI")]
-[assembly: AssemblyCopyright("Copyright © PrimeSense 2010")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible 
-// to COM components.  If you need to access a type in this assembly from 
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("185e12cd-e399-4d85-bbf3-7f18b9b7bb8c")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.0.41")]
-[assembly: AssemblyFileVersion("1.1.0.41")]
diff --git a/Platform/Linux-x86/Build/Samples/NiAudioSample/Makefile b/Platform/Linux-x86/Build/Samples/NiAudioSample/Makefile
deleted file mode 100644
index 3db252e..0000000
--- a/Platform/Linux-x86/Build/Samples/NiAudioSample/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = ../../../../../Include
-
-SRC_FILES = ../../../../../Samples/NiAudioSample/*.cpp
-
-EXE_NAME = Sample-NiAudioSample
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/NiBackRecorder/Makefile b/Platform/Linux-x86/Build/Samples/NiBackRecorder/Makefile
deleted file mode 100644
index 0a6f039..0000000
--- a/Platform/Linux-x86/Build/Samples/NiBackRecorder/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = ../../../../../Include
-
-SRC_FILES = ../../../../../Samples/NiBackRecorder/*.cpp
-
-EXE_NAME = Sample-NiBackRecorder
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/NiCRead/Makefile b/Platform/Linux-x86/Build/Samples/NiCRead/Makefile
deleted file mode 100644
index 2d7663a..0000000
--- a/Platform/Linux-x86/Build/Samples/NiCRead/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = ../../../../../Include
-
-SRC_FILES = ../../../../../Samples/NiCRead/*.c
-
-EXE_NAME = Sample-NiCRead
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/NiConvertXToONI/Makefile b/Platform/Linux-x86/Build/Samples/NiConvertXToONI/Makefile
deleted file mode 100644
index 4967767..0000000
--- a/Platform/Linux-x86/Build/Samples/NiConvertXToONI/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = ../../../../../Include
-
-SRC_FILES = ../../../../../Samples/NiConvertXToONI/*.cpp
-
-EXE_NAME = Sample-NiConvertXToONI
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/NiRecordSynthetic/Makefile b/Platform/Linux-x86/Build/Samples/NiRecordSynthetic/Makefile
deleted file mode 100644
index 18ad596..0000000
--- a/Platform/Linux-x86/Build/Samples/NiRecordSynthetic/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = ../../../../../Include
-
-SRC_FILES = ../../../../../Samples/NiRecordSynthetic/*.cpp
-
-EXE_NAME = Sample-NiRecordSynthetic
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/NiSampleModule/Makefile b/Platform/Linux-x86/Build/Samples/NiSampleModule/Makefile
deleted file mode 100644
index 99cf3dd..0000000
--- a/Platform/Linux-x86/Build/Samples/NiSampleModule/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = ../../../../../Include
-
-SRC_FILES = ../../../../../Samples/NiSampleModule/*.cpp
-
-LIB_NAME = Sample-NiSampleModule
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/NiSimpleCreate/Makefile b/Platform/Linux-x86/Build/Samples/NiSimpleCreate/Makefile
deleted file mode 100644
index 996b0d2..0000000
--- a/Platform/Linux-x86/Build/Samples/NiSimpleCreate/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = ../../../../../Include
-
-SRC_FILES = ../../../../../Samples/NiSimpleCreate/*.cpp
-
-EXE_NAME = Sample-NiSimpleCreate
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/NiSimpleRead/Makefile b/Platform/Linux-x86/Build/Samples/NiSimpleRead/Makefile
deleted file mode 100644
index ffe6f18..0000000
--- a/Platform/Linux-x86/Build/Samples/NiSimpleRead/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = ../../../../../Include
-
-SRC_FILES = ../../../../../Samples/NiSimpleRead/*.cpp
-
-EXE_NAME = Sample-NiSimpleRead
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/NiSimpleViewer/Makefile b/Platform/Linux-x86/Build/Samples/NiSimpleViewer/Makefile
deleted file mode 100644
index cb07c20..0000000
--- a/Platform/Linux-x86/Build/Samples/NiSimpleViewer/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-OSTYPE := $(shell uname -s)
-
-BIN_DIR = ../../../Bin
-
-INC_DIRS = ../../../../../Include
-
-SRC_FILES = ../../../../../Samples/NiSimpleViewer/*.cpp
-
-EXE_NAME = Sample-NiSimpleViewer
-
-ifeq ("$(OSTYPE)","Darwin")
-	LDFLAGS += -framework OpenGL -framework GLUT
-else
-	USED_LIBS += glut
-endif
-
-USED_LIBS += OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/NiUserTracker/Makefile b/Platform/Linux-x86/Build/Samples/NiUserTracker/Makefile
deleted file mode 100644
index f24f7cd..0000000
--- a/Platform/Linux-x86/Build/Samples/NiUserTracker/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-OSTYPE := $(shell uname -s)
-
-BIN_DIR = ../../../Bin
-
-INC_DIRS = ../../../../../Include
-
-SRC_FILES = \
-	../../../../../Samples/NiUserTracker/main.cpp \
-	../../../../../Samples/NiUserTracker/SceneDrawer.cpp	
-
-EXE_NAME = Sample-NiUserTracker
-
-ifneq "$(GLES)" "1"
-ifeq ("$(OSTYPE)","Darwin")
-	LDFLAGS += -framework OpenGL -framework GLUT
-else
-	USED_LIBS += glut
-endif
-else
-	DEFINES += USE_GLES
-	USED_LIBS += GLES_CM IMGegl srv_um
-	SRC_FILES += ../../../../../Samples/NiUserTracker/opengles.cpp
-endif
-
-USED_LIBS += OpenNI
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/NiViewer/Makefile b/Platform/Linux-x86/Build/Samples/NiViewer/Makefile
deleted file mode 100644
index 561bdcf..0000000
--- a/Platform/Linux-x86/Build/Samples/NiViewer/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-OSTYPE := $(shell uname -s)
-
-BIN_DIR = ../../../Bin
-
-INC_DIRS = \
-	../../../../../Include \
-	../../../../../Samples/NiViewer
-
-SRC_FILES = ../../../../../Samples/NiViewer/*.cpp
-
-ifeq ("$(OSTYPE)","Darwin")
-	LDFLAGS += -framework OpenGL -framework GLUT
-else
-	USED_LIBS += glut
-endif
-
-USED_LIBS += OpenNI
-
-EXE_NAME = NiViewer
-
-include ../../CommonMakefile
-
diff --git a/Platform/Linux-x86/Build/Samples/SimpleRead.net/Makefile b/Platform/Linux-x86/Build/Samples/SimpleRead.net/Makefile
deleted file mode 100644
index 2796c27..0000000
--- a/Platform/Linux-x86/Build/Samples/SimpleRead.net/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BIN_DIR = ../../../Bin
-
-NETEXE_NAME = SimpleRead.net
-
-SRC_FILES = \
-	../../../../../Samples/SimpleRead.net/*.cs \
-	../../Res/AssemblyInfo-OpenNI.cs
-	
-USED_LIBS = OpenNI.net
-
-include ../../CommonMakefile
diff --git a/Platform/Linux-x86/Build/Samples/SimpleViewer.net/Makefile b/Platform/Linux-x86/Build/Samples/SimpleViewer.net/Makefile
deleted file mode 100644
index 8bbda9b..0000000
--- a/Platform/Linux-x86/Build/Samples/SimpleViewer.net/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-BIN_DIR = ../../../Bin
-
-NETEXE_NAME = SimpleViewer.net
-
-SRC_FILES = \
-	../../../../../Samples/SimpleViewer.net/*.cs \
-	../../Res/AssemblyInfo-OpenNI.cs
-
-USED_LIBS = OpenNI.net
-CSFLAGS = -unsafe
-NET_WIN_FORMS = 1
-
-include ../../CommonMakefile
diff --git a/Platform/Linux-x86/Build/Samples/UserTracker.net/Makefile b/Platform/Linux-x86/Build/Samples/UserTracker.net/Makefile
deleted file mode 100644
index 774b071..0000000
--- a/Platform/Linux-x86/Build/Samples/UserTracker.net/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-BIN_DIR = ../../../Bin
-
-NETEXE_NAME = UserTracker.net
-
-SRC_FILES = \
-	../../../../../Samples/UserTracker.net/*.cs \
-	../../Res/AssemblyInfo-OpenNI.cs
-
-USED_LIBS = OpenNI.net
-CSFLAGS = -unsafe
-NET_WIN_FORMS = 1
-
-include ../../CommonMakefile
diff --git a/Platform/Linux-x86/Build/Utils/niLicense/Makefile b/Platform/Linux-x86/Build/Utils/niLicense/Makefile
deleted file mode 100644
index a90273a..0000000
--- a/Platform/Linux-x86/Build/Utils/niLicense/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = \
-	../../../../../Include \
-	../../../../../Source
-
-SRC_FILES = \
-	../../../../../Source/Utils/niLicense/*.cpp
-
-EXE_NAME = niLicense
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
-
-
-
diff --git a/Platform/Linux-x86/Build/Utils/niReg/Makefile b/Platform/Linux-x86/Build/Utils/niReg/Makefile
deleted file mode 100644
index 59230eb..0000000
--- a/Platform/Linux-x86/Build/Utils/niReg/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-BIN_DIR = ../../../Bin
-
-INC_DIRS = \
-	../../../../../Include \
-	../../../../../Source
-
-SRC_FILES = \
-	../../../../../Source/Utils/niReg/*.cpp
-
-EXE_NAME = niReg
-USED_LIBS = OpenNI
-
-include ../../CommonMakefile
-
-
-
-
diff --git a/Platform/Linux-x86/Build/Wrappers/OpenNI.net/Makefile b/Platform/Linux-x86/Build/Wrappers/OpenNI.net/Makefile
deleted file mode 100644
index c129172..0000000
--- a/Platform/Linux-x86/Build/Wrappers/OpenNI.net/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-BIN_DIR = ../../../Bin
-
-NETLIB_NAME = OpenNI.net
-
-SRC_FILES = \
-	../../../../../Wrappers/OpenNI.net/*.cs \
-	../../Res/AssemblyInfo-OpenNI.cs
-
-CSFLAGS += -keyfile:OpenNI.snk
-
-include ../../CommonMakefile
diff --git a/Platform/Linux-x86/CreateRedist/RedistMaker b/Platform/Linux-x86/CreateRedist/RedistMaker
deleted file mode 100755
index 8986f5f..0000000
--- a/Platform/Linux-x86/CreateRedist/RedistMaker
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash -e
-python Redist_OpenNi.py $1
-
diff --git a/Platform/Linux-x86/CreateRedist/RedistMaker.CE4100 b/Platform/Linux-x86/CreateRedist/RedistMaker.CE4100
deleted file mode 100644
index dabb7ee..0000000
--- a/Platform/Linux-x86/CreateRedist/RedistMaker.CE4100
+++ /dev/null
@@ -1 +0,0 @@
-./RedistMaker CE4100
\ No newline at end of file
diff --git a/Platform/Linux-x86/CreateRedist/Redist_OpenNi.py b/Platform/Linux-x86/CreateRedist/Redist_OpenNi.py
deleted file mode 100755
index bef5c6c..0000000
--- a/Platform/Linux-x86/CreateRedist/Redist_OpenNi.py
+++ /dev/null
@@ -1,454 +0,0 @@
-#/***************************************************************************
-#*                                                                          *
-#*  OpenNI 1.1 Alpha                                                        *
-#*  Copyright (C) 2011 PrimeSense Ltd.                                      *
-#*                                                                          *
-#*  This file is part of OpenNI.                                            *
-#*                                                                          *
-#*  OpenNI is free software: you can redistribute it and/or modify          *
-#*  it under the terms of the GNU Lesser General Public License as published*
-#*  by the Free Software Foundation, either version 3 of the License, or    *
-#*  (at your option) any later version.                                     *
-#*                                                                          *
-#*  OpenNI is distributed in the hope that it will be useful,               *
-#*  but WITHOUT ANY WARRANTY; without even the implied warranty of          *
-#*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
-#*  GNU Lesser General Public License for more details.                     *
-#*                                                                          *
-#*  You should have received a copy of the GNU Lesser General Public License*
-#*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.          *
-#*                                                                          *
-#***************************************************************************/
-#
-
-
-#-------------Imports----------------------------------------------------------#
-from xml.dom.minidom import parse, parseString
-from time import strftime
-import logging
-import glob
-import os
-import re
-import sys
-import shutil
-import stat
-
-#-------------Functions--------------------------------------------------------#
-
-def finish_script(exit_code):
-    os.chdir(SCRIPT_DIR)
-    exit(exit_code)
-
-def replace_string_in_file(findStr,repStr,filePath):
-    "replaces all findStr by repStr in file filePath"
-    tempName=filePath+'~~~'
-    input = open(filePath)
-    output = open(tempName,'w')
-    for s in input:
-        output.write(s.replace(findStr,repStr))
-    output.close()
-    input.close()
-    os.remove(filePath)
-    os.rename(tempName,filePath)
-
-def regx_replace(findStr,repStr,filePath):
-    "replaces all findStr by repStr in file filePath using regualr expression"
-    findStrRegx = re.compile(findStr)
-    tempName=filePath+'~~~'
-    input = open(filePath)
-    output = open(tempName,'w')
-    for s in input:
-        output.write(findStrRegx.sub(repStr,s))
-    output.close()
-    input.close()
-    os.remove(filePath)
-    os.rename(tempName,filePath)
-
-def check_sample(sample_dir):
-    "Checks if a sample is a tool or should be skipped, returns: 0 - Regular, 1 - Skip, 2 - Tool"
-    rc = 0
-    if os.path.exists(sample_dir + "/.redist"):
-        redistFile = open(sample_dir + "/.redist")
-    else:
-        rc=0
-        return rc
-    redist_lines =redistFile.readlines()
-    skip_re = re.compile("^SKIP=([^\|]*\|)*(" + PLATFORM + "|ALL)(\|[^\|]*)*$")
-    tool_re = re.compile("^TOOL=([^\|]*\|)*(" + PLATFORM + "|ALL)(\|[^\|]*)*$")
-    for line in redist_lines:
-        if skip_re.search(line):
-            rc = 1
-            redistFile.close()
-            return rc
-        if tool_re.search(line):
-            rc = 2
-            redistFile.close()
-            return rc
-    redistFile.close()
-    return rc
-
-def fix_file(arg,dirname,fname):
-    "Fixes paths for all the files in fname"
-    for filename in fname:
-        filePath = dirname + "/" + filename
-        ext = ['cpp','h','.ini','cs']
-        if filename == "Makefile" or filename.partition(".")[2] in ext:
-            #print "Fixing: " + filePath
-            tempName=filePath+'~~~'
-            input = open(filePath)
-            output = open(tempName,'w')
-            for s in input:
-                olds = s
-                s = re.sub(r"../../../Bin",r"../Bin",s)
-                s = re.sub(r"../../../../../Include",r"../../Include /usr/include/ni",s)
-                s = re.sub(r"../../../../../Samples/.*/",r"",s)
-                s = re.sub(r"../../../../Data/SamplesConfig.xml",r"../../Config/SamplesConfig.xml",s)
-                s = re.sub(r"../../Res/",r"../Res/",s)
-                s = re.sub(r"include ../../CommonMakefile",r"LIB_DIRS += ../../Lib\ninclude ../../Include/CommonMakefile",s)
-
-                output.write(s)
-                
-                #if s != olds:
-                    #print "Changed : " + olds.strip("\n")
-                    #print "To      : " + s.strip("\n")
-
-            output.close()
-            input.close()
-            os.remove(filePath)
-            os.rename(tempName,filePath)
-            
-def copy_install_script(platform, filePath, dest):
-    "Copies the install script and fixing it if needed"
-    input = open(filePath)
-    dest_name = os.path.join(dest, os.path.basename(filePath))
-    output = open(dest_name, 'w')
-    
-    for line in input:
-        if platform == 'CE4100':
-            line = re.sub(r"/var/lib/ni", r"/usr/etc/ni", line)
-            
-        output.write(line)
-        
-    input.close()
-    output.close()
-    os.chmod(dest_name, stat.S_IRUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
-
-platform="x86"
-if len(sys.argv) >= 2:
-    if sys.argv[1] == 'CE4100':
-        platform='CE4100'
-    else:
-        print "Unknown platform!!"
-        finish_script(1)
-
-#------------Constants and globals---------------------------------------------#
-DateTimeSTR = strftime("%Y-%m-%d %H:%M:%S")
-DateSTR = strftime("%Y-%m-%d")
-SCRIPT_DIR = os.getcwd()
-# Fix to allow reletive path
-WORK_DIR = os.getcwd() + "/"
-os.chdir(SCRIPT_DIR)
-PROJECT_NAME = "OpenNI"
-ostype = os.popen('uname -s').read().rstrip()
-machinetype = os.popen('uname -m').read().rstrip()
-
-#-------------Log--------------------------------------------------------------#
-
-# Create output dir
-if (os.path.exists(SCRIPT_DIR + "/Output")):
-    shutil.rmtree(SCRIPT_DIR + "/Output")
-if (os.path.exists(SCRIPT_DIR + "/Final")):
-    shutil.rmtree(SCRIPT_DIR + "/Final")
-os.makedirs(SCRIPT_DIR + "/Output")
-logger = logging.getLogger('myapp')
-hdlr = logging.FileHandler('Output/Nightly.log')
-formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
-hdlr.setFormatter(formatter)
-logger.addHandler(hdlr)
-logger.setLevel(logging.INFO)
-
-#------------Welcome Messege--------=------------------------------------------#
-print "\n";
-print "*********************************"
-print "*   PrimeSense OpenNI Redist    *"
-print "*     " + DateTimeSTR + "       *"
-print "*********************************"
-logger.info("PrimeSense OpenNI Redist Started")
-
-#--------------Take Version----------------------------------------------------#
-print "* Taking version..."
-logger.info("Taking version...")
-
-version_file = open("../../../Include/XnVersion.h").read()
-major = re.search(r"define XN_MAJOR_VERSION (\d+)", version_file).groups()[0]
-minor = re.search(r"define XN_MINOR_VERSION (\d+)", version_file).groups()[0]
-maintenance = re.search(r"define XN_MAINTENANCE_VERSION (\d+)", version_file).groups()[0]
-build = re.search(r"define XN_BUILD_VERSION (\d+)", version_file).groups()[0]
-
-version = major + "." + minor + "." + maintenance + "." + build
-print "version is", version
-
-#--------------Build Project---------------------------------------------------#
-print "* Building OpenNI..."
-logger.info("Building OpenNI...")
-
-# Build
-result = os.system("gacutil -u OpenNI.net > " + SCRIPT_DIR + "/Output/gacutil.txt")
-#result = os.system('make PLATFORM=' + platform + ' -C ../Build clean > ' + SCRIPT_DIR + '/Output/Build' + PROJECT_NAME + '_clean.txt')
-result = os.system('make PLATFORM=' + platform + ' -C ../Build > ' + SCRIPT_DIR + '/Output/Build' + PROJECT_NAME + '.txt')
-
-# Get the build output
-lines = open(SCRIPT_DIR+"/Output/Build" + PROJECT_NAME + ".txt").readlines()
-build_result = lines[-1]
-print(build_result)
-logger.info(build_result)
-
-# Check for failed build
-if result != 0:
-    print "Building Failed!!"
-    logger.critical("Building Failed!")
-    finish_script(1)
-
-#--------------Doxygen---------------------------------------------------------#
-print "* Creating Doxygen..."
-logger.info("Creating DoxyGen...")
-os.chdir("../../../Source/DoxyGen");
-if os.path.exists("html"):
-    os.system("rm -rf html")
-# Running doxygen
-os.system("mkdir html")
-result = os.system("doxygen Doxyfile > "+ SCRIPT_DIR + "/Output/EngineDoxy.txt")
-
-if result != 0:
-    print "Creating documentation failed!"
-    logger.critical("DoxyGen Failed!")
-
-# remove unneeded files
-os.system("rm -rf html/*.map html/*.md5 html/*.hhc html/*.hhk html/*.hhp")
-
-#-------------Create Redist Dir------------------------------------------------#
-print "* Creating Redist Dir..."
-logger.info("Creating Redist Dir...")
-os.chdir(SCRIPT_DIR + "/..")
-
-# Removing the old directory
-if (os.path.exists("Redist")):
-    shutil.rmtree("Redist")
-
-# Creating new directory tree
-os.makedirs("Redist")
-os.makedirs("Redist/Bin")
-os.makedirs("Redist/Lib")
-os.makedirs("Redist/Include")
-os.makedirs("Redist/Documentation")
-os.makedirs("Redist/Samples")
-os.makedirs("Redist/Samples/Bin")
-os.makedirs("Redist/Samples/Bin/Debug")
-os.makedirs("Redist/Samples/Bin/Release")
-os.makedirs("Redist/Samples/Build")
-os.makedirs("Redist/Samples/Config")
-os.makedirs("Redist/Samples/Res")
-
-#-------------Copy files to redist---------------------------------------------#
-print "* Copying files to redist dir..."
-logger.info("Copying files to redist dir...")
-
-#license
-shutil.copy("../../GPL.txt", "Redist")
-shutil.copy("../../LGPL.txt", "Redist")
-
-#lib
-if ostype == "Darwin":
-    LIBS_TYPE = ".dylib"
-else:
-    LIBS_TYPE = ".so"
-
-shutil.copy("Bin/Release/libnimCodecs"+LIBS_TYPE, "Redist/Lib")
-shutil.copy("Bin/Release/libnimMockNodes"+LIBS_TYPE, "Redist/Lib")
-shutil.copy("Bin/Release/libnimRecorder"+LIBS_TYPE, "Redist/Lib")
-shutil.copy("Bin/Release/libOpenNI"+LIBS_TYPE, "Redist/Lib")
-
-#bin
-MonoDetected = 0
-shutil.copy("Bin/Release/niReg", "Redist/Bin")
-shutil.copy("Bin/Release/niLicense", "Redist/Bin")
-if platform != 'CE4100':
-	if (os.path.exists("/usr/bin/gmcs")):
-	    shutil.copy("Bin/Release/OpenNI.net.dll", "Redist/Bin")
-	    shutil.copy("Bin/Release/OpenNI.net.dll", "Redist/Samples/Bin/Debug")
-	    shutil.copy("Bin/Release/OpenNI.net.dll", "Redist/Samples/Bin/Release")
-	    MonoDetected = 1
-
-#docs
-shutil.copytree("../../Source/DoxyGen/html", "Redist/Documentation/html")
-
-#include
-for includeFile in os.listdir("../../Include"):
-    if not os.path.isdir("../../Include/" + includeFile):
-        shutil.copy("../../Include/" + includeFile, "Redist/Include")
-
-shutil.copytree("../../Include/Linux-x86", "Redist/Include/Linux-x86")
-shutil.copytree("../../Include/Linux-Arm", "Redist/Include/Linux-Arm")
-shutil.copytree("../../Include/MacOSX", "Redist/Include/MacOSX")
-shutil.copy("Build/CommonMakefile", "Redist/Include")
-
-# samples
-samples_list = os.listdir("Build/Samples")
-if '.svn' in samples_list:
-    samples_list.remove('.svn')
-
-if platform == 'CE4100':
-    samples_list.remove('NiViewer')
-    samples_list.remove('NiSimpleViewer')
-
-if (MonoDetected == 0):
-    samples_list.remove("SimpleRead.net")
-    samples_list.remove("SimpleViewer.net")
-    samples_list.remove("UserTracker.net")
-
-print "Samples:", samples_list
-
-for sample in samples_list:
-    shutil.copytree("../../Samples/" + sample, "Redist/Samples/" + sample)
-    shutil.copy("Build/Samples/"+ sample + "/Makefile", "Redist/Samples/"+ sample)
-
-#data
-shutil.copy("../../Data/SamplesConfig.xml", "Redist/Samples/Config/SamplesConfig.xml")
-
-#res
-res_files = os.listdir("Build/Res")
-if '.svn' in res_files:
-    res_files.remove('.svn')
-for res_file in res_files:
-    shutil.copy("Build/Res/" + res_file, "Redist/Samples/Res")
-
-# remove all .svn files
-os.system("find Redist/. | grep .svn | xargs rm -rf")
-
-# remove all .svn files
-os.system("find Redist/Samples/. | grep .svn | xargs rm -rf")
-
-#-----Remove Read Only Attrib--------------------------------------------------#
-print "* Removing Read Only Attributes..."
-logger.info("Removing Read Only Attributes...")
-os.system ("chmod -R +r Redist/*")
-
-#--------Fixing Files----------------------------------------------------------#
-print "* Fixing Files..."
-logger.info("Fixing Files...")
-os.path.walk("Redist/Samples",fix_file,'')
-
-#-------Creating project and solutions-----------------------------------------#
-print "* Creating Makefile..."
-logger.info("Creating Makefile...")
-
-MAKEFILE = open("Redist/Samples/Build/Makefile", 'w')
-MAKEFILE.write("-include Platform.$(PLATFORM)\n\n")
-MAKEFILE.write(".PHONY: all\n\n")
-MAKEFILE.write("NETPROJ = \n")
-
-MAKEFILE.write("ifneq \"$(realpath /usr/bin/gmcs)\" \"\"\n");
-for sample in samples_list:
-    if sample.find(".net") >0:
-        MAKEFILE.write("\tNETPROJ += " + sample + "\n")
-MAKEFILE.write("endif\n\n");
-
-MAKEFILE.write("all: $(NETPROJ) ")
-for sample in samples_list:
-    if sample.find(".net") == -1:
-        MAKEFILE.write(sample + " ")
-MAKEFILE.write("\n\n")
-
-for sample in samples_list:
-    MAKEFILE.write("\n")
-    MAKEFILE.write(".PHONY: "+sample+"\n")
-    MAKEFILE.write(sample+":\n")
-    MAKEFILE.write("\t$(MAKE) -C ../"+sample+"\n")
-# Close files
-MAKEFILE.close()
-
-# copy platform file
-platform_file = "Build/Platform." + platform
-if os.path.exists(platform_file):
-    shutil.copy(platform_file, "Redist/Samples/Build")
-
-#-------Copy install script---------------------------------------------------#
-print "* Copying install script..."
-logger.info("Copying install script...")
-
-copy_install_script(platform, "CreateRedist/install.sh", "Redist")
-
-#-------------Build Samples---------------------------------------------------#
-print "* Building Samples in release configuration......"
-logger.info("Building Samples in release configuration...")
-
-# Build project solution
-result = os.system("make PLATFORM=" + platform + " -C Redist/Samples/Build " + " > "+SCRIPT_DIR+"/Output/BuildSmpRelease.txt")
-
-# Get the build output
-lines = open(SCRIPT_DIR+"/Output/BuildSmpRelease.txt").readlines()
-build_result = lines[-1]
-print(build_result)
-logger.info(build_result)
-
-# Check for failed build
-if result != 0:
-    print "Samples Building In Release Failed!!"
-    logger.critical("Samples Building Failed!")
-    finish_script(1)
-
-print "* Building Samples in debug configuration......"
-logger.info("Building Samples in debug configuration...")
-
-# Build project solution
-result = os.system("make CFG=Debug -C Redist/Samples/Build > "+SCRIPT_DIR+"/Output/BuildSmpDebug.txt")
-
-# Get the build output
-lines = open(SCRIPT_DIR+"/Output/BuildSmpDebug.txt").readlines()
-build_result = lines[-1]
-print(build_result)
-logger.info(build_result)
-
-# Check for failed build
-if result != 0:
-    print "Samples Building In Debug Failed!!"
-    logger.critical("Samples Building Failed!")
-    finish_script(1)
-
-# delete intermidiate files
-for sample in samples_list:
-   os.system("rm -rf Redist/Samples/"+sample+"/Debug")
-   os.system("rm -rf Redist/Samples/"+sample+"/Release")
-
-
-#-------------Create TAR-------------------------------------------------------#
-print "* Creating tar......"
-logger.info("Creating tar...")
-
-os.chdir("Redist")
-os.makedirs(SCRIPT_DIR+"/Final")
-
-if ostype == "Darwin":
-    TAR_TARGET = "MacOSX"
-elif platform == 'CE4100':
-    TAR_TARGET = "CE4100"
-elif machinetype == "i686":
-    TAR_TARGET = "Linux32"
-elif machinetype == "x86_64":
-    TAR_TARGET = "Linux64"
-else:
-    TAR_TARGET = "Linux"
-
-result = os.system("tar -cjf " +SCRIPT_DIR+"/Final/OpenNI-Bin-" + TAR_TARGET + "-v" + version + ".tar.bz2 *")
-
-if result != 0:
-    print "Tar failed!!"
-    logger.critical("Creating Tar Failed!")
-    finish_script(1)
-
-#-------------CleanUP----------------------------------------------------------#
-print "* Redist OpenNi Ended.   !!"
-logger.info("Redist OpenNi Ended.")
-finish_script(0)
-
-
diff --git a/Platform/Linux-x86/CreateRedist/install.sh b/Platform/Linux-x86/CreateRedist/install.sh
deleted file mode 100755
index dde0cbb..0000000
--- a/Platform/Linux-x86/CreateRedist/install.sh
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/bin/sh -e
-
-INSTALL_LIB=/usr/lib
-INSTALL_BIN=/usr/bin
-INSTALL_INC=/usr/include/ni
-INSTALL_VAR=/var/lib/ni
-
-OS_NAME=`uname -s`
-
-case $OS_NAME in
-Darwin)
-	MODULES="libnimMockNodes.dylib libnimCodecs.dylib libnimRecorder.dylib"
-	;;
-*)
-	MODULES="libnimMockNodes.so libnimCodecs.so libnimRecorder.so"
-	;;
-esac
-
-SCRIPT_DIR=`pwd`/`dirname $0`
-
-# create file list
-LIB_FILES=`ls $SCRIPT_DIR/Lib/*`
-BIN_FILES=`ls $SCRIPT_DIR/Bin/ni*`
-
-case $1 in
--i | "")
-	printf "Installing OpenNI\n"
-	printf "****************************\n\n"
-	
-	# copy libraries
-	printf "copying shared libraries..."
-	cp $LIB_FILES $INSTALL_LIB
-    printf "OK\n"
-
-	# utilities
-	printf "copying executables..."
-	cp $BIN_FILES $INSTALL_BIN
-    printf "OK\n"
-
-	# include files
-	printf "copying include files..."
-	mkdir -p $INSTALL_INC
-	cp -r Include/* $INSTALL_INC
-    printf "OK\n"
-
-	# create database dir
-	printf "creating database directory..."
-	mkdir -p $INSTALL_VAR
-    printf "OK\n"
-
-	# register modules
-	for module in $MODULES; do
-		printf "registering module '$module'..."
-		niReg -r $INSTALL_LIB/$module
-		printf "OK\n"
-	done
-
-        # mono
-	if [ -f /usr/bin/gmcs ]
-	then
-		gacutil -i Bin/OpenNI.net.dll -package 2.0
-	fi
-	;;
-	
--u)
-	printf "Uninstalling OpenNI\n"
-	printf "****************************\n\n"
-
-	# unregister modules
-	for module in $MODULES; do
-    	printf "unregistering module '$module'..."
-        if niReg -u $INSTALL_LIB/$module; then
-            printf "OK\n"
-        fi
-	done
-
-	# include files
-	printf "removing include files..."
-	rm -rf $INSTALL_INC
-	printf "OK\n"
-
-	# binaries
-	printf "removing executables..."
-    for filename in $BIN_FILES; do
-        rm -f $INSTALL_BIN/`basename $filename`
-    done
-	printf "OK\n"
-
-	# libraries
-    printf "removing shared libraries..."
-    for filename in $LIB_FILES; do
-        rm -f $INSTALL_LIB/`basename $filename`
-    done
-    printf "OK\n"
-
-	# mono
-	if [ -f /usr/bin/gmcs ]
-	then
-		printf "Removing OpenNI.net: "
-		gacutil -u OpenNI.net
-	fi
-	;;
-*) 
-	echo "Usage: $0 [options]"
-	echo "Available options:"
-	printf "\t-i\tInstall (default)\n"
-	printf "\t-u\tUninstall\n"
-	exit 1
-	;;
-esac
-
-printf "\n*** DONE ***\n\n"
-
diff --git a/Platform/Linux/Build/Common/CommonCSMakefile b/Platform/Linux/Build/Common/CommonCSMakefile
new file mode 100644
index 0000000..d196440
--- /dev/null
+++ b/Platform/Linux/Build/Common/CommonCSMakefile
@@ -0,0 +1,58 @@
+#############################################################################
+# Primesense template makefile.
+# This file should not be made, but only included from other makefiles.
+# By default, this makefile compiles in release. To compile a debug version:
+#    make CFG=Debug
+#
+# Project makefile should define the following BEFORE including this file:
+# SRC_FILES - a list of all source files
+# Output name under one of the following:
+#     NETLIB_NAME (.net module) or
+#     NETEXE_NAME (.net executable)
+# BIN_DIR - Bin directory (output dir)
+# INC_DIRS - a list of additional include directories
+# USED_LIBS - a list of libraries to link with
+# CSFLAGS - [Optional] additional flags for mono compiler
+# NET_WIN_FORMS - [Optional] when 1, application uses WinForms
+#############################################################################
+
+# take this file's dir
+COMMON_CS_MAKE_FILE_DIR = $(dir $(lastword $(MAKEFILE_LIST)))
+
+include $(COMMON_CS_MAKE_FILE_DIR)CommonDefs.mak
+
+# create -r option to mcs
+USED_NETLIBS_OPTION = $(foreach lib,$(USED_LIBS),-r:$(lib).dll)
+
+ifeq "$(NET_WIN_FORMS)" "1"
+	USED_NETLIBS_OPTION += -r:System.Windows.Forms.dll -r:System.Drawing.dll
+endif
+
+# add the output dir as a place to search for assemblies
+USED_NETLIBS_OPTION += -lib:$(OUT_DIR)
+
+ifeq "$(CFG)" "Release"
+	CSFLAGS += -o+
+endif
+
+# some lib / exe specifics
+ifneq "$(NETLIB_NAME)" ""
+	OUTPUT_NAME = $(NETLIB_NAME).dll
+	TARGET = library
+endif
+ifneq "$(NETEXE_NAME)" ""
+	OUTPUT_NAME = $(NETEXE_NAME).exe
+	TARGET = winexe
+endif
+
+OUTPUT_COMMAND = gmcs -out:$(OUTPUT_FILE) -target:$(TARGET) $(CSFLAGS) $(USED_NETLIBS_OPTION) $(SRC_FILES)
+
+#############################################################################
+# Targets
+#############################################################################
+include $(COMMON_CS_MAKE_FILE_DIR)CommonTargets.mak
+
+# Final output file
+$(OUTPUT_FILE): 
+	$(OUTPUT_COMMAND)
+
diff --git a/Platform/Linux/Build/Common/CommonCppMakefile b/Platform/Linux/Build/Common/CommonCppMakefile
new file mode 100644
index 0000000..c2c4afc
--- /dev/null
+++ b/Platform/Linux/Build/Common/CommonCppMakefile
@@ -0,0 +1,132 @@
+#############################################################################
+# Primesense template makefile.
+# This file should not be made, but only included from other makefiles.
+# By default, this makefile compiles in release. To compile a debug version:
+#    make CFG=Debug
+#
+# Project makefile should define the following BEFORE including this file:
+# SRC_FILES - a list of all source files
+# Output name under one of the following:
+#     EXE_NAME (executable), 
+#     LIB_NAME (dynamic library) or 
+#     SLIB_NAME (static library) or
+# BIN_DIR - Bin directory (output dir)
+# INC_DIRS - a list of additional include directories
+# LIB_DIRS - a list of additional library directories
+# USED_LIBS - a list of libraries to link with
+# DEFINES - [Optional] additional preprocessor defines
+# CFLAGS - [Optional] additional flags for the compiler
+# LDFLAGS - [Optional] additional flags for the linker
+# SSE_GENERATION - [Optional] The SSE generation to use (default is 3)
+# TARGET_SYS_ROOT - [Optional] The path to the root of the target
+#############################################################################
+
+# take this file's dir
+COMMON_CPP_MAKE_FILE_DIR = $(dir $(lastword $(MAKEFILE_LIST)))
+
+include $(COMMON_CPP_MAKE_FILE_DIR)CommonDefs.mak
+
+# define a function to figure .o file for each source file (placed under intermediate directory)
+SRC_TO_OBJ = $(addprefix ./$(INT_DIR)/,$(addsuffix .o,$(notdir $(basename $1))))
+
+# create a list of all object files
+OBJ_FILES = $(call SRC_TO_OBJ,$(SRC_FILES_LIST))
+
+# define a function to translate any source file to its dependency file (note that the way we create
+# dep files, as a side affect of compilation, always puts the files in the INT_DIR with suffix .d)
+SRC_TO_DEP = $(addprefix ./$(INT_DIR)/,$(addsuffix .d,$(notdir $(basename $1))))
+
+# create a list of all dependency files
+DEP_FILES = $(call SRC_TO_DEP,$(SRC_FILES_LIST))
+
+# older version of gcc doesn't support the '=' symbol in include dirs, so we replace it ourselves with sysroot
+INC_DIRS_FROM_SYSROOT = $(patsubst =/%,$(TARGET_SYS_ROOT)/%,$(INC_DIRS))
+
+# append the -I switch to each include directory
+INC_DIRS_OPTION = $(foreach dir,$(INC_DIRS_FROM_SYSROOT),-I$(dir))
+
+# append the -L switch to each library directory
+LIB_DIRS_OPTION = $(foreach dir,$(LIB_DIRS),-L$(dir)) -L$(OUT_DIR)
+
+# append the -l switch to each library used
+USED_LIBS_OPTION = $(foreach lib,$(USED_LIBS),-l$(lib))
+
+# append the -D switch to each define
+DEFINES_OPTION = $(foreach def,$(DEFINES),-D$(def))
+
+# tell compiler to use the target system root
+ifdef TARGET_SYS_ROOT
+	CFLAGS += --sysroot=$(TARGET_SYS_ROOT)
+	LDFLAGS += --sysroot=$(TARGET_SYS_ROOT)
+endif
+
+# set Debug / Release flags
+ifeq "$(CFG)" "Debug"
+	CFLAGS += -O0 -g
+endif
+ifeq "$(CFG)" "Release"
+	CFLAGS += -O2 -DNDEBUG
+endif
+
+CFLAGS += $(INC_DIRS_OPTION) $(DEFINES_OPTION)
+LDFLAGS += $(LIB_DIRS_OPTION) $(USED_LIBS_OPTION)
+
+# some lib / exe specifics
+ifneq "$(LIB_NAME)" ""
+	OUTPUT_NAME = lib$(LIB_NAME).so
+	CFLAGS += -fPIC -fvisibility=hidden
+	ifneq ("$(OSTYPE)","Darwin")
+		LDFLAGS += -Wl,--no-undefined
+		OUTPUT_NAME = lib$(LIB_NAME).so
+		OUTPUT_COMMAND = $(CXX) -o $(OUTPUT_FILE) $(OBJ_FILES) $(LDFLAGS) -shared
+	else
+		LDFLAGS += -undefined error
+		OUTPUT_NAME = lib$(LIB_NAME).dylib
+		OUTPUT_COMMAND = $(CXX) -o $(OUTPUT_FILE) $(OBJ_FILES) $(LDFLAGS) -dynamiclib -headerpad_max_install_names
+	endif
+endif
+ifneq "$(EXE_NAME)" ""
+	OUTPUT_NAME = $(EXE_NAME)
+	OUTPUT_COMMAND = $(CXX) -o $(OUTPUT_FILE) $(OBJ_FILES) $(LDFLAGS)
+endif
+ifneq "$(SLIB_NAME)" ""
+	CFLAGS += -fPIC
+	OUTPUT_NAME = lib$(SLIB_NAME).a
+	OUTPUT_COMMAND = $(AR) -cq $(OUTPUT_FILE) $(OBJ_FILES)
+endif
+
+define CREATE_SRC_TARGETS
+# create a target for the object file (the CXX command creates both an .o file
+# and a .d file)
+ifneq ("$(OSTYPE)","Darwin")
+$(call SRC_TO_OBJ,$1) : $1 | $(INT_DIR)
+	$(CXX) -MD -MP -MT "$(call SRC_TO_DEP,$1) $$@" -c $(CFLAGS) -o $$@ $$<
+else
+$(call SRC_TO_OBJ,$1) : $1 | $(INT_DIR)
+	$(CXX) -c $(CFLAGS) -o $$@ $$<
+endif
+endef
+
+#############################################################################
+# Targets
+#############################################################################
+.PHONY: clean-objs clean-defs
+
+include $(COMMON_CPP_MAKE_FILE_DIR)CommonTargets.mak
+
+# create targets for each source file
+$(foreach src,$(SRC_FILES_LIST),$(eval $(call CREATE_SRC_TARGETS,$(src))))
+
+# include all dependency files (we don't need them the first time, so we can use -include)
+-include $(DEP_FILES)
+
+$(OUTPUT_FILE): $(OBJ_FILES)
+	$(OUTPUT_COMMAND)
+
+clean-objs:
+	rm -rf $(OBJ_FILES)
+	
+clean-defs:
+	rm -rf $(DEP_FILES)
+
+clean: clean-objs clean-defs
diff --git a/Platform/Linux/Build/Common/CommonDefs.mak b/Platform/Linux/Build/Common/CommonDefs.mak
new file mode 100644
index 0000000..546a46a
--- /dev/null
+++ b/Platform/Linux/Build/Common/CommonDefs.mak
@@ -0,0 +1,57 @@
+# some defaults
+ifndef CFG
+    CFG = Release
+endif
+
+# find out the platform on which we're running
+MACHINE = $(shell uname -m)
+ifneq (,$(findstring x86_64,$(MACHINE)))
+	HOST_PLATFORM = x64
+else ifneq (,$(findstring x86,$(MACHINE)))
+	HOST_PLATFORM = x86
+else ifneq (,$(findstring i686,$(MACHINE)))
+	HOST_PLATFORM = x86
+else ifneq (,$(findstring i386,$(MACHINE)))
+	HOST_PLATFORM = x86
+else ifneq (,$(findstring arm,$(MACHINE)))
+	HOST_PLATFORM = Arm
+else
+	DUMMY:=$(error Can't determine host platform)
+endif
+
+# now check if this is a cross-compilation or not
+ifeq "$(PLATFORM)" ""
+	PLATFORM = $(HOST_PLATFORM)
+else
+	ifneq "$(PLATFORM)" "$(HOST_PLATFORM)"
+		# cross compiling. Take CXX and STAGING_DIR from environment
+		PLATFORM_UPPER = $(shell echo $(PLATFORM) | tr 'a-z' 'A-Z')
+		DUMMY:=$(eval CXX = $($(PLATFORM_UPPER)_CXX))
+		DUMMY:=$(eval TARGET_SYS_ROOT = $($(PLATFORM_UPPER)_STAGING))
+		
+		ifeq "$(and $(CXX), $(TARGET_SYS_ROOT))" ""
+			DUMMY:=$(error Cross-Compilation error. Can't find $(PLATFORM_UPPER)_CXX and $(PLATFORM_UPPER)_STAGING)
+		endif
+	endif
+endif
+
+# expand file list
+SRC_FILES_LIST = $(wildcard $(SRC_FILES))
+
+# define the intermediate directory
+INT_DIR = $(PLATFORM)-$(CFG)
+
+# define output directory
+OUT_DIR = $(BIN_DIR)/$(PLATFORM)-$(CFG)
+
+# full path to output file
+OUTPUT_FILE = $(OUT_DIR)/$(OUTPUT_NAME)
+
+# take this file's dir
+COMMON_MAK_DIR = $(dir $(lastword $(MAKEFILE_LIST)))
+
+# get the OS type
+OSTYPE := $(shell uname -s)
+
+# platform specific args
+include $(COMMON_MAK_DIR)Platform.$(PLATFORM)
diff --git a/Platform/Linux/Build/Common/CommonJavaMakefile b/Platform/Linux/Build/Common/CommonJavaMakefile
new file mode 100644
index 0000000..2aa5f82
--- /dev/null
+++ b/Platform/Linux/Build/Common/CommonJavaMakefile
@@ -0,0 +1,79 @@
+#############################################################################
+# Primesense template makefile.
+# This file should not be made, but only included from other makefiles.
+# By default, this makefile compiles in release. To compile a debug version:
+#    make CFG=Debug
+#
+# Project makefile should define the following BEFORE including this file:
+# SRC_FILES - a list of all source files
+# JAR_NAME - name of the package
+# BIN_DIR - Bin directory (output dir)
+# INC_DIRS - a list of additional include directories
+# LIB_DIRS - a list of additional library directories
+# USED_JARS - a list of libraries used
+# MAIN_CLASS - [Optional] for executable jar
+#############################################################################
+
+# take this file's dir
+COMMON_CS_MAKE_FILE_DIR = $(dir $(lastword $(MAKEFILE_LIST)))
+
+include $(COMMON_CS_MAKE_FILE_DIR)CommonDefs.mak
+
+nullstring :=
+space := $(nullstring) # end of the line
+
+USED_JARS_OPTION =
+ifneq "$(USED_JARS)" ""
+	USED_JARS_PATH = $(foreach jar, $(USED_JARS), $(OUT_DIR)/$(jar).jar /usr/share/java/$(jar).jar)
+	USED_JARS_OPTION = -cp $(subst $(space),:,$(strip $(USED_JARS_PATH)))
+endif
+
+OUTPUT_NAME = $(JAR_NAME).jar
+
+# create manifest file if needed
+JAR_MANIFEST_CREATE_COMMAND := 
+MANIFEST_FILE := 
+JAR_OPTIONS = -cf
+
+ifneq (, $(if $(or $(MAIN_CLASS), $(USED_JARS)),1))
+	JAR_OPTIONS = -cfm
+	MANIFEST_FILE = Manifest.txt
+	JAR_MANIFEST_CREATE_COMMAND = (
+	ifneq (,$(MAIN_CLASS))
+		JAR_MANIFEST_CREATE_COMMAND += echo "Main-Class: $(MAIN_CLASS)";
+	endif
+	ifneq (,$(USED_JARS))
+		JAR_MANIFEST_CREATE_COMMAND += echo "Class-Path: $(USED_JARS_PATH)";
+	endif
+	JAR_MANIFEST_CREATE_COMMAND += ) > $(MANIFEST_FILE)
+endif
+
+CREATE_SHORTCUT = 
+ifneq (, $(MAIN_CLASS))
+	SHORTCUT = $(OUT_DIR)/$(JAR_NAME)
+	CREATE_SHORTCUT = echo java -jar $(OUTPUT_NAME) > $(SHORTCUT); chmod +x $(SHORTCUT)
+endif
+
+#############################################################################
+# Targets
+#############################################################################
+include $(COMMON_CS_MAKE_FILE_DIR)CommonTargets.mak
+
+.PHONY: clean-manifest clean-int
+
+# Final output file
+$(OUTPUT_FILE): | $(INT_DIR)
+	javac $(USED_JARS_OPTION) -d $(INT_DIR) $(SRC_FILES)
+	$(JAR_MANIFEST_CREATE_COMMAND)
+	jar $(JAR_OPTIONS) $@ $(MANIFEST_FILE) -C $(INT_DIR) .
+	$(CREATE_SHORTCUT)
+
+clean-manifest:
+	rm -rf $(MANIFEST_FILE)
+	
+clean-int:
+	rm -rf $(INT_DIR)
+	
+clean: clean-manifest clean-int
+
+
diff --git a/Platform/Linux/Build/Common/CommonTargets.mak b/Platform/Linux/Build/Common/CommonTargets.mak
new file mode 100644
index 0000000..ca13126
--- /dev/null
+++ b/Platform/Linux/Build/Common/CommonTargets.mak
@@ -0,0 +1,23 @@
+#############################################################################
+# Targets
+#############################################################################
+.PHONY: all clean clean-$(OUTPUT_FILE)
+
+# define the target 'all' (it is first, and so, default)
+all: $(OUTPUT_FILE)
+
+# Intermediate directory
+$(INT_DIR):
+	mkdir -p $(INT_DIR)
+
+# Output directory
+$(OUT_DIR):
+	mkdir -p $(OUT_DIR)
+
+# Final output file
+$(OUTPUT_FILE): $(SRC_FILES_LIST) | $(OUT_DIR)
+
+clean-$(OUTPUT_FILE):
+	rm -rf $(OUTPUT_FILE)
+	
+clean: clean-$(OUTPUT_FILE)
\ No newline at end of file
diff --git a/Platform/Linux/Build/Common/Platform.Arm b/Platform/Linux/Build/Common/Platform.Arm
new file mode 100644
index 0000000..c85cfb7
--- /dev/null
+++ b/Platform/Linux/Build/Common/Platform.Arm
@@ -0,0 +1,12 @@
+ifeq "$(CFG)" "Release"
+
+    # Hardware specifying flags
+    CFLAGS += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8
+
+    # Optimization level, minus currently buggy optimizing methods (which break bit-exact)
+    CFLAGS += -O3 -fno-tree-pre -fno-strict-aliasing
+
+    # More optimization flags
+    CFLAGS += -ftree-vectorize -ffast-math -funsafe-math-optimizations -fsingle-precision-constant
+
+endif
diff --git a/Platform/Linux/Build/Common/Platform.x64 b/Platform/Linux/Build/Common/Platform.x64
new file mode 100644
index 0000000..5643ffc
--- /dev/null
+++ b/Platform/Linux/Build/Common/Platform.x64
@@ -0,0 +1,5 @@
+# take this file's dir
+COMMON_MAK_DIR = $(dir $(lastword $(MAKEFILE_LIST)))
+
+# everything is the same as in x86
+include $(COMMON_MAK_DIR)Platform.x86
diff --git a/Platform/Linux/Build/Common/Platform.x86 b/Platform/Linux/Build/Common/Platform.x86
new file mode 100644
index 0000000..04dd480
--- /dev/null
+++ b/Platform/Linux/Build/Common/Platform.x86
@@ -0,0 +1,25 @@
+# some defaults
+export GLUT_SUPPORTED=1
+
+ifndef SSE_GENERATION
+	SSE_GENERATION = 3
+endif
+
+ifeq ("$(OSTYPE)","Darwin")
+	# Making the binary a universal one (x86 + x64)
+	CFLAGS += -arch i386 -arch x86_64
+	LDFLAGS += -arch i386 -arch x86_64
+endif
+
+ifeq ($(SSE_GENERATION), 2)
+	CFLAGS += -msse2
+else
+	ifeq ($(SSE_GENERATION), 3)
+		CFLAGS += -msse3
+		ifeq ($(SSSE3_ENABLED), 1)
+			CFLAGS += -mssse3
+		endif
+	else
+		DUMMY:=($error "Only SSE2 and SSE3 are supported")
+	endif
+endif
diff --git a/Platform/Linux/Build/MakeCross.Arm b/Platform/Linux/Build/MakeCross.Arm
new file mode 100644
index 0000000..cf9cd95
--- /dev/null
+++ b/Platform/Linux/Build/MakeCross.Arm
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+# Your cross-compiler and staging-dir will be taken from 'ARM_CXX' and 'ARM_STAGING' environment variables, respectively.
+make PLATFORM=Arm $*
diff --git a/Platform/Linux/Build/Makefile b/Platform/Linux/Build/Makefile
new file mode 100644
index 0000000..51dc234
--- /dev/null
+++ b/Platform/Linux/Build/Makefile
@@ -0,0 +1,202 @@
+#############################################################################
+# OpenNI makefile.
+# 
+# default configuration is Release. for a debug version use:
+# 	make CFG=Debug
+#
+# default compiler is g++. for another one use:
+#   make CXX=<comp>
+#
+# By default, CLR projects will only be build if mono is installed.
+# To force CLR projects use:
+#   make FORCE_BUILD_CLR=1
+#
+#############################################################################
+
+include Common/CommonDefs.mak
+
+# list all modules
+ALL_MODULES = \
+	Modules/nimCodecs \
+	Modules/nimMockNodes \
+	Modules/nimRecorder
+
+# list all utils
+ALL_UTILS = \
+	Utils/niReg \
+	Utils/niLicense
+
+ALL_MONO_PROJS = \
+	Wrappers/OpenNI.net
+
+ALL_JAVA_PROJS = \
+	Wrappers/OpenNI.jni \
+	Wrappers/OpenNI.java
+	
+# list all core projects
+ALL_CORE_PROJS = \
+	OpenNI \
+	$(ALL_MODULES) \
+	$(ALL_UTILS) \
+	$(ALL_JAVA_PROJS)
+
+# list all samples
+CORE_SAMPLES = \
+	Samples/NiSimpleRead \
+	Samples/NiBackRecorder \
+	Samples/NiConvertXToONI \
+	Samples/NiRecordSynthetic \
+	Samples/NiSampleModule \
+	Samples/NiSimpleCreate \
+	Samples/NiCRead \
+	Samples/NiAudioSample \
+	Samples/NiSimpleSkeleton \
+	
+ifeq "$(GLUT_SUPPORTED)" "1"
+	CORE_SAMPLES += \
+		Samples/NiViewer \
+		Samples/NiSimpleViewer \
+		Samples/NiUserTracker \
+		Samples/NiUserSelection \
+		Samples/NiHandTracker
+else
+	ifeq "$(GLES_SUPPORTED)" "1"
+		CORE_SAMPLES += \
+			Samples/NiUserTracker \
+			Samples/NiUserSelection
+	endif
+endif
+
+MONO_SAMPLES = \
+	Samples/SimpleRead.net
+
+MONO_FORMS_SAMPLES = \
+	Samples/SimpleViewer.net \
+	Samples/UserTracker.net
+	
+JAVA_SAMPLES = \
+	Samples/SimpleRead.java \
+	Samples/SimpleViewer.java \
+	Samples/UserTracker.java \
+
+ALL_SAMPLES = \
+	$(CORE_SAMPLES) \
+	$(JAVA_SAMPLES)
+
+# list all projects that are build
+ALL_BUILD_PROJS = \
+	$(ALL_CORE_PROJS) \
+	$(ALL_SAMPLES)
+
+ALL_PROJS = \
+	$(ALL_BUILD_PROJS)
+
+# decide if CLR projects should be build
+ifneq "$(realpath /usr/bin/gmcs)" ""
+	MONO_INSTALLED = 1
+	
+	ifneq "$(shell gacutil -l | grep System.Windows.Forms)" ""
+		MONO_WINFORMS_INSTALLED = 1
+	endif
+endif
+
+ifeq "$(FORCE_BUILD_CLR)" "1"
+	ifndef MONO_INSTALLED
+		DUMMY:=$(error Mono is not installed! Consider turning off FORCE_BUILD_CLR.)
+	endif
+	
+	ifndef MONO_WINFORMS_INSTALLED
+		DUMMY:=$(error Mono WinForms is not installed! Consider turning off FORCE_BUILD_CLR.)
+	endif
+endif
+
+ifdef MONO_INSTALLED
+	ALL_PROJS += $(ALL_MONO_PROJS)
+	ALL_PROJS += $(MONO_SAMPLES)
+	
+	ifdef MONO_WINFORMS_INSTALLED
+		ALL_PROJS += $(MONO_FORMS_SAMPLES)
+	endif
+endif
+
+ALL_PROJS_CLEAN = $(foreach proj,$(ALL_PROJS),$(proj)-clean)
+
+# define a function which creates a target for each proj
+define CREATE_PROJ_TARGET
+$1: 
+	$$(MAKE) -C $1
+
+$1-clean: 
+	$$(MAKE) -C $1 clean
+endef
+
+################ TARGETS ##################
+
+.PHONY: all $(ALL_PROJS) $(ALL_PROJS_CLEAN) install uninstall clean 
+
+# make all makefiles
+all: $(ALL_PROJS)
+
+core: $(ALL_CORE_PROJS)
+
+samples: $(ALL_SAMPLES)
+
+mono_wrapper: Wrappers/OpenNI.net
+
+mono_samples: $(MONO_SAMPLES) $(MONO_FORMS_SAMPLES)
+
+# create projects targets
+$(foreach proj,$(ALL_PROJS),$(eval $(call CREATE_PROJ_TARGET,$(proj))))
+
+# additional dependencies
+Modules/nimCodecs:		OpenNI
+Modules/nimMockNodes:		OpenNI
+Modules/nimRecorder:		OpenNI
+
+Utils/niReg:			OpenNI
+Utils/niLicense:		OpenNI
+
+Wrappers/OpenNI.net:		OpenNI
+Wrappers/OpenNI.jni:		OpenNI
+Wrappers/OpenNI.java:		Wrappers/OpenNI.jni
+
+Samples/NiSimpleRead:		OpenNI
+Samples/NiBackRecorder:		OpenNI
+Samples/NiConvertXToONI:	OpenNI
+Samples/NiRecordSynthetic:	OpenNI
+Samples/NiSampleModule:		OpenNI
+Samples/NiSimpleCreate:		OpenNI
+Samples/NiCRead:		OpenNI
+Samples/NiAudioSample:		OpenNI
+Samples/NiSimpleSkeleton:	OpenNI
+Samples/NiUserTracker:		OpenNI
+Samples/NiUserSelection:	OpenNI
+Samples/NiHandTracker:		OpenNI
+Samples/NiViewer:		OpenNI
+Samples/NiSimpleViewer:		OpenNI
+
+Samples/SimpleRead.net:		Wrappers/OpenNI.net
+Samples/SimpleViewer.net:	Wrappers/OpenNI.net
+Samples/UserTracker.net:	Wrappers/OpenNI.net
+
+Samples/SimpleRead.java:	Wrappers/OpenNI.java
+Samples/SimpleViewer.java:	Wrappers/OpenNI.java
+Samples/UserTracker.java:	Wrappers/OpenNI.java
+
+
+# clean is cleaning all projects
+clean: $(ALL_PROJS_CLEAN)
+
+# redist target
+redist: all
+	cd ../CreateRedist; ./RedistMaker; cd -
+
+# install target
+install: redist
+	cd ../Redist; ./install.sh; cd -
+
+# uninstall target
+uninstall:
+	cd ../Redist; ./install.sh -u; cd -
+
+
diff --git a/Platform/Linux/Build/Modules/nimCodecs/Makefile b/Platform/Linux/Build/Modules/nimCodecs/Makefile
new file mode 100644
index 0000000..600e371
--- /dev/null
+++ b/Platform/Linux/Build/Modules/nimCodecs/Makefile
@@ -0,0 +1,18 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = \
+	../../../../../Include \
+	../../../../../Source \
+	../../../../../Source/External/LibJPEG
+
+SRC_FILES = \
+	../../../../../Source/Modules/nimCodecs/*.cpp \
+	../../../../../Source/External/LibJPEG/*.c
+
+LIB_NAME = nimCodecs
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
+
+
diff --git a/Platform/Linux-x86/Build/Modules/nimCodecs/nimCodecs.vpj b/Platform/Linux/Build/Modules/nimCodecs/nimCodecs.vpj
similarity index 100%
rename from Platform/Linux-x86/Build/Modules/nimCodecs/nimCodecs.vpj
rename to Platform/Linux/Build/Modules/nimCodecs/nimCodecs.vpj
diff --git a/Platform/Linux/Build/Modules/nimMockNodes/Makefile b/Platform/Linux/Build/Modules/nimMockNodes/Makefile
new file mode 100644
index 0000000..cfcf03c
--- /dev/null
+++ b/Platform/Linux/Build/Modules/nimMockNodes/Makefile
@@ -0,0 +1,14 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = \
+	../../../../../Include \
+	../../../../../Source
+
+SRC_FILES = \
+	../../../../../Source/Modules/nimMockNodes/*.cpp
+
+LIB_NAME = nimMockNodes
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux-x86/Build/Modules/nimMockNodes/nimMockNodes.vpj b/Platform/Linux/Build/Modules/nimMockNodes/nimMockNodes.vpj
similarity index 100%
rename from Platform/Linux-x86/Build/Modules/nimMockNodes/nimMockNodes.vpj
rename to Platform/Linux/Build/Modules/nimMockNodes/nimMockNodes.vpj
diff --git a/Platform/Linux/Build/Modules/nimRecorder/Makefile b/Platform/Linux/Build/Modules/nimRecorder/Makefile
new file mode 100644
index 0000000..88537b3
--- /dev/null
+++ b/Platform/Linux/Build/Modules/nimRecorder/Makefile
@@ -0,0 +1,17 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = \
+	../../../../../Include \
+	../../../../../Source \
+	../../../../../Source/Modules/Common
+
+SRC_FILES = \
+	../../../../../Source/Modules/nimRecorder/*.cpp \
+	../../../../../Source/Modules/Common/*.cpp
+
+LIB_NAME = nimRecorder
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
+
diff --git a/Platform/Linux-x86/Build/Modules/nimRecorder/nimRecorder.vpj b/Platform/Linux/Build/Modules/nimRecorder/nimRecorder.vpj
similarity index 100%
rename from Platform/Linux-x86/Build/Modules/nimRecorder/nimRecorder.vpj
rename to Platform/Linux/Build/Modules/nimRecorder/nimRecorder.vpj
diff --git a/Platform/Linux/Build/OpenNI/Makefile b/Platform/Linux/Build/OpenNI/Makefile
new file mode 100644
index 0000000..2f99e3c
--- /dev/null
+++ b/Platform/Linux/Build/OpenNI/Makefile
@@ -0,0 +1,30 @@
+OSTYPE := $(shell uname -s)
+
+BIN_DIR = ../../Bin
+
+INC_DIRS = \
+	../../../../Include \
+	../../../../Source \
+	../../../../Source/External/TinyXml
+
+SRC_FILES = \
+	../../../../Source/OpenNI/*.cpp \
+	../../../../Source/OpenNI/Linux/*.cpp \
+	../../../../Source/External/TinyXml/*.cpp
+
+ifeq ("$(OSTYPE)","Darwin")
+	INC_DIRS += /opt/local/include
+	LIB_DIRS += /opt/local/lib
+	LDFLAGS += -framework CoreFoundation -framework IOKit
+endif
+
+LIB_NAME = OpenNI
+USED_LIBS = usb-1.0 dl pthread
+ifneq ("$(OSTYPE)","Darwin")
+	USED_LIBS += rt 
+endif
+DEFINES = XN_EXPORTS
+
+include ../Common/CommonCppMakefile
+
+
diff --git a/Platform/Linux-x86/Build/OpenNI/OpenNI.vpj b/Platform/Linux/Build/OpenNI/OpenNI.vpj
similarity index 100%
rename from Platform/Linux-x86/Build/OpenNI/OpenNI.vpj
rename to Platform/Linux/Build/OpenNI/OpenNI.vpj
diff --git a/Platform/Linux-x86/Build/Prerequisites/libusb-1.0.8-osx.tar.bz2 b/Platform/Linux/Build/Prerequisites/libusb-1.0.8-osx.tar.bz2
similarity index 100%
rename from Platform/Linux-x86/Build/Prerequisites/libusb-1.0.8-osx.tar.bz2
rename to Platform/Linux/Build/Prerequisites/libusb-1.0.8-osx.tar.bz2
diff --git a/Platform/Linux-x86/Build/Prerequisites/libusb-1.0.8.tar.bz2 b/Platform/Linux/Build/Prerequisites/libusb-1.0.8.tar.bz2
similarity index 100%
rename from Platform/Linux-x86/Build/Prerequisites/libusb-1.0.8.tar.bz2
rename to Platform/Linux/Build/Prerequisites/libusb-1.0.8.tar.bz2
diff --git a/Platform/Linux/Build/Res/AssemblyInfo-OpenNI.cs b/Platform/Linux/Build/Res/AssemblyInfo-OpenNI.cs
new file mode 100644
index 0000000..47ec3bf
--- /dev/null
+++ b/Platform/Linux/Build/Res/AssemblyInfo-OpenNI.cs
@@ -0,0 +1,55 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("PrimeSense Ltd.")]
+[assembly: AssemblyProduct("OpenNI")]
+[assembly: AssemblyCopyright("Copyright © PrimeSense 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("185e12cd-e399-4d85-bbf3-7f18b9b7bb8c")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.5.2.23")]
+[assembly: AssemblyFileVersion("1.5.2.23")]
diff --git a/Platform/Linux-x86/Build/Res/mainicon.ico b/Platform/Linux/Build/Res/mainicon.ico
similarity index 100%
rename from Platform/Linux-x86/Build/Res/mainicon.ico
rename to Platform/Linux/Build/Res/mainicon.ico
diff --git a/Platform/Linux/Build/Samples/NiAudioSample/Makefile b/Platform/Linux/Build/Samples/NiAudioSample/Makefile
new file mode 100644
index 0000000..e4ea870
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiAudioSample/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiAudioSample/*.cpp
+
+EXE_NAME = Sample-NiAudioSample
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiBackRecorder/Makefile b/Platform/Linux/Build/Samples/NiBackRecorder/Makefile
new file mode 100644
index 0000000..2594f69
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiBackRecorder/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiBackRecorder/*.cpp
+
+EXE_NAME = Sample-NiBackRecorder
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiCRead/Makefile b/Platform/Linux/Build/Samples/NiCRead/Makefile
new file mode 100644
index 0000000..94b24d0
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiCRead/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiCRead/*.c
+
+EXE_NAME = Sample-NiCRead
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiConvertXToONI/Makefile b/Platform/Linux/Build/Samples/NiConvertXToONI/Makefile
new file mode 100644
index 0000000..e27106e
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiConvertXToONI/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiConvertXToONI/*.cpp
+
+EXE_NAME = Sample-NiConvertXToONI
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiHandTracker/Makefile b/Platform/Linux/Build/Samples/NiHandTracker/Makefile
new file mode 100644
index 0000000..042a57c
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiHandTracker/Makefile
@@ -0,0 +1,22 @@
+OSTYPE := $(shell uname -s)
+
+BIN_DIR = ../../../Bin
+
+INC_DIRS = \
+	../../../../../Include \
+	../../../../../Samples/NiHandTracker
+
+SRC_FILES = ../../../../../Samples/NiHandTracker/*.cpp
+
+ifeq ("$(OSTYPE)","Darwin")
+	LDFLAGS += -framework OpenGL -framework GLUT
+else
+	USED_LIBS += glut
+endif
+
+USED_LIBS += OpenNI
+
+EXE_NAME = Sample-NiHandTracker
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiRecordSynthetic/Makefile b/Platform/Linux/Build/Samples/NiRecordSynthetic/Makefile
new file mode 100644
index 0000000..885634a
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiRecordSynthetic/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiRecordSynthetic/*.cpp
+
+EXE_NAME = Sample-NiRecordSynthetic
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiSampleModule/Makefile b/Platform/Linux/Build/Samples/NiSampleModule/Makefile
new file mode 100644
index 0000000..37377ce
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiSampleModule/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiSampleModule/*.cpp
+
+LIB_NAME = Sample-NiSampleModule
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiSimpleCreate/Makefile b/Platform/Linux/Build/Samples/NiSimpleCreate/Makefile
new file mode 100644
index 0000000..1e206fe
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiSimpleCreate/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiSimpleCreate/*.cpp
+
+EXE_NAME = Sample-NiSimpleCreate
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiSimpleRead/Makefile b/Platform/Linux/Build/Samples/NiSimpleRead/Makefile
new file mode 100644
index 0000000..75f6d55
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiSimpleRead/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiSimpleRead/*.cpp
+
+EXE_NAME = Sample-NiSimpleRead
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux-x86/Build/Samples/NiSimpleRead/NiSimpleRead.vpj b/Platform/Linux/Build/Samples/NiSimpleRead/NiSimpleRead.vpj
similarity index 100%
rename from Platform/Linux-x86/Build/Samples/NiSimpleRead/NiSimpleRead.vpj
rename to Platform/Linux/Build/Samples/NiSimpleRead/NiSimpleRead.vpj
diff --git a/Platform/Linux/Build/Samples/NiSimpleSkeleton/Makefile b/Platform/Linux/Build/Samples/NiSimpleSkeleton/Makefile
new file mode 100644
index 0000000..8f39acd
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiSimpleSkeleton/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiSimpleSkeleton/*.cpp
+
+EXE_NAME = Sample-NiSimpleSkeleton
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiSimpleSkeleton/NiSimpleSkeleton.vpj b/Platform/Linux/Build/Samples/NiSimpleSkeleton/NiSimpleSkeleton.vpj
new file mode 100644
index 0000000..68b229d
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiSimpleSkeleton/NiSimpleSkeleton.vpj
@@ -0,0 +1,68 @@
+<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
+<Project
+	Version="10.0"
+	VendorName="SlickEdit"
+	WorkingDir=".">
+	<Config
+		Name="Release"
+		Type="Makefile"
+		OutputFile=""
+		CompilerConfigName="">
+		<Menu>
+			<Target
+				Name="Compile"
+				MenuCaption="&Compile"
+				CaptureOutputWith="ProcessBuffer"
+				SaveOption="SaveCurrent"
+				RunFromDir="%rw">
+				<Exec/>
+			</Target>
+			<Target
+				Name="Build"
+				MenuCaption="&Build"
+				CaptureOutputWith="ProcessBuffer"
+				SaveOption="SaveWorkspaceFiles"
+				RunFromDir="%rp"
+				ClearProcessBuffer="1">
+				<Exec CmdLine="make"/>
+			</Target>
+			<Target
+				Name="Rebuild"
+				MenuCaption="&Rebuild"
+				CaptureOutputWith="ProcessBuffer"
+				SaveOption="SaveWorkspaceFiles"
+				RunFromDir="%rp"
+				ClearProcessBuffer="1">
+				<Exec CmdLine="make clean && make"/>
+			</Target>
+			<Target
+				Name="Debug"
+				MenuCaption="&Debug"
+				SaveOption="SaveNone"
+				RunFromDir="%rw">
+				<Exec/>
+			</Target>
+			<Target
+				Name="Execute"
+				MenuCaption="E&xecute"
+				SaveOption="SaveNone"
+				RunFromDir="%rw">
+				<Exec CmdLine='".exe"'/>
+			</Target>
+		</Menu>
+	</Config>
+	<Files>
+		<Folder
+			Name="Source Files "
+			Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d">
+			<F
+				N="../../../../../Samples/NiSimpleSkeleton/*.cpp"
+				Recurse="0"
+				Refilter="0"
+				Excludes=""/>
+		</Folder>
+		<F
+			N="Makefile"
+			Type="Makefile"/>
+	</Files>
+</Project>
diff --git a/Platform/Linux/Build/Samples/NiSimpleViewer/Makefile b/Platform/Linux/Build/Samples/NiSimpleViewer/Makefile
new file mode 100644
index 0000000..f216eb5
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiSimpleViewer/Makefile
@@ -0,0 +1,20 @@
+OSTYPE := $(shell uname -s)
+
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiSimpleViewer/*.cpp
+
+EXE_NAME = Sample-NiSimpleViewer
+
+ifeq ("$(OSTYPE)","Darwin")
+	LDFLAGS += -framework OpenGL -framework GLUT
+else
+	USED_LIBS += glut
+endif
+
+USED_LIBS += OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiUserSelection/Makefile b/Platform/Linux/Build/Samples/NiUserSelection/Makefile
new file mode 100644
index 0000000..7c693bf
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiUserSelection/Makefile
@@ -0,0 +1,29 @@
+OSTYPE := $(shell uname -s)
+
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiUserSelection/*.cpp
+
+EXE_NAME = Sample-NiUserSelection
+
+ifeq "$(GLUT_SUPPORTED)" "1"
+	ifeq ("$(OSTYPE)","Darwin")
+		LDFLAGS += -framework OpenGL -framework GLUT
+	else
+		USED_LIBS += glut
+	endif
+else
+	ifeq "$(GLES_SUPPORTED)" "1"
+		DEFINES += USE_GLES
+		USED_LIBS += GLES_CM IMGegl srv_um
+	else
+		DUMMY:=$(error No GLUT or GLES!)
+	endif
+endif
+
+USED_LIBS += OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiUserTracker/Makefile b/Platform/Linux/Build/Samples/NiUserTracker/Makefile
new file mode 100644
index 0000000..35d9a88
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiUserTracker/Makefile
@@ -0,0 +1,29 @@
+OSTYPE := $(shell uname -s)
+
+BIN_DIR = ../../../Bin
+
+INC_DIRS = ../../../../../Include
+
+SRC_FILES = ../../../../../Samples/NiUserTracker/*.cpp
+
+EXE_NAME = Sample-NiUserTracker
+
+ifeq "$(GLUT_SUPPORTED)" "1"
+	ifeq ("$(OSTYPE)","Darwin")
+		LDFLAGS += -framework OpenGL -framework GLUT
+	else
+		USED_LIBS += glut
+	endif
+else
+	ifeq "$(GLES_SUPPORTED)" "1"
+		DEFINES += USE_GLES
+		USED_LIBS += GLES_CM IMGegl srv_um
+	else
+		DUMMY:=$(error No GLUT or GLES!)
+	endif
+endif
+
+USED_LIBS += OpenNI
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux/Build/Samples/NiViewer/Makefile b/Platform/Linux/Build/Samples/NiViewer/Makefile
new file mode 100644
index 0000000..bf1ed3a
--- /dev/null
+++ b/Platform/Linux/Build/Samples/NiViewer/Makefile
@@ -0,0 +1,22 @@
+OSTYPE := $(shell uname -s)
+
+BIN_DIR = ../../../Bin
+
+INC_DIRS = \
+	../../../../../Include \
+	../../../../../Samples/NiViewer
+
+SRC_FILES = ../../../../../Samples/NiViewer/*.cpp
+
+ifeq ("$(OSTYPE)","Darwin")
+	LDFLAGS += -framework OpenGL -framework GLUT
+else
+	USED_LIBS += glut
+endif
+
+USED_LIBS += OpenNI
+
+EXE_NAME = NiViewer
+
+include ../../Common/CommonCppMakefile
+
diff --git a/Platform/Linux-x86/Build/Samples/NiViewer/NiViewer.vpj b/Platform/Linux/Build/Samples/NiViewer/NiViewer.vpj
similarity index 100%
rename from Platform/Linux-x86/Build/Samples/NiViewer/NiViewer.vpj
rename to Platform/Linux/Build/Samples/NiViewer/NiViewer.vpj
diff --git a/Platform/Linux/Build/Samples/SimpleRead.java/Makefile b/Platform/Linux/Build/Samples/SimpleRead.java/Makefile
new file mode 100644
index 0000000..ec1287f
--- /dev/null
+++ b/Platform/Linux/Build/Samples/SimpleRead.java/Makefile
@@ -0,0 +1,13 @@
+BIN_DIR = ../../../Bin
+
+SRC_FILES = \
+	../../../../../Samples/SimpleRead.java/org/OpenNI/Samples/SimpleRead/*.java
+
+JAR_NAME = org.OpenNI.Samples.SimpleRead
+USED_JARS = org.OpenNI
+MAIN_CLASS = org.OpenNI.Samples.SimpleRead.SimpleRead
+
+include ../../Common/CommonJavaMakefile
+
+
+
diff --git a/Platform/Linux/Build/Samples/SimpleRead.net/Makefile b/Platform/Linux/Build/Samples/SimpleRead.net/Makefile
new file mode 100644
index 0000000..997357e
--- /dev/null
+++ b/Platform/Linux/Build/Samples/SimpleRead.net/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+NETEXE_NAME = SimpleRead.net
+
+SRC_FILES = \
+	../../../../../Samples/SimpleRead.net/*.cs \
+	../../Res/AssemblyInfo-OpenNI.cs
+	
+USED_LIBS = OpenNI.net
+
+include ../../Common/CommonCSMakefile
diff --git a/Platform/Linux/Build/Samples/SimpleViewer.java/Makefile b/Platform/Linux/Build/Samples/SimpleViewer.java/Makefile
new file mode 100644
index 0000000..208c73c
--- /dev/null
+++ b/Platform/Linux/Build/Samples/SimpleViewer.java/Makefile
@@ -0,0 +1,10 @@
+BIN_DIR = ../../../Bin
+
+SRC_FILES = \
+	../../../../../Samples/SimpleViewer.java/org/OpenNI/Samples/SimpleViewer/*.java
+
+JAR_NAME = org.OpenNI.Samples.SimpleViewer
+USED_JARS = org.OpenNI
+MAIN_CLASS = org.OpenNI.Samples.SimpleViewer.SimpleViewerApplication
+
+include ../../Common/CommonJavaMakefile
diff --git a/Platform/Linux/Build/Samples/SimpleViewer.net/Makefile b/Platform/Linux/Build/Samples/SimpleViewer.net/Makefile
new file mode 100644
index 0000000..1777c17
--- /dev/null
+++ b/Platform/Linux/Build/Samples/SimpleViewer.net/Makefile
@@ -0,0 +1,13 @@
+BIN_DIR = ../../../Bin
+
+NETEXE_NAME = SimpleViewer.net
+
+SRC_FILES = \
+	../../../../../Samples/SimpleViewer.net/*.cs \
+	../../Res/AssemblyInfo-OpenNI.cs
+
+USED_LIBS = OpenNI.net
+CSFLAGS = -unsafe
+NET_WIN_FORMS = 1
+
+include ../../Common/CommonCSMakefile
diff --git a/Platform/Linux/Build/Samples/UserTracker.java/Makefile b/Platform/Linux/Build/Samples/UserTracker.java/Makefile
new file mode 100644
index 0000000..80c22c2
--- /dev/null
+++ b/Platform/Linux/Build/Samples/UserTracker.java/Makefile
@@ -0,0 +1,10 @@
+BIN_DIR = ../../../Bin
+
+SRC_FILES = \
+	../../../../../Samples/UserTracker.java/org/OpenNI/Samples/UserTracker/*.java
+
+JAR_NAME = org.OpenNI.Samples.UserTracker
+USED_JARS = org.OpenNI
+MAIN_CLASS = org.OpenNI.Samples.UserTracker.UserTrackerApplication
+
+include ../../Common/CommonJavaMakefile
diff --git a/Platform/Linux/Build/Samples/UserTracker.net/Makefile b/Platform/Linux/Build/Samples/UserTracker.net/Makefile
new file mode 100644
index 0000000..628936c
--- /dev/null
+++ b/Platform/Linux/Build/Samples/UserTracker.net/Makefile
@@ -0,0 +1,13 @@
+BIN_DIR = ../../../Bin
+
+NETEXE_NAME = UserTracker.net
+
+SRC_FILES = \
+	../../../../../Samples/UserTracker.net/*.cs \
+	../../Res/AssemblyInfo-OpenNI.cs
+
+USED_LIBS = OpenNI.net
+CSFLAGS = -unsafe
+NET_WIN_FORMS = 1
+
+include ../../Common/CommonCSMakefile
diff --git a/Platform/Linux/Build/Utils/niLicense/Makefile b/Platform/Linux/Build/Utils/niLicense/Makefile
new file mode 100644
index 0000000..866e444
--- /dev/null
+++ b/Platform/Linux/Build/Utils/niLicense/Makefile
@@ -0,0 +1,17 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = \
+	../../../../../Include \
+	../../../../../Source
+
+SRC_FILES = \
+	../../../../../Source/Utils/niLicense/*.cpp
+
+EXE_NAME = niLicense
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
+
+
+
diff --git a/Platform/Linux/Build/Utils/niReg/Makefile b/Platform/Linux/Build/Utils/niReg/Makefile
new file mode 100644
index 0000000..e47619b
--- /dev/null
+++ b/Platform/Linux/Build/Utils/niReg/Makefile
@@ -0,0 +1,17 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = \
+	../../../../../Include \
+	../../../../../Source
+
+SRC_FILES = \
+	../../../../../Source/Utils/niReg/*.cpp
+
+EXE_NAME = niReg
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
+
+
+
+
diff --git a/Platform/Linux-x86/Build/Utils/niReg/niReg.vpj b/Platform/Linux/Build/Utils/niReg/niReg.vpj
similarity index 100%
rename from Platform/Linux-x86/Build/Utils/niReg/niReg.vpj
rename to Platform/Linux/Build/Utils/niReg/niReg.vpj
diff --git a/Platform/Linux/Build/Wrappers/OpenNI.java/Makefile b/Platform/Linux/Build/Wrappers/OpenNI.java/Makefile
new file mode 100644
index 0000000..0451c5d
--- /dev/null
+++ b/Platform/Linux/Build/Wrappers/OpenNI.java/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+SRC_FILES = \
+	../../../../../Wrappers/OpenNI.java/src/org/OpenNI/*.java
+
+JAR_NAME = org.OpenNI
+
+include ../../Common/CommonJavaMakefile
+
+
+
diff --git a/Platform/Linux/Build/Wrappers/OpenNI.jni/Makefile b/Platform/Linux/Build/Wrappers/OpenNI.jni/Makefile
new file mode 100644
index 0000000..5ccfc44
--- /dev/null
+++ b/Platform/Linux/Build/Wrappers/OpenNI.jni/Makefile
@@ -0,0 +1,13 @@
+BIN_DIR = ../../../Bin
+
+INC_DIRS = \
+	../../../../../Include \
+	../../../../../Wrappers/OpenNI.jni
+
+SRC_FILES = \
+	../../../../../Wrappers/OpenNI.jni/*.cpp
+
+LIB_NAME = OpenNI.jni
+USED_LIBS = OpenNI
+
+include ../../Common/CommonCppMakefile
diff --git a/Platform/Linux/Build/Wrappers/OpenNI.net/Makefile b/Platform/Linux/Build/Wrappers/OpenNI.net/Makefile
new file mode 100644
index 0000000..6b1a5ba
--- /dev/null
+++ b/Platform/Linux/Build/Wrappers/OpenNI.net/Makefile
@@ -0,0 +1,11 @@
+BIN_DIR = ../../../Bin
+
+NETLIB_NAME = OpenNI.net
+
+SRC_FILES = \
+	../../../../../Wrappers/OpenNI.net/*.cs \
+	../../Res/AssemblyInfo-OpenNI.cs
+
+CSFLAGS += -keyfile:OpenNI.snk
+
+include ../../Common/CommonCSMakefile
diff --git a/Platform/Linux-x86/Build/Wrappers/OpenNI.net/OpenNI.snk b/Platform/Linux/Build/Wrappers/OpenNI.net/OpenNI.snk
similarity index 100%
rename from Platform/Linux-x86/Build/Wrappers/OpenNI.net/OpenNI.snk
rename to Platform/Linux/Build/Wrappers/OpenNI.net/OpenNI.snk
diff --git a/Platform/Linux/CreateRedist/RedistMaker b/Platform/Linux/CreateRedist/RedistMaker
new file mode 100644
index 0000000..d4820b1
--- /dev/null
+++ b/Platform/Linux/CreateRedist/RedistMaker
@@ -0,0 +1,3 @@
+#!/bin/bash -e
+python Redist_OpenNi.py $*
+
diff --git a/Platform/Linux/CreateRedist/RedistMaker.Arm b/Platform/Linux/CreateRedist/RedistMaker.Arm
new file mode 100644
index 0000000..728de30
--- /dev/null
+++ b/Platform/Linux/CreateRedist/RedistMaker.Arm
@@ -0,0 +1,2 @@
+#!/bin/sh -e
+./RedistMaker Arm $*
diff --git a/Platform/Linux/CreateRedist/Redist_OpenNi.py b/Platform/Linux/CreateRedist/Redist_OpenNi.py
new file mode 100644
index 0000000..594311b
--- /dev/null
+++ b/Platform/Linux/CreateRedist/Redist_OpenNi.py
@@ -0,0 +1,463 @@
+#/***************************************************************************
+#*                                                                          *
+#*  OpenNI 1.x Alpha                                                        *
+#*  Copyright (C) 2011 PrimeSense Ltd.                                      *
+#*                                                                          *
+#*  This file is part of OpenNI.                                            *
+#*                                                                          *
+#*  OpenNI is free software: you can redistribute it and/or modify          *
+#*  it under the terms of the GNU Lesser General Public License as published*
+#*  by the Free Software Foundation, either version 3 of the License, or    *
+#*  (at your option) any later version.                                     *
+#*                                                                          *
+#*  OpenNI is distributed in the hope that it will be useful,               *
+#*  but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+#*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
+#*  GNU Lesser General Public License for more details.                     *
+#*                                                                          *
+#*  You should have received a copy of the GNU Lesser General Public License*
+#*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.          *
+#*                                                                          *
+#***************************************************************************/
+#
+
+
+#-------------Imports----------------------------------------------------------#
+from xml.dom.minidom import parse, parseString
+from time import strftime
+import logging
+import glob
+import os
+import re
+import sys
+import shutil
+import stat
+from commands import getoutput as gop
+
+#-------------Functions--------------------------------------------------------#
+
+def calc_jobs_number():
+    cores = 1
+	
+    try:
+        if ostype == "Darwin":
+            txt = gop('sysctl -n hw.physicalcpu')
+        else:		
+            txt = gop('grep "processor\W:" /proc/cpuinfo | wc -l')
+			
+        cores = int(txt)
+    except:
+        pass
+       
+    return str(cores * 2)
+
+def finish_script(exit_code):
+    os.chdir(SCRIPT_DIR)
+    exit(exit_code)
+
+def replace_string_in_file(findStr,repStr,filePath):
+    "replaces all findStr by repStr in file filePath"
+    tempName=filePath+'~~~'
+    input = open(filePath)
+    output = open(tempName,'w')
+    for s in input:
+        output.write(s.replace(findStr,repStr))
+    output.close()
+    input.close()
+    os.remove(filePath)
+    os.rename(tempName,filePath)
+
+def regx_replace(findStr,repStr,filePath):
+    "replaces all findStr by repStr in file filePath using regualr expression"
+    findStrRegx = re.compile(findStr)
+    tempName=filePath+'~~~'
+    input = open(filePath)
+    output = open(tempName,'w')
+    for s in input:
+        output.write(findStrRegx.sub(repStr,s))
+    output.close()
+    input.close()
+    os.remove(filePath)
+    os.rename(tempName,filePath)
+
+def check_sample(sample_dir):
+    "Checks if a sample is a tool or should be skipped, returns: 0 - Regular, 1 - Skip, 2 - Tool"
+    rc = 0
+    if os.path.exists(sample_dir + "/.redist"):
+        redistFile = open(sample_dir + "/.redist")
+    else:
+        rc=0
+        return rc
+    redist_lines =redistFile.readlines()
+    skip_re = re.compile("^SKIP=([^\|]*\|)*(" + PLATFORM + "|ALL)(\|[^\|]*)*$")
+    tool_re = re.compile("^TOOL=([^\|]*\|)*(" + PLATFORM + "|ALL)(\|[^\|]*)*$")
+    for line in redist_lines:
+        if skip_re.search(line):
+            rc = 1
+            redistFile.close()
+            return rc
+        if tool_re.search(line):
+            rc = 2
+            redistFile.close()
+            return rc
+    redistFile.close()
+    return rc
+
+def fix_file(arg,dirname,fname):
+    "Fixes paths for all the files in fname"
+    for filename in fname:
+        filePath = dirname + "/" + filename
+        if os.path.isdir(filePath):
+            continue
+
+        ext = ['cpp','h','ini','cs','java']
+        if filename == "Makefile" or filename.partition(".")[2] in ext:
+            #print "Fixing: " + filePath
+            tempName=filePath+'~~~'
+            input = open(filePath)
+            output = open(tempName,'w')
+            for s in input:
+                olds = s
+                s = re.sub(r"../../../Bin",r"../Bin",s)
+                s = re.sub(r"../../../../../Include",r"../../Include =/usr/include/ni",s)
+                s = re.sub(r"../../../../../Samples/[\w.]+/?",r"./",s)
+                s = re.sub(r"../../../../Data/SamplesConfig.xml",r"../../Config/SamplesConfig.xml",s)
+                s = re.sub(r"../../Res/",r"../Res/",s)
+                s = re.sub(r"include ../../Common/CommonCppMakefile",r"LIB_DIRS += ../../Lib\ninclude ../Build/Common/CommonCppMakefile",s)
+                s = re.sub(r"include ../../Common/CommonCSMakefile",r"LIB_DIRS += ../../Lib\ninclude ../Build/Common/CommonCSMakefile",s)
+                s = re.sub(r"include ../../Common/CommonJavaMakefile",r"LIB_DIRS += ../../Lib\ninclude ../Build/Common/CommonJavaMakefile",s)
+
+                output.write(s)
+                
+                #if s != olds:
+                    #print "Changed : " + olds.strip("\n")
+                    #print "To      : " + s.strip("\n")
+
+            output.close()
+            input.close()
+            os.remove(filePath)
+            os.rename(tempName,filePath)
+
+def copy_install_script(platform, filePath, dest):
+    "Copies the install script and fixing it if needed"
+    input = open(filePath)
+    dest_name = os.path.join(dest, os.path.basename(filePath))
+    output = open(dest_name, 'w')
+    
+    for line in input:
+        if platform == 'CE4100':
+            line = re.sub(r"/var/lib/ni", r"/usr/etc/ni", line)
+            
+        output.write(line)
+        
+    input.close()
+    output.close()
+    os.chmod(dest_name, stat.S_IRUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
+    
+def execute_check(cmd, name):
+    "Executes command and checks the return code. If it's not 0, stops redist."
+    ret = os.system(cmd)
+    if ret != 0:
+        print "failed to execute: " + cmd
+        print name + " Failed!"
+        logger.critical(name + " Failed!")
+        finish_script(1)
+        
+
+#------------Constants and globals---------------------------------------------#
+DateTimeSTR = strftime("%Y-%m-%d %H:%M:%S")
+DateSTR = strftime("%Y-%m-%d")
+SCRIPT_DIR = os.getcwd()
+# Fix to allow reletive path
+WORK_DIR = os.getcwd() + "/"
+os.chdir(SCRIPT_DIR)
+PROJECT_NAME = "OpenNI"
+ostype = os.popen('uname -s').read().rstrip()
+machinetype = os.popen('uname -m').read().rstrip()
+
+if len(sys.argv) >= 2:
+    PLATFORM = sys.argv[1]
+    MAKE_ARGS = 'PLATFORM=' + PLATFORM
+else:
+    if machinetype == "x86_64":
+        PLATFORM = "x64"
+    elif machinetype == "x86" or machinetype == "i386" or machinetype == "i686":
+        PLATFORM = "x86"
+    elif machinetype == "arm":
+        PLATFORM = "Arm"
+    else:
+        print "Unknown platform:", machinetype
+        finish_script(1)
+
+    MAKE_ARGS = ''
+
+MAKE_ARGS += ' -j' + calc_jobs_number()
+
+if ostype == "Darwin":
+    TARGET = "MacOSX"
+else:
+    TARGET = "Linux-" + PLATFORM
+
+#-------------Log--------------------------------------------------------------#
+
+# Create output dir
+if (os.path.exists(SCRIPT_DIR + "/Output")):
+    shutil.rmtree(SCRIPT_DIR + "/Output")
+if (os.path.exists(SCRIPT_DIR + "/Final")):
+    shutil.rmtree(SCRIPT_DIR + "/Final")
+os.makedirs(SCRIPT_DIR + "/Output")
+logger = logging.getLogger('myapp')
+hdlr = logging.FileHandler('Output/Nightly.log')
+formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
+hdlr.setFormatter(formatter)
+logger.addHandler(hdlr)
+logger.setLevel(logging.INFO)
+
+#------------Welcome Messege--------=------------------------------------------#
+print "\n";
+print "*********************************"
+print "*   PrimeSense OpenNI Redist    *"
+print "*     " + DateTimeSTR + "       *"
+print "*********************************"
+print
+logger.info("PrimeSense OpenNI Redist Started")
+
+print "Target:", TARGET
+
+#--------------Take Version----------------------------------------------------#
+version_file = open("../../../Include/XnVersion.h").read()
+major = re.search(r"define XN_MAJOR_VERSION (\d+)", version_file).groups()[0]
+minor = re.search(r"define XN_MINOR_VERSION (\d+)", version_file).groups()[0]
+maintenance = re.search(r"define XN_MAINTENANCE_VERSION (\d+)", version_file).groups()[0]
+build = re.search(r"define XN_BUILD_VERSION (\d+)", version_file).groups()[0]
+
+version = major + "." + minor + "." + maintenance + "." + build
+print "Version:", version
+
+print "Num of compile jobs:", calc_jobs_number()
+
+print
+
+#--------------Build Project---------------------------------------------------#
+print "* Building OpenNI..."
+logger.info("Building OpenNI...")
+
+# Build
+#execute_check("gacutil -u OpenNI.net > " + SCRIPT_DIR + "/Output/gacutil.txt", "Remove from GAC")
+execute_check('make ' + MAKE_ARGS + ' -C ' + SCRIPT_DIR + '/../Build clean > ' + SCRIPT_DIR + '/Output/Build' + PROJECT_NAME + '_clean.txt', 'Cleaning')
+execute_check('make ' + MAKE_ARGS + ' -C ' + SCRIPT_DIR + '/../Build > ' + SCRIPT_DIR + '/Output/Build' + PROJECT_NAME + '.txt', 'Building')
+
+#--------------Doxygen---------------------------------------------------------#
+print "* Creating Doxygen..."
+logger.info("Creating DoxyGen...")
+os.chdir("../../../Source/DoxyGen");
+if os.path.exists("html"):
+    os.system("rm -rf html")
+# Running doxygen
+os.makedirs("html")
+execute_check("doxygen Doxyfile > "+ SCRIPT_DIR + "/Output/EngineDoxy.txt", "Creating Documentation")
+
+# remove unneeded files
+os.system("rm -rf html/*.map html/*.md5 html/*.hhc html/*.hhk html/*.hhp")
+
+#-------------Create Redist Dir------------------------------------------------#
+print "* Creating Redist Dir..."
+logger.info("Creating Redist Dir...")
+os.chdir(SCRIPT_DIR + "/..")
+
+REDIST_NAME = "OpenNI-Bin-Dev-" + TARGET + "-v" + version
+
+REDIST_DIR = "Redist/" + REDIST_NAME
+
+# Removing the old directory
+if (os.path.exists(REDIST_DIR)):
+    shutil.rmtree(REDIST_DIR)
+
+# Creating new directory tree
+os.makedirs(REDIST_DIR)
+os.makedirs(REDIST_DIR + "/Bin")
+os.makedirs(REDIST_DIR + "/Lib")
+os.makedirs(REDIST_DIR + "/Jar")
+os.makedirs(REDIST_DIR + "/Include")
+os.makedirs(REDIST_DIR + "/Documentation")
+os.makedirs(REDIST_DIR + "/Samples")
+os.makedirs(REDIST_DIR + "/Samples/Bin")
+os.makedirs(REDIST_DIR + "/Samples/Bin/" + PLATFORM + "-Debug")
+os.makedirs(REDIST_DIR + "/Samples/Bin/" + PLATFORM + "-Release")
+os.makedirs(REDIST_DIR + "/Samples/Build")
+os.makedirs(REDIST_DIR + "/Samples/Config")
+os.makedirs(REDIST_DIR + "/Samples/Res")
+
+#-------------Copy files to redist---------------------------------------------#
+print "* Copying files to redist dir..."
+logger.info("Copying files to redist dir...")
+
+#license
+shutil.copy("../../GPL.txt", REDIST_DIR)
+shutil.copy("../../LGPL.txt", REDIST_DIR)
+
+#lib
+if ostype == "Darwin":
+    LIBS_TYPE = ".dylib"
+else:
+    LIBS_TYPE = ".so"
+
+shutil.copy("Bin/" + PLATFORM + "-Release/libnimCodecs"+LIBS_TYPE, REDIST_DIR + "/Lib")
+shutil.copy("Bin/" + PLATFORM + "-Release/libnimMockNodes"+LIBS_TYPE, REDIST_DIR + "/Lib")
+shutil.copy("Bin/" + PLATFORM + "-Release/libnimRecorder"+LIBS_TYPE, REDIST_DIR + "/Lib")
+shutil.copy("Bin/" + PLATFORM + "-Release/libOpenNI"+LIBS_TYPE, REDIST_DIR + "/Lib")
+shutil.copy("Bin/" + PLATFORM + "-Release/libOpenNI.jni"+LIBS_TYPE, REDIST_DIR + "/Lib")
+
+#bin
+MonoDetected = 0
+shutil.copy("Bin/" + PLATFORM + "-Release/niReg", REDIST_DIR + "/Bin")
+shutil.copy("Bin/" + PLATFORM + "-Release/niLicense", REDIST_DIR + "/Bin")
+if PLATFORM == 'x86' or PLATFORM == 'x64':
+    if (os.path.exists("/usr/bin/gmcs")):
+        shutil.copy("Bin/" + PLATFORM + "-Release/OpenNI.net.dll", REDIST_DIR + "/Bin")
+        shutil.copy("Bin/" + PLATFORM + "-Release/OpenNI.net.dll", REDIST_DIR + "/Samples/Bin/" + PLATFORM + "-Debug")
+        shutil.copy("Bin/" + PLATFORM + "-Release/OpenNI.net.dll", REDIST_DIR + "/Samples/Bin/" + PLATFORM + "-Release")
+        MonoDetected = 1
+        
+# java wrapper
+shutil.copy("Bin/" + PLATFORM + "-Release/org.OpenNI.jar", REDIST_DIR + "/Jar")
+shutil.copy("Bin/" + PLATFORM + "-Release/org.OpenNI.jar", REDIST_DIR + "/Samples/Bin/" + PLATFORM + "-Debug")
+shutil.copy("Bin/" + PLATFORM + "-Release/org.OpenNI.jar", REDIST_DIR + "/Samples/Bin/" + PLATFORM + "-Release")
+
+#docs
+shutil.copytree("../../Source/DoxyGen/html", REDIST_DIR + "/Documentation/html")
+
+#include
+for includeFile in os.listdir("../../Include"):
+    if not os.path.isdir("../../Include/" + includeFile):
+        shutil.copy("../../Include/" + includeFile, REDIST_DIR + "/Include")
+
+shutil.copytree("../../Include/Linux-x86", REDIST_DIR + "/Include/Linux-x86")
+shutil.copytree("../../Include/Linux-Arm", REDIST_DIR + "/Include/Linux-Arm")
+shutil.copytree("../../Include/MacOSX", REDIST_DIR + "/Include/MacOSX")
+shutil.copytree("Build/Common", REDIST_DIR + "/Samples/Build/Common")
+
+# samples
+samples_list = os.listdir("Build/Samples")
+if '.svn' in samples_list:
+    samples_list.remove('.svn')
+
+if PLATFORM == 'CE4100':
+    samples_list.remove('NiViewer')
+    samples_list.remove('NiSimpleViewer')
+
+if PLATFORM == 'Arm':
+    samples_list.remove('NiUserTracker')
+    samples_list.remove('NiViewer')
+    samples_list.remove('NiSimpleViewer')
+    samples_list.remove('NiHandTracker')
+    samples_list.remove('NiUserSelection')
+
+if (MonoDetected == 0):
+    samples_list.remove("SimpleRead.net")
+    samples_list.remove("SimpleViewer.net")
+    samples_list.remove("UserTracker.net")
+
+print "Samples:", samples_list
+
+for sample in samples_list:
+    shutil.copytree("../../Samples/" + sample, REDIST_DIR + "/Samples/" + sample)
+    shutil.copy("Build/Samples/"+ sample + "/Makefile", REDIST_DIR + "/Samples/"+ sample)
+
+#data
+shutil.copy("../../Data/SamplesConfig.xml", REDIST_DIR + "/Samples/Config/SamplesConfig.xml")
+
+#res
+res_files = os.listdir("Build/Res")
+if '.svn' in res_files:
+    res_files.remove('.svn')
+for res_file in res_files:
+    shutil.copy("Build/Res/" + res_file, REDIST_DIR + "/Samples/Res")
+
+# remove all .svn files
+os.system("find " + REDIST_DIR + "/. | grep .svn | xargs rm -rf")
+
+# remove all .svn files
+os.system("find " + REDIST_DIR + "/Samples/. | grep .svn | xargs rm -rf")
+
+#-----Remove Read Only Attrib--------------------------------------------------#
+print "* Removing Read Only Attributes..."
+logger.info("Removing Read Only Attributes...")
+os.system ("chmod -R +r " + REDIST_DIR + "/*")
+
+#--------Fixing Files----------------------------------------------------------#
+print "* Fixing Files..."
+logger.info("Fixing Files...")
+os.path.walk(REDIST_DIR + "/Samples",fix_file,'')
+
+#-------Creating project and solutions-----------------------------------------#
+print "* Creating Makefile..."
+logger.info("Creating Makefile...")
+
+MAKEFILE = open(REDIST_DIR + "/Samples/Build/Makefile", 'w')
+MAKEFILE.write("include Common/CommonDefs.mak\n\n")
+MAKEFILE.write(".PHONY: all\n\n")
+MAKEFILE.write("NETPROJ = \n")
+
+MAKEFILE.write("ifneq \"$(realpath /usr/bin/gmcs)\" \"\"\n");
+for sample in samples_list:
+    if sample.find(".net") >0:
+        MAKEFILE.write("\tNETPROJ += " + sample + "\n")
+MAKEFILE.write("endif\n\n");
+
+MAKEFILE.write("all: $(NETPROJ) ")
+for sample in samples_list:
+    if sample.find(".net") == -1:
+        MAKEFILE.write(sample + " ")
+MAKEFILE.write("\n\n")
+
+for sample in samples_list:
+    MAKEFILE.write("\n")
+    MAKEFILE.write(".PHONY: "+sample+"\n")
+    MAKEFILE.write(sample+":\n")
+    MAKEFILE.write("\t$(MAKE) -C ../"+sample+"\n")
+    
+# Close files
+MAKEFILE.close()
+
+#-------Copy install script---------------------------------------------------#
+print "* Copying install script..."
+logger.info("Copying install script...")
+
+copy_install_script(PLATFORM, "CreateRedist/install.sh", REDIST_DIR)
+
+#-------------Build Samples---------------------------------------------------#
+print "* Building Samples in release configuration......"
+logger.info("Building Samples in release configuration...")
+
+# Build project solution
+execute_check("make " + MAKE_ARGS + " -C " + REDIST_DIR + "/Samples/Build " + " > "+SCRIPT_DIR+"/Output/BuildSmpRelease.txt", "Build samples in release")
+
+print "* Building Samples in debug configuration......"
+logger.info("Building Samples in debug configuration...")
+
+# Build project solution
+execute_check("make " + MAKE_ARGS + " CFG=Debug -C " + REDIST_DIR + "/Samples/Build > "+SCRIPT_DIR+"/Output/BuildSmpDebug.txt", "Build samples in debug")
+
+# delete intermidiate files
+for sample in samples_list:
+   os.system("rm -rf " + REDIST_DIR + "/Samples/"+sample+"/" + PLATFORM + "/Debug")
+   os.system("rm -rf " + REDIST_DIR + "/Samples/"+sample+"/" + PLATFORM + "/Release")
+
+#-------------Create TAR-------------------------------------------------------#
+print "* Creating tar......"
+logger.info("Creating tar...")
+
+os.makedirs(SCRIPT_DIR+"/Final")
+os.chdir(SCRIPT_DIR + "/../Redist")
+
+execute_check("tar -cjf " +SCRIPT_DIR+"/Final/" + REDIST_NAME + ".tar.bz2 " + REDIST_NAME, "Tar")
+
+os.chdir(SCRIPT_DIR)
+
+#-------------CleanUP----------------------------------------------------------#
+print "* Redist OpenNi Ended.   !!"
+logger.info("Redist OpenNi Ended.")
+finish_script(0)
+
+
diff --git a/Platform/Linux/CreateRedist/install.sh b/Platform/Linux/CreateRedist/install.sh
new file mode 100644
index 0000000..cdeff3f
--- /dev/null
+++ b/Platform/Linux/CreateRedist/install.sh
@@ -0,0 +1,181 @@
+#!/bin/sh -e
+
+usage="
+Usage: $0 [OPTIONS]
+Installs OpenNI to current machine.
+
+-i,--install
+	Installs OpenNI (default mode)
+-u,--uninstall
+	Uninstalls OpenNI.
+-c,--cross-compile-rootfs <path>
+	Used for cross-compiling. Installs OpenNI to <path> instead of '/'.
+-h,--help
+	Shows this help screen.
+"
+
+OS_NAME=`uname -s`
+
+case $OS_NAME in
+Darwin)
+	MODULES="libnimMockNodes.dylib libnimCodecs.dylib libnimRecorder.dylib"
+	GACDIR=""
+	;;
+*)
+	MODULES="libnimMockNodes.so libnimCodecs.so libnimRecorder.so"
+	GACDIR="-gacdir $rootfs/usr"	
+	;;
+esac
+
+SCRIPT_DIR=`pwd`/`dirname $0`
+
+# create file list
+LIB_FILES=`ls $SCRIPT_DIR/Lib/*`
+BIN_FILES=`ls $SCRIPT_DIR/Bin/ni*`
+JAR_FILES=`ls $SCRIPT_DIR/Jar/*.jar`
+
+rootfs=
+
+# parse command line
+while [ "$1" ]; do
+	case $1 in
+	-i|--install)
+		install=yes
+		;;
+	-u|--uninstall)
+		uninstall=yes
+		;;
+	-c|--cross-staging-dir)
+		shift
+		rootfs=$1
+		;;
+	-h|--help) 
+		echo "$usage"
+		exit 0
+		;;
+	*)
+		echo "Unrecognized option $1"
+		exit 1
+	esac
+	shift
+done
+
+# default mode is install
+if [ ! "$install" = yes ] && [ ! "$uninstall" = yes ]; then
+	install=yes
+fi
+
+# validity check
+if [ "$install" = yes ] && [ "$uninstall" = yes ]; then
+	echo "-i and -u flags cannot be used together!"
+	exit 1
+fi
+
+INSTALL_LIB=$rootfs/usr/lib
+INSTALL_BIN=$rootfs/usr/bin
+INSTALL_INC=$rootfs/usr/include/ni
+INSTALL_VAR=$rootfs/var/lib/ni
+INSTALL_JAR=$rootfs/usr/share/java
+
+# make all calls into OpenNI run in this filesystem
+export OPEN_NI_INSTALL_PATH=$rootfs
+# make sure the staging dir OpenNI is the one being run
+export LD_LIBRARY_PATH=$INSTALL_LIB
+
+if [ "$install" = yes ]; then
+	printf "Installing OpenNI\n"
+	printf "****************************\n\n"
+	
+	# copy libraries
+	printf "copying shared libraries..."
+	cp $LIB_FILES $INSTALL_LIB
+	printf "OK\n"
+
+	# utilities
+	printf "copying executables..."
+	cp $BIN_FILES $INSTALL_BIN
+	printf "OK\n"
+
+	# include files
+	printf "copying include files..."
+	mkdir -p $INSTALL_INC
+	cp -r Include/* $INSTALL_INC
+	printf "OK\n"
+
+	# create database dir
+	printf "creating database directory..."
+	mkdir -p $INSTALL_VAR
+	printf "OK\n"
+
+	# register modules
+	for module in $MODULES; do
+		printf "registering module '$module'..."
+		$INSTALL_BIN/niReg -r $INSTALL_LIB/$module
+		printf "OK\n"
+	done
+
+	# mono
+	if [ -f $rootfs/usr/bin/gmcs -a -f Bin/OpenNI.net.dll ]; then
+		printf "Installing .Net wrappers...\n"
+		gacutil -i Bin/OpenNI.net.dll -package 2.0 $GACDIR
+	fi
+
+	# java wrappers
+	printf "creating java bindings directory..."
+	mkdir -p $INSTALL_JAR
+	printf "OK\n"
+
+	printf "Installing java bindings..."
+	cp $JAR_FILES $INSTALL_JAR
+	printf "OK\n"
+
+	printf "\n*** DONE ***\n\n"
+
+elif [ "$uninstall" = yes ]; then
+	printf "Uninstalling OpenNI\n"
+	printf "****************************\n\n"
+
+	# unregister modules
+	for module in $MODULES; do
+    	printf "unregistering module '$module'..."
+        if $INSTALL_BIN/niReg -u $INSTALL_LIB/$module; then
+            printf "OK\n"
+        fi
+	done
+
+	# include files
+	printf "removing include files..."
+	rm -rf $INSTALL_INC
+	printf "OK\n"
+
+	# binaries
+	printf "removing executables..."
+	for filename in $BIN_FILES; do
+		rm -f $INSTALL_BIN/`basename $filename`
+	done
+	printf "OK\n"
+
+	# libraries
+	printf "removing shared libraries..."
+	for filename in $LIB_FILES; do
+		rm -f $INSTALL_LIB/`basename $filename`
+	done
+	printf "OK\n"
+
+	# mono
+	if [ -f $rootfs/usr/bin/gmcs -a -f Bin/OpenNI.net.dll ]; then
+		printf "Removing .Net wrappers...\n"
+		gacutil -u OpenNI.net $GACDIR
+	fi
+
+	# java
+	printf "removing java bindings..."
+	for filename in $JAR_FILES; do
+		rm -f $INSTALL_JAR/`basename $filename`
+	done
+	printf "OK\n"
+	
+	printf "\n*** DONE ***\n\n"
+
+fi
+
diff --git a/Platform/Win32/Build/BuildJava.py b/Platform/Win32/Build/BuildJava.py
new file mode 100644
index 0000000..a83d416
--- /dev/null
+++ b/Platform/Win32/Build/BuildJava.py
@@ -0,0 +1,125 @@
+#/***************************************************************************
+#*                                                                          *
+#*  OpenNI 1.x Alpha                                                        *
+#*  Copyright (C) 2011 PrimeSense Ltd.                                      *
+#*                                                                          *
+#*  This file is part of OpenNI.                                            *
+#*                                                                          *
+#*  OpenNI is free software: you can redistribute it and/or modify          *
+#*  it under the terms of the GNU Lesser General Public License as published*
+#*  by the Free Software Foundation, either version 3 of the License, or    *
+#*  (at your option) any later version.                                     *
+#*                                                                          *
+#*  OpenNI is distributed in the hope that it will be useful,               *
+#*  but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+#*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
+#*  GNU Lesser General Public License for more details.                     *
+#*                                                                          *
+#*  You should have received a copy of the GNU Lesser General Public License*
+#*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.          *
+#*                                                                          *
+#***************************************************************************/
+import os
+import subprocess
+import sys
+import shutil
+
+# take script dir
+SCRIPT_DIR = os.path.abspath(os.path.dirname(sys.argv[0]))
+
+# parse command line
+if len(sys.argv) < 5:
+    print (("usage: ", sys.argv[0], " <32|64> <ProjDir> <SourceDir> <Name> [NeededJarFiles] [MainClass]"))
+    exit(1)
+
+if sys.argv[1] == "" or sys.argv[1] == "32":
+    bin_dir = "Bin"
+elif sys.argv[1] == "64":
+    bin_dir = "Bin64"
+else:
+    print ('First argument must be "32", "64" or empty (32)')
+    exit(1)
+    
+proj_dir = sys.argv[2]
+source_dir = os.path.join(proj_dir, sys.argv[3])
+proj_name = sys.argv[4]
+needed_jar_files = ""
+main_class = ""
+if len(sys.argv) > 5:
+    needed_jar_files = sys.argv[5]
+if len(sys.argv) > 6:
+    main_class = sys.argv[6]
+
+RELEASE_DIR = os.path.join(SCRIPT_DIR, "..", bin_dir, "Release")
+DEBUG_DIR = os.path.join(SCRIPT_DIR, "..", bin_dir, "Debug")
+
+JAR_FILE = os.path.join(RELEASE_DIR, proj_name + '.jar')
+BATCH_FILE = os.path.join(RELEASE_DIR, proj_name + '.bat')
+
+# make sure JAVA_HOME is set
+JAVA_HOME = os.path.expandvars("$JAVA_HOME")
+if JAVA_HOME == "":
+    print ("JAVA_HOME is not set!")
+    exit(1)
+    
+CLASS_PATH = os.path.expandvars("$CLASSPATH")
+
+TEMP_BUILD_DIR = os.path.join(proj_dir, "bin")
+
+# create bin dir if needed
+if not os.path.exists(TEMP_BUILD_DIR):
+    os.mkdir(TEMP_BUILD_DIR)
+ 
+# build
+cmd = '"' + os.path.join(JAVA_HOME, 'bin\javac.exe') + '" '
+if needed_jar_files != "":
+    # add class path
+    cmd += '-cp "' + CLASS_PATH + ';'
+    needed_list = needed_jar_files.split(';')
+    for needed in needed_list:
+        cmd += os.path.join(RELEASE_DIR, needed) + ';'
+    cmd += '" '
+
+cmd += '-d ' + TEMP_BUILD_DIR + ' ' + os.path.join(source_dir, '*.java')
+res = subprocess.call(cmd)
+if res != 0:
+    print ("Failed to build!")
+    exit(1)
+
+# create JAR file
+cmd = '"' + os.path.join(JAVA_HOME, 'bin\jar.exe') + '" -cf'
+manifest = main_class != "" or needed_jar_files != ""
+if manifest:
+    # add manifest
+    TEMP_MANIFEST_FILE = os.path.join(proj_dir, "Manifest.txt")
+    manifest = open(TEMP_MANIFEST_FILE, 'w')
+    if needed_jar_files != "":
+        manifest.write("Class-Path:")
+        needed_list = needed_jar_files.split(';')
+        for needed in needed_list:
+            manifest.write(" " + needed)
+        manifest.write('\n')
+    if main_class != "":
+        manifest.write("Main-Class: " + main_class + "\n")
+    manifest.close()
+    cmd += 'm'
+cmd += ' ' + JAR_FILE + ' '
+if manifest:
+    cmd += TEMP_MANIFEST_FILE + ' '
+cmd += '-C ' + TEMP_BUILD_DIR + ' .'
+res = subprocess.call(cmd)
+if res != 0:
+    print ("Failed to jar!")
+    exit(1)
+
+# copy jar to Bin/Debug
+shutil.copy(JAR_FILE, DEBUG_DIR)
+    
+# create batch file (by default, windows does not open a console when double-clicking jar files)
+if main_class != "":
+    batch = open(BATCH_FILE, 'w')
+    batch.write('java -jar ' + proj_name + '.jar\n')
+    batch.close()
+
+    # copy batch to Bin/Debug
+    shutil.copy(BATCH_FILE, DEBUG_DIR)
diff --git a/Platform/Win32/Build/Modules/nimCodecs/nimCodecs.vcproj b/Platform/Win32/Build/Modules/nimCodecs/nimCodecs.vcproj
index 9f0bb93..b2d978d 100644
--- a/Platform/Win32/Build/Modules/nimCodecs/nimCodecs.vcproj
+++ b/Platform/Win32/Build/Modules/nimCodecs/nimCodecs.vcproj
@@ -50,8 +50,9 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="4"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -127,8 +128,9 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -198,6 +200,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -210,8 +213,9 @@
 				EnableEnhancedInstructionSet="2"
 				FloatingPointModel="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -283,6 +287,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -295,8 +300,9 @@
 				EnableEnhancedInstructionSet="2"
 				FloatingPointModel="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -430,26 +436,218 @@
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcapimin.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcapistd.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jccoefct.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jccolor.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcdctmgr.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jchuff.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jchuff.h"
@@ -458,22 +656,182 @@
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcinit.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcmainct.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcmarker.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcmaster.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcomapi.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jconfig.h"
@@ -486,46 +844,398 @@
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcparam.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcphuff.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcprepct.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jcsample.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jctrans.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdapimin.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdapistd.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdatadst.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdatasrc.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdcoefct.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdcolor.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdct.h"
@@ -534,10 +1244,74 @@
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jddctmgr.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdhuff.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdhuff.h"
@@ -546,42 +1320,362 @@
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdinput.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdmainct.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdmarker.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdmaster.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdmerge.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdphuff.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100;4244"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100;4244"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100;4244"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100;4244"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdpostct.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdsample.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jdtrans.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jerror.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jerror.h"
@@ -590,30 +1684,254 @@
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jfdctflt.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jfdctfst.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jfdctint.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jidctflt.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jidctfst.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jidctint.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jidctred.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jinclude.h"
@@ -622,10 +1940,74 @@
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jmemmgr.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jmemnobs.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jmemsys.h"
@@ -646,14 +2028,110 @@
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jquant1.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jquant2.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jutils.c"
 					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|x64"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							DisableSpecificWarnings="4100"
+						/>
+					</FileConfiguration>
 				</File>
 				<File
 					RelativePath="..\..\..\..\..\Source\External\LibJPEG\jversion.h"
diff --git a/Platform/Win32/Build/Modules/nimMockNodes/nimMockNodes.vcproj b/Platform/Win32/Build/Modules/nimMockNodes/nimMockNodes.vcproj
index 478c9cf..58bd985 100644
--- a/Platform/Win32/Build/Modules/nimMockNodes/nimMockNodes.vcproj
+++ b/Platform/Win32/Build/Modules/nimMockNodes/nimMockNodes.vcproj
@@ -50,9 +50,9 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="4"
-				DisableSpecificWarnings="4250"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -128,9 +128,9 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
-				DisableSpecificWarnings="4250"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -200,6 +200,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -212,9 +213,9 @@
 				EnableEnhancedInstructionSet="2"
 				FloatingPointModel="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
-				DisableSpecificWarnings="4250"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -286,6 +287,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -298,9 +300,9 @@
 				EnableEnhancedInstructionSet="2"
 				FloatingPointModel="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
-				DisableSpecificWarnings="4250"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
diff --git a/Platform/Win32/Build/Modules/nimRecorder/nimRecorder.vcproj b/Platform/Win32/Build/Modules/nimRecorder/nimRecorder.vcproj
index 2a9549b..fb8356d 100644
--- a/Platform/Win32/Build/Modules/nimRecorder/nimRecorder.vcproj
+++ b/Platform/Win32/Build/Modules/nimRecorder/nimRecorder.vcproj
@@ -50,8 +50,9 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="4"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -127,8 +128,9 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -198,6 +200,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -210,8 +213,9 @@
 				EnableEnhancedInstructionSet="2"
 				FloatingPointModel="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -283,6 +287,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -295,8 +300,9 @@
 				EnableEnhancedInstructionSet="2"
 				FloatingPointModel="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127;4250"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
diff --git a/Platform/Win32/Build/OpenNI.sln b/Platform/Win32/Build/OpenNI.sln
index b18cfbf..ca8e34f 100644
--- a/Platform/Win32/Build/OpenNI.sln
+++ b/Platform/Win32/Build/OpenNI.sln
@@ -136,6 +136,26 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NiRecordRaw", "Samples\NiRe
 		{8566604D-505A-45CE-A9FF-D94F2F6C4965} = {8566604D-505A-45CE-A9FF-D94F2F6C4965}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenNI.jni", "Wrappers\OpenNI.jni\OpenNI.jni.vcproj", "{97C32C97-C847-4AF2-A8BF-D4FC984F16AA}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8566604D-505A-45CE-A9FF-D94F2F6C4965} = {8566604D-505A-45CE-A9FF-D94F2F6C4965}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NiHandTracker", "Samples\NiHandTracker\NiHandTracker.vcproj", "{F3CEC610-F028-40CE-8713-AFF2078047B9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8566604D-505A-45CE-A9FF-D94F2F6C4965} = {8566604D-505A-45CE-A9FF-D94F2F6C4965}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NiUserSelection", "Samples\NiUserSelection\NiUserSelection.vcproj", "{9E783429-7D81-4DDE-88CA-DD6303DF0199}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8566604D-505A-45CE-A9FF-D94F2F6C4965} = {8566604D-505A-45CE-A9FF-D94F2F6C4965}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NiSimpleSkeleton", "Samples\NiSimpleSkeleton\NiSimpleSkeleton.vcproj", "{DDD89130-33BC-4AA9-89A2-FA089BF5B765}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8566604D-505A-45CE-A9FF-D94F2F6C4965} = {8566604D-505A-45CE-A9FF-D94F2F6C4965}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -342,6 +362,38 @@ Global
 		{C844505D-3D9E-437F-94D6-BDA74999651D}.Release|Win32.Build.0 = Release|Win32
 		{C844505D-3D9E-437F-94D6-BDA74999651D}.Release|x64.ActiveCfg = Release|x64
 		{C844505D-3D9E-437F-94D6-BDA74999651D}.Release|x64.Build.0 = Release|x64
+		{97C32C97-C847-4AF2-A8BF-D4FC984F16AA}.Debug|Win32.ActiveCfg = Debug|Win32
+		{97C32C97-C847-4AF2-A8BF-D4FC984F16AA}.Debug|Win32.Build.0 = Debug|Win32
+		{97C32C97-C847-4AF2-A8BF-D4FC984F16AA}.Debug|x64.ActiveCfg = Debug|x64
+		{97C32C97-C847-4AF2-A8BF-D4FC984F16AA}.Debug|x64.Build.0 = Debug|x64
+		{97C32C97-C847-4AF2-A8BF-D4FC984F16AA}.Release|Win32.ActiveCfg = Release|Win32
+		{97C32C97-C847-4AF2-A8BF-D4FC984F16AA}.Release|Win32.Build.0 = Release|Win32
+		{97C32C97-C847-4AF2-A8BF-D4FC984F16AA}.Release|x64.ActiveCfg = Release|x64
+		{97C32C97-C847-4AF2-A8BF-D4FC984F16AA}.Release|x64.Build.0 = Release|x64
+		{F3CEC610-F028-40CE-8713-AFF2078047B9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F3CEC610-F028-40CE-8713-AFF2078047B9}.Debug|Win32.Build.0 = Debug|Win32
+		{F3CEC610-F028-40CE-8713-AFF2078047B9}.Debug|x64.ActiveCfg = Debug|x64
+		{F3CEC610-F028-40CE-8713-AFF2078047B9}.Debug|x64.Build.0 = Debug|x64
+		{F3CEC610-F028-40CE-8713-AFF2078047B9}.Release|Win32.ActiveCfg = Release|Win32
+		{F3CEC610-F028-40CE-8713-AFF2078047B9}.Release|Win32.Build.0 = Release|Win32
+		{F3CEC610-F028-40CE-8713-AFF2078047B9}.Release|x64.ActiveCfg = Release|x64
+		{F3CEC610-F028-40CE-8713-AFF2078047B9}.Release|x64.Build.0 = Release|x64
+		{9E783429-7D81-4DDE-88CA-DD6303DF0199}.Debug|Win32.ActiveCfg = Debug|Win32
+		{9E783429-7D81-4DDE-88CA-DD6303DF0199}.Debug|Win32.Build.0 = Debug|Win32
+		{9E783429-7D81-4DDE-88CA-DD6303DF0199}.Debug|x64.ActiveCfg = Debug|x64
+		{9E783429-7D81-4DDE-88CA-DD6303DF0199}.Debug|x64.Build.0 = Debug|x64
+		{9E783429-7D81-4DDE-88CA-DD6303DF0199}.Release|Win32.ActiveCfg = Release|Win32
+		{9E783429-7D81-4DDE-88CA-DD6303DF0199}.Release|Win32.Build.0 = Release|Win32
+		{9E783429-7D81-4DDE-88CA-DD6303DF0199}.Release|x64.ActiveCfg = Release|x64
+		{9E783429-7D81-4DDE-88CA-DD6303DF0199}.Release|x64.Build.0 = Release|x64
+		{DDD89130-33BC-4AA9-89A2-FA089BF5B765}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DDD89130-33BC-4AA9-89A2-FA089BF5B765}.Debug|Win32.Build.0 = Debug|Win32
+		{DDD89130-33BC-4AA9-89A2-FA089BF5B765}.Debug|x64.ActiveCfg = Debug|x64
+		{DDD89130-33BC-4AA9-89A2-FA089BF5B765}.Debug|x64.Build.0 = Debug|x64
+		{DDD89130-33BC-4AA9-89A2-FA089BF5B765}.Release|Win32.ActiveCfg = Release|Win32
+		{DDD89130-33BC-4AA9-89A2-FA089BF5B765}.Release|Win32.Build.0 = Release|Win32
+		{DDD89130-33BC-4AA9-89A2-FA089BF5B765}.Release|x64.ActiveCfg = Release|x64
+		{DDD89130-33BC-4AA9-89A2-FA089BF5B765}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -367,9 +419,13 @@ Global
 		{B778C374-A6C6-488C-8911-DD1F3725498E} = {07AFDAB7-B24B-464F-9937-4F552B4676F0}
 		{736D2A64-C37E-4D38-9EE0-A3BB92E0072D} = {07AFDAB7-B24B-464F-9937-4F552B4676F0}
 		{C844505D-3D9E-437F-94D6-BDA74999651D} = {07AFDAB7-B24B-464F-9937-4F552B4676F0}
+		{F3CEC610-F028-40CE-8713-AFF2078047B9} = {07AFDAB7-B24B-464F-9937-4F552B4676F0}
+		{9E783429-7D81-4DDE-88CA-DD6303DF0199} = {07AFDAB7-B24B-464F-9937-4F552B4676F0}
+		{DDD89130-33BC-4AA9-89A2-FA089BF5B765} = {07AFDAB7-B24B-464F-9937-4F552B4676F0}
 		{60638E49-3597-4389-A043-8A6E9A42AF5D} = {81B25B95-A44F-444B-9DA5-5CBFE0FF76D9}
 		{4D7A7078-D442-42DB-B340-6243FE427919} = {81B25B95-A44F-444B-9DA5-5CBFE0FF76D9}
 		{2C90AA1B-9740-4834-B19D-1E8D5D11CF77} = {81B25B95-A44F-444B-9DA5-5CBFE0FF76D9}
 		{2FE4F6DE-12C8-41EE-9588-EB91CB6112FE} = {9396B0B5-82D5-4916-B6AA-21DFBC9597AE}
+		{97C32C97-C847-4AF2-A8BF-D4FC984F16AA} = {9396B0B5-82D5-4916-B6AA-21DFBC9597AE}
 	EndGlobalSection
 EndGlobal
diff --git a/Platform/Win32/Build/OpenNI/OpenNI.vcproj b/Platform/Win32/Build/OpenNI/OpenNI.vcproj
index 6cc6eed..41efce2 100644
--- a/Platform/Win32/Build/OpenNI/OpenNI.vcproj
+++ b/Platform/Win32/Build/OpenNI/OpenNI.vcproj
@@ -50,8 +50,9 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="4"
+				DisableSpecificWarnings="4127"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -129,8 +130,9 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -202,6 +204,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -214,8 +217,9 @@
 				EnableEnhancedInstructionSet="2"
 				FloatingPointModel="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -289,6 +293,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -298,11 +303,11 @@
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;XN_EXPORTS"
 				RuntimeLibrary="2"
 				BufferSecurityCheck="false"
-				EnableEnhancedInstructionSet="2"
 				FloatingPointModel="2"
 				UsePrecompiledHeader="0"
-				WarningLevel="3"
+				WarningLevel="4"
 				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -436,7 +441,7 @@
 					>
 				</File>
 				<File
-					RelativePath="..\..\..\..\Source\OpenNI\xnInternalFuncs.h"
+					RelativePath="..\..\..\..\Source\OpenNI\XnInternalFuncs.h"
 					>
 				</File>
 				<File
@@ -479,10 +484,6 @@
 					RelativePath="..\..\..\..\Include\XnUtils.h"
 					>
 				</File>
-				<File
-					RelativePath="..\..\..\..\Source\OpenNI\XnXmlConfig.cpp"
-					>
-				</File>
 			</Filter>
 			<Filter
 				Name="Platform"
@@ -596,6 +597,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\..\..\..\Source\OpenNI\Win32\XnOSWin32Internal.h"
+					>
+				</File>
+				<File
 					RelativePath="..\..\..\..\Source\OpenNI\XnUSB.cpp"
 					>
 				</File>
@@ -632,14 +637,6 @@
 					>
 				</File>
 				<File
-					RelativePath="..\..\..\..\Source\OpenNI\XnLog.cpp"
-					>
-				</File>
-				<File
-					RelativePath="..\..\..\..\Include\XnLog.h"
-					>
-				</File>
-				<File
 					RelativePath="..\..\..\..\Include\XnMacros.h"
 					>
 				</File>
@@ -864,6 +861,86 @@
 					>
 				</File>
 			</Filter>
+			<Filter
+				Name="Log"
+				>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnDump.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Include\XnDump.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnDumpFileWriter.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnDumpFileWriter.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Include\XnDumpWriters.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnLog.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Include\XnLog.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnLogConsoleWriter.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnLogConsoleWriter.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnLogFileWriter.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnLogFileWriter.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Include\XnLogTypes.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Include\XnLogWriterBase.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="Nodes"
+				>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnExportedNodes.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnXmlScriptNode.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnXmlScriptNode.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnXmlScriptNodeExporter.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\Source\OpenNI\XnXmlScriptNodeExporter.h"
+					>
+				</File>
+			</Filter>
 		</Filter>
 		<Filter
 			Name="Res"
diff --git a/Platform/Win32/Build/Res/AssemblyInfo-OpenNI.cs b/Platform/Win32/Build/Res/AssemblyInfo-OpenNI.cs
index 8af41e8..47ec3bf 100644
--- a/Platform/Win32/Build/Res/AssemblyInfo-OpenNI.cs
+++ b/Platform/Win32/Build/Res/AssemblyInfo-OpenNI.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
@@ -30,5 +51,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers 
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.0.41")]
-[assembly: AssemblyFileVersion("1.1.0.41")]
+[assembly: AssemblyVersion("1.5.2.23")]
+[assembly: AssemblyFileVersion("1.5.2.23")]
diff --git a/Platform/Win32/Build/Res/Resource-OpenNI.h b/Platform/Win32/Build/Res/Resource-OpenNI.h
index 6ce5908..ab48d25 100644
--- a/Platform/Win32/Build/Res/Resource-OpenNI.h
+++ b/Platform/Win32/Build/Res/Resource-OpenNI.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Build/Samples/HandTracker.java/Build.bat b/Platform/Win32/Build/Samples/HandTracker.java/Build.bat
new file mode 100644
index 0000000..e9ccf77
--- /dev/null
+++ b/Platform/Win32/Build/Samples/HandTracker.java/Build.bat
@@ -0,0 +1 @@
+@%0\..\..\..\BuildJava.py "%1" "%0\.." ..\..\..\..\..\Samples\HandTracker.java\org\OpenNI\Samples\HandTracker org.OpenNI.Samples.HandTracker org.OpenNI.jar org.OpenNI.Samples.HandTracker.HandTrackerApplication
diff --git a/Platform/Win32/Build/Samples/NiAudioSample/NiAudioSample.vcproj b/Platform/Win32/Build/Samples/NiAudioSample/NiAudioSample.vcproj
index ace137d..d9584b6 100644
--- a/Platform/Win32/Build/Samples/NiAudioSample/NiAudioSample.vcproj
+++ b/Platform/Win32/Build/Samples/NiAudioSample/NiAudioSample.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -283,6 +284,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
diff --git a/Platform/Win32/Build/Samples/NiBackRecorder/NiBackRecorder.vcproj b/Platform/Win32/Build/Samples/NiBackRecorder/NiBackRecorder.vcproj
index 7929abb..fcf4565 100644
--- a/Platform/Win32/Build/Samples/NiBackRecorder/NiBackRecorder.vcproj
+++ b/Platform/Win32/Build/Samples/NiBackRecorder/NiBackRecorder.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -283,6 +284,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
diff --git a/Platform/Win32/Build/Samples/NiCRead/NiCRead.vcproj b/Platform/Win32/Build/Samples/NiCRead/NiCRead.vcproj
index 9343ed8..b1b27e9 100644
--- a/Platform/Win32/Build/Samples/NiCRead/NiCRead.vcproj
+++ b/Platform/Win32/Build/Samples/NiCRead/NiCRead.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include"
@@ -278,6 +279,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include"
diff --git a/Platform/Win32/Build/Samples/NiConvertXToONI/NiConvertXToONI.vcproj b/Platform/Win32/Build/Samples/NiConvertXToONI/NiConvertXToONI.vcproj
index 71e0e2b..db086ee 100644
--- a/Platform/Win32/Build/Samples/NiConvertXToONI/NiConvertXToONI.vcproj
+++ b/Platform/Win32/Build/Samples/NiConvertXToONI/NiConvertXToONI.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -283,6 +284,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
diff --git a/Platform/Win32/Build/Samples/NiHandTracker/NiHandTracker.vcproj b/Platform/Win32/Build/Samples/NiHandTracker/NiHandTracker.vcproj
new file mode 100644
index 0000000..1a37517
--- /dev/null
+++ b/Platform/Win32/Build/Samples/NiHandTracker/NiHandTracker.vcproj
@@ -0,0 +1,403 @@
+<?xml version="1.0" encoding="windows-1255"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="NiHandTracker"
+	ProjectGUID="{F3CEC610-F028-40CE-8713-AFF2078047B9}"
+	RootNamespace="NiHandTracker"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Bin\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiHandTracker"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI.lib glut32.lib"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="../../../Lib/$(ConfigurationName);../../../../../Samples/NiHandTracker/Libs"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="..\..\..\Bin64\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiHandTracker"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI64.lib glut64.lib"
+				OutputFile="$(OutDir)\$(ProjectName)64.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="../../../Lib64/$(ConfigurationName);../../../../../Samples/NiHandTracker/Libs"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Bin\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiHandTracker"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI.lib glut32.lib"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Lib/$(ConfigurationName);../../../../../Samples/NiHandTracker/Libs"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="..\..\..\Bin64\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiHandTracker"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI64.lib glut64.lib"
+				OutputFile="$(OutDir)\$(ProjectName)64.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Lib64/$(ConfigurationName);../../../../../Samples/NiHandTracker/Libs"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiHandTracker\main.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiHandTracker\NiHandTracker.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiHandTracker\NiHandTracker.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiHandTracker\NiHandViewer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiHandTracker\NiHandViewer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiHandTracker\NiSimpleViewer.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiHandTracker\NiSimpleViewer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiHandTracker\NiTrailHistory.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiHandTracker\NiTrailHistory.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Res"
+			>
+			<File
+				RelativePath="..\..\Res\mainicon.ico"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Res\OpenNI.rc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Res\Resource-OpenNI.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/Platform/Win32/Build/Samples/NiRecordRaw/NiRecordRaw.vcproj b/Platform/Win32/Build/Samples/NiRecordRaw/NiRecordRaw.vcproj
index 60dd742..e2f9979 100644
--- a/Platform/Win32/Build/Samples/NiRecordRaw/NiRecordRaw.vcproj
+++ b/Platform/Win32/Build/Samples/NiRecordRaw/NiRecordRaw.vcproj
@@ -96,12 +96,11 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="1"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
@@ -117,15 +116,16 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="2"
-				EnableIntrinsicFunctions="true"
+				Optimization="0"
 				AdditionalIncludeDirectories="../../../../../Include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				DebugInformationFormat="3"
@@ -142,15 +142,13 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="openNI.lib"
-				OutputFile="../../../Bin/$(ConfigurationName)/$(ProjectName).exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories="../../../Lib/$(ConfigurationName)"
+				AdditionalDependencies="openNI64.lib"
+				OutputFile="$(OutDir)\$(ProjectName)64.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="../../../Lib64/$(ConfigurationName)"
 				GenerateDebugInformation="true"
 				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -175,11 +173,12 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Debug|x64"
-			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			Name="Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
 			ConfigurationType="1"
 			CharacterSet="1"
+			WholeProgramOptimization="1"
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
@@ -195,16 +194,16 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
-				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="0"
+				AdditionalOptions="/MP"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				DebugInformationFormat="3"
@@ -221,13 +220,15 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="openNI64.lib"
-				OutputFile="$(OutDir)\$(ProjectName)64.exe"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories="../../../Lib64/$(ConfigurationName)"
+				AdditionalDependencies="openNI.lib"
+				OutputFile="../../../Bin/$(ConfigurationName)/$(ProjectName).exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Lib/$(ConfigurationName)"
 				GenerateDebugInformation="true"
 				SubSystem="1"
-				TargetMachine="17"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -277,6 +278,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include"
diff --git a/Platform/Win32/Build/Samples/NiRecordSynthetic/NiRecordSynthetic.vcproj b/Platform/Win32/Build/Samples/NiRecordSynthetic/NiRecordSynthetic.vcproj
index 43bc082..8211a10 100644
--- a/Platform/Win32/Build/Samples/NiRecordSynthetic/NiRecordSynthetic.vcproj
+++ b/Platform/Win32/Build/Samples/NiRecordSynthetic/NiRecordSynthetic.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include"
@@ -278,6 +279,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include"
diff --git a/Platform/Win32/Build/Samples/NiSampleExtensionModule/NiSampleExtensionModule.vcproj b/Platform/Win32/Build/Samples/NiSampleExtensionModule/NiSampleExtensionModule.vcproj
index ebe46e9..87359e9 100644
--- a/Platform/Win32/Build/Samples/NiSampleExtensionModule/NiSampleExtensionModule.vcproj
+++ b/Platform/Win32/Build/Samples/NiSampleExtensionModule/NiSampleExtensionModule.vcproj
@@ -202,6 +202,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -289,6 +290,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
diff --git a/Platform/Win32/Build/Samples/NiSampleModule/NiSampleModule.vcproj b/Platform/Win32/Build/Samples/NiSampleModule/NiSampleModule.vcproj
index ba612a4..7cb0143 100644
--- a/Platform/Win32/Build/Samples/NiSampleModule/NiSampleModule.vcproj
+++ b/Platform/Win32/Build/Samples/NiSampleModule/NiSampleModule.vcproj
@@ -202,6 +202,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -289,6 +290,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
diff --git a/Platform/Win32/Build/Samples/NiSimpleCreate/NiSimpleCreate.vcproj b/Platform/Win32/Build/Samples/NiSimpleCreate/NiSimpleCreate.vcproj
index 3d5f8ae..7d502ec 100644
--- a/Platform/Win32/Build/Samples/NiSimpleCreate/NiSimpleCreate.vcproj
+++ b/Platform/Win32/Build/Samples/NiSimpleCreate/NiSimpleCreate.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include"
@@ -278,6 +279,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include"
diff --git a/Platform/Win32/Build/Samples/NiSimpleRead/NiSimpleRead.vcproj b/Platform/Win32/Build/Samples/NiSimpleRead/NiSimpleRead.vcproj
index 5acafec..4d82ff0 100644
--- a/Platform/Win32/Build/Samples/NiSimpleRead/NiSimpleRead.vcproj
+++ b/Platform/Win32/Build/Samples/NiSimpleRead/NiSimpleRead.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -283,6 +284,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
diff --git a/Platform/Win32/Build/Samples/NiSimpleSkeleton/NiSimpleSkeleton.vcproj b/Platform/Win32/Build/Samples/NiSimpleSkeleton/NiSimpleSkeleton.vcproj
new file mode 100644
index 0000000..557d5b9
--- /dev/null
+++ b/Platform/Win32/Build/Samples/NiSimpleSkeleton/NiSimpleSkeleton.vcproj
@@ -0,0 +1,381 @@
+<?xml version="1.0" encoding="windows-1255"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="NiSimpleSkeleton"
+	ProjectGUID="{DDD89130-33BC-4AA9-89A2-FA089BF5B765}"
+	RootNamespace="NiSimpleRead"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Bin\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../../../../../Include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI.lib"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="../../../Lib/$(ConfigurationName)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="..\..\..\Bin64\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../../../../../Include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI64.lib"
+				OutputFile="$(OutDir)\$(ProjectName)64.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="../../../Lib64/$(ConfigurationName)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Bin\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
+				Optimization="2"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="../../../../../Include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableEnhancedInstructionSet="2"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI.lib"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Lib/$(ConfigurationName)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="..\..\..\Bin64\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
+				Optimization="2"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="../../../../../Include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableEnhancedInstructionSet="2"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI64.lib"
+				OutputFile="$(OutDir)\$(ProjectName)64.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Lib64/$(ConfigurationName)"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiSimpleSkeleton\NiSimpleSkeleton.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Res"
+			>
+			<File
+				RelativePath="..\..\Res\mainicon.ico"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Res\OpenNI.rc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Res\Resource-OpenNI.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/Platform/Win32/Build/Samples/NiSimpleViewer/NiSimpleViewer.vcproj b/Platform/Win32/Build/Samples/NiSimpleViewer/NiSimpleViewer.vcproj
index cc18fc1..f1a9ae9 100644
--- a/Platform/Win32/Build/Samples/NiSimpleViewer/NiSimpleViewer.vcproj
+++ b/Platform/Win32/Build/Samples/NiSimpleViewer/NiSimpleViewer.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiSimpleViewer"
@@ -278,6 +279,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiSimpleViewer"
diff --git a/Platform/Win32/Build/Samples/NiUseExtension/NiUseExtension.vcproj b/Platform/Win32/Build/Samples/NiUseExtension/NiUseExtension.vcproj
index 2b17541..d717947 100644
--- a/Platform/Win32/Build/Samples/NiUseExtension/NiUseExtension.vcproj
+++ b/Platform/Win32/Build/Samples/NiUseExtension/NiUseExtension.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -283,6 +284,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
diff --git a/Platform/Win32/Build/Samples/NiUserSelection/NiUserSelection.vcproj b/Platform/Win32/Build/Samples/NiUserSelection/NiUserSelection.vcproj
new file mode 100644
index 0000000..cb24c26
--- /dev/null
+++ b/Platform/Win32/Build/Samples/NiUserSelection/NiUserSelection.vcproj
@@ -0,0 +1,487 @@
+<?xml version="1.0" encoding="windows-1255"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="NiUserSelection"
+	ProjectGUID="{9E783429-7D81-4DDE-88CA-DD6303DF0199}"
+	RootNamespace="NiUserTracker"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Bin\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiUserSelection"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI.lib glut32.lib"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="../../../Lib/$(ConfigurationName);../../../../../Samples/NiUserSelection/Libs"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="..\..\..\Bin64\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiUserSelection"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI64.lib glut64.lib"
+				OutputFile="$(OutDir)\$(ProjectName)64.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="../../../Lib64/$(ConfigurationName);../../../../../Samples/NiUserSelection/Libs"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Bin\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiUserSelection"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI.lib glut32.lib"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Lib/$(ConfigurationName);../../../../../Samples/NiUserSelection/Libs"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="..\..\..\Bin64\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiUserSelection"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI64.lib glut64.lib"
+				OutputFile="$(OutDir)\$(ProjectName)64.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Lib64/$(ConfigurationName);../../../../../Samples/NiUserSelection/Libs"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\..\..\..\Samples\NiUserSelection\Documentation.h"
+				>
+			</File>
+			<Filter
+				Name="Graphics"
+				>
+				<File
+					RelativePath="..\..\..\..\..\Samples\NiUserSelection\SceneDrawer.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\Samples\NiUserSelection\SceneDrawer.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="Sample"
+				>
+				<File
+					RelativePath="..\..\..\..\..\Samples\NiUserSelection\ExitPoseDetector.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\Samples\NiUserSelection\ExitPoseDetector.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\Samples\NiUserSelection\main.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\Samples\NiUserSelection\SampleManager.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\Samples\NiUserSelection\SampleManager.h"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\Samples\NiUserSelection\UserTracker.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\..\..\Samples\NiUserSelection\UserTracker.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="UserSelector"
+				>
+				<Filter
+					Name="headers"
+					>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\ClosestUserSelector.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\DefaultTrackingInitializer.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\PoseToggleUserSelector.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\PoseUserSelector.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\SinglePoseUserSelector.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\TrackingInitializer.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\UserSelectionStructures.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\UserSelector.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Sources"
+					>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\ClosestUserSelector.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\DefaultTrackingInitializer.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\PoseToggleUserSelector.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\PoseUserSelector.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\SinglePoseUserSelector.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\TrackingInitializer.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\..\..\..\..\Samples\NiUserSelection\UserSelector.cpp"
+						>
+					</File>
+				</Filter>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Res"
+			>
+			<File
+				RelativePath="..\..\Res\mainicon.ico"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Res\OpenNI.rc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Res\Resource-OpenNI.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/Platform/Win32/Build/Samples/NiUserTracker/NiUserTracker.vcproj b/Platform/Win32/Build/Samples/NiUserTracker/NiUserTracker.vcproj
index 476007d..81247e5 100644
--- a/Platform/Win32/Build/Samples/NiUserTracker/NiUserTracker.vcproj
+++ b/Platform/Win32/Build/Samples/NiUserTracker/NiUserTracker.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiUserTracker"
@@ -278,6 +279,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include;../../../../../Samples/NiUserTracker"
diff --git a/Platform/Win32/Build/Samples/NiViewer/NiViewer.vcproj b/Platform/Win32/Build/Samples/NiViewer/NiViewer.vcproj
index 088ba73..3e6bfee 100644
--- a/Platform/Win32/Build/Samples/NiViewer/NiViewer.vcproj
+++ b/Platform/Win32/Build/Samples/NiViewer/NiViewer.vcproj
@@ -202,6 +202,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -291,6 +292,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
diff --git a/Platform/Win32/Build/Samples/SimpleRead.java/Build.bat b/Platform/Win32/Build/Samples/SimpleRead.java/Build.bat
new file mode 100644
index 0000000..6344e3c
--- /dev/null
+++ b/Platform/Win32/Build/Samples/SimpleRead.java/Build.bat
@@ -0,0 +1 @@
+@%0\..\..\..\BuildJava.py "%1" "%0\.." ..\..\..\..\..\Samples\SimpleRead.java\org\OpenNI\Samples\SimpleRead org.OpenNI.Samples.SimpleRead org.OpenNI.jar org.OpenNI.Samples.SimpleRead.SimpleRead
diff --git a/Platform/Win32/Build/Samples/SimpleViewer.java/Build.bat b/Platform/Win32/Build/Samples/SimpleViewer.java/Build.bat
new file mode 100644
index 0000000..f7c86d9
--- /dev/null
+++ b/Platform/Win32/Build/Samples/SimpleViewer.java/Build.bat
@@ -0,0 +1 @@
+@%0\..\..\..\BuildJava.py "%1" "%0\.." ..\..\..\..\..\Samples\SimpleViewer.java\org\OpenNI\Samples\SimpleViewer org.OpenNI.Samples.SimpleViewer org.OpenNI.jar org.OpenNI.Samples.SimpleViewer.SimpleViewerApplication
diff --git a/Platform/Win32/Build/Samples/UserTracker.java/Build.bat b/Platform/Win32/Build/Samples/UserTracker.java/Build.bat
new file mode 100644
index 0000000..ca514b8
--- /dev/null
+++ b/Platform/Win32/Build/Samples/UserTracker.java/Build.bat
@@ -0,0 +1 @@
+@%0\..\..\..\BuildJava.py "%1" "%0\.." ..\..\..\..\..\Samples\UserTracker.java\org\OpenNI\Samples\UserTracker org.OpenNI.Samples.UserTracker org.OpenNI.jar org.OpenNI.Samples.UserTracker.UserTrackerApplication
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/Guids.h b/Platform/Win32/Build/Utils/OpenNIFilter/Guids.h
index 5db6b62..4d5fbac 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/Guids.h
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/Guids.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/IAdditionalControls.h b/Platform/Win32/Build/Utils/OpenNIFilter/IAdditionalControls.h
index d92c323..eb3c765 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/IAdditionalControls.h
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/IAdditionalControls.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/OpenNIFilter.vcproj b/Platform/Win32/Build/Utils/OpenNIFilter/OpenNIFilter.vcproj
index b1a3f88..6699e23 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/OpenNIFilter.vcproj
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/OpenNIFilter.vcproj
@@ -197,6 +197,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include;./DirectShowBaseClasses"
@@ -277,6 +278,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="../../../../../Include;./DirectShowBaseClasses"
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/Setup.cpp b/Platform/Win32/Build/Utils/OpenNIFilter/Setup.cpp
index f37f0bb..3bb8160 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/Setup.cpp
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/Setup.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -131,8 +131,7 @@ STDAPI DllRegisterServer()
 
 	// release interface
 	//
-	if(fm)
-		fm->Release();
+	fm->Release();
 
 	CoFreeUnusedLibraries();
 	CoUninitialize();
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/XnAdditionalControlsPropertyPage.cpp b/Platform/Win32/Build/Utils/OpenNIFilter/XnAdditionalControlsPropertyPage.cpp
index 2fbcdb3..49336ee 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/XnAdditionalControlsPropertyPage.cpp
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/XnAdditionalControlsPropertyPage.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/XnAdditionalControlsPropertyPage.h b/Platform/Win32/Build/Utils/OpenNIFilter/XnAdditionalControlsPropertyPage.h
index 575b96d..308b606 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/XnAdditionalControlsPropertyPage.h
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/XnAdditionalControlsPropertyPage.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoSource.cpp b/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoSource.cpp
index 0be16c3..f491828 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoSource.cpp
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoSource.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -37,7 +37,7 @@ XnVideoSource::XnVideoSource(LPUNKNOWN lpunk, HRESULT *phr) :
 	CSource(g_videoName, lpunk, CLSID_OpenNIVideo),
 	m_pVideoProcAmp(NULL),
 	m_pCameraControl(NULL),
-	m_Dump(XN_DUMP_CLOSED)
+	m_Dump(xnDumpFileOpen(XN_MASK_FILTER, "FilterFlow.log"))
 {
 	ASSERT(phr != NULL);
 
@@ -45,8 +45,6 @@ XnVideoSource::XnVideoSource(LPUNKNOWN lpunk, HRESULT *phr) :
 
 	CAutoLock cAutoLock(&m_cStateLock);
 
-	xnDumpInit(&m_Dump, XN_MASK_FILTER, "", "FilterFlow.log");
-
 	// initialize OpenNI
 	XnStatus nRetVal = m_context.Init();
 	if (nRetVal != XN_STATUS_OK)
@@ -93,7 +91,8 @@ XnVideoSource::~XnVideoSource()
 		delete GetPin(i);
 	}
 
-	m_context.Shutdown();
+	m_image.Release();
+	m_context.Release();
 }
 
 //
@@ -121,10 +120,9 @@ CUnknown * WINAPI XnVideoSource::CreateInstance(LPUNKNOWN lpunk, HRESULT *phr)
 
 STDMETHODIMP XnVideoSource::GetPages(CAUUID *pPages)
 {
-	XN_METHOD_START
+	XN_METHOD_START;
 
-	if (!pPages)
-		XN_METHOD_RETURN(E_POINTER);
+	XN_METHOD_CHECK_POINTER(pPages);
 
 	pPages->cElems = 3;
 	pPages->pElems = reinterpret_cast<GUID*>(CoTaskMemAlloc(sizeof(GUID)*pPages->cElems));
@@ -143,21 +141,23 @@ STDMETHODIMP XnVideoSource::NonDelegatingQueryInterface(REFIID riid, void **ppv)
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(ppv);
+
 	HRESULT hr = S_OK;
 
 	if (riid == IID_ISpecifyPropertyPages)
 	{
-		xnDumpWriteString(m_Dump, "Filter query interface to ISpecifyPropertyPages\n");
+		xnDumpFileWriteString(m_Dump, "\tFilter query interface to ISpecifyPropertyPages\n");
 		hr = GetInterface(static_cast<ISpecifyPropertyPages*>(this), ppv);
 	}
 	else if (riid == IID_IAMVideoControl)
 	{
-		xnDumpWriteString(m_Dump, "Filter query interface to IAMVideoControl\n");
+		xnDumpFileWriteString(m_Dump, "\tFilter query interface to IAMVideoControl\n");
 		hr = GetInterface(static_cast<IAMVideoControl*>(this), ppv);
 	}
 	else if (riid == IID_IAMVideoProcAmp)
 	{
-		xnDumpWriteString(m_Dump, "Filter query interface to IAMVideoProcAmp\n");
+		xnDumpFileWriteString(m_Dump, "\tFilter query interface to IAMVideoProcAmp\n");
 		if (m_pVideoProcAmp == NULL)
 		{
 			m_pVideoProcAmp = new VideoProcAmp(this);
@@ -171,7 +171,7 @@ STDMETHODIMP XnVideoSource::NonDelegatingQueryInterface(REFIID riid, void **ppv)
 	}
 	else if (riid == IID_IAMCameraControl)
 	{
-		xnDumpWriteString(m_Dump, "Filter query interface to IAMCameraControl\n");
+		xnDumpFileWriteString(m_Dump, "\tFilter query interface to IAMCameraControl\n");
 		if (m_pCameraControl == NULL)
 		{
 			m_pCameraControl = new CameraControl(this);
@@ -185,14 +185,14 @@ STDMETHODIMP XnVideoSource::NonDelegatingQueryInterface(REFIID riid, void **ppv)
 	}
 	else if (riid == IID_IAdditionalOpenNIControls)
 	{
-		xnDumpWriteString(m_Dump, "Filter query interface to IAdditionalControls\n");
+		xnDumpFileWriteString(m_Dump, "\tFilter query interface to IAdditionalControls\n");
 		hr = GetInterface(static_cast<IAdditionalControls*>(this), ppv);
 	}
 	else
 	{
 		OLECHAR strGuid[40];
 		StringFromGUID2(riid, strGuid, 40);
-		xnDumpWriteString(m_Dump, "Filter query interface to %S\n", strGuid);
+		xnDumpFileWriteString(m_Dump, "\tFilter query interface to %S\n", strGuid);
 
 		hr = CSource::NonDelegatingQueryInterface(riid, ppv);
 	}
@@ -204,6 +204,9 @@ HRESULT STDMETHODCALLTYPE XnVideoSource::GetCaps(IPin *pPin, long *pCapsFlags)
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pPin);
+	XN_METHOD_CHECK_POINTER(pCapsFlags);
+
 	// we have only 1 pin, make sure this is it
 	if (pPin != static_cast<IPin*>(GetPin(0)))
 	{
@@ -218,6 +221,8 @@ HRESULT STDMETHODCALLTYPE XnVideoSource::SetMode( IPin *pPin, long Mode )
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pPin);
+
 	HRESULT hr = S_OK;
 
 	// we have only 1 pin, make sure this is it
@@ -244,6 +249,9 @@ HRESULT STDMETHODCALLTYPE XnVideoSource::GetMode( IPin *pPin, __out long *Mode )
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pPin);
+	XN_METHOD_CHECK_POINTER(Mode);
+
 	HRESULT hr = S_OK;
 
 	// we have only 1 pin, make sure this is it
@@ -268,6 +276,9 @@ HRESULT STDMETHODCALLTYPE XnVideoSource::GetCurrentActualFrameRate( IPin *pPin,
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pPin);
+	XN_METHOD_CHECK_POINTER(ActualFrameRate);
+
 	HRESULT hr = S_OK;
 
 	// we have only 1 pin, make sure this is it
@@ -285,6 +296,9 @@ HRESULT STDMETHODCALLTYPE XnVideoSource::GetMaxAvailableFrameRate( IPin *pPin, l
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pPin);
+	XN_METHOD_CHECK_POINTER(MaxAvailableFrameRate);
+
 	HRESULT hr = S_OK;
 
 	// we have only 1 pin, make sure this is it
@@ -312,6 +326,9 @@ HRESULT STDMETHODCALLTYPE XnVideoSource::GetFrameRateList( IPin *pPin, long iInd
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pPin);
+	XN_METHOD_CHECK_POINTER(ListSize);
+
 	HRESULT hr = S_OK;
 
 	// we have only 1 pin, make sure this is it
@@ -347,6 +364,8 @@ STDMETHODIMP XnVideoSource::GetPowerLineFrequencyDefault(XnPowerLineFrequency* p
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pnValue);
+
 	if (!m_image.IsCapabilitySupported(XN_CAPABILITY_ANTI_FLICKER))
 	{
 		XN_METHOD_RETURN(E_PROP_ID_UNSUPPORTED);
@@ -360,6 +379,9 @@ STDMETHODIMP XnVideoSource::GetPowerLineFrequencyDefault(XnPowerLineFrequency* p
 STDMETHODIMP XnVideoSource::GetPowerLineFrequency(XnPowerLineFrequency *pnValue)
 {
 	XN_METHOD_START;
+
+	XN_METHOD_CHECK_POINTER(pnValue);
+
 	if (!m_image.IsCapabilitySupported(XN_CAPABILITY_ANTI_FLICKER))
 	{
 		XN_METHOD_RETURN(E_PROP_ID_UNSUPPORTED);
@@ -389,6 +411,12 @@ STDMETHODIMP XnVideoSource::GetGainRange(XnInt32 *pnMin, XnInt32* pnMax, XnInt32
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pnMin);
+	XN_METHOD_CHECK_POINTER(pnMax);
+	XN_METHOD_CHECK_POINTER(pnStep);
+	XN_METHOD_CHECK_POINTER(pnDefault);
+	XN_METHOD_CHECK_POINTER(pbAutoSupported);
+
 	if (!m_image.IsCapabilitySupported(XN_CAPABILITY_GAIN))
 	{
 		XN_METHOD_RETURN(E_PROP_ID_UNSUPPORTED);
@@ -404,6 +432,8 @@ STDMETHODIMP XnVideoSource::GetGain(XnInt32 *pnValue)
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pnValue);
+
 	if (!m_image.IsCapabilitySupported(XN_CAPABILITY_GAIN))
 	{
 		XN_METHOD_RETURN(E_PROP_ID_UNSUPPORTED);
@@ -438,6 +468,8 @@ STDMETHODIMP XnVideoSource::GetLowLightCompensationDefault(XnBool* pbValue)
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pbValue);
+
 	if (!m_image.IsCapabilitySupported(XN_CAPABILITY_LOW_LIGHT_COMPENSATION))
 	{
 		XN_METHOD_RETURN(E_PROP_ID_UNSUPPORTED);
@@ -456,6 +488,8 @@ STDMETHODIMP XnVideoSource::GetLowLightCompensation(XnBool *pbValue)
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pbValue);
+
 	if (!m_image.IsCapabilitySupported(XN_CAPABILITY_LOW_LIGHT_COMPENSATION))
 	{
 		XN_METHOD_RETURN(E_PROP_ID_UNSUPPORTED);
@@ -495,6 +529,12 @@ HRESULT XnVideoSource::GetCapRange(const XnChar* strCap, long *pMin, long *pMax,
 		XN_METHOD_RETURN(E_PROP_ID_UNSUPPORTED);
 	}
 
+	XN_METHOD_CHECK_POINTER(pMin);
+	XN_METHOD_CHECK_POINTER(pMax);
+	XN_METHOD_CHECK_POINTER(pSteppingDelta);
+	XN_METHOD_CHECK_POINTER(pDefault);
+	XN_METHOD_CHECK_POINTER(pCapsFlags);
+
 	xn::GeneralIntCapability cap = m_image.GetGeneralIntCap(strCap);
 	XnInt32 nMin, nMax, nStep, nDefault;
 	XnBool bIsAutoSupported;
@@ -518,6 +558,9 @@ HRESULT XnVideoSource::GetCap(const XnChar* strCap, long *lValue, long *Flags)
 		XN_METHOD_RETURN(E_PROP_ID_UNSUPPORTED);
 	}
 
+	XN_METHOD_CHECK_POINTER(lValue);
+	XN_METHOD_CHECK_POINTER(Flags);
+
 	xn::GeneralIntCapability cap = m_image.GetGeneralIntCap(strCap);
 	XnInt32 nVal = cap.Get();
 	if (nVal == XN_AUTO_CONTROL)
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoSource.h b/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoSource.h
index 7aa2e58..80c682e 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoSource.h
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoSource.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -34,15 +34,23 @@
 //---------------------------------------------------------------------------
 // Macros
 //---------------------------------------------------------------------------
-#define XN_METHOD_START				xnDumpWriteString(m_Dump, "Entering %s\n", __FUNCTION__)
+#define XN_METHOD_START				xnDumpFileWriteString(m_Dump, "%s was called\n", __FUNCTION__)
 
 #define XN_METHOD_RETURN(hr)		\
 	do								\
 	{								\
-		xnDumpWriteString(m_Dump, "%s returned %s (%d)\n", __FUNCTION__, XN_STRINGIFY(hr), hr);	\
+		xnDumpFileWriteString(m_Dump, "\t%s returned %s (%d)\n", __FUNCTION__, XN_STRINGIFY(hr), hr);	\
 		return hr;					\
 	} while (0)
 
+#define XN_METHOD_CHECK_POINTER(p)								\
+	if (p == NULL)												\
+	{															\
+		xnDumpFileWriteString(m_Dump, "\t%s returned %s (%d) (%s)\n", \
+			__FUNCTION__, "E_POINTER",							\
+			E_POINTER, XN_STRINGIFY(p));						\
+	}
+
 //---------------------------------------------------------------------------
 // Types
 //---------------------------------------------------------------------------
@@ -88,7 +96,7 @@ public:
 	STDMETHOD(GetLowLightCompensation)(XnBool *pbValue);
 	STDMETHOD(SetLowLightCompensation)(XnBool bValue);
 
-	XnDump m_Dump;
+	XnDumpFile* m_Dump;
 
 private:
 	class VideoProcAmp : public CUnknown, public IAMVideoProcAmp
@@ -106,7 +114,7 @@ private:
 		const XnChar* GetPropertyCap(long Property);
 
 		XnVideoSource* m_pSource;
-		XnDump& m_Dump;
+		XnDumpFile*& m_Dump;
 	};
 
 	class CameraControl : public CUnknown, public IAMCameraControl
@@ -124,7 +132,7 @@ private:
 		const XnChar* GetPropertyCap(long Property);
 
 		XnVideoSource* m_pSource;
-		XnDump& m_Dump;
+		XnDumpFile*& m_Dump;
 	};
 
 	HRESULT GetCapRange(const XnChar* strCap, long *pMin, long *pMax, long *pSteppingDelta, long *pDefault, long *pCapsFlags);
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoStream.cpp b/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoStream.cpp
index 3f77825..084f7cb 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoStream.cpp
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoStream.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -40,10 +40,18 @@ XnVideoStream::XnVideoStream(HRESULT *phr, XnVideoSource *pParent, xn::ImageGene
 
 	xnFPSInit(&m_FPS, 90);
 
-	m_nSupportedModes = m_imageGen.GetSupportedMapOutputModesCount();
-	XnMapOutputMode* aOutputModes = new XnMapOutputMode[m_nSupportedModes];
+	XnUInt32 nSupportedModes = m_imageGen.GetSupportedMapOutputModesCount();
+	XnMapOutputMode* aOutputModes = new XnMapOutputMode[nSupportedModes];
 
-	XnStatus nRetVal = m_imageGen.GetSupportedMapOutputModes(aOutputModes, m_nSupportedModes);
+	XnStatus nRetVal = m_imageGen.GetSupportedMapOutputModes(aOutputModes, nSupportedModes);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		*phr = E_UNEXPECTED;
+		delete[] aOutputModes;
+		return;
+	}
+
+	nRetVal = m_aSupportedModes.Reserve(nSupportedModes);
 	if (nRetVal != XN_STATUS_OK)
 	{
 		*phr = E_UNEXPECTED;
@@ -55,7 +63,7 @@ XnVideoStream::XnVideoStream(HRESULT *phr, XnVideoSource *pParent, xn::ImageGene
 	XnBool bMJPEG = m_imageGen.IsPixelFormatSupported(XN_PIXEL_FORMAT_MJPEG);
 	Mode mode;
 
-	for (XnUInt32 i = 0; i < m_nSupportedModes; ++i)
+	for (XnUInt32 i = 0; i < nSupportedModes; ++i)
 	{
 		mode.OutputMode = aOutputModes[i];
 		if (bRGB)
@@ -88,7 +96,7 @@ HRESULT XnVideoStream::FillBuffer(IMediaSample *pms)
 {
 	XN_METHOD_START;
 
-	CheckPointer(pms,E_POINTER);
+	XN_METHOD_CHECK_POINTER(pms);
 
 	if (!m_imageGen.IsGenerating())
 	{
@@ -115,11 +123,18 @@ HRESULT XnVideoStream::FillBuffer(IMediaSample *pms)
 		XnStatus nRetVal = XN_STATUS_OK;
 
 		// ignore timeouts
-		do
+		while (TRUE)
 		{
 			nRetVal = m_imageGen.WaitAndUpdateData();
+			if (nRetVal != XN_STATUS_WAIT_DATA_TIMEOUT)
+			{
+				break;
+			}
+			else
+			{
+				xnDumpFileWriteString(m_Dump, "\tTimeout during FillBuffer\n");
+			}
 		}
-		while (nRetVal == XN_STATUS_WAIT_DATA_TIMEOUT);
 
 		if (nRetVal != XN_STATUS_OK) XN_METHOD_RETURN(E_UNEXPECTED);
 	}
@@ -168,7 +183,7 @@ HRESULT XnVideoStream::FillBuffer(IMediaSample *pms)
 	else
 	{
 		xnLogError(XN_MASK_FILTER, "Unsupported pixel format!");
-		return E_UNEXPECTED;
+		XN_METHOD_RETURN(E_UNEXPECTED);
 	}
 
 	// The current time is the sample's start
@@ -196,7 +211,7 @@ HRESULT XnVideoStream::GetMediaType(int iPosition, __inout CMediaType *pMediaTyp
 	XN_METHOD_START;
 	HRESULT hr = S_OK;
 
-	CheckPointer(pMediaType,E_POINTER);
+	XN_METHOD_CHECK_POINTER(pMediaType);
 
 	if(iPosition < 0)
 	{
@@ -220,7 +235,7 @@ HRESULT XnVideoStream::GetMediaType(int iPosition, __inout CMediaType *pMediaTyp
 	else
 	{
 		// Have we run off the end of types?
-		if (iPosition > int(m_nSupportedModes))
+		if (iPosition > int(m_aSupportedModes.GetSize()))
 		{
 			XN_METHOD_RETURN(VFW_S_NO_MORE_ITEMS);
 		}
@@ -237,6 +252,8 @@ HRESULT XnVideoStream::SetMediaType(const CMediaType* pMediaType)
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pMediaType);
+
 	Mode mode = MediaTypeToMode(*pMediaType);
 
 	XnStatus nRetVal = m_imageGen.SetMapOutputMode(mode.OutputMode);
@@ -264,7 +281,7 @@ HRESULT XnVideoStream::CheckMediaType(const CMediaType *pMediaType)
 {
 	XN_METHOD_START;
 
-	CheckPointer(pMediaType,E_POINTER);
+	XN_METHOD_CHECK_POINTER(pMediaType);
 
 	int index = FindCapability(*pMediaType);
 	if (index == -1 || // not found
@@ -287,8 +304,8 @@ HRESULT XnVideoStream::DecideBufferSize(IMemAllocator *pIMemAlloc, ALLOCATOR_PRO
 {
 	XN_METHOD_START;
 
-	CheckPointer(pIMemAlloc,E_POINTER);
-	CheckPointer(pProperties,E_POINTER);
+	XN_METHOD_CHECK_POINTER(pIMemAlloc);
+	XN_METHOD_CHECK_POINTER(pProperties);
 
 	CAutoLock cAutoLock(m_pFilter->pStateLock());
 	HRESULT hr = S_OK;
@@ -328,6 +345,7 @@ HRESULT XnVideoStream::Active( void )
 	XnStatus nRetVal = m_imageGen.StartGenerating();
 	if (nRetVal != XN_STATUS_OK)
 	{
+		xnLogWarning(XN_MASK_FILTER, "Can't start ImageGenerator: %s", xnGetStatusString(nRetVal));
 		XN_METHOD_RETURN(E_UNEXPECTED);
 	}
 
@@ -355,7 +373,7 @@ STDMETHODIMP XnVideoStream::GetPages(CAUUID *pPages)
 {
 	XN_METHOD_START;
 
-	if (!pPages) XN_METHOD_RETURN(E_POINTER);
+	XN_METHOD_CHECK_POINTER(pPages);
 
 	pPages->cElems = 1;
 	pPages->pElems = reinterpret_cast<GUID*>(CoTaskMemAlloc(sizeof(GUID)*pPages->cElems));
@@ -371,29 +389,32 @@ STDMETHODIMP XnVideoStream::GetPages(CAUUID *pPages)
 STDMETHODIMP XnVideoStream::NonDelegatingQueryInterface(REFIID riid, void **ppv)
 {   
 	XN_METHOD_START;
+
+	XN_METHOD_CHECK_POINTER(ppv);
+
 	HRESULT hr = S_OK;
 
 	// Standard OLE stuff
 	if(riid == IID_IAMStreamConfig) 
 	{
-		xnDumpWriteString(m_Dump, "Pin query interface to IAMStreamConfig\n");
+		xnDumpFileWriteString(m_Dump, "\tPin query interface to IAMStreamConfig\n");
 		hr = GetInterface(static_cast<IAMStreamConfig*>(this), ppv);
 	}
 	else if(riid == IID_IKsPropertySet)
 	{
-		xnDumpWriteString(m_Dump, "Pin query interface to IKsPropertySet\n");
+		xnDumpFileWriteString(m_Dump, "\tPin query interface to IKsPropertySet\n");
 		hr = GetInterface(static_cast<IKsPropertySet*>(this), ppv);
 	}
 	else if(riid == IID_ISpecifyPropertyPages)
 	{
-		xnDumpWriteString(m_Dump, "Pin query interface to ISpecifyPropertyPages\n");
+		xnDumpFileWriteString(m_Dump, "\tPin query interface to ISpecifyPropertyPages\n");
 		hr = GetInterface(static_cast<ISpecifyPropertyPages*>(this), ppv);
 	}
 	else 
 	{
 		OLECHAR strGuid[40];
 		StringFromGUID2(riid, strGuid, 40);
-		xnDumpWriteString(m_Dump, "Pin query interface to %S\n", strGuid);
+		xnDumpFileWriteString(m_Dump, "\tPin query interface to %S\n", strGuid);
 		hr = CSourceStream::NonDelegatingQueryInterface(riid, ppv);
 	}
 
@@ -408,21 +429,29 @@ HRESULT STDMETHODCALLTYPE XnVideoStream::GetNumberOfCapabilities(int *piCount, i
 {
 	XN_METHOD_START;
 
-	*piCount = m_nSupportedModes;
+	XN_METHOD_CHECK_POINTER(piCount);
+	XN_METHOD_CHECK_POINTER(piSize);
+
+	*piCount = m_aSupportedModes.GetSize();
 	*piSize = sizeof(VIDEO_STREAM_CONFIG_CAPS);
 	XN_METHOD_RETURN(S_OK);
 }
 
 HRESULT STDMETHODCALLTYPE XnVideoStream::GetStreamCaps(int iIndex, AM_MEDIA_TYPE **pmt, BYTE *pSCC)
 {
-	xnDumpWriteString(m_Dump, "Calling %s for %d\n", __FUNCTION__, iIndex);
+	XN_METHOD_START;
+
+	XN_METHOD_CHECK_POINTER(pmt);
+	XN_METHOD_CHECK_POINTER(pSCC);
+
+	xnDumpFileWriteString(m_Dump, "\tCalling %s for %d\n", __FUNCTION__, iIndex);
 
 	CMediaType mediaType;
 	VIDEO_STREAM_CONFIG_CAPS* pvscc = (VIDEO_STREAM_CONFIG_CAPS*)pSCC;
 	HRESULT hr = GetStreamCapability(iIndex, mediaType, *pvscc);
 	if (FAILED(hr)) XN_METHOD_RETURN(hr);
 
-	xnDumpWriteString(m_Dump, "Returning %dx%d@%d using %s\n", m_aSupportedModes[iIndex].OutputMode.nXRes, m_aSupportedModes[iIndex].OutputMode.nYRes, m_aSupportedModes[iIndex].OutputMode.nFPS, xnPixelFormatToString(m_aSupportedModes[iIndex].Format));
+	xnDumpFileWriteString(m_Dump, "\tReturning %dx%d@%d using %s\n", m_aSupportedModes[iIndex].OutputMode.nXRes, m_aSupportedModes[iIndex].OutputMode.nYRes, m_aSupportedModes[iIndex].OutputMode.nFPS, xnPixelFormatToString(m_aSupportedModes[iIndex].Format));
 
 	*pmt = CreateMediaType(&mediaType);
 	XN_METHOD_RETURN(S_OK);
@@ -432,6 +461,12 @@ HRESULT STDMETHODCALLTYPE XnVideoStream::SetFormat(AM_MEDIA_TYPE *pmt)
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(pmt);
+	if (pmt == NULL)
+	{
+		XN_METHOD_RETURN(E_INVALIDARG);
+	}
+
 	xnLogVerbose(XN_MASK_FILTER, "SetFormat was called");
 
 	// check if this format is supported
@@ -470,6 +505,8 @@ HRESULT STDMETHODCALLTYPE XnVideoStream::GetFormat(AM_MEDIA_TYPE **ppmt)
 {
 	XN_METHOD_START;
 
+	XN_METHOD_CHECK_POINTER(ppmt);
+
 	if (IsConnected())
 	{
 		*ppmt = CreateMediaType(&m_mt);
@@ -548,6 +585,8 @@ HRESULT XnVideoStream::QuerySupported(REFGUID guidPropSet, DWORD dwPropID, DWORD
 
 HRESULT XnVideoStream::SetMirror(BOOL bMirror)
 {
+	XN_METHOD_START;
+
 	XnStatus nRetVal = m_imageGen.GetMirrorCap().SetMirror(bMirror);
 	if (nRetVal != XN_STATUS_OK)
 	{
@@ -581,7 +620,7 @@ XnDouble XnVideoStream::GetCurrentFPS()
 HRESULT XnVideoStream::GetStreamCapability(int iIndex, CMediaType& mediaType, VIDEO_STREAM_CONFIG_CAPS& vscc)
 {
 	// check bounds
-	if(iIndex < 0 || iIndex >= int(m_nSupportedModes))
+	if(iIndex < 0 || iIndex >= int(m_aSupportedModes.GetSize()))
 	{
 		xnLogVerbose(XN_MASK_FILTER, "GetStreamCapability() - Index %d is out of bounds!", iIndex);
 		return S_FALSE;
@@ -683,7 +722,7 @@ int XnVideoStream::FindCapability(const CMediaType& mediaType)
 		return -1;
 	}
 
-	for (XnUInt32 i = 0; i < m_nSupportedModes; ++i)
+	for (XnUInt32 i = 0; i < m_aSupportedModes.GetSize(); ++i)
 	{
 		if (memcmp(&mode, &m_aSupportedModes[i], sizeof(mode)) == 0)
 		{
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoStream.h b/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoStream.h
index 2a97f72..7208056 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoStream.h
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/XnVideoStream.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -99,11 +99,10 @@ private:
 
 	xn::ImageGenerator& m_imageGen;
 	XnArray<Mode> m_aSupportedModes;
-	XnUInt32 m_nSupportedModes;
 	BOOL m_bFlipVertically;
 	XnFPSData m_FPS;
 	int m_nPreferredMode;
-	XnDump& m_Dump;
+	XnDumpFile*& m_Dump;
 };
 
 #endif // __XN_VIDEO_STREAM_H__
\ No newline at end of file
diff --git a/Platform/Win32/Build/Utils/OpenNIFilter/resource.h b/Platform/Win32/Build/Utils/OpenNIFilter/resource.h
index da02582..d6efdf9 100644
--- a/Platform/Win32/Build/Utils/OpenNIFilter/resource.h
+++ b/Platform/Win32/Build/Utils/OpenNIFilter/resource.h
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 //{{NO_DEPENDENCIES}}
 // Microsoft Visual C++ generated include file.
 // Used by FilterRes.rc
diff --git a/Platform/Win32/Build/Utils/niLicense/niLicense.vcproj b/Platform/Win32/Build/Utils/niLicense/niLicense.vcproj
index 34891e4..868e2f7 100644
--- a/Platform/Win32/Build/Utils/niLicense/niLicense.vcproj
+++ b/Platform/Win32/Build/Utils/niLicense/niLicense.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -283,6 +284,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
diff --git a/Platform/Win32/Build/Utils/niReg/niReg.vcproj b/Platform/Win32/Build/Utils/niReg/niReg.vcproj
index 0af6076..5c725cc 100644
--- a/Platform/Win32/Build/Utils/niReg/niReg.vcproj
+++ b/Platform/Win32/Build/Utils/niReg/niReg.vcproj
@@ -198,6 +198,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
@@ -283,6 +284,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
 				Optimization="2"
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="true"
diff --git a/Platform/Win32/Build/Wrappers/OpenNI.java/Build.bat b/Platform/Win32/Build/Wrappers/OpenNI.java/Build.bat
new file mode 100644
index 0000000..6888863
--- /dev/null
+++ b/Platform/Win32/Build/Wrappers/OpenNI.java/Build.bat
@@ -0,0 +1 @@
+@%0\..\..\..\BuildJava.py "%1" "%0\.." ..\..\..\..\..\Wrappers\OpenNI.java\src\org\OpenNI org.OpenNI 
diff --git a/Platform/Win32/Build/Wrappers/OpenNI.jni/OpenNI.jni.vcproj b/Platform/Win32/Build/Wrappers/OpenNI.jni/OpenNI.jni.vcproj
new file mode 100644
index 0000000..92040de
--- /dev/null
+++ b/Platform/Win32/Build/Wrappers/OpenNI.jni/OpenNI.jni.vcproj
@@ -0,0 +1,407 @@
+<?xml version="1.0" encoding="windows-1255"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="OpenNI.jni"
+	ProjectGUID="{97C32C97-C847-4AF2-A8BF-D4FC984F16AA}"
+	RootNamespace="OpenNI.jni"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\..\..\Bin\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include;..\..\..\..\..\Wrappers\OpenNI.jni"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4250"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI.lib"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="../../../Lib/$(ConfigurationName)"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				ImportLibrary="..\..\..\Lib\$(ConfigurationName)\$(ProjectName).lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="..\..\..\Bin64\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include;..\..\..\..\..\Wrappers\OpenNI.jni;..\..\..\..\..\Wrappers\OpenNI.jni\win32"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4250"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI64.lib"
+				OutputFile="$(OutDir)\$(ProjectName)64.dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="../../../Lib64/$(ConfigurationName)"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				ImportLibrary="..\..\..\Lib64\$(ConfigurationName)\$(ProjectName)64.lib"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\..\..\Bin\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
+				Optimization="2"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include;..\..\..\..\..\Wrappers\OpenNI.jni;..\..\..\..\..\Wrappers\OpenNI.jni\win32"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableEnhancedInstructionSet="2"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4250"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI.lib"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Lib/$(ConfigurationName)"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="..\..\..\Lib\$(ConfigurationName)\$(ProjectName).lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="..\..\..\Bin64\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/MP"
+				Optimization="2"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include;..\..\..\..\..\Wrappers\OpenNI.jni;..\..\..\..\..\Wrappers\OpenNI.jni\win32"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				EnableEnhancedInstructionSet="2"
+				FloatingPointModel="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4250"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\..\..\Include"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="openNI64.lib"
+				OutputFile="$(OutDir)\$(ProjectName)64.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="../../../Lib64/$(ConfigurationName)"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="..\..\..\Lib64\$(ConfigurationName)\$(ProjectName)64.lib"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\..\..\..\Wrappers\OpenNI.jni\jni.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Wrappers\OpenNI.jni\jni_md.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Wrappers\OpenNI.jni\methods.inl"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Wrappers\OpenNI.jni\OpenNI.jni.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Wrappers\OpenNI.jni\org_OpenNI_NativeMethods.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\..\..\Wrappers\OpenNI.jni\org_OpenNI_NativeMethods.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Res"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+			<File
+				RelativePath="..\..\Res\mainicon.ico"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Res\OpenNI.rc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\Res\Resource-OpenNI.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/Platform/Win32/Build/Wrappers/OpenNI.net/OpenNI.net.csproj b/Platform/Win32/Build/Wrappers/OpenNI.net/OpenNI.net.csproj
index 74c25d0..09ea238 100644
--- a/Platform/Win32/Build/Wrappers/OpenNI.net/OpenNI.net.csproj
+++ b/Platform/Win32/Build/Wrappers/OpenNI.net/OpenNI.net.csproj
@@ -90,6 +90,9 @@
     <Compile Include="..\..\..\..\..\Wrappers\OpenNI.net\Device.cs">
       <Link>Nodes\Device.cs</Link>
     </Compile>
+    <Compile Include="..\..\..\..\..\Wrappers\OpenNI.net\DeviceIdentificationCapability.cs">
+      <Link>Capabilities\DeviceIdentificationCapability.cs</Link>
+    </Compile>
     <Compile Include="..\..\..\..\..\Wrappers\OpenNI.net\EnumerationErrors.cs">
       <Link>EnumerationErrors.cs</Link>
     </Compile>
@@ -108,6 +111,9 @@
     <Compile Include="..\..\..\..\..\Wrappers\OpenNI.net\HandsGenerator.cs">
       <Link>Nodes\HandsGenerator.cs</Link>
     </Compile>
+    <Compile Include="..\..\..\..\..\Wrappers\OpenNI.net\HandTouchingFOVEdgeCapability.cs">
+      <Link>Capabilities\HandTouchingFOVEdgeCapability.cs</Link>
+    </Compile>
     <Compile Include="..\..\..\..\..\Wrappers\OpenNI.net\ImageGenerator.cs">
       <Link>Nodes\ImageGenerator.cs</Link>
     </Compile>
@@ -183,6 +189,9 @@
     <Compile Include="..\..\..\..\..\Wrappers\OpenNI.net\SceneMetaData.cs">
       <Link>MetaData\SceneMetaData.cs</Link>
     </Compile>
+    <Compile Include="..\..\..\..\..\Wrappers\OpenNI.net\ScriptNode.cs">
+      <Link>Nodes\ScriptNode.cs</Link>
+    </Compile>
     <Compile Include="..\..\..\..\..\Wrappers\OpenNI.net\SkeletonCapability.cs">
       <Link>Capabilities\SkeletonCapability.cs</Link>
     </Compile>
diff --git a/Platform/Win32/CreateRedist/OpenNi_Config.xml b/Platform/Win32/CreateRedist/OpenNi_Config.xml
index c372da2..8f96aa8 100644
--- a/Platform/Win32/CreateRedist/OpenNi_Config.xml
+++ b/Platform/Win32/CreateRedist/OpenNi_Config.xml
@@ -1,7 +1,7 @@
 <root>
   <PROJECT>OpenNI</PROJECT>
   <PLATFORM>WIN32</PLATFORM>
-  <VERSION_NUMBER>1.1.0</VERSION_NUMBER>
+  <VERSION_NUMBER>1.5.2</VERSION_NUMBER>
   <WORK_DIR>..\..\..</WORK_DIR>
   <PROJECT_SLN>\Platform\Win32\Build\OpenNI.sln</PROJECT_SLN>
   <SAMPLES_SLN>Platform\Win32\Redist\Samples\Build\All_2008.sln</SAMPLES_SLN>
diff --git a/Platform/Win32/CreateRedist/RedistMaker.bat b/Platform/Win32/CreateRedist/RedistMaker.bat
index 22e4933..b8126f6 100644
--- a/Platform/Win32/CreateRedist/RedistMaker.bat
+++ b/Platform/Win32/CreateRedist/RedistMaker.bat
@@ -1,9 +1,10 @@
 @echo off
 
 set MAJOR_VERSION=1
-set MINOR_VERSION=1
-set MAINTENANCE_VERSION=0
-set BUILD_VERSION=41
+set MINOR_VERSION=5
+set MAINTENANCE_VERSION=2
+set BUILD_VERSION=23
+
 
 @echo ************************
 @echo *** ONI Redist Maker ***
@@ -14,14 +15,24 @@ echo Going to build redist for version: %MAJOR_VERSION%.%MINOR_VERSION%.%MAINTEN
 @echo ******************************************
 @echo *** Erasing the old Final directory... ***
 @echo ******************************************
-rmdir /S /q Final
-rmdir /S /q Output
-mkdir Final
-mkdir Output
+If "%2%" == "64" (       
+    set bits=64
+) ELSE (    
+    set bits=32
+)
+
+set finalDir=Final%bits%
+set outputDir=Output%bits%
+
+rmdir /S /q %finalDir%
+rmdir /S /q %outputDir%
+mkdir %finalDir%
+mkdir %outputDir%
+
 
 @echo.
 @echo *******************************************
- at echo *** Running the Redist OpenNI script... ***
+ at echo *** Running the Redist OpenNI script...%output% ***
 @echo *******************************************
 IF "%1"=="" GOTO RedistNoParam
 Redist_OpenNi.py %1 %2 %3 %4
@@ -33,36 +44,39 @@ if not "%ERRORLEVEL%" == "0" goto ErrorScript
 
 @echo.
 @echo *************************************************
- at echo *** Copying files into the Final directory... ***
+ at echo *** Copying files into the %finalDir% directory... ***
 @echo *************************************************
 @echo.
 
-Echo Moving the setup OPENNI-Win*-x.x.x file...
-echo f | move Output\OPENNI-Win*-*.msi Final
-if "%ERRORLEVEL%" == "1" goto ErrorCopy
-
 Echo Copying the release notes...
-copy  ..\..\..\Platform\Win32\Build\ReleaseNotes.txt Final
+copy  ..\..\..\Platform\Win32\Build\ReleaseNotes.txt %finalDir%\
 
 Echo Copying the unpacked files...
-xcopy /E /I ..\Redist\Bin Final\Files\Bin
-xcopy /E /I ..\Redist\Bin64 Final\Files\Bin64
-xcopy /E /I ..\Redist\Driver Final\Files\Driver
-xcopy /E /I ..\Redist\Documentation Final\Files\Documentation
-xcopy /E /I ..\Redist\Include Final\Files\Include
-xcopy /E /I ..\Redist\Lib Final\Files\Lib
-xcopy /E /I ..\Redist\Lib64 Final\Files\Lib64
+xcopy /E /I ..\Redist\Bin %finalDir%\Files\Bin
+xcopy /E /I ..\Redist\Bin64 %finalDir%\Files\Bin64
+xcopy /E /I ..\Redist\Driver %finalDir%\Files\Driver
+xcopy /E /I ..\Redist\Documentation %finalDir%\Files\Documentation
+xcopy /E /I ..\Redist\Include %finalDir%\Files\Include
+xcopy /E /I ..\Redist\Lib %finalDir%\Files\Lib
+xcopy /E /I ..\Redist\Lib64 %finalDir%\Files\Lib64
 
 Echo Copying the debug driver...
-xcopy /E /I ..\Driver\BinVSDbg Final\DebugDriver
+xcopy /E /I ..\Driver\BinVSDbg %finalDir%\DebugDriver
 
 Echo Copying PDBs...
-xcopy /I ..\Bin\Release\*.pdb Final\PDBs\32
-xcopy /I ..\Bin64\Release\*.pdb Final\PDBs\64
-xcopy /E /I ..\Driver\PDBs\*.pdb Final\PDBs\DRV
+xcopy /I ..\Bin\Release\*.pdb %finalDir%\PDBs\32
+xcopy /I ..\Bin64\Release\*.pdb %finalDir%\PDBs\64
+xcopy /E /I ..\Driver\PDBs\*.pdb %finalDir%\PDBs\DRV
 
 Echo Creating the build info...
- at echo This build (V%MAJOR_VERSION%.%MINOR_VERSION%.%MAINTENANCE_VERSION%.%BUILD_VERSION%) was auto-generated by RedistMaker on %COMPUTERNAME%\%USERNAME% at %DATE% %TIME% > Final\Buildinfo.txt
+ at echo This build (V%MAJOR_VERSION%.%MINOR_VERSION%.%MAINTENANCE_VERSION%.%BUILD_VERSION%) was auto-generated by RedistMaker on %COMPUTERNAME%\%USERNAME% at %DATE% %TIME% > %finalDir%\Buildinfo.txt
+
+If NOT "%BuildRepository%" == "" (
+    Echo Copying file to %BuildRepository%
+	cd common
+    CopyToRepository.py ..\%finalDir% %BuildRepository% %5 %bits% %6 %MAJOR_VERSION% %MINOR_VERSION% %MAINTENANCE_VERSION% %BUILD_VERSION%
+	cd ..
+)
 
 @echo.
 @echo ***********************************************
@@ -76,7 +90,7 @@ goto END
 @echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 @echo !!! An error occured while copying a file !!!
 @echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-pause
+
 exit /b 1
 goto END
 
@@ -85,7 +99,7 @@ goto END
 @echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 @echo !!! An error occured while running a script !!!
 @echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-pause
+
 exit /b 1
 goto END
 
diff --git a/Platform/Win32/CreateRedist/Redist_OpenNi.py b/Platform/Win32/CreateRedist/Redist_OpenNi.py
index 9dc78c8..f709e56 100644
--- a/Platform/Win32/CreateRedist/Redist_OpenNi.py
+++ b/Platform/Win32/CreateRedist/Redist_OpenNi.py
@@ -1,6 +1,6 @@
 #/***************************************************************************
 #*                                                                          *
-#*  OpenNI 1.1 Alpha                                                        *
+#*  OpenNI 1.x Alpha                                                        *
 #*  Copyright (C) 2011 PrimeSense Ltd.                                      *
 #*                                                                          *
 #*  This file is part of OpenNI.                                            *
@@ -19,9 +19,6 @@
 #*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.          *
 #*                                                                          *
 #***************************************************************************/
-#
-
-
 #-------------Imports----------------------------------------------------------#
 from xml.dom.minidom import parse, parseString
 import win32con,pywintypes,win32api
@@ -34,710 +31,310 @@ import sys
 import subprocess
 import shutil
 import stat
+import uuid
+path_to_base = os.path.dirname(os.path.abspath('common/redist_base.py'))
+if path_to_base not in sys.path:
+    sys.path.insert(0, path_to_base)
+import redist_base
 
-#-------------Classes----------------------------------------------------------#
-class SampleData(object):
+class RedistOpenNI(redist_base.RedistBase):
     def __init__(self):
-        self.name = ''
-        self.project_dir = ''
-        self.source_dir = ''
-        self.project_guid = ''
-        self.project_file = ''
-        self.is_net = False
-        self.project_name = ''
-        self.redist_dir = ''
-        self.dependencies = []
-
-    def print_():
-        print self.name
-    def __str__(self):
-        return self.name
-    def __eval__(self):
-        return self.name
-
-#-------------Functions--------------------------------------------------------#
-def find_samples():
-    # returns a dictionary of all samples
-    all_samples = dict()
-    samples_list = os.listdir("..\\..\\Samples")
-    if '.svn' in samples_list:
-        samples_list.remove('.svn')
-    print(samples_list)
-    for sample in samples_list:
-        sample_data = SampleData()
-        sample_data.name = sample
-        sample_data.source_dir = "..\\..\\Samples\\" + sample
-        sample_data.project_dir = "Build\\Samples\\" + sample
-
-        vc_proj_name = sample_data.project_dir + "\\" + sample + ".vcproj"
-        cs_proj_name = sample_data.project_dir + "\\" + sample + ".csproj"
-
-        # check if this is a VC project
-        if os.path.exists(vc_proj_name):
-            sample_data.project_file = vc_proj_name
-
-            # open it
-            prj = open(vc_proj_name, 'r')
-            lines = prj.readlines()
-            for line in lines:
-                # Search for name
-                if sample_data.project_name == "":
-                    ProjNametmp = re.search(r"Name=\"(.*)\"",line)
-                    if (ProjNametmp != None):
-                        sample_data.project_name = ProjNametmp.group(1)
-
-                # Search for GUID
-                if sample_data.project_guid == "":
-                    ProjGUIDtmp = re.search(r"ProjectGUID=\"(.*)\"",line)
-                    if (ProjGUIDtmp != None):
-                        sample_data.project_guid = ProjGUIDtmp.group(1)
-
-                ProjNametmp = re.search(r"<AssemblyName>(.*)</AssemblyName>",line)
-                if (ProjNametmp!=None):
-                    if (ProjName==""):
-                        ProjName = ProjNametmp.group(1)
-                        ProjIsNET = 1
-                ProjGUIDtmp = re.search(r"<ProjectGuid>(.*)</ProjectGuid>",line)
-                if (ProjGUIDtmp!=None):
-                    if (ProjGUID==""):
-                        ProjGUID = ProjGUIDtmp.group(1)
-
-            prj.close()
-
-        # or a .NET project
-        elif os.path.exists(cs_proj_name):
-            sample_data.project_file = cs_proj_name
-            sample_data.is_net = True
-            # open it, read GUID
-            prj = open(cs_proj_name, 'r')
-
-            # open it
-            prj = open(cs_proj_name, 'r')
-            lines = prj.readlines()
-            for line in lines:
-                # Search for name
-                if sample_data.project_name == "":
-                    ProjNametmp = re.search(r"<AssemblyName>(.*)</AssemblyName>",line)
-                    if (ProjNametmp != None):
-                        sample_data.project_name = ProjNametmp.group(1)
-
-                # Search for GUID
-                if sample_data.project_guid == "":
-                    ProjGUIDtmp = re.search(r"<ProjectGuid>(.*)</ProjectGuid>",line)
-                    if (ProjGUIDtmp != None):
-                        sample_data.project_guid = ProjGUIDtmp.group(1)
-
-            prj.close()
-
-        else:
-            print('Sample ' + sample + ' does not have a valid project file')
-            logger.critical('Sample ' + sample + ' does not have a valid project file')
-            finish_script(1)
-
-        # check if it has a special configuration
-        redist_file_name = sample_data.source_dir + "\\.redist"
-        if os.path.exists(redist_file_name):
-            redist_file = open(redist_file_name, 'r')
-
-            for line in redist_file.readlines():
-                # seach for dependencies
-                match = re.search("^DEPENDS=(.*)$", line)
-                if match != None:
-                    sample_data.dependencies.append(match.group(1))
-
-            redist_file.close()
-
-        sample_data.redist_dir = "Redist\\Samples\\" + sample_data.name
-        all_samples[sample_data.name] = sample_data
-
-    return all_samples
-
-def finish_script(exit_code):
-    os.chdir(SCRIPT_DIR)
-    #logging.shutdown()
-    exit(exit_code)
-
-def regx_replace(findStr,repStr,filePath):
-    "replaces all findStr by repStr in file filePath using regualr expression"
-    findStrRegx = re.compile(findStr)
-    tempName=filePath+'~~~'
-    input = open(filePath)
-    output = open(tempName,'w')
-    for s in input:
-        output.write(findStrRegx.sub(repStr,s))
-    output.close()
-    input.close()
-    os.remove(filePath)
-    os.rename(tempName,filePath)
-
-def fix_file(arg,dirname,fname):
-    "Fixes paths for all the files in fname"
-    for filename in fname:
-        filePath = dirname + "\\" + filename
-        ext = ['icproj','vcproj','csproj','cpp','h','ini','cs']
-        file_ext = os.path.splitext(filename)[1][1:]
-        if file_ext in ext:
-            #print("Fixing: " + filePath)
-            file = open(filePath, "r+")
-            s = file.read()
-            file.seek(0)
-
-            olds = s
-            s = re.sub(r"..\\..\\..\\..\\..\\",r"..\\..\\",s)
-            s = re.sub(r"../../../../../",r"../../",s)
-            s = re.sub(r"..\\\\..\\\\..\\\\..\\\\Data\\",r"..\\\\..\\\\..\\\\Data\\",s)
-            s = re.sub(r"..\\..\\..\\..\\Data\\",r"..\\..\\..\\Data\\",s)
-            s = re.sub("../../../../Data/",r"../../../Data/",s)
-            s = re.sub(r"..\\..\\Res\\",r"..\\Res\\",s)
-            if vc_build_bits=="32":
+        #RedistBase.__init__(self)
+        super(RedistOpenNI,self).__init__()
+        self.VC_version = 9
+        self.vc_build_bits = "32"
+        self.config_xml_filename = "OpenNi_Config.xml"
+        self.redist_name = "OpenNI"
+        self.redist_internal_name = 'OpenNI'
+        self.product_name = 'OpenNI'
+        self.doxy_file_name = 'Doxyfile'
+        self.write_2010_sample_dependency = True
+        self.internal_conf_name = 'Dev'
+        self.SCRIPT_DIR = os.getcwd()
+
+    def init_win_sdk_vars(self):
+        """find Windows SDK install dir"""
+        WIN_SDK_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Microsoft SDKs\Windows")
+        WIN_SDK_VALUES = [("CurrentInstallFolder", win32con.REG_SZ)]
+        self.WIN_SDK_INST_DIR = redist_base.get_reg_values(WIN_SDK_KEY, WIN_SDK_VALUES)[0]
+
+    def init_version_vars(self):
+        """
+        Init Verison vars.
+        currently not called in script. Taken from Redist_OpenNi.
+        """
+        version_file = open(self.WORK_DIR + "/Include/XnVersion.h").read()
+        version_major = re.search(r"define XN_MAJOR_VERSION (\d+)", version_file).groups()[0]
+        self.version_minor = re.search(r"define XN_MINOR_VERSION (\d+)", version_file).groups()[0]
+        version_maintenance = re.search(r"define XN_MAINTENANCE_VERSION (\d+)", version_file).groups()[0]
+        version_build = re.search(r"define XN_BUILD_VERSION (\d+)", version_file).groups()[0]
+        self.version_string = version_major + "." + self.version_minor + "." + version_maintenance + "." + version_build
+
+    def build_project(self):
+        #--------------Build Project---------------------------------------------------#
+        self.build_proj_solution()
+        self.build_java_wrapper()
+        self.build_other_samples()
+        self.build_dotnet_policy()
+        self.make_doxy()
+        self.create_redist_dir()
+        self.copy_files_to_redist()
+        self.creating_samples()
+        self.remove_read_only_attributes()
+
+    def build_dotnet_policy(self):
+        # Build the .NET publisher policy assembly (unfortunately, this should be done manually):
+        for minor in range(1, int(self.version_minor)+1):
+            policy_name = 'Policy.1.' + str(minor) + '.OpenNI.Net.dll'
+            cmd = self.WIN_SDK_INST_DIR + '\\Bin\\al.exe'
+            cmd += ' /link:' + self.WORK_DIR + '\\Wrappers\\OpenNI.Net\\PublisherPolicy.config'
+            cmd += ' /out:' + self.WORK_DIR + '\\Platform\\Win32\\' + self.bin_dir + '\\Release\\' + policy_name
+            cmd += ' /keyFile:' + self.WORK_DIR + '\\Platform\\Win32\\Build\\Wrappers\\OpenNI.Net\\OpenNI.snk'
+            cmd += ' /platform:'
+            if self.vc_build_bits=="32":
+                cmd += 'x86'
+            else:
+                cmd += 'x64'
+            cmd += ' /version:' + self.version_string
+
+            if subprocess.call(cmd) != 0:
+                print("Building Publisher Policy Failed!!")
+                self.logger.critical("Building Publisher Policy Failed!")
+                self.finish_script(1)
+
+    def build_java_wrapper(self):
+        "Builds the Java wrapper"
+        self.build_other_proj(self.WORK_DIR + '\\Platform\\Win32\\Build\\Wrappers\\OpenNI.java')
+
+    def update_installer_clr_policy(self):
+        updater = UpdateInstallerCLRPolicy(os.path.join(self.WORK_DIR,self.inst_proj_path))
+        for minor in range(1, int(self.version_minor)+1):
+            [missing,broken] = updater.is_missing(minor)
+            if broken:
+                self.logger.error('WXS file seems to be broken on definitions of dotnet policy for version 1.%d.'%minor)
+            elif missing:
+                self.logger.info('WXS file missing definitions of dotnet policy for version 1.%d.'%minor)
+                updater.add_policy_clauses(minor)
+                self.logger.info('WXS was succesfully updated to contain definitions of dotnet policy for version 1.%d.'%minor)
+            else:
+                self.logger.info('WXS contains definitions of dotnet policy for version 1.%d.'%minor)
+
+    def copy_doxy_files(self):
+        os.system("""copy "html\*.chm" ..\..\Documentation""")
+
+    def copy_files_to_redist(self):
+        #-------------Copy files to redist---------------------------------------------#
+        print("* Copying files to redist dir...")
+        self.logger.info("Copying files to redist dir...")
+
+        os.chdir(self.WORK_DIR + "\\Platform\\Win32")
+
+        #license
+        os.system ("copy \"..\\..\\GPL.txt\" Redist")
+        os.system ("copy \"..\\..\\LGPL.txt\" Redist")
+
+        #bin
+        os.system ("copy " + self.bin_dir + "\\Release\\OpenNI*.dll Redist\\" + self.bin_dir)
+        os.system ("copy " + self.bin_dir + "\\Release\\OpenNI.Net.dll Redist\\" + self.bin_dir)
+        os.system ("copy " + self.bin_dir + "\\Release\\Policy.1.*.OpenNI.Net.dll Redist\\" + self.bin_dir)
+        #os.system ("copy " + "..\\..\\Wrappers\\OpenNI.Net\\PublisherPolicy.config Redist\\" + self.bin_dir)
+        os.system ("copy " + self.bin_dir + "\\Release\\nimCodecs*.dll Redist\\" + self.bin_dir)
+        os.system ("copy " + self.bin_dir + "\\Release\\nimMockNodes*.dll Redist\\" + self.bin_dir)
+        os.system ("copy " + self.bin_dir + "\\Release\\nimRecorder*.dll Redist\\" + self.bin_dir)
+        os.system ("copy " + self.bin_dir + "\\Release\\niReg*.exe Redist\\" + self.bin_dir)
+        os.system ("copy " + self.bin_dir + "\\Release\\niLicense*.exe Redist\\" + self.bin_dir)
+        os.system ("copy " + self.bin_dir + "\\Release\\OpenNI.jni.dll Redist\\" + self.bin_dir)
+        os.system ("copy " + self.bin_dir + "\\Release\\org.OpenNI.jar Redist\\" + self.bin_dir)
+
+        for minor in range(1, int(self.version_minor)+1):
+            policy_congfig_name = 'PublisherPolicy1.' + str(minor) + '.config'
+            os.system ("copy " + "..\\..\\Wrappers\\OpenNI.Net\\PublisherPolicy.config Redist\\" + self.bin_dir + "\\" + policy_congfig_name)
+
+        #lib
+        os.system ("copy " + self.lib_dir + "\\Release\\*.* Redist\\" + self.lib_dir)
+
+        #docs
+        os.system ("copy \"..\\..\\Documentation\\*.pdf\" Redist\\Documentation")
+        os.system ("copy \"..\\..\\Documentation\\*.chi\" Redist\\Documentation")
+        os.system ("copy \"..\\..\\Documentation\\*.chm\" Redist\\Documentation")
+
+        #include
+        os.system ("xcopy /S ..\\..\\Include\\* Redist\\Include\\")
+
+        #driver
+        os.system ("xcopy /S Driver\\Bin\\*.* Redist\\Driver\\")
+
+        #samples
+        os.system ("copy Redist\\Samples\\" + self.bin_dir + "\\Release\\*.* Redist\\Samples\\" + self.bin_dir + "\\Debug")
+        os.system ("xcopy /S Build\\Res\\*.* Redist\\Samples\\Res\\")
+
+        #data
+        os.system ("copy ..\\..\\Data\\SamplesConfig.xml Redist\\Data\\SamplesConfig.xml")
+
+        # Copy the glut dll to the samples
+        os.system ("xcopy /S .\\" + self.bin_dir + "\\Release\\glut*.dll Redist\\Samples\\" + self.bin_dir + "\\Release\\")
+        os.system ("xcopy /S .\\" + self.bin_dir + "\\Release\\glut*.dll Redist\\Samples\\" + self.bin_dir + "\\Debug\\")
+
+        # Copy the wrappers to the samples
+        shutil.copy(os.path.join(self.bin_dir, "Release", "OpenNI.net.dll"), os.path.join("Redist", "Samples", self.bin_dir, "Release"))
+        shutil.copy(os.path.join(self.bin_dir, "Release", "OpenNI.net.dll"), os.path.join("Redist", "Samples", self.bin_dir, "Debug"))
+        shutil.copy(os.path.join(self.bin_dir, "Release", "org.OpenNI.jar"), os.path.join("Redist", "Samples", self.bin_dir, "Release"))
+        shutil.copy(os.path.join(self.bin_dir, "Release", "org.OpenNI.jar"), os.path.join("Redist", "Samples", self.bin_dir, "Debug"))
+
+        # Copy the release notes
+        os.system ("copy .\\ReleaseNotes.txt Redist\\Documentation\\")
+
+        os.chdir(self.WORK_DIR)
+
+    def fix_file(self,arg,dirname,fname):
+        "Fixes paths for all the files in fname"
+        for filename in fname:
+            filePath = dirname + "\\" + filename
+            if os.path.isdir(filePath):
+                continue
+
+            ext = ['icproj','vcproj','csproj','cpp','h','c','ini','cs','py','bat','java']
+            file_ext = os.path.splitext(filename)[1][1:]
+            if file_ext in ext:
+                file = open(filePath, "r+")
+                s = file.read()
+                file.seek(0)
+
+                olds = s
+                # Fix include paths
+                s = re.sub(r"../../../../../Include",r"$(OPEN_NI_INCLUDE)",s)
+                s = re.sub(r"..\\..\\..\\..\\..\\Include",r"$(OPEN_NI_INCLUDE)",s)
+                
+                sample_name = os.path.basename(dirname)
+                s = re.sub(r"..\\..\\..\\..\\..\\Samples\\" + sample_name, r".", s)
+                s = re.sub(r"../../../../../Samples/" + sample_name, r".", s)
+                
+                # fix path to "Data" folder
+                s = re.sub(r"..\\\\..\\\\..\\\\..\\\\Data\\",r"..\\\\..\\\\..\\\\Data\\",s)
+                s = re.sub(r"..\\..\\..\\..\\Data\\",r"..\\..\\..\\Data\\",s)
+                s = re.sub("../../../../Data/",r"../../../Data/",s)
+
+                # fix path to res files
+                s = re.sub(r"..\\..\\Res\\",r"..\\Res\\",s)
+
+                # fix path to java build script
+                s = re.sub(r"..\\..\\BuildJava.py", r"..\\Build\\BuildJava.py", s)
+                
+                # fix bin and lib path for 32 bit configuration
                 s = re.sub(r"../../../Bin/",r"../Bin/",s)
                 s = re.sub(r"..\\..\\..\\Bin\\",r"../Bin/",s)
-                s = re.sub(r"../../../Lib/\$\(ConfigurationName\)",r"../../Lib/",s)
-                s = re.sub(r"..\\..\\..\\Lib\\\$\(ConfigurationName\)",r"../../Lib/",s)
-            else:
+                s = re.sub(r"../../../Lib/\$\(ConfigurationName\)",r"$(OPEN_NI_LIB)",s)
+                s = re.sub(r"..\\..\\..\\Lib\\\$\(ConfigurationName\)",r"$(OPEN_NI_LIB)",s)
+                
+                # fix bin and lib path for 64 bit configuration
                 s = re.sub(r"../../../Bin64/",r"../Bin64/",s)
                 s = re.sub(r"..\\..\\..\\Bin64\\",r"../Bin64/",s)
-                s = re.sub(r"../../../Lib64/\$\(ConfigurationName\)",r"../../Lib64/",s)
-                s = re.sub(r"..\\..\\..\\Lib64\\\$\(ConfigurationName\)",r";../../Lib64/",s)
-
-            s = re.sub(r".*SccProjectName=\".*", r"", s);
-            s = re.sub(r".*SSccAuxPath=\".*", r"", s);
-            s = re.sub(r".*SccLocalPath=\".*", r"", s);
-            
-            # fix csproj link problem
-            if file_ext == "csproj":
-                sample_name = os.path.basename(dirname)
-                link_re = r"<Compile Include=\"..\\..\\Samples\\" + sample_name + r"\\.*\">\n"
-                link_re += r"\s*<Link>(.*)</Link>"
-                compiled_re = re.compile(link_re, re.MULTILINE)
-                s = compiled_re.sub("<Compile Include=\"\\1\">", s)
-            
-            file.truncate()
-            file.write(s)
-            file.close()
-
-def get_reg_values(reg_key, value_list):
-    # open the reg key
-    try:
-        reg_key = win32api.RegOpenKeyEx(*reg_key)
-    except pywintypes.error as e:
-        raise Exception("Failed to open registry key!")
-    # Get the values
-    try:
-        values = [(win32api.RegQueryValueEx(reg_key, name), data_type) for name, data_type in value_list]
-        # values list of ((value, type), expected_type)
-        for (value, data_type), expected in values:
-            if data_type != expected:
-                raise Exception("Bad registry value type! Expected %d, got %d instead." % (expected, data_type))
-        # values okay, leave only values
-        values = [value for ((value, data_type), expected) in values]
-    except pywintypes.error as e:
-        raise Exception("Failed to get registry value!")
-    finally:
-        try:
-            win32api.RegCloseKey(reg_key)
-        except pywintypes.error as e:
-            # We don't care if reg key close failed...
-            pass
-    return tuple(values)
-
-#------------Check args---------------------------------------------#
-
-if len(sys.argv) not in [4,5]:
-    print "Args: <Doxygen:y/n> <BuildTarget:32/64> <FullRebuild:y/n> [<VCVersion:9/10>]"
-    exit(1)
-
-if sys.argv[1] == 'y':
-    Make_Doxy=1
-elif sys.argv[1] == 'n':
-    Make_Doxy=0
-else:
-    print "Args: <Doxygen:y/n> <BuildTarget:32/64> <FullRebuild:y/n>"
-    print "Doxygen param must be y or n!"
-    exit(1)
-
-if sys.argv[2] == '32':
-    vc_build_bits = "32"
-elif sys.argv[2] == '64':
-    vc_build_bits = "64"
-else:
-    print "Args: <Doxygen:y/n> <BuildTarget:32/64> <FullRebuild:y/n>"
-    print "BuildTarget param must be 32 or 64!"
-    exit(1)
-
-if sys.argv[3] == 'y':
-    vc_build_type = "/Rebuild"
-elif sys.argv[3] == 'n':
-    vc_build_type = "/Build"
-else:
-    print "Args: <Doxygen:y/n> <BuildTarget:32/64> <FullRebuild:y/n>"
-    print "Doxygen param must be y or n!"
-    exit(1)
-
-VC_version = 9
-if len(sys.argv) > 4:
-    if sys.argv[4] == '10':
-        VC_version = 10
-
-try:
-    VS_NEED_UPGRADE = 0
-    MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\9.0")
-    MSVC_VALUES = [("InstallDir", win32con.REG_SZ)]
-    VS_INST_DIR = get_reg_values(MSVC_KEY, MSVC_VALUES)[0]
-except Exception as e:
-    VC_version = 10
-
-print ("\n*** Build target is:" + vc_build_bits + " Doxy:" + str(Make_Doxy) + " Rebuild:" + sys.argv[3] + " VC Version:" + str(VC_version) + " ***");	
-	
-#------------Constants and globals---------------------------------------------#
-if VC_version == 10:
-    VS_NEED_UPGRADE = 1
-    MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\10.0")    
-    MSVC_VALUES = [("InstallDir", win32con.REG_SZ)]
-    VS_INST_DIR = get_reg_values(MSVC_KEY, MSVC_VALUES)[0]    
-    
-# find Windows SDK install dir
-WIN_SDK_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Microsoft SDKs\Windows")
-WIN_SDK_VALUES = [("CurrentInstallFolder", win32con.REG_SZ)]
-WIN_SDK_INST_DIR = get_reg_values(WIN_SDK_KEY, WIN_SDK_VALUES)[0]
-
-DateTimeSTR = strftime("%Y-%m-%d %H:%M:%S")
-DateSTR = strftime("%Y-%m-%d")
-SCRIPT_DIR = os.getcwd()
-CONFIG_XML = parse("OpenNi_Config.xml")
-WORK_DIR = str(CONFIG_XML.getElementsByTagName("WORK_DIR")[0].firstChild.data)
-# Fix to allow reletive path
-os.chdir(WORK_DIR)
-WORK_DIR = os.getcwd() + "\\"
-os.chdir(SCRIPT_DIR)
-OPENNI_VER = str(CONFIG_XML.getElementsByTagName("VERSION_NUMBER")[0].firstChild.data)
-PLATFORM = str(CONFIG_XML.getElementsByTagName("PLATFORM")[0].firstChild.data)
-PROJECT_SLN = str(CONFIG_XML.getElementsByTagName("PROJECT_SLN")[0].firstChild.data)
-SAMPLES_SLN = str(CONFIG_XML.getElementsByTagName("SAMPLES_SLN")[0].firstChild.data)
-PROJECT_NAME = str(CONFIG_XML.getElementsByTagName("PROJECT")[0].firstChild.data)
-ver_regx = re.compile("SDK \d.*\s")
-global samples_proj_list
-global samples_guid_list
-global samples_guid_list_net
-samples_proj_list = []
-samples_guid_list = []
-samples_guid_list_net = []
-
-if vc_build_bits=="32":
-	bin_dir = "Bin"
-	lib_dir = "Lib"
-	vc_build_platform = "Win32"
-else:
-	bin_dir = "Bin64"
-	lib_dir = "Lib64"
-	vc_build_platform = "x64"
-
-version_file = open("../../../Include/XnVersion.h").read()
-version_major = re.search(r"define XN_MAJOR_VERSION (\d+)", version_file).groups()[0]
-version_minor = re.search(r"define XN_MINOR_VERSION (\d+)", version_file).groups()[0]
-version_maintenance = re.search(r"define XN_MAINTENANCE_VERSION (\d+)", version_file).groups()[0]
-version_build = re.search(r"define XN_BUILD_VERSION (\d+)", version_file).groups()[0]
-
-version_string = version_major + "." + version_minor + "." + version_maintenance + "." + version_build
-
-#-------------Log--------------------------------------------------------------#
-if not(os.path.exists(SCRIPT_DIR + "\\Output\\")):
-    os.mkdir(SCRIPT_DIR + "\\Output\\")
-logger = logging.getLogger('myapp')
-hdlr = logging.FileHandler('Output\\Nightly.log')
-formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
-hdlr.setFormatter(formatter)
-logger.addHandler(hdlr)
-logger.setLevel(logging.INFO)
-
-#------------Welcome Messege--------=------------------------------------------#
-print("\n");
-print("*********************************")
-print("*   PrimeSense OpenNI Redist    *")
-print("*     " + DateTimeSTR + "       *")
-print("*********************************")
-logger.info("PrimeSense OpenNI Redist Started")
-
-#--------------Build Project---------------------------------------------------#
-print("* Building " + PROJECT_NAME + "...")
-logger.info("Building " + PROJECT_NAME + "...")
-
-# Build project solution
-os.chdir(WORK_DIR + PROJECT_SLN.rpartition("\\")[0])
-if VS_NEED_UPGRADE == 1:
-    os.system("attrib -r * /s")
-    os.system("\""+VS_INST_DIR + "devenv\" " + PROJECT_SLN.rpartition("\\")[2]+\
-                 " /upgrade > ..\\CreateRedist\\Output\\Build"+PROJECT_NAME+".txt")
-
-subprocess.call('\"'+VS_INST_DIR + 'devenv\" ' + PROJECT_SLN.rpartition("\\")[2]+\
-             " " + vc_build_type + " \"release|" + vc_build_platform + "\" /out ..\\CreateRedist\\Output\\Build"+PROJECT_NAME+".txt", close_fds=True)
-
-# Get the build output
-lines = open(SCRIPT_DIR+"\\Output\\Build"+PROJECT_NAME+".txt").readlines()
-build_result = lines[-2]
-print(build_result)
-logger.info(build_result)
-# Check for failed build
-
-temp = re.search("(\d*) failed",build_result)
-if temp != None :
-	failed_builds = int(temp.group(1))
-else:
-	failed_builds = 0
-if failed_builds != 0:
-    print("Building Failed!!")
-    logger.critical("Building Failed!")
-    finish_script(1)
-    
-# Build the .NET publisher policy assembly (unfortunately, this should be done manually):
-cmd = WIN_SDK_INST_DIR + '\\Bin\\al.exe'
-cmd += ' /link:..\\..\\..\\Wrappers\\OpenNI.Net\\PublisherPolicy.config'
-cmd += ' /out:..\\' + bin_dir + '\\Release\\Policy.1.1.OpenNI.Net.dll'
-cmd += ' /keyFile:Wrappers\\OpenNI.Net\\OpenNI.snk'
-cmd += ' /platform:'
-if vc_build_bits=="32":
-    cmd += 'x86'
-else:
-    cmd += 'x64'
-cmd += ' /version:' + version_string
-    
-if subprocess.call(cmd) != 0:
-    print("Building Publisher Policy Failed!!")
-    logger.critical("Building Publisher Policy Failed!")
-    finish_script(1)
-
-#--------------Doxygen---------------------------------------------------------#
-if Make_Doxy==1:
-    print("* Creating Doxygen...")
-    logger.info("Creating Doxygen...")
-    os.chdir(WORK_DIR + "Source\\Doxygen");
-    # Replacing version number in the doxygen setup file
-    res = os.system("attrib -r Doxyfile")
-    print 'removing readonly attribute for Doxyfile: ' + str(res)
-    regx_replace("OpenNI \d*.\d*.\d*\s",PROJECT_NAME +" " + OPENNI_VER + " ",'Doxyfile')
-    if os.path.exists(WORK_DIR + "\\Source\\Doxygen\\html\\"):
-        os.system("rmdir /S /Q html")
-    # Running doxygen
-    os.system("mkdir html")
-    #os.system("copy PSSmallLogo.jpg html") // where is this file ? 
-    os.system("doxygen.exe Doxyfile > ..\\..\\Platform\Win32\\CreateRedist\\Output\\EngineDoxy.txt")
-    os.system("""copy "html\*.chm" ..\..\Documentation""")
-else:
-    print("Skipping Doxygen...")
-
-#-------------Create Redist Dir------------------------------------------------#
-print("* Creating Redist Dir...")
-logger.info("Creating Redist Dir...")
-os.chdir(WORK_DIR + "\\Platform\\Win32")
-# Removing the old directory
-os.system("rmdir /S /Q Redist")
-# Creating new directory tree
-os.system("mkdir Redist")
-os.system("mkdir Redist\\" + bin_dir)
-os.system("mkdir Redist\\" + lib_dir)
-os.system("mkdir Redist\\Include")
-os.system("mkdir Redist\\Documentation")
-os.system("mkdir Redist\\Samples")
-os.system("mkdir Redist\\Samples\\" + bin_dir)
-os.system("mkdir Redist\\Samples\\" + bin_dir + "\\Debug")
-os.system("mkdir Redist\\Samples\\" + bin_dir + "\\Release")
-os.system("mkdir Redist\\Samples\\Build")
-os.system("mkdir Redist\\Samples\\Res")
-os.system("mkdir Redist\\Data")
-
-#-------------Copy files to redist---------------------------------------------#
-print("* Copying files to redist dir...")
-logger.info("Copying files to redist dir...")
-
-#license
-os.system ("copy \"..\\..\\GPL.txt\" Redist")
-os.system ("copy \"..\\..\\LGPL.txt\" Redist")
-
-#bin
-os.system ("copy " + bin_dir + "\\Release\\OpenNI*.dll Redist\\" + bin_dir)
-os.system ("copy " + bin_dir + "\\Release\\OpenNI.Net.dll Redist\\" + bin_dir)
-os.system ("copy " + bin_dir + "\\Release\\Policy.1.1.OpenNI.Net.dll Redist\\" + bin_dir)
-os.system ("copy " + "..\\..\\Wrappers\\OpenNI.Net\\PublisherPolicy.config Redist\\" + bin_dir)
-os.system ("copy " + bin_dir + "\\Release\\nimCodecs*.dll Redist\\" + bin_dir)
-os.system ("copy " + bin_dir + "\\Release\\nimMockNodes*.dll Redist\\" + bin_dir)
-os.system ("copy " + bin_dir + "\\Release\\nimRecorder*.dll Redist\\" + bin_dir)
-os.system ("copy " + bin_dir + "\\Release\\niReg*.exe Redist\\" + bin_dir)
-os.system ("copy " + bin_dir + "\\Release\\niLicense*.exe Redist\\" + bin_dir)
-
-#lib
-os.system ("copy " + lib_dir + "\\Release\\*.* Redist\\" + lib_dir)
-
-#docs
-os.system ("copy \"..\\..\\Documentation\\*.pdf\" Redist\\Documentation")
-os.system ("copy \"..\\..\\Documentation\\*.chi\" Redist\\Documentation")
-os.system ("copy \"..\\..\\Documentation\\*.chm\" Redist\\Documentation")
-
-#include
-os.system ("xcopy /S ..\\..\\Include\\* Redist\\Include\\")
-
-#driver
-os.system ("xcopy /S Driver\\Bin\\*.* Redist\\Driver\\")
-
-#samples
-os.system ("copy Redist\\Samples\\" + bin_dir + "\\Release\\*.* Redist\\Samples\\" + bin_dir + "\\Debug")
-os.system ("xcopy /S Build\\Res\\*.* Redist\\Samples\\Res\\")
-
-#data
-os.system ("copy ..\\..\\Data\\SamplesConfig.xml Redist\\Data\\SamplesConfig.xml")
-
-# Copy the glut dll to the samples
-os.system ("xcopy /S .\\" + bin_dir + "\\Release\\glut*.dll Redist\\Samples\\" + bin_dir + "\\Release\\")
-os.system ("xcopy /S .\\" + bin_dir + "\\Release\\glut*.dll Redist\\Samples\\" + bin_dir + "\\Debug\\")
-
-# Copy the OpenNI.net dll to the samples
-os.system ("xcopy /S .\\" + bin_dir + "\\Release\\OpenNI.net.dll Redist\\Samples\\" + bin_dir + "\\Release\\")
-os.system ("xcopy /S .\\" + bin_dir + "\\Release\\OpenNI.net.dll Redist\\Samples\\" + bin_dir + "\\Debug\\")
-
-# Copy the release notes
-os.system ("copy .\\ReleaseNotes.txt Redist\\Documentation\\")
-
-#-------Creating samples-------------------------------------------------------#
-print("* Creating samples...")
-logger.info("Creating samples...")
-
-# open all solution files
-OUTFILESLN2008 = open("Redist\\Samples\\Build\\All_2008.sln",'w')
-OUTFILESLN2008.write("Microsoft Visual Studio Solution File, Format Version 10.00\n")
-OUTFILESLN2008.write("# Visual Studio 2008\n")
-OUTFILESLN2010 = open("Redist\\Samples\\Build\\All_2010.sln",'w')
-OUTFILESLN2010.write("Microsoft Visual Studio Solution File, Format Version 11.00\n")
-OUTFILESLN2010.write("# Visual Studio 2010\n")
-
-all_samples = find_samples()
-
-# add projects
-for sample in all_samples.values():
-    print(sample.name)
-
-    # make dir
-    os.system ("mkdir " + sample.redist_dir)
-    # copy source
-    os.system ("xcopy /S " + sample.source_dir + " " + sample.redist_dir)
-
-    # copy the project file to 2008 and 2010:
-    prj_name_partitioned = os.path.splitext(sample.project_file);
-    prj2008_filename = sample.redist_dir + "\\" + sample.name + "_2008" + prj_name_partitioned[1]
-    prj2010_filename = sample.redist_dir + "\\" + sample.name + "_2010" + prj_name_partitioned[1]
-
-    shutil.copy(sample.project_file, prj2008_filename)
-    shutil.copy(sample.project_file, prj2010_filename)
-
-    # create reletive path to samples
-    prj2008_path = "..\\" + prj2008_filename.partition("\\")[2].partition("\\")[2]
-    prj2010_path = "..\\" + prj2010_filename.partition("\\")[2].partition("\\")[2]
-
-    # add project to solution
-    OUTFILESLN2008.write("Project(\"{19091980-2008-4CFA-1491-04CC20D8BCF9}\") = \""+\
-                                sample.project_name + "\", \"" + prj2008_path + "\", \"" + sample.project_guid + "\"\n")
-    OUTFILESLN2010.write("Project(\"{19091980-2008-4CFA-1491-04CC20D8BCF9}\") = \""+\
-                                sample.project_name + "\", \"" + prj2010_path + "\", \"" + sample.project_guid + "\"\n")
-
-    # write down dependencies
-    if len(sample.dependencies) > 0:
-        OUTFILESLN2008.write("\tProjectSection(ProjectDependencies) = postProject\n")
-        for depend in sample.dependencies:
-            OUTFILESLN2008.write("\t\t" + all_samples[depend].project_guid + " = " + all_samples[depend].project_guid + "\n")
-        OUTFILESLN2008.write("\tEndProjectSection\n")
-        OUTFILESLN2010.write("\tProjectSection(ProjectDependencies) = postProject\n")
-        for depend in sample.dependencies:
-            OUTFILESLN2010.write("\t\t" + all_samples[depend].project_guid + " = " + all_samples[depend].project_guid + "\n")
-        OUTFILESLN2010.write("\tEndProjectSection\n")		
-
-    OUTFILESLN2008.write("EndProject\n")
-    OUTFILESLN2010.write("EndProject\n")
-
-# Close files
-OUTFILESLN2008.write("Global\n")
-OUTFILESLN2008.write("	GlobalSection(SolutionConfigurationPlatforms) = preSolution\n")
-OUTFILESLN2008.write("		Debug|Win32 = Debug|Win32\n")
-OUTFILESLN2008.write("		Debug|x64 = Debug|x64\n")
-OUTFILESLN2008.write("		Release|Win32 = Release|Win32\n")
-OUTFILESLN2008.write("		Release|x64 = Release|x64\n")
-OUTFILESLN2008.write("	EndGlobalSection\n")
-OUTFILESLN2008.write("	GlobalSection(ProjectConfigurationPlatforms) = postSolution\n")
-OUTFILESLN2010.write("Global\n")
-OUTFILESLN2010.write("	GlobalSection(SolutionConfigurationPlatforms) = preSolution\n")
-OUTFILESLN2010.write("		Debug|Win32 = Debug|Win32\n")
-OUTFILESLN2010.write("		Debug|x64 = Debug|x64\n")
-OUTFILESLN2010.write("		Release|Win32 = Release|Win32\n")
-OUTFILESLN2010.write("		Release|x64 = Release|x64\n")
-OUTFILESLN2010.write("	EndGlobalSection\n")
-OUTFILESLN2010.write("	GlobalSection(ProjectConfigurationPlatforms) = postSolution\n")
-
-for sample in all_samples.values():
-    conf_32_name = "Win32"
-    if sample.is_net:
-        conf_32_name = "x86"
-
-    OUTFILESLN2008.write("		" + sample.project_guid + ".Debug|Win32.ActiveCfg = Debug|" + conf_32_name + "\n")
-    OUTFILESLN2008.write("		" + sample.project_guid + ".Debug|Win32.Build.0 = Debug|" + conf_32_name + "\n")
-    OUTFILESLN2008.write("		" + sample.project_guid + ".Debug|x64.ActiveCfg = Debug|x64\n")
-    OUTFILESLN2008.write("		" + sample.project_guid + ".Debug|x64.Build.0 = Debug|x64\n")
-    OUTFILESLN2008.write("		" + sample.project_guid + ".Release|Win32.ActiveCfg = Release|" + conf_32_name + "\n")
-    OUTFILESLN2008.write("		" + sample.project_guid + ".Release|Win32.Build.0 = Release|" + conf_32_name + "\n")
-    OUTFILESLN2008.write("		" + sample.project_guid + ".Release|x64.ActiveCfg = Release|x64\n")
-    OUTFILESLN2008.write("		" + sample.project_guid + ".Release|x64.Build.0 = Release|x64\n")
-    OUTFILESLN2010.write("		" + sample.project_guid + ".Debug|Win32.ActiveCfg = Debug|" + conf_32_name + "\n")
-    OUTFILESLN2010.write("		" + sample.project_guid + ".Debug|Win32.Build.0 = Debug|" + conf_32_name + "\n")
-    OUTFILESLN2010.write("		" + sample.project_guid + ".Debug|x64.ActiveCfg = Debug|x64\n")
-    OUTFILESLN2010.write("		" + sample.project_guid + ".Debug|x64.Build.0 = Debug|x64\n")
-    OUTFILESLN2010.write("		" + sample.project_guid + ".Release|Win32.ActiveCfg = Release|" + conf_32_name + "\n")
-    OUTFILESLN2010.write("		" + sample.project_guid + ".Release|Win32.Build.0 = Release|" + conf_32_name + "\n")
-    OUTFILESLN2010.write("		" + sample.project_guid + ".Release|x64.ActiveCfg = Release|x64\n")
-    OUTFILESLN2010.write("		" + sample.project_guid + ".Release|x64.Build.0 = Release|x64\n")
-
-OUTFILESLN2008.write("	EndGlobalSection\n")
-OUTFILESLN2008.write("	GlobalSection(SolutionProperties) = preSolution\n")
-OUTFILESLN2008.write("		HideSolutionNode = FALSE\n")
-OUTFILESLN2008.write("	EndGlobalSection\n")
-OUTFILESLN2008.write("EndGlobal	\n")
-OUTFILESLN2010.write("	EndGlobalSection\n")
-OUTFILESLN2010.write("	GlobalSection(SolutionProperties) = preSolution\n")
-OUTFILESLN2010.write("		HideSolutionNode = FALSE\n")
-OUTFILESLN2010.write("	EndGlobalSection\n")
-OUTFILESLN2010.write("EndGlobal	\n")
-
-OUTFILESLN2008.close()
-OUTFILESLN2010.close()
-
-#-----Remove Read Only Attrib--------------------------------------------------#
-print("* Removing Read Only Attributes...")
-full_path = os.path.join(os.getcwd(), "Redist")
-logger.info("Removing Read Only Attributes... (%s)" % (full_path))
-#os.system ("attrib -r -h -s /S Redist\\*.*")
-
-def remove_readonly(path):
-	for root, dirs, files in os.walk(path):
-		for fname in files: 
-			full_path = os.path.join(root, fname)
-			os.chmod(full_path ,stat.S_IWRITE)
-			
-remove_readonly(full_path)
-
-
-
-#--------Fixing Files----------------------------------------------------------#
-print("* Fixing Files...")
-logger.info("Fixing Files...")
-for dirpath, dirnames, filenames in os.walk('Redist\\'):
-    fix_file('', dirpath, dirnames + filenames)
-
-#-------------Build Samples---------------------------------------------------#
-print("* Building Samples in release configuration......")
-logger.info("Building Samples in release configuration...")
-# Build project solution
-os.chdir(WORK_DIR + SAMPLES_SLN.rpartition("\\")[0])
-
-if VS_NEED_UPGRADE == 1:
-    os.system("\""+VS_INST_DIR + "devenv\" " + SAMPLES_SLN.rpartition("\\")[2]+\
-                           " /upgrade > ..\\..\\..\\CreateRedist\\Output\\EngineSmpRelease.txt")
-
-subprocess.call("\""+VS_INST_DIR + "devenv\" " + SAMPLES_SLN.rpartition("\\")[2]+\
-                 " " + vc_build_type + " \"release|" + vc_build_platform + "\" /out ..\\..\\..\\CreateRedist\\Output\\EngineSmpRelease.txt")
-
-# Get the build output
-lines = open(SCRIPT_DIR+"\\Output\\EngineSmpRelease.txt").readlines()
-build_result = lines[-2]
-print(build_result)
-logger.info(build_result)
-# Check for failed build
-failed_builds = int(re.search("(\d*) failed",build_result).group(1))
-if failed_builds != 0:
-    print("Samples Building In Release Failed!!")
-    logger.critical("Samples Building Failed!")
-#    finish_script(1)
-
-print("* Building Samples in debug configuration......")
-logger.info("Building Samples in debug configuration...")
-# Build project solution
-os.chdir(WORK_DIR + SAMPLES_SLN.rpartition("\\")[0])
-
-if VS_NEED_UPGRADE == 1:
-    os.system("\""+VS_INST_DIR + "devenv\" " + SAMPLES_SLN.rpartition("\\")[2]+\
-                     " /upgrade > ..\\..\\..\\CreateRedist\\Output\\EngineSmpDebug.txt")
-
-subprocess.call("\""+VS_INST_DIR + "devenv\" " + SAMPLES_SLN.rpartition("\\")[2]+\
-                 " " + vc_build_type + " \"debug|" + vc_build_platform + "\" /out ..\\..\\..\\CreateRedist\\Output\\EngineSmpDebug.txt")
-
-# Get the build output
-lines = open(SCRIPT_DIR+"\\Output\\EngineSmpDebug.txt").readlines()
-build_result = lines[-2]
-print(build_result)
-logger.info(build_result)
-# Check for failed build
-failed_builds = int(re.search("(\d*) failed",build_result).group(1))
-if failed_builds != 0:
-    print("Samples Building In Debug Failed!!")
-    logger.critical("Samples Building Failed!")
-#    finish_script(1)
-
-# --------------------Delete stuff
-os.chdir(WORK_DIR + "\\Platform\\Win32\\Redist\\Samples\\" + bin_dir +"\\Release\\")
-os.system("del *.pdb")
-os.chdir(WORK_DIR + "\\Platform\\Win32\\Redist\\Samples\\" + bin_dir +"\\Debug\\")
-os.system("del *.pdb")
-os.system("del *.ilk")
-os.chdir(WORK_DIR + "\\Platform\\Win32\\Redist\\" + lib_dir + "\\")
-os.system("del nim*.*")
-
-#-------------Make installer---------------------------------------------------#
-print("* Making Installer...")
-logger.info("Making Installer...")
-os.chdir(WORK_DIR + "Platform\\Win32\\Install\\OpenNI\\")
-# Replace version in the WIX
-os.system("attrib -r Includes\\OpenNIVariables.wxi")
-
-print("setting WIX BuildPlatform")
-#regx_replace("BuildPlatform=(.*)", "BuildPlatform=" + str(vc_build_bits) + "?>", "Includes\\OpenNIVariables.wxi")
-
-print("setting WIX BinaryOnlyRedist=True")
-regx_replace("BinaryOnlyRedist=(.*)", "BinaryOnlyRedist=True?>", "Includes\\OpenNIVariables.wxi")
-
-# make installer
-wixPath = os.environ.get('WIX')
-if wixPath == None:
-    print '*** no WIX env. var. defined ! use set WIX=C:\Program Files\Windows Installer XML v3.5\ or similar to set the path ***'
-    print 'make installer is SERIOUSLY expected to fail'
-else:
-    print 'WIX='+wixPath
-
-if VS_NEED_UPGRADE == 1:
-	subprocess.call("\"" + VS_INST_DIR + "devenv\" OpenNI.sln /upgrade /out ..\\..\\CreateRedist\\Output\\UpgradeOpenNIWIX.txt", close_fds=True)
-	
-print("calling WIX")
-if vc_build_bits=="32":
-	subprocess.call("\"" + VS_INST_DIR + "devenv\" OpenNI.wixproj /Build \"release|x86"\
-                + "\" /out ..\\..\\CreateRedist\\Output\\BuildOpenNIWIXRedist.txt", close_fds=True)
-else:
-	subprocess.call("\"" + VS_INST_DIR + "devenv\" OpenNI.wixproj /Build \"release|x64"\
-                + "\" /out ..\\..\\CreateRedist\\Output\\BuildOpenNIWIXRedist.txt", close_fds=True)
-
-print("moving Redist Msi")
-os.system("move .\\bin\Release\en-US\\OpenNI.msi ..\\..\\CreateRedist\\Output\\OpenNI-Win" + vc_build_bits + "-" + OPENNI_VER + "-Redist.msi")
-
-print("setting WIX BinaryOnlyRedist=False")
-regx_replace("BinaryOnlyRedist=(.*)", "BinaryOnlyRedist=False?>", "Includes\\OpenNIVariables.wxi")
-
-# make installer
-print("calling WIX")
-if vc_build_bits=="32":
-	subprocess.call("\"" + VS_INST_DIR + "devenv\" OpenNI.wixproj /Build \"release|x86"\
-                + "\" /out ..\\..\\CreateRedist\\Output\\BuildOpenNIWIXDev.txt", close_fds=True)
-else:
-	subprocess.call("\"" + VS_INST_DIR + "devenv\" OpenNI.wixproj /Build \"release|x64"\
-                + "\" /out ..\\..\\CreateRedist\\Output\\BuildOpenNIWIXDev.txt", close_fds=True)
-print("moving Dev Msi")	
-
-os.system("move .\\bin\Release\en-US\\OpenNI.msi ..\\..\\CreateRedist\\Output\\OpenNI-Win" + vc_build_bits + "-" + OPENNI_VER + "-Dev.msi")
-
-#-------------CleanUP----------------------------------------------------------#
-print("* Redist OpenNi Ended.   !!")
-logger.info("Redist OpenNi Ended.")
-finish_script(0)
-
-
+                s = re.sub(r"../../../Lib64/\$\(ConfigurationName\)",r"$(OPEN_NI_LIB64)",s)
+                s = re.sub(r"..\\..\\..\\Lib64\\\$\(ConfigurationName\)",r"$(OPEN_NI_LIB64)",s)
+
+                # fix general path problems
+                s = re.sub(r"..\\..\\..\\..\\..\\",r"..\\..\\",s)
+                s = re.sub(r"../../../../../",r"../../",s)
+                
+                # remove source control integraion (if exists)
+                s = re.sub(r".*SccProjectName=\".*", r"", s);
+                s = re.sub(r".*SSccAuxPath=\".*", r"", s);
+                s = re.sub(r".*SccLocalPath=\".*", r"", s);
+
+                # fix csproj link problem
+                if file_ext == "csproj":
+                    sample_name = os.path.basename(dirname)
+                    link_re = r"<Compile Include=\"\.\\(?P<file>.*)\">\n"
+                    link_re += r"\s*<Link>(?P=file)</Link>"
+                    compiled_re = re.compile(link_re, re.MULTILINE)
+                    s = compiled_re.sub("<Compile Include=\"\g<file>\">", s)
+
+                file.truncate()
+                file.write(s)
+                file.close()
+
+    def redist_openni(self):
+        """
+        Main Script.
+        """
+        self.init_logger(self.redist_name)
+        self.check_args(sys.argv)
+        self.init_vars()
+        self.init_vs_vars()
+        print (("\n*** Build target is:" + self.vc_build_bits + " Doxy:" + str(self.Make_Doxy) + " Rebuild:" + sys.argv[3] + " VC Version:" + str(self.VC_version) + " ***"))
+        self.init_win_sdk_vars()
+        self.init_version_vars()
+        self.print_message()
+        self.logger.info("PrimeSense OpenNI Redist Started")
+        self.build_project()
+        self.fixing_files()
+        
+        # set OpenNI environment variables to point to the redist folder (so that samples can compile correctly)
+        REDIST_DIR = os.path.join(self.WORK_DIR,"Platform","Win32","Redist")
+        os.environ['OPEN_NI_INCLUDE'] = REDIST_DIR + "\\Include"
+        os.environ['OPEN_NI_LIB'] = REDIST_DIR + "\\Lib"
+        os.environ['OPEN_NI_LIB64'] = REDIST_DIR + "\\Lib64"
+        self.build_samples()
+        self.update_installer_clr_policy()
+        [dev,redist] = self.make_installer(self.SCRIPT_DIR)
+        if not dev:
+            return 1
+        else:
+            if not redist:
+                return 1
+        self.clean_up()
+        return 0
+
+
+class UpdateInstallerCLRPolicy:
+    """
+    Covers up for missing parts in the installer
+    that are responsible for dotnet-publisher-policy stuff.
+    """
+    def __init__(self,inst_proj_full_path):
+        self.wxs_file = os.path.join(inst_proj_full_path,'OpenNI.wxs')
+    def is_missing(self, minor):
+        """
+        Returns [missing,broken] if this version is missing,
+        or broken if only one of the clauses exist.
+        """
+        #checks the WXS file if 2 patterns are found
+        #<Component Id="OpenNIPolicy1.%d"
+        #<ComponentRef Id="OpenNIPolicy1.%d"/>
+        comp_id_clause = False
+        rev_re = re.compile('<Component Id=\"OpenNIPolicy1\.%d\"'%minor)
+        all_lines = open(self.wxs_file).readlines()
+        re_res = rev_re.search(str(all_lines))
+        if re_res:
+            comp_id_clause = True
+        comp_ref_clause = False
+        comp_ref_str = '<ComponentRef Id=\"OpenNIPolicy1\.%d\"/>'%minor
+        rev_re = re.compile(comp_ref_str)
+        re_res = rev_re.search(str(all_lines))
+        if re_res:
+            comp_ref_clause = True
+        missing = not comp_ref_clause and not comp_id_clause
+        broken = (comp_id_clause and not comp_ref_clause) or (comp_ref_clause and not comp_id_clause)
+        return [missing,broken]
+    def add_policy_clauses(self,minor):
+        """
+        Adds the two clauses into the file.
+        """
+        comp_ref_str = '<ComponentRef Id=\"OpenNIPolicy1.%d\"/>'%minor
+        comp_ref_anchor = '<ComponentRef Id="OpenNINET"/>'
+        redist_base.regx_replace(comp_ref_anchor,'%s\n%s'%(comp_ref_anchor,comp_ref_str),self.wxs_file)
+
+        guid = uuid.uuid1()
+        comp_id_str = r'<Component Id="OpenNIPolicy1.%d" Guid="%s" DiskId="1">'%(minor,str(guid)) + '\n' + \
+        r'<File Id="OpenNIPolicy1.%d" Name="Policy.1.%d.OpenNI.Net.dll" Assembly=".net" KeyPath="yes" '%(minor,minor) +  \
+        r'Source="$(var.OpenNIFilesDir)\\bin$(var.PlatformSuffix)\Policy.1.%d.OpenNI.Net.dll" />'%(minor) + '\n' + \
+        r'<File Id="OpenNIPolicyConfig1.%d" Name="PublisherPolicy1.%d.config" KeyPath="no" '%(minor,minor) + \
+        r'Source="$(var.OpenNIFilesDir)\\bin$(var.PlatformSuffix)\PublisherPolicy1.%d.config" />'%(minor) + '\n' + \
+        r'</Component>'
+        comp_id_anchor = r'<Component Id="OpenNINET"'
+        redist_base.regx_replace(comp_id_anchor,'%s\n%s'%(comp_id_str,comp_id_anchor),self.wxs_file)
+
+if __name__ == "__main__":
+    redist = RedistOpenNI()
+    rc =  redist.redist_openni()
+    redist.finish_script(rc)
diff --git a/Platform/Win32/CreateRedist/UpdateVersion.py b/Platform/Win32/CreateRedist/UpdateVersion.py
index d911cb7..e2cf037 100644
--- a/Platform/Win32/CreateRedist/UpdateVersion.py
+++ b/Platform/Win32/CreateRedist/UpdateVersion.py
@@ -1,6 +1,6 @@
 #/***************************************************************************
 #*                                                                          *
-#*  OpenNI 1.1 Alpha                                                        *
+#*  OpenNI 1.x Alpha                                                        *
 #*  Copyright (C) 2011 PrimeSense Ltd.                                      *
 #*                                                                          *
 #*  This file is part of OpenNI.                                            *
@@ -23,109 +23,150 @@
 import sys
 import os
 import re
+from datetime import date
 
-# ----------------------- PARAMS -------------------------
 VERSION_MAJOR = 1
-VERSION_MINOR = 1
-VERSION_MAINTENANCE = 0
-VERSION_BUILD = 41
-
-strVersion = str(VERSION_MAJOR) + "." + str(VERSION_MINOR) + "." + str(VERSION_MAINTENANCE) + "." + str(VERSION_BUILD)
-
-# ---------------------- FUNCTIONS -----------------------
-def regx_replace(findStr,repStr,filePath):
-	"replaces all findStr by repStr in file filePath using regualr expression"
-	findStrRegx = re.compile(findStr)
-	tempName=filePath+'~~~'
-	os.system("attrib -r " + filePath)
-	input = open(filePath)
-	output = open(tempName,'w')
-	for s in input:
-		output.write(findStrRegx.sub(repStr,s))
-	output.close()
-	input.close()
-	os.remove(filePath)
-	os.rename(tempName,filePath)
-
-def update_self_defs (filePath):
-	print "Updating self version defines: " + filePath
-	regx_replace("VERSION_MAJOR = \d+\n", "VERSION_MAJOR = " + str(VERSION_MAJOR) + "\n", filePath)
-	regx_replace("VERSION_MINOR = \d+\n", "VERSION_MINOR = " + str(VERSION_MINOR) + "\n", filePath)
-	regx_replace("VERSION_MAINTENANCE = \d+\n", "VERSION_MAINTENANCE = " + str(VERSION_MAINTENANCE) + "\n", filePath)	
-	regx_replace("VERSION_BUILD = \d+\n", "VERSION_BUILD = " + str(VERSION_BUILD) + "\n", filePath)
-
-def update_src_ver_defs (filePath):
-	print "Updating source version defines: " + filePath
-	regx_replace("#define XN_MAJOR_VERSION (.*)", "#define XN_MAJOR_VERSION " + str(VERSION_MAJOR), filePath)
-	regx_replace("#define XN_MINOR_VERSION (.*)", "#define XN_MINOR_VERSION " + str(VERSION_MINOR), filePath)
-	regx_replace("#define XN_MAINTENANCE_VERSION (.*)", "#define XN_MAINTENANCE_VERSION " + str(VERSION_MAINTENANCE), filePath)	
-	regx_replace("#define XN_BUILD_VERSION (.*)", "#define XN_BUILD_VERSION " + str(VERSION_BUILD), filePath)
-
-def update_redist_defs (filePath):
-	print "Updating RedistMaker version defines: " + filePath
-	regx_replace("set MAJOR_VERSION=(.*)", "set MAJOR_VERSION=" + str(VERSION_MAJOR), filePath)
-	regx_replace("set MINOR_VERSION=(.*)", "set MINOR_VERSION=" + str(VERSION_MINOR), filePath)
-	regx_replace("set MAINTENANCE_VERSION=(.*)", "set MAINTENANCE_VERSION=" + str(VERSION_MAINTENANCE), filePath)	
-	regx_replace("set BUILD_VERSION=(.*)", "set BUILD_VERSION=" + str(VERSION_BUILD), filePath)
-
-def update_redist_eng_defs (filePath):
-	print "Updating Redist Engine version defines: " + filePath
-	regx_replace("  <VERSION_NUMBER>(\d+).(\d+).(\d+)</VERSION_NUMBER>", "  <VERSION_NUMBER>" + str(VERSION_MAJOR) + "." + str(VERSION_MINOR) + "." + str(VERSION_MAINTENANCE) + "</VERSION_NUMBER>", filePath)
-	
-def update_assembly_info (filePath):
-	print "Updating assembly info: " + filePath
-	regx_replace(r"^\[assembly: AssemblyVersion\(\"(.*)\"\)\]", "[assembly: AssemblyVersion(\"" + str(VERSION_MAJOR) + "." + str(VERSION_MINOR) + "." + str(VERSION_MAINTENANCE) + "." + str(VERSION_BUILD) + "\")]", filePath)
-	regx_replace(r"^\[assembly: AssemblyFileVersion\(\"(.*)\"\)\]", "[assembly: AssemblyFileVersion(\"" + str(VERSION_MAJOR) + "." + str(VERSION_MINOR) + "." + str(VERSION_MAINTENANCE) + "." + str(VERSION_BUILD) + "\")]", filePath)
-
-def update_wix (filePath):
-	print "Updating wix: " + filePath
-	regx_replace("define MajorVersion=(.*)", "define MajorVersion=" + str(VERSION_MAJOR) + "?>", filePath)
-	regx_replace("define MinorVersion=(.*)", "define MinorVersion=" + str(VERSION_MINOR) + "?>", filePath)
-	regx_replace("define MaintenanceVersion=(.*)", "define MaintenanceVersion=" + str(VERSION_MAINTENANCE) + "?>", filePath)
-	regx_replace("define BuildVersion=(.*)", "define BuildVersion=" + str(VERSION_BUILD) + "?>", filePath)
-		
-def update_publisher_policy (filePath):
-	print "Updating publisher policy: " + filePath
-	regx_replace("oldVersion=\"1.1.0.31 - (.*)\"", "oldVersion=\"1.1.0.31 - " + strVersion + "\"", filePath)
-	regx_replace("newVersion=\"(.*)\"", "newVersion=\"" + strVersion + "\"", filePath)
-		
-# ----------------------- MAIN -------------------------
-if len(sys.argv) == 5:
-	VERSION_MAJOR=int(sys.argv[1])
-	VERSION_MINOR=int(sys.argv[2])
-	VERSION_MAINTENANCE=int(sys.argv[3])	
-	VERSION_BUILD=int(sys.argv[4])
-
-if (VERSION_MAJOR > 9):
-	print "Illegal major version"
-	sys.exit()
-
-if (VERSION_MINOR > 99):
-	print "Illegal minor version"
-	sys.exit()
-
-if (VERSION_MAINTENANCE > 99):
-	print "Illegal maintenance version"
-	sys.exit()
-	
-if (VERSION_BUILD > 9999):
-	print "Illegal build version"
-	sys.exit()
-
-print "Going to update files to version: %d.%d.%d.%d" % (VERSION_MAJOR, VERSION_MINOR, VERSION_MAINTENANCE, VERSION_BUILD)
-
-update_self_defs("./UpdateVersion.py")
-update_redist_defs("./RedistMaker.bat")
-update_redist_eng_defs("./OpenNi_Config.xml")
-update_src_ver_defs("../../../Include/XnVersion.h")
-update_assembly_info("../Build/Res/AssemblyInfo-OpenNI.cs")
-update_assembly_info("../../Linux-x86/Build/Res/AssemblyInfo-OpenNI.cs")
-update_wix("../Install/OpenNI/Includes/OpenNIVariables.wxi")
-update_publisher_policy("../../../Wrappers/OpenNI.Net/PublisherPolicy.config")
-
-try:
-	update_redist_defs("../../../ExportOpenSource.bat")
-except:
-	print "Skipping the export script..."
- 
-print "\n*** Done ***"
+VERSION_MINOR = 5
+VERSION_MAINTENANCE = 2
+VERSION_BUILD = 23
+
+class UpdateVersion:
+    def main(self):
+        self.version_major = VERSION_MAJOR
+        self.version_minor = VERSION_MINOR
+        self.version_maintenance = VERSION_MAINTENANCE
+        self.version_build = VERSION_BUILD
+        # ----------------------- MAIN -------------------------
+        if len(sys.argv) == 5:
+            self.version_major=int(sys.argv[1])
+            self.version_minor=int(sys.argv[2])
+            self.version_maintenance=int(sys.argv[3])
+            self.version_build=int(sys.argv[4])
+
+        if (self.version_major > 9):
+            print( "Illegal major version")
+            sys.exit()
+
+        if (self.version_minor > 99):
+            print ("Illegal minor version")
+            sys.exit()
+
+        if (self.version_maintenance > 99):
+            print ("Illegal maintenance version")
+            sys.exit()
+
+        if (self.version_build > 9999):
+            print ("Illegal build version")
+            sys.exit()
+
+        self.strVersion = str(self.version_major) + "." + str(self.version_minor) + "." + str(self.version_maintenance) + "." + str(self.version_build)
+
+        print (("Going to update files to version: %d.%d.%d.%d" % (self.version_major, self.version_minor, self.version_maintenance, self.version_build)))
+
+        self.update_self_defs("./UpdateVersion.py")
+        self.update_redist_defs("./RedistMaker.bat")
+        self.update_redist_script("./Redist_OpenNI.py")
+        self.update_redist_eng_defs("./OpenNi_Config.xml")
+        self.update_src_ver_defs("../../../Include/XnVersion.h")
+        self.update_assembly_info("../Build/Res/AssemblyInfo-OpenNI.cs")
+        self.update_assembly_info("../../Linux/Build/Res/AssemblyInfo-OpenNI.cs")
+        self.update_wix("../Install/OpenNI/Includes/OpenNIVariables.wxi")
+        self.update_publisher_policy("../../../Wrappers/OpenNI.Net/PublisherPolicy.config")
+        self.update_doxygen("../../../Source/DoxyGen/Doxyfile")
+        self.update_release_notes("../../../Platform/Win32/Build/ReleaseNotes.txt")
+
+        try:
+            self.update_redist_defs("../../../ExportOpenSource.bat")
+        except:
+            print ("Skipping the export script...")
+
+        print ("\n*** Done ***")
+    def regx_replace(self,findStr,repStr,filePath):
+        "replaces all findStr by repStr in file filePath using regualr expression"
+        findStrRegx = re.compile(findStr)
+        tempName=filePath+'~~~'
+        os.system("attrib -r " + filePath)
+        input = open(filePath)
+        output = open(tempName,'w')
+        for s in input:
+            output.write(findStrRegx.sub(repStr,s))
+        output.close()
+        input.close()
+        os.remove(filePath)
+        os.rename(tempName,filePath)
+
+    def update_self_defs (self,filePath):
+        print(( "Updating self version defines: " + filePath))
+        self.regx_replace("VERSION_MAJOR = \d+\n", "VERSION_MAJOR = " + str(self.version_major) + "\n", filePath)
+        self.regx_replace("VERSION_MINOR = \d+\n", "VERSION_MINOR = " + str(self.version_minor) + "\n", filePath)
+        self.regx_replace("VERSION_MAINTENANCE = \d+\n", "VERSION_MAINTENANCE = " + str(self.version_maintenance) + "\n", filePath)
+        self.regx_replace("VERSION_BUILD = \d+\n", "VERSION_BUILD = " + str(self.version_build) + "\n", filePath)
+
+    def update_src_ver_defs (self,filePath):
+        print(( "Updating source version defines: " + filePath))
+        self.regx_replace("#define XN_MAJOR_VERSION (.*)", "#define XN_MAJOR_VERSION " + str(self.version_major), filePath)
+        self.regx_replace("#define XN_MINOR_VERSION (.*)", "#define XN_MINOR_VERSION " + str(self.version_minor), filePath)
+        self.regx_replace("#define XN_MAINTENANCE_VERSION (.*)", "#define XN_MAINTENANCE_VERSION " + str(self.version_maintenance), filePath)
+        self.regx_replace("#define XN_BUILD_VERSION (.*)", "#define XN_BUILD_VERSION " + str(self.version_build), filePath)
+
+    def update_redist_defs (self,filePath):
+        print(( "Updating RedistMaker version defines: " + filePath))
+        self.regx_replace("set MAJOR_VERSION=(.*)", "set MAJOR_VERSION=" + str(self.version_major), filePath)
+        self.regx_replace("set MINOR_VERSION=(.*)", "set MINOR_VERSION=" + str(self.version_minor), filePath)
+        self.regx_replace("set MAINTENANCE_VERSION=(.*)", "set MAINTENANCE_VERSION=" + str(self.version_maintenance), filePath)
+        self.regx_replace("set BUILD_VERSION=(.*)", "set BUILD_VERSION=" + str(self.version_build), filePath)
+
+    def update_redist_script (self,filePath):
+        print(("Updating Redist script version defines: " + filePath))
+        self.regx_replace("set MAJOR_VERSION=(.*)", "set MAJOR_VERSION=" + str(self.version_major), filePath)
+        self.regx_replace("set MINOR_VERSION=(.*)", "set MINOR_VERSION=" + str(self.version_minor), filePath)
+        self.regx_replace("set MAINTENANCE_VERSION=(.*)", "set MAINTENANCE_VERSION=" + str(self.version_maintenance), filePath)
+        self.regx_replace("set BUILD_VERSION=(.*)", "set BUILD_VERSION=" + str(self.version_build), filePath)
+
+    def update_redist_eng_defs (self,filePath):
+        print (("Updating Redist Engine version defines: " + filePath))
+        self.regx_replace("  <VERSION_NUMBER>(\d+).(\d+).(\d+)</VERSION_NUMBER>", "  <VERSION_NUMBER>" + str(self.version_major) + "." + str(self.version_minor) + "." + str(self.version_maintenance) + "</VERSION_NUMBER>", filePath)
+
+    def update_assembly_info (self,filePath):
+        print (("Updating assembly info: " + filePath))
+        self.regx_replace(r"^\[assembly: AssemblyVersion\(\"(.*)\"\)\]", "[assembly: AssemblyVersion(\"" + str(self.version_major) + "." + str(self.version_minor) + "." + str(self.version_maintenance) + "." + str(self.version_build) + "\")]", filePath)
+        self.regx_replace(r"^\[assembly: AssemblyFileVersion\(\"(.*)\"\)\]", "[assembly: AssemblyFileVersion(\"" + str(self.version_major) + "." + str(self.version_minor) + "." + str(self.version_maintenance) + "." + str(self.version_build) + "\")]", filePath)
+
+    def update_wix (self,filePath):
+        print (("Updating wix: " + filePath))
+        self.regx_replace("define MajorVersion=(.*)", "define MajorVersion=" + str(self.version_major) + "?>", filePath)
+        self.regx_replace("define MinorVersion=(.*)", "define MinorVersion=" + str(self.version_minor) + "?>", filePath)
+        self.regx_replace("define MaintenanceVersion=(.*)", "define MaintenanceVersion=" + str(self.version_maintenance) + "?>", filePath)
+        self.regx_replace("define BuildVersion=(.*)", "define BuildVersion=" + str(self.version_build) + "?>", filePath)
+
+    def update_publisher_policy (self,filePath):
+        print(( "Updating publisher policy: " + filePath))
+        self.regx_replace("oldVersion=\"1.1.0.31 - (.*)\"", "oldVersion=\"1.1.0.31 - " + self.strVersion + "\"", filePath)
+        self.regx_replace("newVersion=\"(.*)\"", "newVersion=\"" + self.strVersion + "\"", filePath)
+
+    def update_doxygen (self,filePath):
+        print (("Updating doxygen: " + filePath))
+        self.regx_replace("PROJECT_NAME\s*=\s*\"OpenNI (\d+)\.(\d+)\.(\d+)\"", "PROJECT_NAME = \"OpenNI " + str(self.version_major) + "." + str(self.version_minor) + "." + str(self.version_maintenance) + "\"", filePath)
+
+    def update_release_notes (self,filePath):
+        print (("Updating release notes: " + filePath))
+
+        tempName = filePath + '~~~'
+        os.system("attrib -r " + filePath)
+        input = open(filePath)
+        output = open(tempName, 'w')
+        lines = input.readlines()
+        input.close()
+        today = date.today()
+
+        lines[0] = 'OpenNI ' + str(self.version_major) + '.' + str(self.version_minor) + '.' + str(self.version_maintenance) + ' Build ' + str(self.version_build) + '\n'
+        lines[1] = today.strftime('%B ') + str(today.day) + ' ' + str(today.year) + '\n'
+        
+        for s in lines:
+            output.write(s)
+        output.close()
+        os.remove(filePath)
+        os.rename(tempName,filePath)        
+        
+if __name__ == '__main__':
+    UpdateVersion().main()
diff --git a/Platform/Win32/Install/Output/dummy b/Platform/Win32/CreateRedist/__init__.py
similarity index 100%
copy from Platform/Win32/Install/Output/dummy
copy to Platform/Win32/CreateRedist/__init__.py
diff --git a/Platform/Win32/CreateRedist/common/CopyToRepository.py b/Platform/Win32/CreateRedist/common/CopyToRepository.py
new file mode 100644
index 0000000..2c39d0d
--- /dev/null
+++ b/Platform/Win32/CreateRedist/common/CopyToRepository.py
@@ -0,0 +1,78 @@
+import os
+import sys
+import re
+import time
+import traceback
+
+packageFullPath = "..\..\..\..\..\PrimeSenseVersions.nsh"
+
+def find_package_number(findStr, text):
+    for line in text:
+        temp = re.search(findStr, line)
+        if temp != None:
+            packageNumber = temp.group(1)
+            return packageNumber
+
+def copy_files_to_repository(SourcePath,RepositoryPath, BuildDate, PackageVersion, Bits, ProjectName,
+                             Major_version, Minor_version, Maintenance_version, Build_version):
+    fullVersion = Major_version + "." + Minor_version + "." + Maintenance_version + "." + Build_version
+    destPath = os.path.join(RepositoryPath, BuildDate + "__" + PackageVersion, "Win" + Bits,
+                            ProjectName + "-" + fullVersion)
+    os.system("rmdir /S /q " + destPath)
+    os.system("mkdir " + destPath)
+    os.system("xcopy /E /I " + SourcePath + " " + destPath)
+
+def copy_zip_to_repository(SourcePath,RepositoryPath, BuildDate, PackageVersion, Bits, ProjectName,
+                             Major_version, Minor_version, Maintenance_version, Build_version):
+    fullVersion = Major_version + "." + Minor_version + "." + Maintenance_version + "." + Build_version
+    destPath = os.path.join(RepositoryPath, BuildDate + "__" + PackageVersion, "Win" + Bits,
+                            ProjectName + "-" + fullVersion)
+    os.system("rmdir /S /q " + destPath)
+    os.system("mkdir " + destPath)
+    os.system("xcopy /I " + SourcePath + " " + destPath)
+
+def open_package_file(path):
+    files = open(path).readlines()
+    packageNumber = find_package_number("!define PACKAGE_VER\s+\"(\S+)\"", files)
+    return packageNumber
+
+if __name__ == "__main__":
+    try:
+        if len(sys.argv) != 10:
+            print (("Usage: copyToRepository.py <FinalPath> <RepositoryPath> <BuildDate> <bits> " \
+            + "<ProjectName> <Major_version> <Minor_version> <Maintenance_version> <Build_version>"))
+            sys.exit(1)
+
+        finalPath = sys.argv[1]
+        repositoryPath = sys.argv[2]
+        buildDate = sys.argv[3]
+        bits = sys.argv[4]
+        projectName = sys.argv[5]
+        major_version = sys.argv[6]
+        minor_version = sys.argv[7]
+        maintenance_version = sys.argv[8]
+        build_version = sys.argv[9]
+
+        packageNumber = ''
+        if not(os.path.exists(packageFullPath)):
+            # Redist of OpenNI openSource
+            packageFullPath = "..\..\..\..\..\..\PrimeSenseVersions.nsh"
+            packageNumber = open_package_file(packageFullPath)
+            if packageNumber == '':
+                sys.exit(1)
+            copy_zip_to_repository("..\..\..\..\*.zip",repositoryPath, buildDate, packageNumber, bits,
+                                 projectName, major_version, minor_version, maintenance_version, build_version)
+        else:
+            # Redist of OpenNI
+            packageNumber = open_package_file(packageFullPath)
+            if packageNumber == '':
+                sys.exit(1)
+            copy_files_to_repository(finalPath,repositoryPath, buildDate, packageNumber, bits,
+                                 projectName, major_version, minor_version, maintenance_version, build_version)
+
+        sys.exit(0)
+    except SystemExit as e:
+        sys.exit(e)
+    except:
+        print ((traceback.print_exc()))
+        sys.exit(1)
diff --git a/Platform/Win32/Install/Output/dummy b/Platform/Win32/CreateRedist/common/__init__.py
similarity index 100%
copy from Platform/Win32/Install/Output/dummy
copy to Platform/Win32/CreateRedist/common/__init__.py
diff --git a/Platform/Win32/CreateRedist/common/redist_base.py b/Platform/Win32/CreateRedist/common/redist_base.py
new file mode 100644
index 0000000..3389ce9
--- /dev/null
+++ b/Platform/Win32/CreateRedist/common/redist_base.py
@@ -0,0 +1,862 @@
+#/****************************************************************************
+#*      THIS file should be DUPLICATED IN BOTH                               *
+#*      Engine\Platform\Win32\CreateRedist                                   *
+#*  AND OpenNI\Platform\Win32\CreateRedist                                   *
+#*                                                                           *
+#****************************************************************************/
+
+#/****************************************************************************
+#*                                                                           *
+#*  PrimeSense OpenNI & Sensor                                               *
+#*  Copyright (C) 2010 PrimeSense Ltd.                                       *
+#*                                                                           *
+#*  This file is part of PrimeSense Common.                                  *
+#*                                                                           *
+#*  PrimeSense OpenNI & Sensor are free software: you can redistribute       *
+#*  it and/or modify                                                         *
+#*  it under the terms of the GNU Lesser General Public License as published *
+#*  by the Free Software Foundation, either version 3 of the License, or     *
+#*  (at your option) any later version.                                      *
+#*                                                                           *
+#*  PrimeSense OpenNI & Sensor are distributed in the hope that they will    *
+#*  be useful,                                                               *
+#*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+#*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+#*  GNU Lesser General Public License for more details.                      *
+#*                                                                           *
+#*  You should have received a copy of the GNU Lesser General Public License *
+#*  along with PrimeSense OpenNI & Sensor.                                   *
+#*  If not, see <http://www.gnu.org/licenses/>.                              *
+#*                                                                           *
+#****************************************************************************/
+
+#-------------Imports----------------------------------------------------------#
+from xml.dom.minidom import parse, parseString
+import win32con,pywintypes,win32api
+from time import strftime
+import logging
+import glob
+import os
+import re
+import sys
+import subprocess
+import shutil
+import stat
+import threading
+
+#-------------Functions--------------------------------------------------------#
+
+def is_64_bit_platform():
+    result = False
+    import platform
+    (bits,linkage) = platform.architecture()
+    matchObject = re.search('64',bits)
+    result = matchObject is not None
+    return result
+
+def write_dependencides(sln_file, all_samples,sample):
+    sln_file.write("\tProjectSection(ProjectDependencies) = postProject\n")
+    for depend in sample.dependencies:
+        sln_file.write("\t\t" + all_samples[depend].project_guid + " = " + all_samples[depend].project_guid + "\n")
+    sln_file.write("\tEndProjectSection\n")
+
+def remove_readonly(path):
+    for root, dirs, files in os.walk(path):
+        for fname in files:
+            full_path = os.path.join(root, fname)
+            os.chmod(full_path ,stat.S_IWRITE)
+
+def regx_replace(findStr,repStr,filePath):
+    "replaces all findStr by repStr in file filePath using regualr expression"
+    findStrRegx = re.compile(findStr)
+    tempName=filePath+'~~~'
+    input = open(filePath)
+    output = open(tempName,'w')
+    for s in input:
+        output.write(findStrRegx.sub(repStr,s))
+    output.close()
+    input.close()
+    os.remove(filePath)
+    os.rename(tempName,filePath)
+
+def get_reg_values(reg_key, value_list):
+    # open the reg key
+    try:
+        reg_key = win32api.RegOpenKeyEx(*reg_key)
+    except pywintypes.error as e:
+        raise Exception("Failed to open registry key!")
+    # Get the values
+    try:
+        values = [(win32api.RegQueryValueEx(reg_key, name), data_type) for name, data_type in value_list]
+        # values list of ((value, type), expected_type)
+        for (value, data_type), expected in values:
+            if data_type != expected:
+                raise Exception("Bad registry value type! Expected %d, got %d instead." % (expected, data_type))
+        # values okay, leave only values
+        values = [value for ((value, data_type), expected) in values]
+    except pywintypes.error as e:
+        raise Exception("Failed to get registry value!")
+    finally:
+        try:
+            win32api.RegCloseKey(reg_key)
+        except pywintypes.error as e:
+            # We don't care if reg key close failed...
+            pass
+    return tuple(values)
+
+#-------------Classes----------------------------------------------------------#
+class SampleData(object):
+    def __init__(self):
+        self.name = ''
+        self.project_dir = ''
+        self.source_dir = ''
+        self.project_guid = ''
+        self.project_file = ''
+        self.is_net = False
+        self.is_other = False
+        self.project_name = ''
+        self.redist_dir = ''
+        self.dependencies = []
+
+    def print_():
+        print((self.name))
+
+    def __str__(self):
+        return self.name
+
+    def __eval__(self):
+        return self.name
+
+class RedistBase(object):
+    def __init__(self):
+        self.SCRIPT_DIR = ''
+        self.VC_version = 0
+        self.vc_build_bits = ""
+        self.output_dir = ""
+        self.final_dir = ""
+        self.config_xml_filename = ""
+        self.redist_name = ""
+        self.redist_internal_name = ''
+        self.product_name = ''
+        self.doxy_file_name = ""
+        self.write_2010_sample_dependency = False
+        self.all_samples = None
+        self.internal_conf_name = ''
+        self.TIMEOUT_UPGRADE_VS10_SEC = 180
+
+    def finish_script(self,exit_code):
+        os.chdir(self.SCRIPT_DIR)
+        #logging.shutdown()
+        exit(exit_code)
+
+    def check_args(self,args):
+        """
+        Parse cmdline args; along them are doxy,bitness,VC.
+        """
+        if len(sys.argv) not in [4,5]:
+            print ("Args: <Doxygen:y/n> <BuildTarget:32/64> <FullRebuild:y/n> [<VCVersion:9/10>]")
+            exit(1)
+        if sys.argv[1] == 'y' or sys.argv[1] == 'Yes':
+            self.Make_Doxy=1
+        elif sys.argv[1] == 'n' or sys.argv[1] == 'No':
+            self.Make_Doxy=0
+        else:
+            print("Args: <Doxygen:y/n> <BuildTarget:32/64> <FullRebuild:y/n>")
+            print("Doxygen param must be y or n!")
+            exit(1)
+
+        if sys.argv[2] == '32':
+            self.vc_build_bits = "32"
+        elif sys.argv[2] == '64':
+            self.vc_build_bits = "64"
+        else:
+            print("Args: <Doxygen:y/n> <BuildTarget:32/64> <FullRebuild:y/n>")
+            print("BuildTarget param must be 32 or 64!")
+            exit(1)
+
+        if sys.argv[3] == 'y' or sys.argv[3] == 'Yes':
+            self.vc_build_type = "/Rebuild"
+        elif sys.argv[3] == 'n' or sys.argv[3] == 'No':
+            self.vc_build_type = "/Build"
+        else:
+            print("Args: <Doxygen:y/n> <BuildTarget:32/64> <FullRebuild:y/n>")
+            print("FullRebuild param must be y or n!")
+            exit(1)
+
+        self.VC_version = 9
+        if len(sys.argv) > 4:
+            if sys.argv[4] == '10':
+                self.VC_version = 10
+
+    def init_vs_vars(self):
+        """
+        Checks for the availablity of Visual Studio to compile with.
+        Currently supports VS2008 (vc9) and VS2010(vc10).
+        If 64-bit platform, registry key under Software/Wow6432Node/...
+        """
+        self.VS_NEED_UPGRADE = 0
+        try:
+            if self.is_64_bit_platform:
+                MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0")
+            else:
+                MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\9.0")
+            MSVC_VALUES = [("InstallDir", win32con.REG_SZ)]
+            self.VS_INST_DIR = get_reg_values(MSVC_KEY, MSVC_VALUES)[0]
+        except Exception as e:
+            self.VC_version = 10
+        if self.VC_version == 10:
+            self.VS_NEED_UPGRADE = 1
+            if self.is_64_bit_platform:
+                MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0")
+            else:
+                MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\10.0")
+            MSVC_VALUES = [("InstallDir", win32con.REG_SZ)]
+            self.VS_INST_DIR = get_reg_values(MSVC_KEY, MSVC_VALUES)[0]
+
+    def init_vars(self):
+        """
+        Initializae misc variables.
+        Among them: is_64_bit_platform
+        """
+        self.inst_proj_path = 'Platform\\Win32\\Install\\%s\\'%self.redist_internal_name
+        self.is_64_bit_platform = is_64_bit_platform()
+        self.DateTimeSTR = strftime("%Y-%m-%d %H:%M:%S")
+        DateSTR = strftime("%Y-%m-%d")
+        CONFIG_XML = parse(self.config_xml_filename)
+        self.WORK_DIR = str(CONFIG_XML.getElementsByTagName("WORK_DIR")[0].firstChild.data)
+        # Fix to allow reletive path
+        os.chdir(self.WORK_DIR)
+        self.WORK_DIR = os.getcwd() + "\\"
+        os.chdir(self.SCRIPT_DIR)
+        self.VER = str(CONFIG_XML.getElementsByTagName("VERSION_NUMBER")[0].firstChild.data)
+        PLATFORM = str(CONFIG_XML.getElementsByTagName("PLATFORM")[0].firstChild.data)
+        self.PROJECT_SLN = str(CONFIG_XML.getElementsByTagName("PROJECT_SLN")[0].firstChild.data)
+        self.SAMPLES_SLN = str(CONFIG_XML.getElementsByTagName("SAMPLES_SLN")[0].firstChild.data)
+        self.PROJECT_NAME = str(CONFIG_XML.getElementsByTagName("PROJECT")[0].firstChild.data)
+        self.BUILD_DIR = os.path.join(self.WORK_DIR, "Platform", "Win32", "Build")
+
+        ver_regx = re.compile("SDK \d.*\s")
+        global samples_proj_list
+        global samples_guid_list
+        global samples_guid_list_net
+        samples_proj_list = []
+        samples_guid_list = []
+        samples_guid_list_net = []
+
+        if self.vc_build_bits=="32":
+            self.bin_dir = "Bin"
+            self.lib_dir = "Lib"
+            self.vc_build_platform = "Win32"
+            self.output_dir = "Output32"
+            self.final_dir = "Final32"
+        else:
+            self.bin_dir = "Bin64"
+            self.lib_dir = "Lib64"
+            self.vc_build_platform = "x64"
+            self.output_dir = "Output64"
+            self.final_dir = "Final64"
+
+    def init_logger(self,name):
+        """
+        Initilizes the logger.
+        """
+        #-------------Log--------------------------------------------------------------#
+        out_path = os.path.join(self.SCRIPT_DIR,self.output_dir)
+        if not(os.path.exists(out_path)):
+            os.mkdir(out_path)
+        self.logger = logging.getLogger(name)
+        hdlr = logging.FileHandler(os.path.join(self.output_dir, '%s_redist_maker.log'%name))
+        formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
+        hdlr.setFormatter(formatter)
+        self.logger.addHandler(hdlr)
+        self.logger.setLevel(logging.INFO)
+
+    def print_message(self):
+        """
+        TO DO: fix that function in Redist_OpenNi to resemble this (better) version.
+        """
+        #------------Welcome Messege--------=------------------------------------------#
+        print("\n");
+        print("*********************************")
+        print(("*   PrimeSense " + self.redist_name +  " Redist    *"))
+        print(("*     " + self.DateTimeSTR + "       *"))
+        print("*********************************")
+
+    def build_proj_solution(self):
+        #--------------Build Project---------------------------------------------------#
+        print(("* Building " + self.PROJECT_NAME + "..."))
+        path2output = os.path.join(self.SCRIPT_DIR,self.output_dir)
+        if not os.path.exists(path2output):
+            os.makedirs(path2output)
+        path2final = os.path.join(self.SCRIPT_DIR,self.final_dir)
+        if not os.path.exists(path2final):
+            os.makedirs(path2final)
+
+        self.logger.info(("Building " + self.PROJECT_NAME + "..."))
+        # Set Intel Env
+        os.system("set INTEL_LICENSE_FILE=C:\\Program Files\\Common Files\\Intel\\Licenses")
+        # Build project solution
+        os.chdir(self.WORK_DIR + self.PROJECT_SLN.rpartition("\\")[0])
+        print((os.getcwd()))
+
+        out_file = os.path.join(self.SCRIPT_DIR, self.output_dir, "Build"+self.PROJECT_NAME+".txt")
+        upg_out_file = os.path.join(self.SCRIPT_DIR, self.output_dir, "Build"+self.PROJECT_NAME+"UPG"+".txt")
+        if self.VS_NEED_UPGRADE == 1:
+            os.system("attrib -r * /s")
+            devenv_upg_cmd_str = "\""+self.VS_INST_DIR + "devenv\" " + self.PROJECT_SLN.rpartition("\\")[2]+\
+                         " /upgrade > " + upg_out_file
+            print(('upgrading. out put in %s'%out_file))
+            print(('command is %s'%devenv_upg_cmd_str))
+            my_rc = os.system(devenv_upg_cmd_str)
+            print(('upgrading finished w result %d'%my_rc))
+            #devenv_upg_cmd = Command(devenv_upg_cmd_str)
+            #devenv_upg_cmd.run(self.TIMEOUT_UPGRADE_VS10_SEC)
+
+        devenv_cmd = '\"'+self.VS_INST_DIR + 'devenv\" ' + self.PROJECT_SLN.rpartition("\\")[2]+\
+                     " " + self.vc_build_type + " \"release|" + self.vc_build_platform + "\" /out " + \
+                     out_file
+        self.logger.debug('Calling vs : %s'%devenv_cmd)
+        rc = subprocess.call(devenv_cmd, close_fds=True)
+        self.logger.debug('Calling vs, RC: %d'%rc)
+        # Get the build output
+        lines = open(out_file).readlines()
+        build_result = lines[-2]
+        print(build_result)
+        self.logger.info(build_result)
+        # Check for failed build
+        failed_builds = 0
+        fail_to_open = 0
+
+        temp = re.search("(\d*) failed",build_result)
+        if temp != None :
+            failed_builds = int(temp.group(1))
+
+        temp2 = re.search('cannot be opened',str(lines))
+        if temp2 != None :
+            fail_to_open = 1
+
+        if failed_builds != 0 or fail_to_open !=0:
+            print("Building Failed!!")
+            self.logger.critical("Building Failed!")
+            self.finish_script(1)
+
+        # return to work dir
+        os.chdir(self.WORK_DIR)
+
+    def make_doxy(self):
+        """
+        Make Doxy.
+        """
+        if self.Make_Doxy==1:
+            print("* Creating Doxygen...")
+            self.logger.info("Creating Doxygen...")
+            os.chdir(os.path.join(self.WORK_DIR,"Source\\Doxygen"));
+            # Replacing version number in the doxygen setup file
+            res = os.system("attrib -r " + self.doxy_file_name)
+            print(('removing readonly attribute for Doxyfile: ' + str(res)))
+            regx_replace(self.redist_name + " \d*.\d*.\d*\s",self.PROJECT_NAME +" " + self.VER + " ",self.doxy_file_name)
+            if os.path.exists(self.WORK_DIR + "\\Source\\Doxygen\\html\\"):
+                os.system("rmdir /S /Q html")
+            # Running doxygen
+            os.system("mkdir html > null")
+            #os.system("copy PSSmallLogo.jpg html > null") // where is this file ?
+            doxy_out_file = os.path.join(self.SCRIPT_DIR,self.output_dir,self.PROJECT_NAME + "Doxy.txt")
+            doxygen_cmd = "doxygen.exe %s > " % (self.doxy_file_name) + doxy_out_file
+            os.system(doxygen_cmd)
+            self.copy_doxy_files()
+            os.chdir(self.WORK_DIR)
+        else:
+            print("Skipping Doxygen...")
+
+    def create_redist_dir(self):
+        """
+        Creates directory structure for Redist.
+        """
+        #-------------Create Redist Dir------------------------------------------------#
+        print("* Creating Redist Dir...")
+        self.logger.info("Creating Redist Dir...")
+        os.chdir(os.path.join(self.WORK_DIR,"Platform","Win32"))
+        # Removing the old directory
+        os.system("rmdir /S /Q Redist")
+        # Creating new directory tree
+        os.system("mkdir Redist")
+        os.system("mkdir Redist\\" + self.bin_dir)
+        os.system("mkdir Redist\\" + self.lib_dir)
+        os.system("mkdir Redist\\Include")
+        os.system("mkdir Redist\\Documentation")
+        os.system("mkdir Redist\\Samples")
+        os.system("mkdir Redist\\Samples\\" + self.bin_dir)
+        os.system("mkdir Redist\\Samples\\" + self.bin_dir + "\\Debug")
+        os.system("mkdir Redist\\Samples\\" + self.bin_dir + "\\Release")
+        os.system("mkdir Redist\\Samples\\Build")
+        os.system("mkdir Redist\\Samples\\Res")
+        os.system("mkdir Redist\\Data")
+        os.chdir(self.WORK_DIR)
+
+    def find_samples(self):
+        # returns a dictionary of all samples
+        all_samples = dict()
+        os.chdir(self.WORK_DIR)
+        samples_list = os.listdir(os.path.join(self.BUILD_DIR,"Samples"))
+        if '.svn' in samples_list:
+            samples_list.remove('.svn')
+        for sample in samples_list:
+            sample_data = SampleData()
+            sample_data.name = sample
+            sample_data.source_dir = os.path.join(self.WORK_DIR, "Samples", sample)
+            sample_data.project_dir = os.path.join(self.BUILD_DIR, "Samples", sample)
+            sample_data.is_other = False;
+
+            vc_proj_name = sample_data.project_dir + "\\" + sample + ".vcproj"
+            cs_proj_name = sample_data.project_dir + "\\" + sample + ".csproj"
+            other_proj_name = os.path.join(sample_data.project_dir, "Build.bat")
+
+            # check if this is a VC project
+            if os.path.exists(vc_proj_name):
+                sample_data.project_file = vc_proj_name
+
+                # open it
+                prj = open(vc_proj_name, 'r')
+                lines = prj.readlines()
+                for line in lines:
+                    # Search for name
+                    if sample_data.project_name == "":
+                        ProjNametmp = re.search(r"Name=\"(.*)\"",line)
+                        if (ProjNametmp != None):
+                            sample_data.project_name = ProjNametmp.group(1)
+
+                    # Search for GUID
+                    if sample_data.project_guid == "":
+                        ProjGUIDtmp = re.search(r"ProjectGUID=\"(.*)\"",line)
+                        if (ProjGUIDtmp != None):
+                            sample_data.project_guid = ProjGUIDtmp.group(1)
+
+                    ProjNametmp = re.search(r"<AssemblyName>(.*)</AssemblyName>",line)
+                    if (ProjNametmp!=None):
+                        if (ProjName==""):
+                            ProjName = ProjNametmp.group(1)
+                            ProjIsNET = 1
+                    ProjGUIDtmp = re.search(r"<ProjectGuid>(.*)</ProjectGuid>",line)
+                    if (ProjGUIDtmp!=None):
+                        if (ProjGUID==""):
+                            ProjGUID = ProjGUIDtmp.group(1)
+
+                prj.close()
+
+            elif os.path.exists(cs_proj_name):
+                # a .NET project
+                sample_data.project_file = cs_proj_name
+                sample_data.is_net = True
+
+                # open it
+                prj = open(cs_proj_name, 'r')
+                lines = prj.readlines()
+                for line in lines:
+                    # Search for name
+                    if sample_data.project_name == "":
+                        ProjNametmp = re.search(r"<AssemblyName>(.*)</AssemblyName>",line)
+                        if (ProjNametmp != None):
+                            sample_data.project_name = ProjNametmp.group(1)
+
+                    # Search for GUID
+                    if sample_data.project_guid == "":
+                        ProjGUIDtmp = re.search(r"<ProjectGuid>(.*)</ProjectGuid>",line)
+                        if (ProjGUIDtmp != None):
+                            sample_data.project_guid = ProjGUIDtmp.group(1)
+
+                prj.close()
+
+            elif os.path.exists(other_proj_name):
+                # some other type of project (java?)
+                sample_data.project_file = other_proj_name
+                sample_data.is_other = True
+                sample_data.project_name = sample
+
+            else:
+                print(('Sample ' + sample + ' does not have a valid project file'))
+                self.finish_script(1)
+
+            # check if it has a special configuration
+            redist_file_name = sample_data.source_dir + "\\.redist"
+            if os.path.exists(redist_file_name):
+                redist_file = open(redist_file_name, 'r')
+
+                for line in redist_file.readlines():
+                    # seach for dependencies
+                    match = re.search("^DEPENDS=(.*)$", line)
+                    if match != None:
+                        sample_data.dependencies.append(match.group(1))
+
+                redist_file.close()
+
+            sample_data.redist_dir = "Redist\\Samples\\" + sample_data.name
+            all_samples[sample_data.name] = sample_data
+
+        return all_samples
+
+    def get_samples(self):
+        # returns a dictionary of all samples
+        if self.all_samples == None:
+            self.all_samples = self.find_samples()
+
+        return self.all_samples
+
+    def build_other_proj(self, build_dir):
+        # build other (not Visual Studio) project
+        ret = subprocess.call(os.path.join(build_dir, "Build.bat") + " " + self.vc_build_bits)
+        if ret != 0:
+            print(("Building project " + build_dir + " failed!"))
+            self.logger.critical("Building project " + build_dir + " failed!")
+            self.finish_script(1)
+
+    def build_other_samples(self):
+        "Builds other samples (java?)"
+        all_samples = self.get_samples()
+        for sample in list(all_samples.values()):
+            if not sample.is_other:
+                continue
+            build_dir = os.path.join(self.BUILD_DIR, "Samples", sample.name)
+            self.build_other_proj(build_dir)
+
+    def creating_samples(self):
+        """
+        not exactly the same some further work needed.
+        """
+        #-------Creating samples-------------------------------------------------------#
+        print("* Creating samples...")
+        self.logger.info("Creating samples...")
+
+        all_samples = self.get_samples()
+
+        os.chdir(os.path.join(self.WORK_DIR, "Platform", "Win32"))
+
+        # open all solution files
+        OUTFILESLN2008 = open("Redist\\Samples\\Build\\All_2008.sln",'w')
+        OUTFILESLN2008.write("Microsoft Visual Studio Solution File, Format Version 10.00\n")
+        OUTFILESLN2008.write("# Visual Studio 2008\n")
+        OUTFILESLN2010 = open("Redist\\Samples\\Build\\All_2010.sln",'w')
+        OUTFILESLN2010.write("Microsoft Visual Studio Solution File, Format Version 11.00\n")
+        OUTFILESLN2010.write("# Visual Studio 2010\n")
+
+        # copy java build script
+        try:
+            shutil.copy(os.path.join("Build", "BuildJava.py"), os.path.join("Redist", "Samples", "Build"))
+        except:
+            pass
+
+
+        # add projects
+        for sample in list(all_samples.values()):
+            # make dir
+            os.system ("mkdir " + sample.redist_dir)
+            # copy source
+            os.system ("xcopy /S " + sample.source_dir + " " + sample.redist_dir)
+
+            if sample.is_other:
+                shutil.copy(sample.project_file, sample.redist_dir)
+            else:
+                # copy the project file to 2008 and 2010:
+                prj_name_partitioned = os.path.splitext(sample.project_file);
+                prj2008_filename = sample.redist_dir + "\\" + sample.name + "_2008" + prj_name_partitioned[1]
+                prj2010_filename = sample.redist_dir + "\\" + sample.name + "_2010" + prj_name_partitioned[1]
+
+                shutil.copy(sample.project_file, prj2008_filename)
+                shutil.copy(sample.project_file, prj2010_filename)
+
+                # create reletive path to samples
+                prj2008_path = "..\\" + prj2008_filename.partition("\\")[2].partition("\\")[2]
+                prj2010_path = "..\\" + prj2010_filename.partition("\\")[2].partition("\\")[2]
+
+                # add project to solution
+                OUTFILESLN2008.write("Project(\"{19091980-2008-4CFA-1491-04CC20D8BCF9}\") = \""+\
+                                            sample.project_name + "\", \"" + prj2008_path + "\", \"" + sample.project_guid + "\"\n")
+                OUTFILESLN2010.write("Project(\"{19091980-2008-4CFA-1491-04CC20D8BCF9}\") = \""+\
+                                            sample.project_name + "\", \"" + prj2010_path + "\", \"" + sample.project_guid + "\"\n")
+
+                # write down dependencies
+                if len(sample.dependencies) > 0:
+                    OUTFILESLN2008.write("\tProjectSection(ProjectDependencies) = postProject\n")
+                    for depend in sample.dependencies:
+                        OUTFILESLN2008.write("\t\t" + all_samples[depend].project_guid + " = " + all_samples[depend].project_guid + "\n")
+                    OUTFILESLN2008.write("\tEndProjectSection\n")
+                    if self.write_2010_sample_dependency == True:
+                        write_dependencides(OUTFILESLN2010,all_samples,sample)
+                OUTFILESLN2008.write("EndProject\n")
+                OUTFILESLN2010.write("EndProject\n")
+
+        # Close files
+        OUTFILESLN2008.write("Global\n")
+        OUTFILESLN2008.write("	GlobalSection(SolutionConfigurationPlatforms) = preSolution\n")
+        OUTFILESLN2008.write("		Debug|Win32 = Debug|Win32\n")
+        OUTFILESLN2008.write("		Debug|x64 = Debug|x64\n")
+        OUTFILESLN2008.write("		Release|Win32 = Release|Win32\n")
+        OUTFILESLN2008.write("		Release|x64 = Release|x64\n")
+        OUTFILESLN2008.write("	EndGlobalSection\n")
+        OUTFILESLN2008.write("	GlobalSection(ProjectConfigurationPlatforms) = postSolution\n")
+        OUTFILESLN2010.write("Global\n")
+        OUTFILESLN2010.write("	GlobalSection(SolutionConfigurationPlatforms) = preSolution\n")
+        OUTFILESLN2010.write("		Debug|Win32 = Debug|Win32\n")
+        OUTFILESLN2010.write("		Debug|x64 = Debug|x64\n")
+        OUTFILESLN2010.write("		Release|Win32 = Release|Win32\n")
+        OUTFILESLN2010.write("		Release|x64 = Release|x64\n")
+        OUTFILESLN2010.write("	EndGlobalSection\n")
+        OUTFILESLN2010.write("	GlobalSection(ProjectConfigurationPlatforms) = postSolution\n")
+
+        for sample in list(all_samples.values()):
+            conf_32_name = "Win32"
+            if sample.is_net:
+                conf_32_name = "x86"
+
+            OUTFILESLN2008.write("		" + sample.project_guid + ".Debug|Win32.ActiveCfg = Debug|" + conf_32_name + "\n")
+            OUTFILESLN2008.write("		" + sample.project_guid + ".Debug|Win32.Build.0 = Debug|" + conf_32_name + "\n")
+            OUTFILESLN2008.write("		" + sample.project_guid + ".Debug|x64.ActiveCfg = Debug|x64\n")
+            OUTFILESLN2008.write("		" + sample.project_guid + ".Debug|x64.Build.0 = Debug|x64\n")
+            OUTFILESLN2008.write("		" + sample.project_guid + ".Release|Win32.ActiveCfg = Release|" + conf_32_name + "\n")
+            OUTFILESLN2008.write("		" + sample.project_guid + ".Release|Win32.Build.0 = Release|" + conf_32_name + "\n")
+            OUTFILESLN2008.write("		" + sample.project_guid + ".Release|x64.ActiveCfg = Release|x64\n")
+            OUTFILESLN2008.write("		" + sample.project_guid + ".Release|x64.Build.0 = Release|x64\n")
+            OUTFILESLN2010.write("		" + sample.project_guid + ".Debug|Win32.ActiveCfg = Debug|" + conf_32_name + "\n")
+            OUTFILESLN2010.write("		" + sample.project_guid + ".Debug|Win32.Build.0 = Debug|" + conf_32_name + "\n")
+            OUTFILESLN2010.write("		" + sample.project_guid + ".Debug|x64.ActiveCfg = Debug|x64\n")
+            OUTFILESLN2010.write("		" + sample.project_guid + ".Debug|x64.Build.0 = Debug|x64\n")
+            OUTFILESLN2010.write("		" + sample.project_guid + ".Release|Win32.ActiveCfg = Release|" + conf_32_name + "\n")
+            OUTFILESLN2010.write("		" + sample.project_guid + ".Release|Win32.Build.0 = Release|" + conf_32_name + "\n")
+            OUTFILESLN2010.write("		" + sample.project_guid + ".Release|x64.ActiveCfg = Release|x64\n")
+            OUTFILESLN2010.write("		" + sample.project_guid + ".Release|x64.Build.0 = Release|x64\n")
+
+        OUTFILESLN2008.write("	EndGlobalSection\n")
+        OUTFILESLN2008.write("	GlobalSection(SolutionProperties) = preSolution\n")
+        OUTFILESLN2008.write("		HideSolutionNode = FALSE\n")
+        OUTFILESLN2008.write("	EndGlobalSection\n")
+        OUTFILESLN2008.write("EndGlobal	\n")
+        OUTFILESLN2010.write("	EndGlobalSection\n")
+        OUTFILESLN2010.write("	GlobalSection(SolutionProperties) = preSolution\n")
+        OUTFILESLN2010.write("		HideSolutionNode = FALSE\n")
+        OUTFILESLN2010.write("	EndGlobalSection\n")
+        OUTFILESLN2010.write("EndGlobal	\n")
+
+        OUTFILESLN2008.close()
+        OUTFILESLN2010.close()
+
+        os.chdir(self.WORK_DIR)
+
+    def remove_read_only_attributes(self):
+        #-----Remove Read Only Attrib--------------------------------------------------#
+        print("* Removing Read Only Attributes...")
+        full_path = os.path.join(self.WORK_DIR,"Platform", "Win32" , "Redist")
+        self.logger.info("Removing Read Only Attributes... (%s)" % (full_path))
+        #os.system ("attrib -r -h -s /S Redist\\*.*")
+        remove_readonly(full_path)
+
+    def make_installer(self,msi_dest_path):
+        """
+        [dev_success,redist_success]
+        """
+        wix_var_file = '%sVariables.wxi'%self.redist_internal_name.replace('_','')
+
+        [dev_success,redist_success] = [False,False]
+        print("* Making Installer...")
+        self.logger.info("Making Installer...")
+        self.wix_inst_primitive_check()
+        os.chdir(os.path.join(self.WORK_DIR,self.inst_proj_path))
+        # Replace version in the WIX
+        self.wix_dev_var_set()
+        self.check_upgrade_install_sln()
+        print("calling WIX")
+        conf_name = self.internal_conf_name
+        dev_success = self.build_installer(conf_name)
+        print(("moving %s Msi"%conf_name))
+        src = ('.\\bin\Release\en-US\\%s.msi'%self.redist_internal_name)
+        dst = os.path.join( msi_dest_path ,self.final_dir,(self.product_name + '-Win' + self.vc_build_bits + "-" + self.VER + '-%s.msi'%conf_name))
+        os.system(("move %s %s"%(src,dst)))
+        self.dev_to_redist_hack()
+        self.wix_redist_var_set()
+        print("calling WIX")
+        conf_name = 'Redist'
+        redist_success = self.build_installer(conf_name)
+        print(("moving %s Msi"%conf_name))
+        os.system("move .\\bin\Release\en-US\\%s.msi %s"%(self.redist_internal_name,\
+                                                          os.path.join( msi_dest_path ,self.final_dir,self.product_name + '-Win' + self.vc_build_bits + "-" + self.VER + '-%s.msi'%conf_name)))
+
+        os.chdir(self.WORK_DIR)
+        return [dev_success,redist_success]
+
+    def build_installer(self,conf_name):
+        success = False
+        wix_log = 'Build%sWIX%s'%(self.redist_internal_name,conf_name)
+        wix_log.replace('_','') #because outside code expects EENI in the name instead of EE_NI
+        out_file = os.path.join('..\\..\\CreateRedist',self.output_dir,"%s.txt"%wix_log)
+        wix_rc = subprocess.call("\"" + self.VS_INST_DIR \
+            + "devenv\" %s.wixproj /Build \"release|%s"%(self.redist_internal_name, 'x86' if self.vc_build_bits=='32' else 'x64')  \
+            + "\" /out " + out_file, close_fds=True)
+        failed_builds = self.check_vs_report_failed(out_file)
+        if failed_builds > 0 or wix_rc != 0:
+            self.logger.info('Fail to build installer for %s version'%conf_name)
+        else:
+            success = True
+        return success
+
+    def wix_redist_var_set(self):
+        """preconsdition: CWD is where wix-variables-file is stored"""
+        temp = self.redist_internal_name.replace('_','')
+        os.system("attrib -r Includes\\%sVariables.wxi"%temp)
+        #print("setting WIX BuildPlatform")
+        #regx_replace("BuildPlatform=(.*)", "BuildPlatform=" + str(vc_build_bits) + "?>", "Includes\\OpenNIVariables.wxi")
+        print("setting WIX BinaryOnlyRedist=True")
+        regx_replace("BinaryOnlyRedist=(.*)", "BinaryOnlyRedist=True?>", "Includes\\%sVariables.wxi"%temp)
+
+    def wix_dev_var_set(self):
+        """preconsdition: CWD is where wix-variables-file is stored"""
+        print("setting WIX BinaryOnlyRedist=False")
+        temp = self.redist_internal_name.replace('_','')
+        os.system("attrib -r Includes\\%sVariables.wxi"%temp)
+        regx_replace("BinaryOnlyRedist=(.*)", "BinaryOnlyRedist=False?>", "Includes\\%sVariables.wxi"%temp)
+
+    def check_upgrade_install_sln(self):
+        """preconsdition: CWD is where wix-variables-file is stored"""
+        up_wix_file = os.path.join('..\\..\\CreateRedist',self.output_dir,"Upgrade%sWIX.txt"%(self.redist_internal_name))
+        if self.VS_NEED_UPGRADE == 1:
+            subprocess.call("\"" + self.VS_INST_DIR +  \
+            "devenv\" %s.sln /upgrade /out "%(self.redist_internal_name) + up_wix_file, close_fds=True)
+
+    def wix_inst_primitive_check(self):
+        wixPath = os.environ.get('WIX')
+        if wixPath == None:
+            print('*** no WIX env. var. defined ! use set WIX=C:\Program Files\Windows Installer XML v3.5\ or similar to set the path ***')
+            print('make installer is SERIOUSLY expected to fail')
+            self.logger.info('It seems that WIX is not installed and therefore teh installer cannot be built.')
+        else:
+            print(('WIX='+wixPath))
+
+    def dev_to_redist_hack(self):
+        pass
+
+    def check_vs_report_failed(self,file):
+        lines = open(file).readlines()
+        build_result = lines[-2]
+        failed_builds = 0
+        temp = re.search("(\d*) failed",build_result)
+        if temp != None :
+            failed_builds = int(temp.group(1))
+        return failed_builds
+
+    def fixing_files(self):
+        """
+        fixing files
+        """
+        #--------Fixing Files----------------------------------------------------------#
+        print("* Fixing Files...")
+        self.logger.info("Fixing Files...")
+        for dirpath, dirnames, filenames in os.walk(os.path.join(self.WORK_DIR, "Platform", "Win32", "Redist")):
+            self.fix_file('', dirpath, dirnames + filenames)
+
+    def build_samples(self):
+        """
+        Build Samples.
+        """
+        #-------------Build Samples---------------------------------------------------#
+        print("* Building Samples in release configuration......")
+        self.logger.info("Building Samples in release configuration...")
+        # Build project solution
+        os.chdir(self.WORK_DIR + self.SAMPLES_SLN.rpartition("\\")[0])
+
+        output_file = os.path.join(self.SCRIPT_DIR ,self.output_dir ,self.PROJECT_NAME + "SmpRelease.txt")
+
+        if self.VS_NEED_UPGRADE == 1:
+            os.system("\""+self.VS_INST_DIR + "devenv\" " +self.SAMPLES_SLN.rpartition("\\")[2]+\
+                       " /upgrade > " + output_file)
+
+        subprocess.call("\""+self.VS_INST_DIR + "devenv\" " +self.SAMPLES_SLN.rpartition("\\")[2]+\
+                 " " + self.vc_build_type + " \"release|" + self.vc_build_platform + "\" /out " + output_file)
+
+        # Get the build output
+        lines = open(output_file).readlines()
+        build_result = lines[-2]
+        print(build_result)
+        self.logger.info(build_result)
+        # Check for failed build
+
+        failed_builds = 0
+        temp = re.search("(\d*) failed",build_result)
+
+        if temp != None :
+            failed_builds = int(temp.group(1))
+        if failed_builds != 0:
+            print("Samples Building In Release Failed!!")
+            self.logger.critical("Samples Building Failed!")
+            self.finish_script(1)
+
+        print("* Building Samples in debug configuration......")
+        self.logger.info("Building Samples in debug configuration...")
+        # Build project solution
+        os.chdir(self.WORK_DIR +self.SAMPLES_SLN.rpartition("\\")[0])
+
+        output_file = os.path.join(self.SCRIPT_DIR ,self.output_dir ,self.PROJECT_NAME + "SmpDebug.txt")
+
+        if self.VS_NEED_UPGRADE == 1:
+            os.system("\""+self.VS_INST_DIR + "devenv\" " +self.SAMPLES_SLN.rpartition("\\")[2]+\
+                     " /upgrade > " + output_file)
+
+        subprocess.call("\""+self.VS_INST_DIR + "devenv\" " +self.SAMPLES_SLN.rpartition("\\")[2]+\
+                 " " + self.vc_build_type + " \"debug|" + self.vc_build_platform + "\" /out " + output_file)
+
+        # Get the build output
+        lines = open(output_file).readlines()
+        build_result = lines[-2]
+        print(build_result)
+        self.logger.info(build_result)
+        # Check for failed build
+
+        failed_builds = 0
+        tempReResult = re.search("(\d*) failed",build_result)
+
+        if tempReResult != None :
+            failed_builds = int(tempReResult.group(1))
+        if failed_builds != 0:
+            print("Samples Building In Debug Failed!!")
+            self.logger.critical("Samples Building Failed!")
+            self.finish_script(1)
+
+        # Build other samples
+        all_samples = self.get_samples()
+        for sample in list(all_samples.values()):
+            if sample.is_other:
+                self.build_other_proj(os.path.join(self.WORK_DIR, "Platform", "Win32", "Redist", "Samples", sample.name))
+
+        # --------------------Delete stuff
+        os.chdir(self.WORK_DIR + "\\Platform\\Win32\\Redist\\Samples\\" + self.bin_dir +"\\Release\\")
+        os.system("del *.pdb")
+        os.chdir(self.WORK_DIR + "\\Platform\\Win32\\Redist\\Samples\\" + self.bin_dir +"\\Debug\\")
+        os.system("del *.pdb")
+        os.system("del *.ilk")
+        os.chdir(self.WORK_DIR + "\\Platform\\Win32\\Redist\\" + self.lib_dir + "\\")
+        os.system("del nim*.*")
+
+        os.chdir(self.WORK_DIR)
+
+    def clean_up(self):
+        temp_str = "Redist "+ self.redist_name +" Ended."
+        print(temp_str)
+        self.logger.info(temp_str)
+        #self.finish_script(0)
+class Command(object):
+    def __init__(self, cmd):
+        self.cmd = cmd
+        self.process = None
+
+    def run(self, timeout):
+        def target():
+            print('Thread started')
+            self.process = subprocess.Popen(self.cmd, shell=True)
+            self.process.communicate()
+            print('Thread finished')
+
+        thread = threading.Thread(target=target)
+        thread.start()
+
+        thread.join(timeout)
+        if thread.is_alive():
+            print('Terminating process')
+            self.process.terminate()
+            thread.join()
+        print((self.process.returncode))
diff --git a/Platform/Win32/Driver/Bin/amd64/psdrv3.sys b/Platform/Win32/Driver/Bin/amd64/psdrv3.sys
index 5a81639..d83c22b 100644
Binary files a/Platform/Win32/Driver/Bin/amd64/psdrv3.sys and b/Platform/Win32/Driver/Bin/amd64/psdrv3.sys differ
diff --git a/Platform/Win32/Driver/Bin/psdrv3.cat b/Platform/Win32/Driver/Bin/psdrv3.cat
index 05ed698..0dca907 100644
Binary files a/Platform/Win32/Driver/Bin/psdrv3.cat and b/Platform/Win32/Driver/Bin/psdrv3.cat differ
diff --git a/Platform/Win32/Driver/Bin/psdrv3.inf b/Platform/Win32/Driver/Bin/psdrv3.inf
index 0971f06..3a3714a 100644
--- a/Platform/Win32/Driver/Bin/psdrv3.inf
+++ b/Platform/Win32/Driver/Bin/psdrv3.inf
@@ -19,7 +19,7 @@ Signature="$WINDOWS NT$"
 Class=PrimeSense
 ClassGuid={dce97d75-aef7-1980-1909-531357633222}
 Provider=%PS%
-DriverVer=02/16/2011,3.1.2.0
+DriverVer=11/21/2011,3.1.3.1
 CatalogFile=psdrv3.cat
 
 ; ================= Class section =====================
@@ -50,8 +50,13 @@ DefaultDestDir = 12 ; Driver Dir
 %USB\VID_1D27&PID_0500.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0500
 %USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0600&MI_00
 %USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0600
+%USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0601&MI_00
+%USB\VID_1D27&PID_1280.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_1280&MI_00
+%USB\VID_1D27&PID_1280.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_1280
 %USB\VID_1D27&PID_2100.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2100&MI_00
 %USB\VID_1D27&PID_2100.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2100
+%USB\VID_1D27&PID_2200.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2200&MI_00
+%USB\VID_1D27&PID_2200.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2200
 %USB\VID_1D27&PID_F9DB.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_F9DB&MI_00
 %USB\VID_1D27&PID_F9DB.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_F9DB
 
@@ -66,8 +71,13 @@ DefaultDestDir = 12 ; Driver Dir
 %USB\VID_1D27&PID_0500.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0500
 %USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0600&MI_00
 %USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0600
+%USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0601&MI_00
+%USB\VID_1D27&PID_1280.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_1280&MI_00
+%USB\VID_1D27&PID_1280.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_1280
 %USB\VID_1D27&PID_2100.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2100&MI_00
 %USB\VID_1D27&PID_2100.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2100
+%USB\VID_1D27&PID_2200.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2200&MI_00
+%USB\VID_1D27&PID_2200.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2200
 %USB\VID_1D27&PID_F9DB.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_F9DB&MI_00
 %USB\VID_1D27&PID_F9DB.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_F9DB
 
@@ -146,5 +156,8 @@ USB\VID_1D27&PID_0300.DeviceDesc="PrimeSense Sensor Development Kit 3.x"
 USB\VID_1D27&PID_0400.DeviceDesc="PrimeSense Sensor Development Kit 4.x"
 USB\VID_1D27&PID_0500.DeviceDesc="PrimeSense Sensor Development Kit 5.x"
 USB\VID_1D27&PID_0600.DeviceDesc="PrimeSense PS1080"
-USB\VID_1D27&PID_2100.DeviceDesc="PrimeSense Sensor Development Kit NG"
+USB\VID_1D27&PID_0601.DeviceDesc="PrimeSense PS1080"
+USB\VID_1D27&PID_1280.DeviceDesc="PrimeSense RD 1.28"
+USB\VID_1D27&PID_2100.DeviceDesc="PrimeSense Sensor Development Kit NG 2100"
+USB\VID_1D27&PID_2200.DeviceDesc="PrimeSense Sensor Development Kit NG 2200"
 USB\VID_1D27&PID_F9DB.DeviceDesc="PrimeSense Sensor Development Kit NG Debug"
\ No newline at end of file
diff --git a/Platform/Win32/Driver/Bin/x86/psdrv3.sys b/Platform/Win32/Driver/Bin/x86/psdrv3.sys
index 95b2dc5..6d00c6c 100644
Binary files a/Platform/Win32/Driver/Bin/x86/psdrv3.sys and b/Platform/Win32/Driver/Bin/x86/psdrv3.sys differ
diff --git a/Platform/Win32/Driver/Build/UpdateVersion.py b/Platform/Win32/Driver/Build/UpdateVersion.py
index 61db69e..6581aec 100644
--- a/Platform/Win32/Driver/Build/UpdateVersion.py
+++ b/Platform/Win32/Driver/Build/UpdateVersion.py
@@ -1,6 +1,6 @@
 #/***************************************************************************
 #*                                                                          *
-#*  OpenNI 1.1 Alpha                                                        *
+#*  OpenNI 1.x Alpha                                                        *
 #*  Copyright (C) 2011 PrimeSense Ltd.                                      *
 #*                                                                          *
 #*  This file is part of OpenNI.                                            *
@@ -29,8 +29,8 @@ import datetime
 # ----------------------- PARAMS -------------------------
 VERSION_MAJOR = 3
 VERSION_MINOR = 1
-VERSION_MAINTENANCE = 2
-VERSION_BUILD = 0
+VERSION_MAINTENANCE = 3
+VERSION_BUILD = 1
 
 # ---------------------- FUNCTIONS -----------------------
 def regx_replace(findStr,repStr,filePath):
diff --git a/Platform/Win32/Driver/Build/inf/psdrv3.inf b/Platform/Win32/Driver/Build/inf/psdrv3.inf
index 0971f06..1c4bb3f 100644
--- a/Platform/Win32/Driver/Build/inf/psdrv3.inf
+++ b/Platform/Win32/Driver/Build/inf/psdrv3.inf
@@ -19,7 +19,7 @@ Signature="$WINDOWS NT$"
 Class=PrimeSense
 ClassGuid={dce97d75-aef7-1980-1909-531357633222}
 Provider=%PS%
-DriverVer=02/16/2011,3.1.2.0
+DriverVer=11/30/2011,3.1.3.1
 CatalogFile=psdrv3.cat
 
 ; ================= Class section =====================
@@ -50,8 +50,13 @@ DefaultDestDir = 12 ; Driver Dir
 %USB\VID_1D27&PID_0500.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0500
 %USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0600&MI_00
 %USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0600
+%USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0601&MI_00
+%USB\VID_1D27&PID_1280.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_1280&MI_00
+%USB\VID_1D27&PID_1280.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_1280
 %USB\VID_1D27&PID_2100.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2100&MI_00
 %USB\VID_1D27&PID_2100.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2100
+%USB\VID_1D27&PID_2200.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2200&MI_00
+%USB\VID_1D27&PID_2200.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2200
 %USB\VID_1D27&PID_F9DB.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_F9DB&MI_00
 %USB\VID_1D27&PID_F9DB.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_F9DB
 
@@ -66,8 +71,13 @@ DefaultDestDir = 12 ; Driver Dir
 %USB\VID_1D27&PID_0500.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0500
 %USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0600&MI_00
 %USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0600
+%USB\VID_1D27&PID_0600.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_0601&MI_00
+%USB\VID_1D27&PID_1280.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_1280&MI_00
+%USB\VID_1D27&PID_1280.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_1280
 %USB\VID_1D27&PID_2100.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2100&MI_00
 %USB\VID_1D27&PID_2100.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2100
+%USB\VID_1D27&PID_2200.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2200&MI_00
+%USB\VID_1D27&PID_2200.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_2200
 %USB\VID_1D27&PID_F9DB.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_F9DB&MI_00
 %USB\VID_1D27&PID_F9DB.DeviceDesc%=psdrv3.Dev, USB\VID_1D27&PID_F9DB
 
@@ -146,5 +156,8 @@ USB\VID_1D27&PID_0300.DeviceDesc="PrimeSense Sensor Development Kit 3.x"
 USB\VID_1D27&PID_0400.DeviceDesc="PrimeSense Sensor Development Kit 4.x"
 USB\VID_1D27&PID_0500.DeviceDesc="PrimeSense Sensor Development Kit 5.x"
 USB\VID_1D27&PID_0600.DeviceDesc="PrimeSense PS1080"
-USB\VID_1D27&PID_2100.DeviceDesc="PrimeSense Sensor Development Kit NG"
+USB\VID_1D27&PID_0601.DeviceDesc="PrimeSense PS1080"
+USB\VID_1D27&PID_1280.DeviceDesc="PrimeSense RD 1.28"
+USB\VID_1D27&PID_2100.DeviceDesc="PrimeSense Sensor Development Kit NG 2100"
+USB\VID_1D27&PID_2200.DeviceDesc="PrimeSense Sensor Development Kit NG 2200"
 USB\VID_1D27&PID_F9DB.DeviceDesc="PrimeSense Sensor Development Kit NG Debug"
\ No newline at end of file
diff --git a/Platform/Win32/Driver/Build/sys/PSDrvBulk.c b/Platform/Win32/Driver/Build/sys/PSDrvBulk.c
index f4dff0e..f4f78f4 100644
--- a/Platform/Win32/Driver/Build/sys/PSDrvBulk.c
+++ b/Platform/Win32/Driver/Build/sys/PSDrvBulk.c
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Driver/Build/sys/PSDrvDevice.c b/Platform/Win32/Driver/Build/sys/PSDrvDevice.c
index 44f1bfa..3d52415 100644
--- a/Platform/Win32/Driver/Build/sys/PSDrvDevice.c
+++ b/Platform/Win32/Driver/Build/sys/PSDrvDevice.c
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Driver/Build/sys/PSDrvDriver.c b/Platform/Win32/Driver/Build/sys/PSDrvDriver.c
index 38beb33..d9b7899 100644
--- a/Platform/Win32/Driver/Build/sys/PSDrvDriver.c
+++ b/Platform/Win32/Driver/Build/sys/PSDrvDriver.c
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Driver/Build/sys/PSDrvIOCtls.c b/Platform/Win32/Driver/Build/sys/PSDrvIOCtls.c
index 619765e..3793afe 100644
--- a/Platform/Win32/Driver/Build/sys/PSDrvIOCtls.c
+++ b/Platform/Win32/Driver/Build/sys/PSDrvIOCtls.c
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Driver/Build/sys/PSDrvIso.c b/Platform/Win32/Driver/Build/sys/PSDrvIso.c
index fe27d85..192733f 100644
--- a/Platform/Win32/Driver/Build/sys/PSDrvIso.c
+++ b/Platform/Win32/Driver/Build/sys/PSDrvIso.c
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Driver/Build/sys/PSDrvPrivate.h b/Platform/Win32/Driver/Build/sys/PSDrvPrivate.h
index a11df72..56f0855 100644
--- a/Platform/Win32/Driver/Build/sys/PSDrvPrivate.h
+++ b/Platform/Win32/Driver/Build/sys/PSDrvPrivate.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Driver/Build/sys/PSDrvPublic.h b/Platform/Win32/Driver/Build/sys/PSDrvPublic.h
index 5ee9c80..8a4417d 100644
--- a/Platform/Win32/Driver/Build/sys/PSDrvPublic.h
+++ b/Platform/Win32/Driver/Build/sys/PSDrvPublic.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Platform/Win32/Driver/Build/sys/PSDrvVersion.h b/Platform/Win32/Driver/Build/sys/PSDrvVersion.h
index 6f472cc..8935490 100644
--- a/Platform/Win32/Driver/Build/sys/PSDrvVersion.h
+++ b/Platform/Win32/Driver/Build/sys/PSDrvVersion.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -21,8 +21,8 @@
 ****************************************************************************/
 #define PSUSBDRV_MAJOR_VERSION 3
 #define PSUSBDRV_MINOR_VERSION 1
-#define PSUSBDRV_MAINTENANCE_VERSION 2
-#define PSUSBDRV_BUILD_VERSION 0
+#define PSUSBDRV_MAINTENANCE_VERSION 3
+#define PSUSBDRV_BUILD_VERSION 1
 
 #define PSDRV_STRINGIFY(n) PSDRV_STRINGIFY_HELPER(n)
 #define PSDRV_STRINGIFY_HELPER(n) #n
diff --git a/Platform/Win32/Driver/PDBs/objfre_win7_amd64/amd64/psdrv3.pdb b/Platform/Win32/Driver/PDBs/objfre_win7_amd64/amd64/psdrv3.pdb
index b19117b..ee7910a 100644
Binary files a/Platform/Win32/Driver/PDBs/objfre_win7_amd64/amd64/psdrv3.pdb and b/Platform/Win32/Driver/PDBs/objfre_win7_amd64/amd64/psdrv3.pdb differ
diff --git a/Platform/Win32/Driver/PDBs/objfre_win7_x86/i386/psdrv3.pdb b/Platform/Win32/Driver/PDBs/objfre_win7_x86/i386/psdrv3.pdb
index 7239db5..d95e7e1 100644
Binary files a/Platform/Win32/Driver/PDBs/objfre_win7_x86/i386/psdrv3.pdb and b/Platform/Win32/Driver/PDBs/objfre_win7_x86/i386/psdrv3.pdb differ
diff --git a/Platform/Win32/Install/OpenNI/Fragments/BinariesFragment.wxs b/Platform/Win32/Install/OpenNI/Fragments/BinariesFragment.wxs
index c17dfd8..922a617 100644
--- a/Platform/Win32/Install/OpenNI/Fragments/BinariesFragment.wxs
+++ b/Platform/Win32/Install/OpenNI/Fragments/BinariesFragment.wxs
@@ -34,6 +34,12 @@
         <Component Id="OpenNI" Guid="*">
           <File Id="filF374558A6F08B598A4FA106496D94FA6" KeyPath="yes" Source="$(var.OpenNIFilesDir)\Bin$(var.PlatformSuffix)\OpenNI$(var.PlatformSuffix).dll" />
         </Component>
+        <Component Id="OpenNIjar" Guid="*">
+          <File Id="filF374558A6F08B598A4FA106496D94JAR" KeyPath="yes" Source="$(var.OpenNIFilesDir)\Bin$(var.PlatformSuffix)\org.OpenNI.jar" />
+        </Component>
+        <Component Id="OpenNIjnidll" Guid="*">
+          <File Id="filF374558A6F08B598A4FA106496D94JNI" KeyPath="yes" Source="$(var.OpenNIFilesDir)\Bin$(var.PlatformSuffix)\OpenNI.jni$(var.PlatformSuffix).dll" />
+        </Component>        
       </Directory>
       <Directory Id="dir80E123015D0DE85FDA6E8AE3782EF58C" Name="Driver">
         <Component Id="dpinstamd64" Guid="*">
@@ -84,6 +90,8 @@
       <ComponentRef Id="nimRecorder"/>
       <ComponentRef Id="niReg"/>
       <ComponentRef Id="OpenNI"/>
+      <ComponentRef Id="OpenNIjar"/>
+      <ComponentRef Id="OpenNIjnidll"/>      
       <ComponentRef Id="dpinstamd64"/>
       <ComponentRef Id="dpinstx86"/>
       <ComponentRef Id="dpinst"/>
diff --git a/Platform/Win32/Install/OpenNI/Includes/OpenNIVariables.wxi b/Platform/Win32/Install/OpenNI/Includes/OpenNIVariables.wxi
index 0877eae..564f059 100644
--- a/Platform/Win32/Install/OpenNI/Includes/OpenNIVariables.wxi
+++ b/Platform/Win32/Install/OpenNI/Includes/OpenNIVariables.wxi
@@ -5,10 +5,10 @@
   It's not enough to just include newer files.
   -->
   <?define MajorVersion=1?>
-  <?define MinorVersion=1?>
-  <?define MaintenanceVersion=0?>
+  <?define MinorVersion=5?>
+  <?define MaintenanceVersion=2?>
   <!-- BuildVersion is NOT used by WiX in the upgrade procedure -->
-  <?define BuildVersion=41?>
+  <?define BuildVersion=23?>
   <!-- Full version number to display -->
   <?define VersionNumber="$(var.MajorVersion).$(var.MinorVersion).$(var.MaintenanceVersion).$(var.BuildVersion)"?>
    
@@ -20,7 +20,7 @@
 
   <?define MinOpenNIVersion="1.0.0"?>
   
-  <?define BinaryOnlyRedist=False?>
+  <?define BinaryOnlyRedist=True?>
    
   <?if $(var.Platform)="x86"?>
     <?define PlatformSuffix=""?>    
diff --git a/Platform/Win32/Install/OpenNI/OpenNI.wixproj b/Platform/Win32/Install/OpenNI/OpenNI.wixproj
index 735526e..7969325 100644
--- a/Platform/Win32/Install/OpenNI/OpenNI.wixproj
+++ b/Platform/Win32/Install/OpenNI/OpenNI.wixproj
@@ -32,6 +32,10 @@
     <CompilerAdditionalOptions>-arch x86</CompilerAdditionalOptions>
     <WixVariables>
     </WixVariables>
+    <SuppressSpecificWarnings>
+    </SuppressSpecificWarnings>
+    <VerboseOutput>False</VerboseOutput>
+    <SuppressIces>ICE03</SuppressIces>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     <DefineConstants>Debug;OpenNIFilesDir=..\..\..\..\..\Redist</DefineConstants>
diff --git a/Platform/Win32/Install/OpenNI/OpenNI.wxs b/Platform/Win32/Install/OpenNI/OpenNI.wxs
index e68071a..a527397 100644
--- a/Platform/Win32/Install/OpenNI/OpenNI.wxs
+++ b/Platform/Win32/Install/OpenNI/OpenNI.wxs
@@ -49,112 +49,187 @@
     <Directory Id="TARGETDIR" Name="SourceDir">
       <Directory Id="$(var.PlatformProgramFilesFolder)">
         <Directory Id="INSTALLLOCATION" Name="!(loc.ProductName)">
-          <Directory Id="INSTALLLOCATIONTools" Name="Tools"/>
+         <Directory Id="INSTALLLOCATIONTools" Name="Tools"/>
+          <Directory Id="INSTALLLOCATIONSamples" Name="Samples">
+            <Directory Id="INSTALLLOCATIONSamplesBin" Name="Bin$(var.PlatformSuffix)">
+               <Directory Id="INSTALLLOCATIONSamplesBinRelease" Name="Release">
+                <Directory Id="INSTALLLOCATIONSamplesBinReleaseLog" Name="Log"/>
+              </Directory>
+              
+              <Directory Id="INSTALLLOCATIONSamplesBinDebug" Name="Debug">
+                <Directory Id="INSTALLLOCATIONSamplesBinDebugLog" Name="Log"/>
+              </Directory> 
+            </Directory>
+          </Directory>
           <Directory Id="INSTALLLOCATIONDriver" Name="Driver"/>
           <Directory Id="INSTALLLOCATIONBin" Name="Bin$(var.PlatformSuffix)">
             <Directory Id="INSTALLLOCATIONBinLog" Name="Log"/>  
-          </Directory>
+          </Directory>  
           <Directory Id="INSTALLLOCATIONData" Name="Data"/>
-          <Directory Id="INSTALLLOCATIONSAMPLES" Name="Samples">
-            <Directory Id="INSTALLLOCATIONSAMPLESBIN" Name="Bin$(var.PlatformSuffix)">
-              <Directory Id="INSTALLLOCATIONSAMPLESBINRELEASE" Name="Release">
-                <Directory Id="INSTALLLOCATIONSAMPLESBINRELEASELOG" Name="Log"/>
-              </Directory>
-              <Directory Id="INSTALLLOCATIONSAMPLESBINDEBUG" Name="Debug">
-                <Directory Id="INSTALLLOCATIONSAMPLESBINDEBUGLOG" Name="Log"/>
-              </Directory>            
-            </Directory>
-          </Directory>
-        </Directory>    
+          
+          
       </Directory>
+      </Directory>
+
 
       <Directory Id="ProgramMenuFolder">
         <Directory Id="ApplicationProgramsFolder" Name="$(var.ProductShortName)" >
-          <?if $(var.BinaryOnlyRedist)="False"?>
-          <Directory Id="DocumentationShortcutFolder" Name="Documentation"/>
-          <Directory Id="SamplesShortcutFolder" Name="Samples"/>
+          <?if $(var.BinaryOnlyRedist)="False"?>          
+            <Directory Id="DocumentationShortcutFolder" Name="Documentation"/>
+            <Directory Id="SamplesShortcutFolder" Name="Samples"/>
           <?endif?>
         </Directory>
-      </Directory>
-
-
+      </Directory>     
+      
     </Directory>
 
+    
     <DirectoryRef Id="INSTALLLOCATIONBinLog">
-      <Component Id="RemoveLogDir" Guid="45BC94F5-FA27-4d42-AFD8-E18B65F9A52D" KeyPath="yes">        
-        <RemoveFile Id="RemoveLogFiles" On="uninstall" Name="*.*" />
-        <RemoveFolder Id="RemoveLogDir" On="uninstall"/>
-      </Component>
+      <?if $(var.Platform)="x86"?>
+        <Component Id="RemoveLogDir$(var.Platform)" Guid="D8F6BD18-BBB3-4ED5-82A5-78D89D96D738" KeyPath="yes">
+        <RemoveFile Id="RemoveLogFiles$(var.Platform)" On="uninstall" Name="*.*" />
+        <RemoveFolder Id="RemoveLogDirFolder$(var.Platform)" On="uninstall"/>
+        </Component>
+       <?else?>
+         <Component Id="RemoveLogDir$(var.Platform)" Guid="D8F6BD18-BBB3-4ED5-82A5-78D89D962738" KeyPath="yes">
+            <RemoveFile Id="RemoveLogFiles$(var.Platform)" On="uninstall" Name="*.*" />
+            <RemoveFolder Id="RemoveLogDirFolder$(var.Platform)" On="uninstall"/>
+         </Component>
+         <?endif?>       
     </DirectoryRef>
-
-    <DirectoryRef Id="ApplicationProgramsFolder">
-      <Component Id="ApplicationShortcut" Guid="3B13870F-0D69-401C-8B5C-862E13874449" >
-        <Shortcut Id="UninstallProduct"
-                Name="Uninstall OpenNI"
-                Target="[SystemFolder]msiexec.exe"
-                Arguments="/x [ProductCode]"/>
-        <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall" />
-        <RegistryValue Root="HKCU" Key="Software\OpenNI" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
+    
+    <!--NEW NODE SEMION-->
+   <DirectoryRef Id="INSTALLLOCATIONBin">
+     <?if $(var.Platform)="x86"?>
+      <Component Id="RemoveBinDir$(var.Platform)" Guid="45BC94F5-FA27-4d42-AFD8-E18B65F9A52D" KeyPath="yes">
+        <RemoveFile Id="RemoveBinFiles$(var.Platform)" On="uninstall" Name="*.*" />
+        <RemoveFolder Id="RemoveBinDir$(var.Platform)" On="uninstall"/>
       </Component>
+     <?else?>
+       <Component Id="RemoveBinDir$(var.Platform)" Guid="45BC94F5-FA27-4d42-AAD8-E18B65F9A52D" KeyPath="yes">
+         <RemoveFile Id="RemoveBinFiles$(var.Platform)" On="uninstall" Name="*.*" />
+         <RemoveFolder Id="RemoveBinDir$(var.Platform)" On="uninstall"/>
+       </Component>
+     <?endif?>
     </DirectoryRef>
 
+   
     <?if $(var.BinaryOnlyRedist)="False"?>
-      <DirectoryRef Id="INSTALLLOCATIONSAMPLESBINRELEASELOG">
-        <Component Id="RemoveReleaseLogDir" Guid="7934C4DA-4CE1-41bb-8EE8-B974706B1C22" KeyPath="yes">
-          <RemoveFile Id="RemoveReleaseLogFiles" On="uninstall" Name="*.*" />
-          <RemoveFolder Id="RemoveReleaseLogDir" On="uninstall"/>
-        </Component>
-      </DirectoryRef>
 
-      <DirectoryRef Id="INSTALLLOCATIONSAMPLESBINDEBUGLOG">
+
+    <?if $(var.Platform)="x86"?>
+    
+    <!-- New node create SamplesBinDebugLog folder  -->
+      <DirectoryRef Id="INSTALLLOCATIONSamplesBinDebugLog">
+      <Component Id="SamplesBinDebugLog" Guid="7C42E243-C475-486F-B08C-606737C3CC73" KeyPath="yes">
+      </Component>
+    </DirectoryRef>
+
+    <!-- New node create SamplesBinReleaseLog folder  -->
+    <DirectoryRef Id="INSTALLLOCATIONSamplesBinReleaseLog">
+      <Component Id="SamplesBinReleaseLog" Guid="3FD0DBF9-C87C-43A1-A4A9-208969EE9060" KeyPath="yes">
+      </Component>
+   </DirectoryRef>
+    
+    <DirectoryRef Id="INSTALLLOCATIONSamplesBinDebugLog">
         <Component Id="RemoveDebugLogDir" Guid="0AC4A0E8-CDE7-43c4-BDFA-FE0176AFFE21" KeyPath="yes">
           <RemoveFile Id="RemoveDebugLogFiles" On="uninstall" Name="*.*" />
           <RemoveFolder Id="RemoveDebugLogDir" On="uninstall"/>
         </Component>
       </DirectoryRef>
+
+    <DirectoryRef Id="INSTALLLOCATIONSamplesBinDebug">
+      <Component Id="RemoveDebugDir" Guid="0AC4A018-CDE7-43c4-BDFA-FE0176AFFE21" KeyPath="yes">
+        <RemoveFile Id="RemoveDebugFiles" On="uninstall" Name="*.*" />
+        <RemoveFolder Id="RemoveDebugDir" On="uninstall"/>
+      </Component>
+    </DirectoryRef>
+    <?else?>
+    <!-- New node create SamplesBinDebugLog folder  -->
+    <DirectoryRef Id="INSTALLLOCATIONSamplesBinDebugLog">
+      <Component Id="SamplesBinDebugLog" Guid="7C42E243-C425-486F-B08C-606737C3CC73" KeyPath="yes">
+      </Component>
+    </DirectoryRef>
+
+    <!-- New node create SamplesBinReleaseLog folder  -->
+    <DirectoryRef Id="INSTALLLOCATIONSamplesBinReleaseLog">
+      <Component Id="SamplesBinReleaseLog" Guid="3FD0DBF9-C81C-43A1-A4A9-208969EE9060" KeyPath="yes">
+      </Component>
+    </DirectoryRef>
+
+    <DirectoryRef Id="INSTALLLOCATIONSamplesBinDebugLog">
+      <Component Id="RemoveDebugLogDir" Guid="0AC4A0E8-CDE7-4377-BDFA-FE0176AFFE21" KeyPath="yes">
+        <RemoveFile Id="RemoveDebugLogFiles" On="uninstall" Name="*.*" />
+        <RemoveFolder Id="RemoveDebugLogDir" On="uninstall"/>
+      </Component>
+    </DirectoryRef>
+
+    <DirectoryRef Id="INSTALLLOCATIONSamplesBinDebug">
+      <Component Id="RemoveDebugDir" Guid="0AC4A018-CDE7-43c4-BDFA-FE0176AFFE22" KeyPath="yes">
+        <RemoveFile Id="RemoveDebugFiles" On="uninstall" Name="*.*" />
+        <RemoveFolder Id="RemoveDebugDir" On="uninstall"/>
+      </Component>
+    </DirectoryRef>
+      <?endif?>
+    <?endif?>
+    
          
-      <DirectoryRef Id="DocumentationShortcutFolder">
-        <Component Id="DocumentationShortcut" Guid="2B5269BD-5CEA-4072-8E11-B4AA98AD382D" >
-          <Shortcut Id="APIRefMenuShortcut"
-             Name="API Reference $(var.VersionNumber)"
-             Description="API Reference $(var.VersionNumber)"
-             Target="[INSTALLLOCATION]Documentation\OpenNI.chm"
-             WorkingDirectory="INSTALLLOCATION"/>          
-          <RemoveFolder Id="DocumentationShortcutFolder" On="uninstall"/>
-          <RegistryValue Root="HKCU" Key="Software\OpenNI" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
-        </Component>                 
-      </DirectoryRef>
+      <DirectoryRef Id="ApplicationProgramsFolder">
+        <Component Id="DocumentationShortcut" Guid="*" >
 
-       <DirectoryRef Id="SamplesShortcutFolder">
-        <Component Id="SamplesShortcut" Guid="2C2BA43F-A81B-4BD1-9D93-170C4E833E96" >
-          <Shortcut Id="NiSimpleReadMenuShortcut"
-              Name="NiSimpleRead$(var.PlatformSuffix)"
-              Description="NiSimpleRead$(var.PlatformSuffix)"
-              Target="[INSTALLLOCATION]Samples\Bin$(var.PlatformSuffix)\Release\NiSimpleRead$(var.PlatformSuffix).exe"
-              WorkingDirectory="INSTALLLOCATIONSAMPLESBINRELEASE"/>
-          <Shortcut Id="NiSimpleViewerMenuShortcut"
-            Name="NiViewer$(var.PlatformSuffix)"
-            Description="NiViewer$(var.PlatformSuffix)"
-            Target="[INSTALLLOCATION]Samples\Bin$(var.PlatformSuffix)\Release\NiViewer$(var.PlatformSuffix).exe"
-            WorkingDirectory="INSTALLLOCATIONSAMPLESBINRELEASE"/>                  
-          <Shortcut Id="SampleDirMenuShortcut"
-             Name="Samples Directory $(var.PlatformSuffix)"
-             Description="Samples Directory"
-             Target="[INSTALLLOCATION]Samples\"
-             WorkingDirectory="INSTALLLOCATION"/>
-          <RemoveFolder Id="SamplesShortcutFolder" On="uninstall"/>
+          <Shortcut Id="UninstallProduct"
+                Name="Uninstall OpenNI"
+                Target="[SystemFolder]msiexec.exe"
+                Arguments="/x [ProductCode]" Directory="ApplicationProgramsFolder"/>
+          <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"  Directory="ApplicationProgramsFolder"/>
+          
+          <?if $(var.BinaryOnlyRedist)="False"?>
+            <Shortcut Id="APIRefMenuShortcut"
+               Name="API Reference $(var.VersionNumber)"
+               Description="API Reference $(var.VersionNumber)"
+               Target="[INSTALLLOCATION]Documentation\OpenNI.chm"
+               WorkingDirectory="INSTALLLOCATION" />                             
+            
+            <Shortcut Id="UserGuideMenuShortcut"
+               Name="User Guide $(var.VersionNumber)"
+               Description="User Guide $(var.VersionNumber)"
+               Target="[INSTALLLOCATION]Documentation\OpenNI_UserGuide.pdf"
+               WorkingDirectory="INSTALLLOCATION"/>
+            
+            <Shortcut Id="NiSimpleReadMenuShortcut"
+             Name="NiSimpleRead$(var.PlatformSuffix)"
+             Description="NiSimpleRead$(var.PlatformSuffix)"
+             Target="[INSTALLLOCATION]Samples\Bin$(var.PlatformSuffix)\Release\NiSimpleRead$(var.PlatformSuffix).exe"
+             WorkingDirectory="INSTALLLOCATIONSamplesBinRelease" Directory="SamplesShortcutFolder"/>
+            <Shortcut Id="NiSimpleViewerMenuShortcut"
+              Name="NiViewer$(var.PlatformSuffix)"
+              Description="NiViewer$(var.PlatformSuffix)"
+              Target="[INSTALLLOCATION]Samples\Bin$(var.PlatformSuffix)\Release\NiViewer$(var.PlatformSuffix).exe"
+              WorkingDirectory="INSTALLLOCATIONSamplesBinRelease" Directory="SamplesShortcutFolder"/>
+            <Shortcut Id="SampleDirMenuShortcut"
+               Name="Samples Directory $(var.PlatformSuffix)"
+               Description="Samples Directory"
+               Target="[INSTALLLOCATION]Samples\"
+               WorkingDirectory="INSTALLLOCATION" Directory="SamplesShortcutFolder"/>
+            
+            <RemoveFolder Id="SamplesShortcutFolder" On="uninstall" Directory="SamplesShortcutFolder"/>          
+            <RemoveFolder Id="RemoveDocumentationShortcutFolder" On="install" Directory="DocumentationShortcutFolder"/>
+          <?endif?>
+          
           <RegistryValue Root="HKCU" Key="Software\OpenNI" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
         </Component>
       </DirectoryRef>
-    <?endif?>
-    
-    <DirectoryRef Id="TARGETDIR">
-      <Component Id="RegistryEntries" Guid="D48D0BF7-6004-4403-B390-54C46454C394"  >
-        <RegistryKey Root="HKLM" Key="Software\OpenNI" Action="createAndRemoveOnUninstall">
-          <RegistryValue Type="string" Name="InstallDir" Value="[INSTALLLOCATION]" />
+
+
+         
+    <DirectoryRef Id="TARGETDIR">      
+      <Component Id="RegistryEntries"  Guid="*" >
+        
+        <RegistryKey Root="HKLM" Key="Software\OpenNI" Action="none" >
+          <RegistryValue Type="string" Name="InstallDir" Value="[INSTALLLOCATION]"  />
           <RegistryValue Type="string" Name="Version" Value="$(var.VersionNumber)"/>
         </RegistryKey>
-
+        
         <RegistryKey Root="HKCR" Key=".oni" Action="createAndRemoveOnUninstall" >
           <RegistryValue Type="string" Value="NIRecording"/>
         </RegistryKey>
@@ -174,27 +249,45 @@
       </Component>
     </DirectoryRef>
 
+
     <!-- Install OpenNI.net-->
     <DirectoryRef Id="TARGETDIR" >
-      <Component Id="OpenNINET" Guid="60718C69-87CB-45C0-A8A0-1B60E072D20A" DiskId="1">
-        <File Id="OpenNINET" Name="OpenNI.Net.dll" Assembly=".net" KeyPath="yes" Source="$(var.OpenNIFilesDir)\bin$(var.PlatformSuffix)\OpenNI.Net.dll" />
+      <Component Id="OpenNIPolicy1.4" Guid="4bb7335e-1049-11e1-9352-b8ac6f2d7539" DiskId="1">
+<File Id="OpenNIPolicy1.4" Name="Policy.1.4.OpenNI.Net.dll" Assembly=".net" KeyPath="yes" Source="$(var.OpenNIFilesDir)\bin$(var.PlatformSuffix)\Policy.1.4.OpenNI.Net.dll" />
+<File Id="OpenNIPolicyConfig1.4" Name="PublisherPolicy1.4.config" KeyPath="no" Source="$(var.OpenNIFilesDir)\bin$(var.PlatformSuffix)\PublisherPolicy1.4.config" />
+</Component>
+<Component Id="OpenNIPolicy1.5" Guid="b100518f-19a2-11e1-a67c-080027007877" DiskId="1">
+<File Id="OpenNIPolicy1.5" Name="Policy.1.5.OpenNI.Net.dll" Assembly=".net" KeyPath="yes" Source="$(var.OpenNIFilesDir)\bin$(var.PlatformSuffix)\Policy.1.5.OpenNI.Net.dll" />
+<File Id="OpenNIPolicyConfig1.5" Name="PublisherPolicy1.5.config" KeyPath="no" Source="$(var.OpenNIFilesDir)\bin$(var.PlatformSuffix)\PublisherPolicy1.5.config" />
+</Component>
+<Component Id="OpenNINET" Guid="60718C69-87CB-45C0-A8A0-1B60E072D20A" DiskId="1">
+        <File Id="OpenNINET" Name="OpenNI.Net.dll" Assembly=".net" KeyPath="yes" Source="$(var.OpenNIFilesDir)\Bin$(var.PlatformSuffix)\OpenNI.Net.dll" />
+      </Component>
+      <Component Id="OpenNIPolicy1.1" Guid="ED633D34-ADC1-4b87-B3F6-930B8D600E0C" DiskId="1">
+        <File Id="OpenNIPolicy1.1" Name="Policy.1.1.OpenNI.Net.dll" Assembly=".net" KeyPath="yes" Source="$(var.OpenNIFilesDir)\Bin$(var.PlatformSuffix)\Policy.1.1.OpenNI.Net.dll" />
+        <File Id="OpenNIPolicyConfig1.1" Name="PublisherPolicy1.1.config" KeyPath="no" Source="$(var.OpenNIFilesDir)\Bin$(var.PlatformSuffix)\PublisherPolicy1.1.config" />
+      </Component>
+      <Component Id="OpenNIPolicy1.2" Guid="5CF88226-1671-4081-88BB-798791A6060A" DiskId="1">
+        <File Id="OpenNIPolicy1.2" Name="Policy.1.2.OpenNI.Net.dll" Assembly=".net" KeyPath="yes" Source="$(var.OpenNIFilesDir)\Bin$(var.PlatformSuffix)\Policy.1.2.OpenNI.Net.dll" />
+        <File Id="OpenNIPolicyConfig1.2" Name="PublisherPolicy1.2.config" KeyPath="no" Source="$(var.OpenNIFilesDir)\Bin$(var.PlatformSuffix)\PublisherPolicy1.2.config" />
       </Component>
-      <Component Id="OpenNIPolicy" Guid="ED633D34-ADC1-4b87-B3F6-930B8D600E0C" DiskId="1">
-        <File Id="OpenNIPolicy" Name="Policy.1.1.OpenNI.Net.dll" Assembly=".net" KeyPath="yes" Source="$(var.OpenNIFilesDir)\bin$(var.PlatformSuffix)\Policy.1.1.OpenNI.Net.dll" />
-        <File Id="OpenNIPolicyConfig" Name="PublisherPolicy.config" KeyPath="no" Source="$(var.OpenNIFilesDir)\bin$(var.PlatformSuffix)\PublisherPolicy.config" />
+      <Component Id="OpenNIPolicy1.3" Guid="5CF88226-1671-4081-88BB-798791A60613" DiskId="1">
+        <File Id="OpenNIPolicy1.3" Name="Policy.1.3.OpenNI.Net.dll" Assembly=".net" KeyPath="yes" Source="$(var.OpenNIFilesDir)\Bin$(var.PlatformSuffix)\Policy.1.3.OpenNI.Net.dll" />
+        <File Id="OpenNIPolicyConfig1.3" Name="PublisherPolicy1.3.config" KeyPath="no" Source="$(var.OpenNIFilesDir)\Bin$(var.PlatformSuffix)\PublisherPolicy1.3.config" />
       </Component>
     </DirectoryRef>
     
     <DirectoryRef Id="TARGETDIR" >
-      <Component Id="EnviromentVars" Guid="9270882A-E2CA-4F91-BB6B-87F483A0D3D0" DiskId="1">
-
+      
+      <Component Id="EnviromentVars" Guid="*" DiskId="1" >
+      
         <Environment Id="OPENNIINSTALLPATH"
                             Action="set"
                             Part="all"
                             Name="OPEN_NI_INSTALL_PATH$(var.PlatformSuffix)"
                             Permanent="no"
                             System="yes"
-                            Value="[INSTALLLOCATION]"/>
+                            Value="[INSTALLLOCATION]" />
 
         <Environment Id="OPENNIBIN"
                             Action="set"
@@ -202,7 +295,7 @@
                             Name="OPEN_NI_BIN$(var.PlatformSuffix)"
                             Permanent="no"
                             System="yes"
-                            Value="[INSTALLLOCATION]bin$(var.PlatformSuffix)"/>
+                            Value="[INSTALLLOCATION]Bin$(var.PlatformSuffix)"/>
 
         <Environment Id="OPENNIINCLUDE"
                             Action="set"
@@ -219,9 +312,17 @@
                             Permanent="no"
                             System="yes"
                             Value="[INSTALLLOCATION]Lib$(var.PlatformSuffix)"/>
+        
+
 
-        <Environment Id="Path" Action="set" Part="last" Name="Path" Permanent="yes" System="yes" Value="[INSTALLLOCATION]bin$(var.PlatformSuffix)"/>
-                
+        <Environment Id="ClassPath" Action="set" Part="last" Name="CLASSPATH" Permanent="yes" System="yes"
+                           Value="[INSTALLLOCATION]Bin$(var.PlatformSuffix)\org.OpenNI.jar"/>
+        
+        <Environment Id="Path" Action="set" Part="last" Name="Path" Permanent="yes" System="yes"
+                     Value="[INSTALLLOCATION]Bin$(var.PlatformSuffix)"/>
+        
+        <RegistryValue Root="HKCU" Key="Software\OpenNI" Name="installedEnv$(var.PlatformSuffix)" Type="integer" Value="1" KeyPath="yes"/> 
+        
       </Component>
       
     </DirectoryRef>
@@ -236,7 +337,7 @@
     <!--  Install the visual studio 2008 DLLs-->
     <DirectoryRef Id="TARGETDIR">
       <?if $(var.Platform)="x86"?>
-        <Merge Id="VCRedist" SourceFile="$(var.ResourcesDir)\\Microsoft_VC90_CRT_x86.msm" DiskId="1" Language="0"/>
+        <Merge Id="VCRedist" SourceFile="$(var.ResourcesDir)\\Microsoft_VC90_CRT_x86.msm" DiskId="1" Language="0" />
       <?else?>
         <Merge Id="VCRedist" SourceFile="$(var.ResourcesDir)\\Microsoft_VC90_CRT_x86_x64.msm" DiskId="1" Language="0"/>
       <?endif?>
@@ -246,19 +347,7 @@
     <CustomAction Id='drivex86Install' Directory="INSTALLLOCATIONDriver" Return="ignore" Impersonate="no" Execute="deferred"
                   ExeCommand=""[INSTALLLOCATIONDriver]dpinst-x86.exe" /sw /el" />    
     <CustomAction Id='driveamd64Install' Directory="INSTALLLOCATIONDriver" Return="ignore" Impersonate="no" Execute="deferred"
-                  ExeCommand=""[INSTALLLOCATIONDriver]dpinst-amd64.exe" /sw /el"/>
-    
-    <!-- Register Recorder     -->
-    <CustomAction Id='RegRecorder' Directory="INSTALLLOCATIONBin" Return="check" Impersonate="no"  Execute="deferred"
-                  ExeCommand=""[INSTALLLOCATIONBin]niReg$(var.PlatformSuffix).exe" nimRecorder$(var.PlatformSuffix).dll"/>
-    
-    <!-- Register MockNodes-->
-    <CustomAction Id='RegMockNodes' Directory="INSTALLLOCATIONBin" Return="check" Impersonate="no"  Execute="deferred"
-                  ExeCommand=""[INSTALLLOCATIONBin]niReg$(var.PlatformSuffix).exe" nimMockNodes$(var.PlatformSuffix).dll"/>
-    
-    <!-- Register Codecs-->
-    <CustomAction Id='RegCodecs' Directory="INSTALLLOCATIONBin" Return="check" Impersonate="no" Execute="deferred"
-                  ExeCommand=""[INSTALLLOCATIONBin]niReg$(var.PlatformSuffix).exe" nimCodecs$(var.PlatformSuffix).dll"/>
+                  ExeCommand=""[INSTALLLOCATIONDriver]dpinst-amd64.exe" /sw /el"/>       
 
     <!-- UnRegister Recorder     -->
     <CustomAction Id='UnRegRecorder' Directory="INSTALLLOCATIONBin" Return="ignore"  Impersonate="no" Execute="deferred"
@@ -272,7 +361,72 @@
     <CustomAction Id='UnRegCodecs' Directory="INSTALLLOCATIONBin" Return="ignore"  Impersonate="no" Execute="deferred"
                   ExeCommand=""[INSTALLLOCATIONBin]niReg$(var.PlatformSuffix).exe" -u nimCodecs$(var.PlatformSuffix).dll" />
 
-                      
+
+    <!-- Create the modules XML -->
+    <CustomAction Id="SetModulesXML" Property="ModulesXML" Value="[INSTALLLOCATION]"/>
+    <CustomAction Id="ModulesXML" Script="vbscript" Execute="deferred" Return="check" Impersonate="no"  Win64="$(var.Win64)">
+      <![CDATA[                  
+     Dim objFSO 
+      Dim objTextFile 
+      Const ForReading = 1, ForWriting = 2	    
+      
+      path = Session.Property("CustomActionData") 
+	  'path = "C:\Program Files (x86)\OpenNI"
+      
+      Set objFSO = CreateObject("Scripting.FileSystemObject")
+      
+      If (objFSO.FileExists(path + "\Data\modules.xml")) Then  
+        
+        Set objFSOTarget = CreateObject("scripting.filesystemobject")
+
+        Set objFilesSource = objFSO.OpenTextFile(path +"\Data\modules.xml",ForReading,True,0) 
+        Set objFilesTarget = objFSO.OpenTextFile(path +"\Data\modules.xml1",ForWriting,True,0)         
+
+        Do While objFilesSource.AtEndOfStream = FALSE
+		
+          strCurrentLine = objFilesSource.ReadLine
+          strCurrentLineNoSpace = Replace(strCurrentLine," ","")
+          
+          if StrComp(Left(strCurrentLineNoSpace,10),"<Modules/>") = 0 then            
+			objFilesTarget.WriteLine ("<Modules>")
+            objFilesTarget.WriteLine ("	<Module path=" + chr(&H22) + path + "bin$(var.PlatformSuffix)\nimRecorder$(var.PlatformSuffix).dll" + chr(&H22) + " />")
+            objFilesTarget.WriteLine ("	<Module path=" + chr(&H22) + path + "bin$(var.PlatformSuffix)\nimMockNodes$(var.PlatformSuffix).dll" + chr(&H22) +" />")
+            objFilesTarget.WriteLine ("	<Module path=" + chr(&H22) + path + "bin$(var.PlatformSuffix)\nimCodecs$(var.PlatformSuffix).dll"+ chr(&H22) + " />")       
+			objFilesTarget.WriteLine ("</Modules>")
+          else 
+			if StrComp(Left(strCurrentLineNoSpace,8),"<Modules") = 0 then
+				objFilesTarget.WriteLine strCurrentLine
+				objFilesTarget.WriteLine ("	<Module path=" + chr(&H22) + path + "bin$(var.PlatformSuffix)\nimRecorder$(var.PlatformSuffix).dll" + chr(&H22) + " />")
+				objFilesTarget.WriteLine ("	<Module path=" + chr(&H22) + path + "bin$(var.PlatformSuffix)\nimMockNodes$(var.PlatformSuffix).dll" + chr(&H22) +" />")
+				objFilesTarget.WriteLine ("	<Module path=" + chr(&H22) + path + "bin$(var.PlatformSuffix)\nimCodecs$(var.PlatformSuffix).dll"+ chr(&H22) + " />")       
+							
+			else
+				objFilesTarget.WriteLine strCurrentLine
+			end if
+          end if
+        Loop
+
+        objFilesSource.Close
+        objFilesTarget.Close
+      
+        'objFSOTarget.CopyFile path + "\Data\modules.xml", path + "\Data\modules.xml2"
+		    objFSOTarget.DeleteFile path + "\Data\modules.xml"
+        objFSOTarget.MoveFile path + "\Data\modules.xml1", path + "\Data\modules.xml"
+        
+      Else        
+        Set objTextFile = objFSO.CreateTextFile(path +"\Data\modules.xml", True)
+        
+        objTextFile.WriteLine ("<Modules>")
+        objTextFile.WriteLine ("	<Module path=" + chr(&H22) + path + "bin$(var.PlatformSuffix)\nimRecorder$(var.PlatformSuffix).dll" + chr(&H22) + " />")
+        objTextFile.WriteLine ("	<Module path=" + chr(&H22) + path + "bin$(var.PlatformSuffix)\nimMockNodes$(var.PlatformSuffix).dll" + chr(&H22) +" />")
+        objTextFile.WriteLine ("	<Module path=" + chr(&H22) + path + "bin$(var.PlatformSuffix)\nimCodecs$(var.PlatformSuffix).dll"+ chr(&H22) + " />")
+        objTextFile.WriteLine ("</Modules>")
+        
+        objTextFile.Close       
+      End If
+      ]]>
+    </CustomAction>
+    
     <!-- Set Environment for the current process -->
     <CustomAction Id="SetOpenNIPathData" Property="OpenNIPath" Value="[INSTALLLOCATION]"/>
     <CustomAction Id="OpenNIPath" Script="vbscript" Execute="deferred" Return="check" Impersonate="no"  Win64="$(var.Win64)">
@@ -282,40 +436,73 @@
       ]]>
     </CustomAction>
 
-    <!-- Set Environment for the current process  -->
-    <CustomAction Id="SetRemoveOpenNIPathData" Property="RemoveOpenNIPath" Value="[INSTALLLOCATIONBin]|[%Path]"/>
+    
+    
+    
+    <!-- Remove OpenNI path from the env PATH  -->
+    <CustomAction Id="SetRemoveOpenNIPathData" Property="RemoveOpenNIPath" Value="[INSTALLLOCATION]Bin$(var.PlatformSuffix)|[%Path]"/>
     <CustomAction Id="RemoveOpenNIPath" Script="vbscript" Execute="deferred" Impersonate="no"  Win64="$(var.Win64)">
       <![CDATA[
       strArgs = Session.Property("CustomActionData")      
-      Args = Split( strArgs, "|" )      
+      Args = Split( strArgs, "|" )            
+      str = Replace(Args(1),Args(0)+";","")      
       str = Replace(Args(1),Args(0),"")      
       set WSHShell = CreateObject("WScript.Shell")
-      WSHShell.Environment.item("PATH") = str
+      WSHShell.Environment.item("PATH") = str      
       ]]>
-    </CustomAction>                    
-    
+    </CustomAction>
+
+    <!-- Remove OpenNI path from the env CLASSPATH  -->
+    <CustomAction Id="SetRemoveOpenNIClassPathData" Property="RemoveOpenNIClassPath" Value="[INSTALLLOCATIONBin]org.OpenNI.jar|[%CLASSPATH]"/>
+    <CustomAction Id="RemoveOpenNIClassPath" Script="vbscript" Execute="deferred" Impersonate="no"  Win64="$(var.Win64)">
+      <![CDATA[
+      strArgs = Session.Property("CustomActionData")      
+      Args = Split( strArgs, "|" )  
+      str = Replace(Args(1),Args(0)+";","")   
+      str = Replace(Args(1),Args(0),"")      
+      set WSHShell = CreateObject("WScript.Shell")      
+      WSHShell.Environment.item("CLASSPATH") = str      
+      ]]>
+    </CustomAction>
+
+ 
     <!-- Set the components defined in our fragment files that will be used for our feature  -->
-    <Feature Id="OpenNIFeature" Title="!(loc.ProductName)" Level="1" >
+    <Feature Id="OpenNIFeature" Title="!(loc.ProductName)" Level="1"  >
+       <!--New id var-->
+      <ComponentRef Id="RemoveLogDir$(var.Platform)"/>
+      <ComponentRef Id="RemoveBinDir$(var.Platform)"/>
       <?if $(var.BinaryOnlyRedist)="False"?>
-        <ComponentGroupRef Id="OpenNIFiles" />              
-        <ComponentRef Id="DocumentationShortcut" />
-        <ComponentRef Id="SamplesShortcut" />
-        <ComponentRef Id="RemoveReleaseLogDir"/>
+        <ComponentGroupRef Id="OpenNIFiles" />
         <ComponentRef Id="RemoveDebugLogDir"/>
+        <ComponentRef Id="RemoveDebugDir" />              
+        <ComponentRef Id="SamplesBinDebugLog"/>      
+        <ComponentRef Id="SamplesBinReleaseLog"/>
       <?else?>        
-        <ComponentGroupRef Id="OpenNIBinaryFiles"/>
+        <ComponentGroupRef Id="OpenNIBinaryFiles"/>      
       <?endif?>
       
-      <ComponentRef Id="ApplicationShortcut" />
-      <ComponentRef Id="RegistryEntries" />
+      <ComponentRef Id="DocumentationShortcut" />
+      <ComponentRef Id="RegistryEntries" />     
       <ComponentRef Id="OpenNINET"/>
-      <ComponentRef Id="OpenNIPolicy"/>
+
+      
+      <ComponentRef Id="OpenNIPolicy1.1"/>
+      <ComponentRef Id="OpenNIPolicy1.2"/>
+      <ComponentRef Id="OpenNIPolicy1.3"/>
+      <ComponentRef Id="OpenNIPolicy1.4"/>      
+      <ComponentRef Id="OpenNIPolicy1.5"/>
+      
       <ComponentRef Id="EnviromentVars"/>
-      <ComponentRef Id="RemoveLogDir"/>
+
+      
+     
+
+
+
     </Feature>
 
-    <Feature Id="VCRedist" Title="Visual C++ 9.0 Runtime" AllowAdvertise="no" Display="hidden" Level="1">
-      <MergeRef Id="VCRedist"/>
+    <Feature Id="VCRedist" Title="Visual C++ 9.0 Runtime" AllowAdvertise="no" Display="hidden" Level="1" >
+      <MergeRef Id="VCRedist" />
     </Feature>
     
     <WixVariable Id="WixUICostingPopupOptOut" Value="0" />
@@ -324,13 +511,17 @@
 
       <Custom Action="SetRemoveOpenNIPathData" Before="RemoveOpenNIPath">REMOVE ~= "ALL" </Custom>
       <Custom Action="RemoveOpenNIPath" Before="InstallFinalize">REMOVE ~= "ALL" </Custom>
+
+      <Custom Action="SetRemoveOpenNIClassPathData" Before="RemoveOpenNIClassPath">REMOVE ~= "ALL" </Custom>
+      <Custom Action="RemoveOpenNIClassPath" Before="InstallFinalize">REMOVE ~= "ALL" </Custom>
             
       <Custom Action="SetOpenNIPathData" Before="OpenNIPath"/>
       <Custom Action="OpenNIPath" Before="PublishProduct"/>
 
-      <Custom Action='RegRecorder' After='OpenNIPath'>NOT Installed </Custom>
-      <Custom Action='RegMockNodes' After='RegRecorder'>NOT Installed </Custom>     
-      <Custom Action='RegCodecs' After='RegMockNodes'>NOT Installed </Custom>
+      <Custom Action="SetModulesXML" Before="ModulesXML">NOT Installed</Custom>
+      <Custom Action="ModulesXML" Before="InstallFinalize">NOT Installed</Custom>
+      
+
       <Custom Action='UnRegRecorder' Before='RemoveFiles'> REMOVE ~= "ALL" </Custom>
       <Custom Action='UnRegMockNodes' Before='RemoveFiles'> REMOVE ~= "ALL" </Custom>
       <Custom Action='UnRegCodecs' Before='RemoveFiles'> REMOVE ~= "ALL" </Custom>
diff --git a/Platform/Win32/Install/OpenNI/UI/CustomeInstallUI.wxs b/Platform/Win32/Install/OpenNI/UI/CustomeInstallUI.wxs
index 0fcc597..4a3f3cc 100644
--- a/Platform/Win32/Install/OpenNI/UI/CustomeInstallUI.wxs
+++ b/Platform/Win32/Install/OpenNI/UI/CustomeInstallUI.wxs
@@ -13,6 +13,7 @@
 
       <Dialog Id="CostumeInstallUIDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">        
 
+        
         <Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="!(loc.WelcomeEulaDlgInstall)" Hidden="yes">          
           <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
           <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
@@ -21,6 +22,8 @@
           <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
           <Condition Action="show">ALLUSERS</Condition>
         </Control>
+        
+       <!--
         <Control Id="InstallNoShield" Type="PushButton" ElevationShield="no" X="212" Y="243" Width="80" Height="17" Default="yes" Text="!(loc.WelcomeEulaDlgInstall)" Hidden="yes">          
           <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
           <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
@@ -29,6 +32,9 @@
           <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
           <Condition Action="show">NOT ALLUSERS</Condition>
         </Control>
+        -->
+        
+       
         <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
           <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
         </Control>
diff --git a/README b/README
index a98fbae..6e4290a 100644
--- a/README
+++ b/README
@@ -1,26 +1,26 @@
-OpenNI (Version 1.1.0.41 Unstable version - Apr 18th 2010)
-----------------------------------------------------------
+OpenNI (Version 1.5.2.23 - Dec 28th 2011)
+-----------------------------------------
 
-Website: www.openni.org
+Website: http://www.primesense.com
 Forum: http://groups.google.com/group/openni-dev
-Wiki: Coming soon!
+Wiki: http://wiki.openni.org
 
 Binaries are available at:
-http://www.openni.org/downloadfiles/openni-binaries/20-latest-unstable
-
-Please use this with the sensor unstable branch located at:
-Source:
-https://github.com/PrimeSense/Sensor/tree/unstable
-Binaries:
-http://www.openni.org/downloadfiles/openni-compliant-hardware/31-latest-unstable
+http://www.openni.org/Downloads/OpenNIModules.aspx
+(The "OpenNI Binaries" section)
 
+Sources are available at:
+https://github.com/OpenNI/OpenNI
+or
+https://github.com/OpenNI/OpenNI/tree/unstable
+for unstable branch
 
 Release Notes:
 --------------
 * At the moment, the default is to compile the code with SSE3 support (this is also true for the supplied binaries). 
   If you have a CPU without such support, please remove the sse compiler flags from the make files.
   (A good hint for this error is that you encounter an "illegal instructions" messages)
-* MacOSX: Only OSX 10.6 (Snow Leopard) with an Intel based CPU is currently supported.
+* MacOSX: Only OSX 10.6 (Snow Leopard) and above with an Intel based CPU is currently supported.
 * MacOSX: Drawing the depth/image maps via the mono .NET wrapper can be slow and will cause the FPS to drop.
   
 Build Notes:
@@ -36,6 +36,10 @@ Windows:
 		   Please make sure you download the version that matches your exact python version.
 		4) WIX 3.5
 		   From: http://wix.codeplex.com/releases/view/60102
+		5) JDK 6.0
+           From: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html
+		   You must also define an environment variable called "JAVA_HOME" that points to the JDK installation directory.
+		   For example: set JAVA_HOME=c:\Program Files\Java\jdk1.6.0_26
 
 	Optional requirements (To build the USB device driver):
 		1) Microsoft WDK
@@ -50,11 +54,13 @@ Windows:
 		   From: http://www.graphviz.org/Download_windows.php
 	
 	Building OpenNI:
-		1) Go to the directory: "Platform\Win32\CreateRedist".
-		   x86 32-bit - Run the script: "RedistMaker.bat".
+	    1) Uninstall the previous version.
+		2) Go to the directory: "Platform\Win32\CreateRedist".
+		   x86 32-bit - Run the script: "RedistMaker.bat y 32 y".
 		   x64 64-bit - Run the script: "RedistMaker.bat y 64 y".
 		   This will compile and prepare the redist exe files that includes everything.
-		2) Install the exe you've just made which is located in Platform\Win32\CreateRedist\Final\OPENNI-WinXX-1.X.X.X.exe 
+		3) Install the exe you've just made which is located in Platform\Win32\CreateRedist\FinalXX\OPENNI-WinXX-1.X.X.X.exe 
+		   (XX being the number of bits: 32 or 64)
 		   The installer will also create the necessary environment variables (OPEN_NI_xxx), add the DLLs to the system path and register the internal modules with NiReg.
 		   
 		The visual studio solution is located in: Platform\Win32\Build\OpenNI.sln.
@@ -87,6 +93,12 @@ Linux:
 		   From: http://freeglut.sourceforge.net/index.php#download
 		   Or via apt:
 		   sudo apt-get install freeglut3-dev
+		5) JDK 6.0
+		   From: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html
+		   Or via apt:
+		   sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
+		   sudo apt-get update
+		   sudo apt-get install sun-java6-jdk
 		   
 	Optional Requirements (To build the documentation):
 		1) Doxygen
@@ -105,11 +117,11 @@ Linux:
 		   sudo apt-get install mono-complete
 		   
 	Building OpenNI:
-		1) Go into the directory: "Platform/Linux-x86/CreateRedist".
+		1) Go into the directory: "Platform/Linux/CreateRedist".
 		   Run the script: "./RedistMaker".
-		   This will compile everything and create a redist package in the "Platform/Linux-x86/Redist" directory.
-		   It will also create a distribution in the "Platform/Linux-x86/CreateRedist/Final" directory.
-		2) Go into the directory: "Platform/Linux-x86/Redist".
+		   This will compile everything and create a redist package in the "Platform/Linux/Redist" directory.
+		   It will also create a distribution in the "Platform/Linux/CreateRedist/Final" directory.
+		2) Go into the directory: "Platform/Linux/Redist".
 		   Run the script: "sudo ./install.sh" (needs to run as root)
 
   		   The install script copies key files to the following location:
@@ -118,10 +130,31 @@ Linux:
 		       Includes into: /usr/include/ni
 		       Config files into: /var/lib/ni
 			
-		To build the package manually, you can run "make" in the "Platform\Linux-x86\Build" directory.
+		To build the package manually, you can run "make" in the "Platform\Linux\Build" directory.
 		If you wish to build the Mono wrappers, also run "make mono_wrapper" and "make mono_samples".
 		
-		Important: Please note that even though the directory is called Linux-x86, you can also use it to compile it for 64-bit targets and pretty much any other linux based environment.
+	Building OpenNI using a cross-compiler:
+		1) Make sure to define two environment variables:
+		   - <platform>_CXX - the name of the cross g++ for platform <platform>
+		   - <platform>_STAGING - a path to the staging dir (a directory which simulates the target root filesystem).
+		   Note that <platform> should be upper cased.
+		   For example, if wanting to compile for ARM from a x86 machine, ARM_CXX and ARM_STAGING should be defined.
+		2) Go into the directory: "Platform/Linux/CreateRedist".
+		   Run: "./RedistMaker <platform>" (for example: "./RedistMake Arm").
+		   This will compile everything and create a redist package in the "Platform/Linux/Redist" directory.
+		   It will also create a distribution in the "Platform/Linux/CreateRedist/Final" directory.
+		3) To install OpenNI files on the target file system:
+		   Go into the directory: "Platform/Linux/Redist".
+		   Run the script: "./install.sh -c $<platform>_STAGING" (for example: "./install.sh -c $ARM_STAGING").
+
+  		   The install script copies key files to the following location:
+		       Libs into: STAGING/usr/lib
+		       Bins into: STAGING/usr/bin
+		       Includes into: STAGING/usr/include/ni
+		       Config files into: STAGING/var/lib/ni
+			
+		To build the package manually, you can run "make PLATFORM=<platform>" in the "Platform\Linux\Build" directory.
+		If you wish to build the Mono wrappers, also run "make PLATFORM=<platform> mono_wrapper" and "make PLATFORM=<platform> mono_samples".
 	
 MacOSX:
 	Requirements:
diff --git a/Samples/HandTracker.java/org/OpenNI/Samples/HandTracker/HandTracker.java b/Samples/HandTracker.java/org/OpenNI/Samples/HandTracker/HandTracker.java
new file mode 100644
index 0000000..188a921
--- /dev/null
+++ b/Samples/HandTracker.java/org/OpenNI/Samples/HandTracker/HandTracker.java
@@ -0,0 +1,249 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI.Samples.HandTracker;
+
+import org.OpenNI.*;
+
+import java.nio.ShortBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.awt.*;
+import java.awt.image.*;
+
+class HandTracker extends Component
+{
+
+	class MyGestureRecognized implements IObserver<GestureRecognizedEventArgs>
+	{
+
+		@Override
+		public void update(IObservable<GestureRecognizedEventArgs> observable,
+				GestureRecognizedEventArgs args)
+		{
+			try
+			{
+				handsGen.StartTracking(args.getEndPosition());
+				gestureGen.removeGesture("Click");
+			} catch (StatusException e)
+			{
+				e.printStackTrace();
+			}
+		}
+	}
+	class MyHandCreateEvent implements IObserver<ActiveHandEventArgs>
+	{
+		public void update(IObservable<ActiveHandEventArgs> observable,
+				ActiveHandEventArgs args)
+		{
+			ArrayList<Point3D> newList = new ArrayList<Point3D>();
+			newList.add(args.getPosition());
+			history.put(new Integer(args.getId()), newList);
+		}
+	}
+	class MyHandUpdateEvent implements IObserver<ActiveHandEventArgs>
+	{
+		public void update(IObservable<ActiveHandEventArgs> observable,
+				ActiveHandEventArgs args)
+		{
+			ArrayList<Point3D> historyList = history.get(args.getId());
+			
+			historyList.add(args.getPosition());
+			
+			while (historyList.size() > historySize)
+			{
+				historyList.remove(0);
+			}
+
+		}
+	}
+	private int historySize = 10;
+	class MyHandDestroyEvent implements IObserver<InactiveHandEventArgs>
+	{
+		public void update(IObservable<InactiveHandEventArgs> observable,
+				InactiveHandEventArgs args)
+		{
+			history.remove(args.getId());
+			if (history.isEmpty())
+			{
+				try
+				{
+					gestureGen.addGesture("Click");
+				} catch (StatusException e)
+				{
+					e.printStackTrace();
+				}
+			}
+		}
+	}
+	
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private OutArg<ScriptNode> scriptNode;
+    private Context context;
+    private DepthGenerator depthGen;
+    private GestureGenerator gestureGen;
+    private HandsGenerator handsGen;
+    private HashMap<Integer, ArrayList<Point3D>> history;
+    private byte[] imgbytes;
+    private float histogram[];
+
+    private BufferedImage bimg;
+    int width, height;
+    
+    private final String SAMPLE_XML_FILE = "../../../../Data/SamplesConfig.xml";
+    public HandTracker()
+    {
+
+        try {
+            scriptNode = new OutArg<ScriptNode>();
+            context = Context.createFromXmlFile(SAMPLE_XML_FILE, scriptNode);
+
+            gestureGen = GestureGenerator.create(context);
+            gestureGen.addGesture("Click");
+            gestureGen.getGestureRecognizedEvent().addObserver(new MyGestureRecognized());
+            
+            handsGen = HandsGenerator.create(context);
+            handsGen.getHandCreateEvent().addObserver(new MyHandCreateEvent());
+            handsGen.getHandUpdateEvent().addObserver(new MyHandUpdateEvent());
+            handsGen.getHandDestroyEvent().addObserver(new MyHandDestroyEvent());
+            
+            depthGen = DepthGenerator.create(context);
+            DepthMetaData depthMD = depthGen.getMetaData();
+
+			context.startGeneratingAll();
+			
+            history = new HashMap<Integer, ArrayList<Point3D>>(); 
+            
+            histogram = new float[10000];
+            width = depthMD.getFullXRes();
+            height = depthMD.getFullYRes();
+            
+            imgbytes = new byte[width*height];
+            
+            DataBufferByte dataBuffer = new DataBufferByte(imgbytes, width*height);
+            Raster raster = Raster.createPackedRaster(dataBuffer, width, height, 8, null);
+            bimg = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_GRAY);
+            bimg.setData(raster);
+
+        } catch (GeneralException e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+    
+    private void calcHist(ShortBuffer depth)
+    {
+        // reset
+        for (int i = 0; i < histogram.length; ++i)
+            histogram[i] = 0;
+        
+        depth.rewind();
+
+        int points = 0;
+        while(depth.remaining() > 0)
+        {
+            short depthVal = depth.get();
+            if (depthVal != 0)
+            {
+                histogram[depthVal]++;
+                points++;
+            }
+        }
+        
+        for (int i = 1; i < histogram.length; i++)
+        {
+            histogram[i] += histogram[i-1];
+        }
+
+        if (points > 0)
+        {
+            for (int i = 1; i < histogram.length; i++)
+            {
+                histogram[i] = (int)(256 * (1.0f - (histogram[i] / (float)points)));
+            }
+        }
+    }
+
+
+    void updateDepth()
+    {
+        try {
+            DepthMetaData depthMD = depthGen.getMetaData();
+
+            context.waitAnyUpdateAll();
+            
+            ShortBuffer depth = depthMD.getData().createShortBuffer();
+            calcHist(depth);
+            depth.rewind();
+            
+            while(depth.remaining() > 0)
+            {
+                int pos = depth.position();
+                short pixel = depth.get();
+                imgbytes[pos] = (byte)histogram[pixel];
+            }
+        } catch (GeneralException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    public Dimension getPreferredSize() {
+        return new Dimension(width, height);
+    }
+
+    Color colors[] = {Color.RED, Color.BLUE, Color.CYAN, Color.GREEN, Color.MAGENTA, Color.PINK, Color.YELLOW};
+    public void paint(Graphics g) {
+        DataBufferByte dataBuffer = new DataBufferByte(imgbytes, width*height);
+        Raster raster = Raster.createPackedRaster(dataBuffer, width, height, 8, null);
+        bimg.setData(raster);
+
+        g.drawImage(bimg, 0, 0, null);
+
+        for (Integer id : history.keySet())
+        {
+        	try
+        	{
+        	ArrayList<Point3D> points = history.get(id);
+        	g.setColor(colors[id%colors.length]);
+        	int[] xPoints = new int[points.size()];
+        	int[] yPoints = new int[points.size()];
+        	for (int i = 0; i < points.size(); ++i)
+        	{
+        		Point3D proj = depthGen.convertRealWorldToProjective(points.get(i));
+        		xPoints[i] = (int)proj.getX();
+        		yPoints[i] = (int)proj.getY();
+        	}
+            g.drawPolyline(xPoints, yPoints, points.size());
+    		Point3D proj = depthGen.convertRealWorldToProjective(points.get(points.size()-1));
+            g.drawArc((int)proj.getX(), (int)proj.getY(), 5, 5, 0, 360);
+        	} catch (StatusException e)
+        	{
+        		e.printStackTrace();
+        	}
+        }
+        
+    }
+}
+
diff --git a/Samples/HandTracker.java/org/OpenNI/Samples/HandTracker/HandTrackerApplication.java b/Samples/HandTracker.java/org/OpenNI/Samples/HandTracker/HandTrackerApplication.java
new file mode 100644
index 0000000..50128a7
--- /dev/null
+++ b/Samples/HandTracker.java/org/OpenNI/Samples/HandTracker/HandTrackerApplication.java
@@ -0,0 +1,93 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI.Samples.HandTracker;
+
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JFrame;
+
+public class HandTrackerApplication {
+
+    /**
+	 * 
+	 */
+	public HandTracker viewer;
+	private boolean shouldRun = true;
+	private JFrame frame;
+
+    public HandTrackerApplication (JFrame frame)
+    {
+    	this.frame = frame;
+    	frame.addKeyListener(new KeyListener()
+		{
+			@Override
+			public void keyTyped(KeyEvent arg0) {}
+			@Override
+			public void keyReleased(KeyEvent arg0) {}
+			@Override
+			public void keyPressed(KeyEvent arg0) {
+				if (arg0.getKeyCode() == KeyEvent.VK_ESCAPE)
+				{
+					shouldRun = false;
+				}
+			}
+		});
+    }
+
+    public void buildUI()
+    {
+        if (viewer == null)
+        {
+            viewer = new HandTracker();
+        }
+        viewer.updateDepth();
+        viewer.repaint();
+    }
+
+    public static void main(String s[])
+    {
+        JFrame f = new JFrame("OpenNI Hand Tracker");
+        f.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {System.exit(0);}
+        });
+        HandTrackerApplication app = new HandTrackerApplication(f);
+        
+        app.viewer = new HandTracker();
+        f.add("Center", app.viewer);
+        f.pack();
+        f.setVisible(true);
+        app.run();
+    }
+
+    void run()
+    {
+        while(shouldRun) {
+            viewer.updateDepth();
+            viewer.repaint();
+        }
+        frame.dispose();
+    }
+    
+}
diff --git a/Samples/NiAudioSample/NiAudioSample.cpp b/Samples/NiAudioSample/NiAudioSample.cpp
index 6ade7e6..2205b96 100644
--- a/Samples/NiAudioSample/NiAudioSample.cpp
+++ b/Samples/NiAudioSample/NiAudioSample.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -89,7 +89,7 @@ XnStatus play(Context& context, AudioGenerator* aGens, XnUInt32 nNodes)
 	MMRESULT mmRes = waveOutOpen(&hWaveOut, WAVE_MAPPER, &wf, NULL, NULL, CALLBACK_NULL);
 	if (mmRes != MMSYSERR_NOERROR)
 	{
-		printf("Warning: Failed opening wave out device. Audio will not be played!\n");
+		printf("Warning: Failed opening wave out device. Audio could not be played!\n");
 		return -1;
 	}
 
@@ -166,6 +166,23 @@ XnStatus play(Context& context, AudioGenerator* aGens, XnUInt32 nNodes)
 		nAudioNextBuffer = (nAudioNextBuffer + 1) % NUMBER_OF_AUDIO_BUFFERS;
 	}
 
+	// stop playback
+	if (MMSYSERR_NOERROR != waveOutReset(hWaveOut))
+	{
+		printf("Warning: Failed stopping wave out device.!\n");
+		return -1;
+	}
+
+	// close device
+	waveOutClose(hWaveOut);
+
+	// release memory
+	for (int i = 0; i < NUMBER_OF_AUDIO_BUFFERS; ++i)
+	{
+		delete[] pAudioBuffers[i].lpData;
+	}
+	delete pAudioBuffers;
+
 #endif
 
 	return XN_STATUS_OK;
@@ -262,7 +279,9 @@ int main(int argc, char* argv[])
 	}
 #endif
 
-	nRetVal = context.InitFromXmlFile(SAMPLE_XML_PATH);
+	ScriptNode scriptNode;
+
+	nRetVal = context.InitFromXmlFile(SAMPLE_XML_PATH, scriptNode);
 	if (nRetVal == XN_STATUS_NO_NODE_PRESENT)
 	{
 		XnChar strError[1024];
@@ -307,7 +326,10 @@ int main(int argc, char* argv[])
 		nRetVal = record(context, gens, nNodes);
 	}
 
-	context.Shutdown();
+	scriptNode.Release();
+	for (int i = 0; i < nSupportedNodes; ++i)
+		gens[i].Release();
+	context.Release();
 
 	return nRetVal;
 }
diff --git a/Samples/NiBackRecorder/main.cpp b/Samples/NiBackRecorder/main.cpp
index 367cc58..3138e99 100644
--- a/Samples/NiBackRecorder/main.cpp
+++ b/Samples/NiBackRecorder/main.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -37,7 +37,7 @@
 		return rc;													\
 	}
 
-#define CHECK_RC_ERR(rc, what, error)			\
+#define CHECK_RC_ERR(rc, what, errors)			\
 {												\
 	if (rc == XN_STATUS_NO_NODE_PRESENT)		\
 	{											\
@@ -284,7 +284,8 @@ public:
 	CyclicBuffer(xn::Context& context, xn::DepthGenerator& depthGenerator, xn::ImageGenerator& imageGenerator, const RecConfiguration& config) :
 		m_context(context),
 		m_depthGenerator(depthGenerator),
-		m_imageGenerator(imageGenerator)
+		m_imageGenerator(imageGenerator),
+		m_pFrames(NULL)
 	{
 		m_bDepth = config.bRecordDepth;
 		m_bImage = config.bRecordImage;
@@ -409,8 +410,6 @@ public:
 
 		// Close recorder
 		m_recorder.Release();
-		mockImage.Release();
-		mockDepth.Release();
 
 		return XN_STATUS_OK;
 	}
@@ -466,8 +465,7 @@ int main(int argc, char** argv)
 		// Turn on log
 		xnLogInitSystem();
 		xnLogSetConsoleOutput(TRUE);
-		xnLogSetMaskState(XN_LOG_MASK_ALL, TRUE);
-		xnLogSetSeverityFilter(XN_LOG_VERBOSE);
+		xnLogSetMaskMinSeverity(XN_LOG_MASK_ALL, XN_LOG_VERBOSE);
 	}
 
 	// Initialize OpenNI
@@ -550,7 +548,9 @@ int main(int argc, char** argv)
 		printf("Missed %d of %d image frames (%5.2f%%)\n", nMissedImageFrames, (nMissedImageFrames+nImageFrames), (nMissedImageFrames*100.0)/(nMissedImageFrames+nImageFrames));
 	}
 
-	context.Shutdown();
+	imageGenerator.Release();
+	depthGenerator.Release();
+	context.Release();
 
 	return 0;
 }
diff --git a/Samples/NiCRead/NiCRead.c b/Samples/NiCRead/NiCRead.c
index d796816..89051ed 100644
--- a/Samples/NiCRead/NiCRead.c
+++ b/Samples/NiCRead/NiCRead.c
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -47,6 +47,7 @@ int main()
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 	XnContext* pContext;
+	XnNodeHandle hScriptNode;
 	XnEnumerationErrors* pErrors;
 	XnNodeHandle hDepth;
 	XnDepthMetaData* pDepthMD;
@@ -56,7 +57,7 @@ int main()
 	nRetVal = xnEnumerationErrorsAllocate(&pErrors);
 	CHECK_RC(nRetVal, "Allocate errors object");
 
-	nRetVal = xnInitFromXmlFile(SAMPLE_XML_PATH, &pContext, pErrors);
+	nRetVal = xnInitFromXmlFileEx(SAMPLE_XML_PATH, &pContext, pErrors, &hScriptNode);
 	if (nRetVal == XN_STATUS_NO_NODE_PRESENT)
 	{
 		XnChar strError[1024];
@@ -74,7 +75,7 @@ int main()
 
 	xnEnumerationErrorsFree(pErrors);
 
-	nRetVal = xnFindExistingNodeByType(pContext, XN_NODE_TYPE_DEPTH, &hDepth);
+	nRetVal = xnFindExistingRefNodeByType(pContext, XN_NODE_TYPE_DEPTH, &hDepth);
 	CHECK_RC(nRetVal, "Find depth generator");
 
 	pDepthMD = xnAllocateDepthMetaData();
@@ -97,7 +98,9 @@ int main()
 
 	xnFreeDepthMetaData(pDepthMD);
 
-	xnShutdown(pContext);
+	xnProductionNodeRelease(hDepth);
+	xnProductionNodeRelease(hScriptNode);
+	xnContextRelease(pContext);
 
 	return 0;
 }
diff --git a/Samples/NiConvertXToONI/NiConvertXToONI.cpp b/Samples/NiConvertXToONI/NiConvertXToONI.cpp
index c657923..c223b15 100644
--- a/Samples/NiConvertXToONI/NiConvertXToONI.cpp
+++ b/Samples/NiConvertXToONI/NiConvertXToONI.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -82,12 +82,9 @@ int main(int argc, char* argv[])
 	CHECK_RC(nRetVal, "Init");
 
 	// open input file
-	nRetVal = context.OpenFileRecording(strInputFile);
-	CHECK_RC(nRetVal, "Open input file");
-
 	Player player;
-	nRetVal = context.FindExistingNode(XN_NODE_TYPE_PLAYER, player);
-	CHECK_RC(nRetVal, "Get player node");
+	nRetVal = context.OpenFileRecording(strInputFile, player);
+	CHECK_RC(nRetVal, "Open input file");
 
 	nRetVal = player.SetPlaybackSpeed(XN_PLAYBACK_SPEED_FASTEST);
 	CHECK_RC(nRetVal, "Setting playback speed");
@@ -105,8 +102,6 @@ int main(int argc, char* argv[])
 	nRetVal = recorder.SetDestination(XN_RECORD_MEDIUM_FILE, strOutputFile);
 	CHECK_RC(nRetVal, "Set recorder destination file");
 
-	ProductionNode seekNode;
-
 	// add all nodes to recorder
 	for (NodeInfoList::Iterator it = nodes.Begin(); it != nodes.End(); ++it)
 	{
@@ -122,17 +117,17 @@ int main(int argc, char* argv[])
 		nRetVal = nodeInfo.GetInstance(node);
 		CHECK_RC(nRetVal, "Get instance");
 
-		if (seekNodeType == nodeInfo.GetDescription().Type)
+		if (seekNodeType == XN_NODE_TYPE_INVALID)
 		{
-			seekNode = node;
-			nRetVal = player.SeekToFrame(seekNode.GetName(), nStartFrame, XN_PLAYER_SEEK_SET);
-			CHECK_RC(nRetVal, "Seek player to frame");
-			nRetVal = recorder.AddNodeToRecording(seekNode);
-			CHECK_RC(nRetVal, "Add seek node to recording");
-			break; //Out of for - we found our sought node.
+			//No node type specified - record all nodes.
+			nRetVal = recorder.AddNodeToRecording(node);
+			CHECK_RC(nRetVal, "Add node to recording");
 		}
-		else
+		else if (seekNodeType == nodeInfo.GetDescription().Type)
 		{
+			//If node type is specified, we only record nodes of that type.
+			nRetVal = player.SeekToFrame(node.GetName(), nStartFrame, XN_PLAYER_SEEK_SET);
+			CHECK_RC(nRetVal, "Seek player to frame");
 			nRetVal = recorder.AddNodeToRecording(node);
 			CHECK_RC(nRetVal, "Add node to recording");
 		}
@@ -141,19 +136,20 @@ int main(int argc, char* argv[])
 	nRetVal = player.SetRepeat(FALSE);
 	XN_IS_STATUS_OK(nRetVal);
 
-	int nFrame = 0;
+	XnUInt32 nFrame = 0;
 
 	while ((nRetVal = context.WaitAnyUpdateAll()) != XN_STATUS_EOF)
 	{
 		CHECK_RC(nRetVal, "Read next frame");
 		printf("Recording: %u\r", nFrame++);
-		if (seekNode.IsValid() && (nFrame == nEndFrame))
+		if ((seekNodeType != XN_NODE_TYPE_INVALID) && (nFrame == nEndFrame))
 		{
 			break;			
 		}
 	}
 
-	context.Shutdown();
+	player.Release();
+	context.Release();
 
 	return 0;
 }
diff --git a/Samples/NiSimpleViewer/GL/gl.h b/Samples/NiHandTracker/GL/gl.h
similarity index 100%
copy from Samples/NiSimpleViewer/GL/gl.h
copy to Samples/NiHandTracker/GL/gl.h
diff --git a/Samples/NiSimpleViewer/GL/glext.h b/Samples/NiHandTracker/GL/glext.h
similarity index 100%
copy from Samples/NiSimpleViewer/GL/glext.h
copy to Samples/NiHandTracker/GL/glext.h
diff --git a/Samples/NiSimpleViewer/GL/glut.h b/Samples/NiHandTracker/GL/glut.h
similarity index 100%
copy from Samples/NiSimpleViewer/GL/glut.h
copy to Samples/NiHandTracker/GL/glut.h
diff --git a/Samples/NiSimpleViewer/GL/wglext.h b/Samples/NiHandTracker/GL/wglext.h
similarity index 100%
copy from Samples/NiSimpleViewer/GL/wglext.h
copy to Samples/NiHandTracker/GL/wglext.h
diff --git a/Samples/NiSimpleViewer/Libs/glut32.lib b/Samples/NiHandTracker/Libs/glut32.lib
similarity index 100%
copy from Samples/NiSimpleViewer/Libs/glut32.lib
copy to Samples/NiHandTracker/Libs/glut32.lib
diff --git a/Samples/NiSimpleViewer/Libs/glut64.lib b/Samples/NiHandTracker/Libs/glut64.lib
similarity index 100%
copy from Samples/NiSimpleViewer/Libs/glut64.lib
copy to Samples/NiHandTracker/Libs/glut64.lib
diff --git a/Samples/NiHandTracker/NiHandTracker.cpp b/Samples/NiHandTracker/NiHandTracker.cpp
new file mode 100644
index 0000000..700a26c
--- /dev/null
+++ b/Samples/NiHandTracker/NiHandTracker.cpp
@@ -0,0 +1,226 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "NiHandTracker.h"
+#include <cassert>
+
+
+using namespace xn;
+typedef TrailHistory::Trail Trail;
+
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define LENGTHOF(arr)			(sizeof(arr)/sizeof(arr[0]))
+#define FOR_ALL(arr, action)	{for(int i = 0; i < LENGTHOF(arr); ++i){action(arr[i])}}
+
+#define ADD_GESTURE(name)		{if(m_GestureGenerator.AddGesture(name, NULL) != XN_STATUS_OK){printf("Unable to add gesture"); exit(1);}}
+#define REMOVE_GESTURE(name)	{if(m_GestureGenerator.RemoveGesture(name) != XN_STATUS_OK){printf("Unable to remove gesture"); exit(1);}}
+
+#define ADD_ALL_GESTURES		FOR_ALL(cGestures, ADD_GESTURE)
+#define REMOVE_ALL_GESTURES		FOR_ALL(cGestures, REMOVE_GESTURE)
+
+
+//---------------------------------------------------------------------------
+// Consts
+//---------------------------------------------------------------------------
+// Gestures to track
+static const char			cClickStr[] = "Click";
+static const char			cWaveStr[] = "Wave";
+static const char* const	cGestures[] =
+{
+	cClickStr,
+	cWaveStr
+};
+
+//---------------------------------------------------------------------------
+// Statics
+//---------------------------------------------------------------------------
+XnList	HandTracker::sm_Instances;
+
+
+//---------------------------------------------------------------------------
+// Hooks
+//---------------------------------------------------------------------------
+void XN_CALLBACK_TYPE HandTracker::Gesture_Recognized(	xn::GestureGenerator&	generator, 
+														const XnChar*			strGesture, 
+														const XnPoint3D*		pIDPosition, 
+														const XnPoint3D*		pEndPosition, 
+														void*					pCookie)
+{
+	printf("Gesture recognized: %s\n", strGesture);
+
+	HandTracker*	pThis = static_cast<HandTracker*>(pCookie);
+	if(sm_Instances.Find(pThis) == sm_Instances.end())
+	{
+		printf("Dead HandTracker: skipped!\n");
+		return;
+	}
+
+	pThis->m_HandsGenerator.StartTracking(*pEndPosition);
+}
+
+void XN_CALLBACK_TYPE HandTracker::Hand_Create(	xn::HandsGenerator& generator, 
+												XnUserID			nId, 
+												const XnPoint3D*	pPosition, 
+												XnFloat				fTime, 
+												void*				pCookie)
+{
+	printf("New Hand: %d @ (%f,%f,%f)\n", nId, pPosition->X, pPosition->Y, pPosition->Z);
+
+	HandTracker*	pThis = static_cast<HandTracker*>(pCookie);
+	if(sm_Instances.Find(pThis) == sm_Instances.end())
+	{
+		printf("Dead HandTracker: skipped!\n");
+		return;
+	}
+
+	// Add to hands history if this user is not already tracked
+	if(!pThis->m_History.Find(nId))
+	{
+		pThis->m_History.Add(nId).Push(*pPosition);
+	}
+}
+
+void XN_CALLBACK_TYPE HandTracker::Hand_Update(	xn::HandsGenerator& generator, 
+												XnUserID			nId, 
+												const XnPoint3D*	pPosition, 
+												XnFloat				fTime, 
+												void*				pCookie)
+{
+	HandTracker*	pThis = static_cast<HandTracker*>(pCookie);
+	if(sm_Instances.Find(pThis) == sm_Instances.end())
+	{
+		printf("Dead HandTracker: skipped!\n");
+		return;
+	}
+
+	// Add to this user's hands history
+	Trail*	const trail = pThis->m_History.Find(nId);
+	if(!trail)
+	{
+		printf("Dead hand update: skipped!\n");
+		return;
+	}
+	trail->Push(*pPosition);
+}
+
+void XN_CALLBACK_TYPE HandTracker::Hand_Destroy(	xn::HandsGenerator& generator, 
+													XnUserID			nId, 
+													XnFloat				fTime, 
+													void*				pCookie)
+{
+	printf("Lost Hand: %d\n", nId);
+
+	HandTracker*	pThis = static_cast<HandTracker*>(pCookie);
+	if(sm_Instances.Find(pThis) == sm_Instances.end())
+	{
+		printf("Dead HandTracker: skipped!\n");
+		return;
+	}
+
+	// Remove this user from hands history
+	pThis->m_History.Remove(nId);
+}
+
+
+//---------------------------------------------------------------------------
+// Method Definitions
+//---------------------------------------------------------------------------
+HandTracker::HandTracker(xn::Context& context)
+:m_rContext(context),
+m_History(MAX_HAND_TRAIL_LENGTH)
+{
+	// Track all living instances (to protect against calling dead pointers in the Gesture/Hand Generator hooks)
+	XnStatus rc = sm_Instances.AddLast(this);
+	if (rc != XN_STATUS_OK)
+	{
+		printf("Unable to add NiHandTracker instance to the list.");
+		exit(1);
+	}
+}
+
+HandTracker::~HandTracker()
+{
+	// Remove the current instance from living instances list
+	XnList::ConstIterator it = sm_Instances.Find(this);
+	assert(it != sm_Instances.end());
+	sm_Instances.Remove(it);
+}
+
+XnStatus HandTracker::Init()
+{            
+	XnStatus			rc;
+	XnCallbackHandle	chandle;
+
+	// Create generators
+	rc = m_GestureGenerator.Create(m_rContext);
+	if (rc != XN_STATUS_OK)
+	{
+		printf("Unable to create GestureGenerator.");
+		return rc;
+	}
+
+	rc = m_HandsGenerator.Create(m_rContext);
+	if (rc != XN_STATUS_OK)
+	{
+		printf("Unable to create HandsGenerator.");
+		return rc;
+	}
+
+	// Register callbacks
+	// Using this as cookie
+	rc = m_GestureGenerator.RegisterGestureCallbacks(Gesture_Recognized, Gesture_Process, this, chandle);
+	if (rc != XN_STATUS_OK)
+	{
+		printf("Unable to register gesture callbacks.");
+		return rc;
+	}
+
+	rc = m_HandsGenerator.RegisterHandCallbacks(Hand_Create, Hand_Update, Hand_Destroy, this, chandle);
+	if (rc != XN_STATUS_OK)
+	{
+		printf("Unable to register hand callbacks.");
+		return rc;
+	}
+
+	return XN_STATUS_OK;
+}
+
+XnStatus HandTracker::Run()
+{
+	//ADD_ALL_GESTURES;
+
+	XnStatus	rc = m_rContext.StartGeneratingAll();
+	if (rc != XN_STATUS_OK)
+	{
+		printf("Unable to start generating.");
+		return rc;
+	}
+
+	ADD_ALL_GESTURES;
+
+	return XN_STATUS_OK;
+}
diff --git a/Samples/NiHandTracker/NiHandTracker.h b/Samples/NiHandTracker/NiHandTracker.h
new file mode 100644
index 0000000..1703e99
--- /dev/null
+++ b/Samples/NiHandTracker/NiHandTracker.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef NI_HAND_TRACKER_H__
+#define NI_HAND_TRACKER_H__
+
+#include <XnCppWrapper.h>
+#include "NiTrailHistory.h"
+
+// Hand position history length (positions)
+#define MAX_HAND_TRAIL_LENGTH	10
+
+class HandTracker
+{
+public:
+	HandTracker(xn::Context& context);
+	~HandTracker();
+
+	XnStatus Init();
+	XnStatus Run();
+
+	const TrailHistory&	GetHistory()	const	{return m_History;}
+
+private:
+	// OpenNI Gesture and Hands Generator callbacks
+	static void XN_CALLBACK_TYPE Gesture_Recognized(xn::GestureGenerator&	generator, 
+													const XnChar*			strGesture, 
+													const XnPoint3D*		pIDPosition, 
+													const XnPoint3D*		pEndPosition, 
+													void*					pCookie);
+	static void XN_CALLBACK_TYPE Gesture_Process(	xn::GestureGenerator&	generator, 
+													const XnChar*			strGesture, 
+													const XnPoint3D*		pPosition, 
+													XnFloat					fProgress, 
+													void*					pCookie)	{}
+	static void XN_CALLBACK_TYPE Hand_Create(	xn::HandsGenerator& generator, 
+												XnUserID			nId, 
+												const XnPoint3D*	pPosition, 
+												XnFloat				fTime, 
+												void*				pCookie);
+	static void XN_CALLBACK_TYPE Hand_Update(	xn::HandsGenerator& generator, 
+												XnUserID			nId, 
+												const XnPoint3D*	pPosition, 
+												XnFloat				fTime, 
+												void*				pCookie);
+	static void XN_CALLBACK_TYPE Hand_Destroy(	xn::HandsGenerator& generator, 
+												XnUserID			nId, 
+												XnFloat				fTime, 
+												void*				pCookie);
+
+	xn::Context&			m_rContext;
+	TrailHistory			m_History;
+	xn::GestureGenerator	m_GestureGenerator;
+	xn::HandsGenerator		m_HandsGenerator;
+
+	static XnList	sm_Instances;	// Living instances of the class
+};
+
+#endif //NI_HAND_TRACKER_H__
\ No newline at end of file
diff --git a/Samples/NiHandTracker/NiHandViewer.cpp b/Samples/NiHandTracker/NiHandViewer.cpp
new file mode 100644
index 0000000..c1ed416
--- /dev/null
+++ b/Samples/NiHandTracker/NiHandViewer.cpp
@@ -0,0 +1,144 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "NiHandViewer.h"
+#if (XN_PLATFORM == XN_PLATFORM_MACOSX)
+#include <GLUT/glut.h>
+#else
+#include <GL/glut.h>
+#endif
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define LENGTHOF(arr)			(sizeof(arr)/sizeof(arr[0]))
+
+
+//---------------------------------------------------------------------------
+// Method Definitions
+//---------------------------------------------------------------------------
+SimpleViewer& HandViewer::CreateInstance( xn::Context& context )
+{
+	assert(!sm_pInstance);
+	return *(sm_pInstance = new HandViewer(context));
+}
+
+HandViewer::HandViewer(xn::Context& context)
+:SimpleViewer(context),
+m_HandTracker(context)
+{}
+
+XnStatus HandViewer::Init(int argc, char **argv)
+{
+	XnStatus rc;
+	rc = SimpleViewer::Init(argc, argv);
+	if(rc != XN_STATUS_OK)
+	{
+		return rc;
+	}
+
+	return m_HandTracker.Init();
+}
+
+XnStatus HandViewer::Run()
+{
+	XnStatus rc = m_HandTracker.Run();
+
+	if(rc != XN_STATUS_OK)
+	{
+		return rc;
+	}
+
+	return SimpleViewer::Run(); // Does not return, enters OpenGL main loop instead
+}
+
+void HandViewer::DisplayPostDraw()
+{
+	typedef TrailHistory			History;
+	typedef History::ConstIterator	HistoryIterator;
+	typedef History::Trail			Trail;
+	typedef Trail::ConstIterator	TrailIterator;
+
+	static const float colours[][3] =
+	{
+		{ 0.5f, 0.5f, 0.5f},
+		{ 0.0f, 1.0f, 0.0f},
+		{ 0.0f, 0.5f, 1.0f},
+		{ 1.0f, 1.0f, 0.0f},
+		{ 1.0f, 0.5f, 0.0f},
+		{ 1.0f, 0.0f, 1.0f}
+	};
+	const TrailHistory&	history = m_HandTracker.GetHistory();
+
+	// History points coordinates buffer
+	XnFloat	coordinates[3 * MAX_HAND_TRAIL_LENGTH];
+
+	const HistoryIterator	hend = history.end();
+	for(HistoryIterator		hit = history.begin(); hit != hend; ++hit)
+	{
+
+		// Dump the history to local buffer
+		int				numpoints = 0;
+		const Trail&	trail = hit.GetTrail();
+
+		const TrailIterator	tend = trail.end();
+		for(TrailIterator	tit = trail.begin(); tit != tend; ++tit)
+		{
+			XnPoint3D	point = *tit;
+			m_depth.ConvertRealWorldToProjective(1, &point, &point);
+			ScalePoint(point);
+			coordinates[numpoints * 3] = point.X;
+			coordinates[numpoints * 3 + 1] = point.Y;
+			coordinates[numpoints * 3 + 2] = 0;
+
+			++numpoints;
+		}
+		assert(numpoints <= MAX_HAND_TRAIL_LENGTH);
+
+		// Draw the hand trail history
+		XnUInt32 nColor = hit.GetKey() % LENGTHOF(colours);
+		glColor4f(colours[nColor][0],
+			colours[nColor][1],
+			colours[nColor][2],
+			1.0f);
+		glPointSize(2);
+		glVertexPointer(3, GL_FLOAT, 0, coordinates);
+		glDrawArrays(GL_LINE_STRIP, 0, numpoints);
+		// Current point as a larger dot
+		glPointSize(8);
+		glDrawArrays(GL_POINTS, 0, 1);
+		glFlush();
+	}
+}
+
+
+XnStatus HandViewer::InitOpenGL( int argc, char **argv )
+{
+	XnStatus rc = SimpleViewer::InitOpenGL(argc, argv); 
+
+	glEnableClientState(GL_VERTEX_ARRAY);
+	glDisableClientState(GL_COLOR_ARRAY);
+
+	return rc;
+}
diff --git a/Samples/NiHandTracker/NiHandViewer.h b/Samples/NiHandTracker/NiHandViewer.h
new file mode 100644
index 0000000..9f90274
--- /dev/null
+++ b/Samples/NiHandTracker/NiHandViewer.h
@@ -0,0 +1,48 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef NI_HAND_VIEWER_H__
+#define NI_HAND_VIEWER_H__
+
+#include "NiSimpleViewer.h"
+#include "NiHandTracker.h"
+
+class HandViewer: public SimpleViewer
+{
+public:
+	// Singleton
+	static SimpleViewer& CreateInstance(xn::Context& context);
+
+	virtual XnStatus Init(int argc, char **argv);
+	virtual XnStatus Run();	//Does not return if successful
+
+protected:
+	HandViewer(xn::Context& context);
+
+	virtual void DisplayPostDraw();
+
+	virtual XnStatus InitOpenGL(int argc, char **argv);
+
+private:
+	HandTracker	m_HandTracker;
+};
+
+#endif //NI_HAND_VIEWER_H__
\ No newline at end of file
diff --git a/Samples/NiHandTracker/NiSimpleViewer.cpp b/Samples/NiHandTracker/NiSimpleViewer.cpp
new file mode 100644
index 0000000..31757cc
--- /dev/null
+++ b/Samples/NiHandTracker/NiSimpleViewer.cpp
@@ -0,0 +1,369 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "NiSimpleViewer.h"
+#include <XnOS.h>
+#if (XN_PLATFORM == XN_PLATFORM_MACOSX)
+#include <GLUT/glut.h>
+#else
+#include <GL/glut.h>
+#endif
+#include <math.h>
+#include <cassert>
+
+
+using namespace xn;
+
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define GL_WIN_SIZE_X	1280
+#define GL_WIN_SIZE_Y	1024
+#define TEXTURE_SIZE	512
+
+#define DEFAULT_DISPLAY_MODE	DISPLAY_MODE_DEPTH
+
+#define MIN_NUM_CHUNKS(data_size, chunk_size)	((((data_size)-1) / (chunk_size) + 1))
+#define MIN_CHUNKS_SIZE(data_size, chunk_size)	(MIN_NUM_CHUNKS(data_size, chunk_size) * (chunk_size))
+
+
+//---------------------------------------------------------------------------
+// Statics
+//---------------------------------------------------------------------------
+SimpleViewer* SimpleViewer::sm_pInstance = NULL;
+
+
+//---------------------------------------------------------------------------
+// GLUT Hooks
+//---------------------------------------------------------------------------
+void SimpleViewer::glutIdle (void)
+{
+	// Display the frame
+	glutPostRedisplay();
+}
+
+void SimpleViewer::glutDisplay (void)
+{
+	Instance().Display();
+}
+
+void SimpleViewer::glutKeyboard (unsigned char key, int x, int y)
+{
+	Instance().OnKey(key, x, y);
+}
+
+
+//---------------------------------------------------------------------------
+// Method Definitions
+//---------------------------------------------------------------------------
+SimpleViewer::SimpleViewer(xn::Context& context)
+	:m_pTexMap(NULL),
+	m_nTexMapX(0),
+	m_nTexMapY(0),
+	m_eViewState(DEFAULT_DISPLAY_MODE),
+	m_rContext(context)
+{}
+
+SimpleViewer::~SimpleViewer()
+{
+	delete[] m_pTexMap;
+}
+
+SimpleViewer& SimpleViewer::CreateInstance( xn::Context& context )
+{
+	assert(!sm_pInstance);
+	return *(sm_pInstance = new SimpleViewer(context));
+}
+
+void SimpleViewer::DestroyInstance(SimpleViewer& instance)
+{
+	assert(sm_pInstance);
+	assert(sm_pInstance == &instance);
+	delete sm_pInstance;
+	sm_pInstance = NULL;
+}
+
+SimpleViewer& SimpleViewer::Instance()
+{
+	assert(sm_pInstance);
+	return *sm_pInstance;
+}
+
+XnStatus SimpleViewer::Init(int argc, char **argv)
+{
+	XnStatus	rc;
+
+	rc = m_rContext.FindExistingNode(XN_NODE_TYPE_DEPTH, m_depth);
+	if (rc != XN_STATUS_OK)
+	{
+		printf("No depth node exists! Check your XML.");
+		return rc;
+	}
+
+	rc = m_rContext.FindExistingNode(XN_NODE_TYPE_IMAGE, m_image);
+	if (rc != XN_STATUS_OK)
+	{
+		printf("No image node exists! Check your XML.");
+		return rc;
+	}
+
+	m_depth.GetMetaData(m_depthMD);
+	m_image.GetMetaData(m_imageMD);
+
+	// Hybrid mode isn't supported in this sample
+	if (m_imageMD.FullXRes() != m_depthMD.FullXRes() || m_imageMD.FullYRes() != m_depthMD.FullYRes())
+	{
+		printf ("The device depth and image resolution must be equal!\n");
+		return 1;
+	}
+
+	// RGB is the only image format supported.
+	if (m_imageMD.PixelFormat() != XN_PIXEL_FORMAT_RGB24)
+	{
+		printf("The device image format must be RGB24\n");
+		return 1;
+	}
+
+	// Texture map init
+	m_nTexMapX = MIN_CHUNKS_SIZE(m_depthMD.FullXRes(), TEXTURE_SIZE);
+	m_nTexMapY = MIN_CHUNKS_SIZE(m_depthMD.FullYRes(), TEXTURE_SIZE);
+	m_pTexMap = new XnRGB24Pixel[m_nTexMapX * m_nTexMapY];
+
+	return InitOpenGL(argc, argv);
+}
+
+XnStatus SimpleViewer::Run()
+{
+	// Per frame code is in Display
+	glutMainLoop();	// Does not return!
+
+	return XN_STATUS_OK;
+}
+
+XnStatus SimpleViewer::InitOpenGL(int argc, char **argv)
+{
+	glutInit(&argc, argv);
+	glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+	glutInitWindowSize(GL_WIN_SIZE_X, GL_WIN_SIZE_Y);
+	glutCreateWindow ("OpenNI Hand Tracker");
+// 	glutFullScreen();
+	glutSetCursor(GLUT_CURSOR_NONE);
+
+	InitOpenGLHooks();
+
+	glDisable(GL_DEPTH_TEST);
+	glEnable(GL_TEXTURE_2D);
+
+	return XN_STATUS_OK;
+}
+
+void SimpleViewer::InitOpenGLHooks()
+{
+	glutKeyboardFunc(glutKeyboard);
+	glutDisplayFunc(glutDisplay);
+	glutIdleFunc(glutIdle);
+}
+
+void SimpleViewer::Display()
+{
+	XnStatus		rc = XN_STATUS_OK;
+
+	// Read a new frame
+	rc = m_rContext.WaitAnyUpdateAll();
+	if (rc != XN_STATUS_OK)
+	{
+		printf("Read failed: %s\n", xnGetStatusString(rc));
+		return;
+	}
+
+	m_depth.GetMetaData(m_depthMD);
+	m_image.GetMetaData(m_imageMD);
+
+	const XnDepthPixel* pDepth = m_depthMD.Data();
+	const XnUInt8* pImage = m_imageMD.Data();
+
+	unsigned int nImageScale = GL_WIN_SIZE_X / m_depthMD.FullXRes();
+
+	// Copied from SimpleViewer
+	// Clear the OpenGL buffers
+	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+	// Setup the OpenGL viewpoint
+	glMatrixMode(GL_PROJECTION);
+	glPushMatrix();
+	glLoadIdentity();
+	glOrtho(0, GL_WIN_SIZE_X, GL_WIN_SIZE_Y, 0, -1.0, 1.0);
+
+	// Calculate the accumulative histogram (the yellow display...)
+	xnOSMemSet(m_pDepthHist, 0, MAX_DEPTH*sizeof(float));
+
+	unsigned int nNumberOfPoints = 0;
+	for (XnUInt y = 0; y < m_depthMD.YRes(); ++y)
+	{
+		for (XnUInt x = 0; x < m_depthMD.XRes(); ++x, ++pDepth)
+		{
+			if (*pDepth != 0)
+			{
+				m_pDepthHist[*pDepth]++;
+				nNumberOfPoints++;
+			}
+		}
+	}
+	for (int nIndex=1; nIndex<MAX_DEPTH; nIndex++)
+	{
+		m_pDepthHist[nIndex] += m_pDepthHist[nIndex-1];
+	}
+	if (nNumberOfPoints)
+	{
+		for (int nIndex=1; nIndex<MAX_DEPTH; nIndex++)
+		{
+			m_pDepthHist[nIndex] = (unsigned int)(256 * (1.0f - (m_pDepthHist[nIndex] / nNumberOfPoints)));
+		}
+	}
+
+	xnOSMemSet(m_pTexMap, 0, m_nTexMapX*m_nTexMapY*sizeof(XnRGB24Pixel));
+
+	// check if we need to draw image frame to texture
+	if (m_eViewState == DISPLAY_MODE_OVERLAY ||
+		m_eViewState == DISPLAY_MODE_IMAGE)
+	{
+		const XnRGB24Pixel* pImageRow = m_imageMD.RGB24Data();
+		XnRGB24Pixel* pTexRow = m_pTexMap + m_imageMD.YOffset() * m_nTexMapX;
+
+		for (XnUInt y = 0; y < m_imageMD.YRes(); ++y)
+		{
+			const XnRGB24Pixel* pImage = pImageRow;
+			XnRGB24Pixel* pTex = pTexRow + m_imageMD.XOffset();
+
+			for (XnUInt x = 0; x < m_imageMD.XRes(); ++x, ++pImage, ++pTex)
+			{
+				*pTex = *pImage;
+			}
+
+			pImageRow += m_imageMD.XRes();
+			pTexRow += m_nTexMapX;
+		}
+	}
+
+	// check if we need to draw depth frame to texture
+	if (m_eViewState == DISPLAY_MODE_OVERLAY ||
+		m_eViewState == DISPLAY_MODE_DEPTH)
+	{
+		const XnDepthPixel* pDepthRow = m_depthMD.Data();
+		XnRGB24Pixel* pTexRow = m_pTexMap + m_depthMD.YOffset() * m_nTexMapX;
+
+		for (XnUInt y = 0; y < m_depthMD.YRes(); ++y)
+		{
+			const XnDepthPixel* pDepth = pDepthRow;
+			XnRGB24Pixel* pTex = pTexRow + m_depthMD.XOffset();
+
+			for (XnUInt x = 0; x < m_depthMD.XRes(); ++x, ++pDepth, ++pTex)
+			{
+				if (*pDepth != 0)
+				{
+					int nHistValue = m_pDepthHist[*pDepth];
+					pTex->nRed = nHistValue;
+					pTex->nGreen = nHistValue;
+					pTex->nBlue = nHistValue;
+				}
+			}
+
+			pDepthRow += m_depthMD.XRes();
+			pTexRow += m_nTexMapX;
+		}
+	}
+
+	// Create the OpenGL texture map
+	glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_nTexMapX, m_nTexMapY, 0, GL_RGB, GL_UNSIGNED_BYTE, m_pTexMap);
+
+
+	// Display the OpenGL texture map
+	glColor4f(1,1,1,1);
+
+	glEnable(GL_TEXTURE_2D);
+	glBegin(GL_QUADS);
+
+	int nXRes = m_depthMD.FullXRes();
+	int nYRes = m_depthMD.FullYRes();
+
+	
+	// upper left
+	glTexCoord2f(0, 0);
+	glVertex2f(0, 0);
+	// upper right
+	glTexCoord2f((float)nXRes/(float)m_nTexMapX, 0);
+	glVertex2f(GL_WIN_SIZE_X, 0);
+	// bottom right
+	glTexCoord2f((float)nXRes/(float)m_nTexMapX, (float)nYRes/(float)m_nTexMapY);
+	glVertex2f(GL_WIN_SIZE_X, GL_WIN_SIZE_Y);
+	// bottom left
+	glTexCoord2f(0, (float)nYRes/(float)m_nTexMapY);
+	glVertex2f(0, GL_WIN_SIZE_Y);
+
+	glEnd();
+	glDisable(GL_TEXTURE_2D);
+
+	// Subclass draw hook
+	DisplayPostDraw();
+
+	// Swap the OpenGL display buffers
+	glutSwapBuffers();
+}
+
+void SimpleViewer::OnKey(unsigned char key, int x, int y)
+{
+	switch (key)
+	{
+	case 27:
+		exit (1);
+	case '1':
+		m_eViewState = DISPLAY_MODE_OVERLAY;
+		m_depth.GetAlternativeViewPointCap().SetViewPoint(m_image);
+		break;
+	case '2':
+		m_eViewState = DISPLAY_MODE_DEPTH;
+		m_depth.GetAlternativeViewPointCap().ResetViewPoint();
+		break;
+	case '3':
+		m_eViewState = DISPLAY_MODE_IMAGE;
+		m_depth.GetAlternativeViewPointCap().ResetViewPoint();
+		break;
+	case 'm':
+		m_rContext.SetGlobalMirror(!m_rContext.GetGlobalMirror());
+		break;
+	}
+}
+
+void SimpleViewer::ScalePoint(XnPoint3D& point)
+{
+	point.X *= GL_WIN_SIZE_X;
+	point.X /= m_depthMD.XRes();
+
+	point.Y *= GL_WIN_SIZE_Y;
+	point.Y /= m_depthMD.YRes();
+}
diff --git a/Samples/NiHandTracker/NiSimpleViewer.h b/Samples/NiHandTracker/NiSimpleViewer.h
new file mode 100644
index 0000000..0731c2c
--- /dev/null
+++ b/Samples/NiHandTracker/NiSimpleViewer.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef NI_SIMPLE_VIEWER_H__
+#define NI_SIMPLE_VIEWER_H__
+
+#include <XnCppWrapper.h>
+
+
+#define MAX_DEPTH 10000
+
+
+enum DisplayModes_e
+{
+	DISPLAY_MODE_OVERLAY,
+	DISPLAY_MODE_DEPTH,
+	DISPLAY_MODE_IMAGE
+};
+
+
+class SimpleViewer
+{
+public:
+	// Singleton
+	static SimpleViewer& CreateInstance(xn::Context& context);
+	static void DestroyInstance(SimpleViewer& instance);
+
+	virtual XnStatus Init(int argc, char **argv);
+	virtual XnStatus Run();	//Does not return
+
+protected:
+	SimpleViewer(xn::Context& context);
+	virtual ~SimpleViewer();
+
+	virtual void Display();
+	virtual void DisplayPostDraw(){};	// Overload to draw over the screen image
+
+	virtual void OnKey(unsigned char key, int x, int y);
+
+	virtual XnStatus InitOpenGL(int argc, char **argv);
+	void InitOpenGLHooks();
+
+	static SimpleViewer& Instance();
+
+	xn::Context&		m_rContext;
+	xn::DepthGenerator	m_depth;
+	xn::ImageGenerator	m_image;
+
+	static SimpleViewer*	sm_pInstance;
+
+	void ScalePoint(XnPoint3D& point);
+private:
+	// GLUT callbacks
+	static void glutIdle();
+	static void glutDisplay();
+	static void glutKeyboard(unsigned char key, int x, int y);
+
+	float				m_pDepthHist[MAX_DEPTH];
+	XnRGB24Pixel*		m_pTexMap;
+	unsigned int		m_nTexMapX;
+	unsigned int		m_nTexMapY;
+	DisplayModes_e		m_eViewState;
+	xn::DepthMetaData	m_depthMD;
+	xn::ImageMetaData	m_imageMD;
+};
+
+#endif //NI_SIMPLE_VIEWER_H__
\ No newline at end of file
diff --git a/Samples/NiHandTracker/NiTrailHistory.cpp b/Samples/NiHandTracker/NiTrailHistory.cpp
new file mode 100644
index 0000000..ad735ee
--- /dev/null
+++ b/Samples/NiHandTracker/NiTrailHistory.cpp
@@ -0,0 +1,160 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "NiTrailHistory.h"
+
+
+//---------------------------------------------------------------------------
+// Trail Method Definitions
+//---------------------------------------------------------------------------
+TrailHistory::Trail::~Trail()
+{
+	// Pop and delete all data
+	XnPoint3D* point;
+	while((point = Pop()))
+	{
+		delete point;
+	}
+}
+
+void TrailHistory::Trail::Push( const XnPoint3D& position )
+{
+	XnPoint3D*	point;
+
+	if(m_nLength == m_nMaxLength)
+	{
+		// Reuse the already allocated memory, remove oldest history element
+		point = Pop();
+		assert(point);
+	}
+	else
+	{
+		// Should never overflow
+		assert(m_nLength < m_nMaxLength);
+		point = new XnPoint3D;
+	}
+
+	// Add the pushed value to the list
+	*point = position;
+	if(m_List.AddFirst(point) != XN_STATUS_OK)
+	{
+		printf("Unable to add to XnList");
+		exit(1);
+	}
+	++m_nLength;
+}
+
+XnPoint3D* TrailHistory::Trail::Pop()
+{
+	void*	point = NULL;
+
+	if(m_List.IsEmpty())
+	{
+		return NULL;
+	}
+
+	if(m_List.Remove(m_List.rbegin(), point) != XN_STATUS_OK)
+	{
+		printf("Unable to remove from XnList");
+		exit(1);
+	}
+	assert(point);
+	assert(m_nLength);
+	--m_nLength;
+	assert(m_nLength < m_nMaxLength);
+	return static_cast<XnPoint3D*>(point);
+}
+
+
+//---------------------------------------------------------------------------
+// TrailHistory Method Definitions
+//---------------------------------------------------------------------------
+
+TrailHistory::~TrailHistory()
+{
+	// Delete all data
+	while(!m_Hash.IsEmpty())
+	{
+		Trail*	trail;
+
+		if(m_Hash.Remove(m_Hash.begin().Key(), trail) != XN_STATUS_OK)
+		{
+			printf("Unable to remove from XnHash");
+			exit(1);
+		}
+		assert(trail);
+
+		delete static_cast<Trail*>(trail);
+	}
+}
+
+TrailHistory::Trail& TrailHistory::Add( XnUserID id )
+{
+	Trail*	dummy = NULL;
+
+	// An existing user should not be added again
+	assert(m_Hash.Get(id, dummy) == XN_STATUS_NO_MATCH);
+
+	Trail*	trail = new Trail(m_nMaxTrailLength);
+
+	if(m_Hash.Set(id, trail) != XN_STATUS_OK)
+	{
+		printf("Unable to add to XnHash");
+		exit(1);
+	}
+
+	return *trail;
+}
+
+TrailHistory::Trail* TrailHistory::Find( XnUserID id ) const
+{
+	Trail*	trail;
+
+	switch(m_Hash.Get(id, trail))
+	{
+	case XN_STATUS_OK:
+		return trail;
+
+	case XN_STATUS_NO_MATCH:
+		return NULL;
+
+	default:
+		printf("Unable to search XnHash");
+		exit(1);
+	}
+}
+
+void TrailHistory::Remove( XnUserID id )
+{
+	Trail*	trail = NULL;
+
+	if(m_Hash.Remove(id, trail) != XN_STATUS_OK)
+	{
+		printf("Unable to remove from XnHash");
+		exit(1);
+	}
+	assert(trail);
+
+	delete trail;
+}
diff --git a/Samples/NiHandTracker/NiTrailHistory.h b/Samples/NiHandTracker/NiTrailHistory.h
new file mode 100644
index 0000000..8394196
--- /dev/null
+++ b/Samples/NiHandTracker/NiTrailHistory.h
@@ -0,0 +1,114 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef NI_TRAIL_HISTORY_H__
+#define NI_TRAIL_HISTORY_H__
+
+#include <XnCppWrapper.h>
+#include <XnList.h>
+#include <XnHash.h>
+#include <cassert>
+
+// Substitute for map<XnUserID, queue<XnPoint3D>>
+class TrailHistory
+{
+public:
+	//TrailHistory service classes
+	class Trail
+	{
+	public:
+		class ConstIterator
+		{
+		public:
+			ConstIterator(XnList::ConstIterator	base)						:m_Iterator(base){};
+
+			ConstIterator&	operator++()									{++m_Iterator; return *this;}
+			XnBool			operator==(const ConstIterator& other)	const	{return m_Iterator == other.m_Iterator;}
+			XnBool			operator!=(const ConstIterator& other)	const	{return m_Iterator != other.m_Iterator;}
+
+			const XnPoint3D&	operator*()	const							{return *static_cast<XnPoint3D*>(*m_Iterator);}
+
+		private:
+			XnList::ConstIterator	m_Iterator;
+		};
+
+	public:
+		Trail(unsigned short maxLength)										:m_nLength(0),m_nMaxLength(maxLength){assert(maxLength > 0);}
+		~Trail();
+
+		void Push(const XnPoint3D&	position);
+
+		ConstIterator		begin() const									{return ConstIterator(m_List.begin());}
+		const ConstIterator	end()	const									{return ConstIterator(m_List.end());}
+
+	private:
+		// Not supported:
+		Trail(const Trail&);
+		Trail&	operator=(const Trail&);
+
+		// Service
+		XnPoint3D*	Pop();
+
+		XnList			m_List;
+		unsigned short	m_nLength;
+		unsigned short	m_nMaxLength;
+	};
+
+	XN_DECLARE_DEFAULT_HASH(XnUserID, Trail*, XnUserTrailHash);
+
+	class ConstIterator
+	{
+	public:
+		ConstIterator(XnUserTrailHash::ConstIterator	base)						:m_Iterator(base){};
+
+		ConstIterator&	operator++()									{++m_Iterator; return *this;}
+		XnBool			operator==(const ConstIterator& other)	const	{return m_Iterator == other.m_Iterator;}
+		XnBool			operator!=(const ConstIterator& other)	const	{return m_Iterator != other.m_Iterator;}
+
+		XnUserID		GetKey()	const								{return m_Iterator.Key();}
+		const Trail&	GetTrail()	const								{return *m_Iterator.Value();}
+
+	private:
+		XnUserTrailHash::ConstIterator	m_Iterator;
+	};
+
+	// TrailHistory methods
+public:
+	TrailHistory(unsigned short maxTrailLength)							:m_nMaxTrailLength(maxTrailLength){assert(maxTrailLength > 0);}
+	~TrailHistory();
+
+	Trail&	Add(XnUserID id);
+	Trail*	Find(XnUserID id)	const;
+	void	Remove(XnUserID id);
+
+	ConstIterator		begin() const									{return ConstIterator(m_Hash.begin());}
+	const ConstIterator	end()	const									{return ConstIterator(m_Hash.end());}
+
+private:
+	// Not supported:
+	TrailHistory(const TrailHistory&);
+	TrailHistory&	operator=(const TrailHistory&);
+
+	XnUserTrailHash			m_Hash;
+	unsigned short	m_nMaxTrailLength;
+};
+
+#endif //NI_TRAIL_HISTORY_H__
\ No newline at end of file
diff --git a/Samples/NiSimpleViewer/glh/glh_array.h b/Samples/NiHandTracker/glh/glh_array.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_array.h
copy to Samples/NiHandTracker/glh/glh_array.h
diff --git a/Samples/NiSimpleViewer/glh/glh_convenience.h b/Samples/NiHandTracker/glh/glh_convenience.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_convenience.h
copy to Samples/NiHandTracker/glh/glh_convenience.h
diff --git a/Samples/NiSimpleViewer/glh/glh_cube_map.h b/Samples/NiHandTracker/glh/glh_cube_map.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_cube_map.h
copy to Samples/NiHandTracker/glh/glh_cube_map.h
diff --git a/Samples/NiSimpleViewer/glh/glh_extensions.h b/Samples/NiHandTracker/glh/glh_extensions.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_extensions.h
copy to Samples/NiHandTracker/glh/glh_extensions.h
diff --git a/Samples/NiSimpleViewer/glh/glh_genext.h b/Samples/NiHandTracker/glh/glh_genext.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_genext.h
copy to Samples/NiHandTracker/glh/glh_genext.h
diff --git a/Samples/NiSimpleViewer/glh/glh_glut.h b/Samples/NiHandTracker/glh/glh_glut.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_glut.h
copy to Samples/NiHandTracker/glh/glh_glut.h
diff --git a/Samples/NiSimpleViewer/glh/glh_glut2.h b/Samples/NiHandTracker/glh/glh_glut2.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_glut2.h
copy to Samples/NiHandTracker/glh/glh_glut2.h
diff --git a/Samples/NiSimpleViewer/glh/glh_glut_callfunc.h b/Samples/NiHandTracker/glh/glh_glut_callfunc.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_glut_callfunc.h
copy to Samples/NiHandTracker/glh/glh_glut_callfunc.h
diff --git a/Samples/NiSimpleViewer/glh/glh_glut_replay.h b/Samples/NiHandTracker/glh/glh_glut_replay.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_glut_replay.h
copy to Samples/NiHandTracker/glh/glh_glut_replay.h
diff --git a/Samples/NiSimpleViewer/glh/glh_glut_text.h b/Samples/NiHandTracker/glh/glh_glut_text.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_glut_text.h
copy to Samples/NiHandTracker/glh/glh_glut_text.h
diff --git a/Samples/NiSimpleViewer/glh/glh_interactors.h b/Samples/NiHandTracker/glh/glh_interactors.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_interactors.h
copy to Samples/NiHandTracker/glh/glh_interactors.h
diff --git a/Samples/NiSimpleViewer/glh/glh_linear.h b/Samples/NiHandTracker/glh/glh_linear.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_linear.h
copy to Samples/NiHandTracker/glh/glh_linear.h
diff --git a/Samples/NiSimpleViewer/glh/glh_mipmaps.h b/Samples/NiHandTracker/glh/glh_mipmaps.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_mipmaps.h
copy to Samples/NiHandTracker/glh/glh_mipmaps.h
diff --git a/Samples/NiSimpleViewer/glh/glh_obs.h b/Samples/NiHandTracker/glh/glh_obs.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_obs.h
copy to Samples/NiHandTracker/glh/glh_obs.h
diff --git a/Samples/NiSimpleViewer/glh/glh_text.h b/Samples/NiHandTracker/glh/glh_text.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_text.h
copy to Samples/NiHandTracker/glh/glh_text.h
diff --git a/Samples/NiHandTracker/main.cpp b/Samples/NiHandTracker/main.cpp
new file mode 100644
index 0000000..d5ca19e
--- /dev/null
+++ b/Samples/NiHandTracker/main.cpp
@@ -0,0 +1,78 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "NiHandViewer.h"
+
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
+
+
+//---------------------------------------------------------------------------
+// Globals
+//---------------------------------------------------------------------------
+xn::Context		g_context;
+xn::ScriptNode	g_scriptNode;
+
+
+int main(int argc, char* argv[])
+{
+	XnStatus				rc;
+	xn::EnumerationErrors	errors;
+
+	// Create a context with default settings
+	rc = g_context.InitFromXmlFile(SAMPLE_XML_PATH, g_scriptNode, &errors);
+	if (rc == XN_STATUS_NO_NODE_PRESENT)
+	{
+		XnChar strError[1024];
+		errors.ToString(strError, 1024);
+		printf("%s\n", strError);
+		return (rc);
+	}
+	else if (rc != XN_STATUS_OK)
+	{
+		printf("Open failed: %s\n", xnGetStatusString(rc));
+		return (rc);
+	}
+
+	SimpleViewer& viewer = HandViewer::CreateInstance(g_context);
+
+	rc = viewer.Init(argc, argv);
+	if (rc != XN_STATUS_OK)
+	{
+		printf("Viewer init failed: %s\n", xnGetStatusString(rc));
+		return 1;
+	}
+
+	rc = viewer.Run();
+	if (rc != XN_STATUS_OK)
+	{
+		printf("Viewer run failed: %s\n", xnGetStatusString(rc));
+		return 1;
+	}
+
+	return 0;
+}
\ No newline at end of file
diff --git a/Samples/NiRecordRaw/NiRecordRaw.cpp b/Samples/NiRecordRaw/NiRecordRaw.cpp
index 354677d..bfa1a80 100644
--- a/Samples/NiRecordRaw/NiRecordRaw.cpp
+++ b/Samples/NiRecordRaw/NiRecordRaw.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -122,16 +122,10 @@ int main(int argc, char* argv[])
 
 	rawGenerator.Release();
 
-	nRetVal = context.GetProductionNodeByName("MockRaw", rawGenerator);
-	XN_ASSERT(nRetVal == XN_STATUS_BAD_NODE_NAME);
-
-	nRetVal = context.OpenFileRecording(RECORDING_FILE_NAME);
+	Player player;
+	nRetVal = context.OpenFileRecording(RECORDING_FILE_NAME, player);
 	CHECK_RC(nRetVal, "Open file recording");
 	
-	Player player;
-	nRetVal = context.FindExistingNode(XN_NODE_TYPE_PLAYER, player);
-	CHECK_RC(nRetVal, "Get player node");
-
 	nRetVal = player.SetRepeat(FALSE);
 	CHECK_RC(nRetVal, "Turn repeat off");
 
@@ -153,8 +147,11 @@ int main(int argc, char* argv[])
 		}
 		printf("\n");
 	}
-	
-	context.Shutdown();
+
+	player.Release();
+	rawGenerator.Release();
+	recorder.Release();
+	context.Release();
 
 	return 0;
 }
diff --git a/Samples/NiRecordSynthetic/NiRecordSynthetic.cpp b/Samples/NiRecordSynthetic/NiRecordSynthetic.cpp
index 91a3e28..93579d3 100644
--- a/Samples/NiRecordSynthetic/NiRecordSynthetic.cpp
+++ b/Samples/NiRecordSynthetic/NiRecordSynthetic.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -87,12 +87,9 @@ int main(int argc, char* argv[])
 	CHECK_RC(nRetVal, "Init");
 
 	// open input file
-	nRetVal = context.OpenFileRecording(strInputFile);
-	CHECK_RC(nRetVal, "Open input file");
-
 	Player player;
-	nRetVal = context.FindExistingNode(XN_NODE_TYPE_PLAYER, player);
-	CHECK_RC(nRetVal, "Get player node");
+	nRetVal = context.OpenFileRecording(strInputFile, player);
+	CHECK_RC(nRetVal, "Open input file");
 
 	// Get depth node from recording
 	DepthGenerator depth;
@@ -158,8 +155,5 @@ int main(int argc, char* argv[])
 
 	printf("\n");
 
-	recorder.Release();
-	context.Shutdown();
-
 	return 0;
 }
diff --git a/Samples/NiSampleExtensionModule/ExportedRotatingDevice.cpp b/Samples/NiSampleExtensionModule/ExportedRotatingDevice.cpp
index aaf4eca..568bc8f 100644
--- a/Samples/NiSampleExtensionModule/ExportedRotatingDevice.cpp
+++ b/Samples/NiSampleExtensionModule/ExportedRotatingDevice.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSampleExtensionModule/ExportedRotatingDevice.h b/Samples/NiSampleExtensionModule/ExportedRotatingDevice.h
index 8e59089..46c7564 100644
--- a/Samples/NiSampleExtensionModule/ExportedRotatingDevice.h
+++ b/Samples/NiSampleExtensionModule/ExportedRotatingDevice.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSampleExtensionModule/Registration.cpp b/Samples/NiSampleExtensionModule/Registration.cpp
index 32cc9f3..0981d83 100644
--- a/Samples/NiSampleExtensionModule/Registration.cpp
+++ b/Samples/NiSampleExtensionModule/Registration.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSampleExtensionModule/RotatingDeviceExtension.cpp b/Samples/NiSampleExtensionModule/RotatingDeviceExtension.cpp
index bcb74db..f1357e0 100644
--- a/Samples/NiSampleExtensionModule/RotatingDeviceExtension.cpp
+++ b/Samples/NiSampleExtensionModule/RotatingDeviceExtension.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSampleExtensionModule/RotatingDeviceExtension.h b/Samples/NiSampleExtensionModule/RotatingDeviceExtension.h
index be7f9fc..6c9567d 100644
--- a/Samples/NiSampleExtensionModule/RotatingDeviceExtension.h
+++ b/Samples/NiSampleExtensionModule/RotatingDeviceExtension.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -56,35 +56,40 @@ namespace Sample
 	public:
 		XnStatus Create(xn::Context& context, xn::Query* pQuery = NULL, xn::EnumerationErrors* pErrors = NULL)
 		{
-			return xnCreateAnyProductionTree(context.GetUnderlyingObject(), XN_NODE_TYPE_ROTATING_DEVICE, 
+			XnNodeHandle hNode;
+			XnStatus nRetVal = XN_STATUS_OK;
+			nRetVal = xnCreateAnyProductionTree(context.GetUnderlyingObject(), XN_NODE_TYPE_ROTATING_DEVICE, 
 				pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(),
-				&m_hNode,
+				&hNode,
 				pErrors == NULL ? NULL : pErrors->GetUnderlying());
+			XN_IS_STATUS_OK(nRetVal);
+			TakeOwnership(hNode);
+			return XN_STATUS_OK;
 		}
 
 		XnStatus PlayBeep()
 		{
-			return xnPlayBeep(m_hNode);
+			return xnPlayBeep(GetHandle());
 		}
 
 		XnStatus SetViewAngle(XnDouble dAngle)
 		{
-			return xnSetViewAngle(m_hNode, dAngle);
+			return xnSetViewAngle(GetHandle(), dAngle);
 		}
 
 		XnDouble GetViewAngle()
 		{
-			return xnGetViewAngle(m_hNode);
+			return xnGetViewAngle(GetHandle());
 		}
 
 		XnStatus RegisterToViewAngleChange(xn::StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
 		{
-			return xn::_RegisterToStateChange(xnRegisterToViewAngleChange, m_hNode, handler, pCookie, hCallback);
+			return xn::_RegisterToStateChange(xnRegisterToViewAngleChange, GetHandle(), handler, pCookie, hCallback);
 		}
 
 		void UnregisterFromViewAngleChange(XnCallbackHandle hCallback)
 		{
-			xn::_UnregisterFromStateChange(xnUnregisterFromViewAngleChange, m_hNode, hCallback);
+			xn::_UnregisterFromStateChange(xnUnregisterFromViewAngleChange, GetHandle(), hCallback);
 		}
 	};
 }
diff --git a/Samples/NiSampleExtensionModule/SampleRotatingDevice.cpp b/Samples/NiSampleExtensionModule/SampleRotatingDevice.cpp
index feb0bf2..611174b 100644
--- a/Samples/NiSampleExtensionModule/SampleRotatingDevice.cpp
+++ b/Samples/NiSampleExtensionModule/SampleRotatingDevice.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSampleExtensionModule/SampleRotatingDevice.h b/Samples/NiSampleExtensionModule/SampleRotatingDevice.h
index 9e78ffc..6b0c707 100644
--- a/Samples/NiSampleExtensionModule/SampleRotatingDevice.h
+++ b/Samples/NiSampleExtensionModule/SampleRotatingDevice.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSampleModule/ExportedSampleDepth.cpp b/Samples/NiSampleModule/ExportedSampleDepth.cpp
index 352f7fc..cc36c8d 100644
--- a/Samples/NiSampleModule/ExportedSampleDepth.cpp
+++ b/Samples/NiSampleModule/ExportedSampleDepth.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSampleModule/ExportedSampleDepth.h b/Samples/NiSampleModule/ExportedSampleDepth.h
index 0b63e45..daafa40 100644
--- a/Samples/NiSampleModule/ExportedSampleDepth.h
+++ b/Samples/NiSampleModule/ExportedSampleDepth.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSampleModule/Registration.cpp b/Samples/NiSampleModule/Registration.cpp
index 7409575..7579ecc 100644
--- a/Samples/NiSampleModule/Registration.cpp
+++ b/Samples/NiSampleModule/Registration.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSampleModule/SampleDepth.cpp b/Samples/NiSampleModule/SampleDepth.cpp
index 84c0794..16cddc8 100644
--- a/Samples/NiSampleModule/SampleDepth.cpp
+++ b/Samples/NiSampleModule/SampleDepth.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSampleModule/SampleDepth.h b/Samples/NiSampleModule/SampleDepth.h
index 81ca909..0b584ff 100644
--- a/Samples/NiSampleModule/SampleDepth.h
+++ b/Samples/NiSampleModule/SampleDepth.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiSimpleCreate/NiSimpleCreate.cpp b/Samples/NiSimpleCreate/NiSimpleCreate.cpp
index ce89b59..fe6f6f4 100644
--- a/Samples/NiSimpleCreate/NiSimpleCreate.cpp
+++ b/Samples/NiSimpleCreate/NiSimpleCreate.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -73,7 +73,8 @@ int main()
 		printf("Frame %d Middle point is: %u.\n", depthMD.FrameID(), depthMD(depthMD.XRes() / 2, depthMD.YRes() / 2));
 	}
 
-	context.Shutdown();
+	depth.Release();
+	context.Release();
 
 	return 0;
 }
diff --git a/Samples/NiSimpleRead/NiSimpleRead.cpp b/Samples/NiSimpleRead/NiSimpleRead.cpp
index 5a3a7d6..44351a7 100644
--- a/Samples/NiSimpleRead/NiSimpleRead.cpp
+++ b/Samples/NiSimpleRead/NiSimpleRead.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -31,6 +31,7 @@
 // Defines
 //---------------------------------------------------------------------------
 #define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
+#define SAMPLE_XML_PATH_LOCAL "SamplesConfig.xml"
 
 //---------------------------------------------------------------------------
 // Macros
@@ -48,14 +49,30 @@
 
 using namespace xn;
 
+XnBool fileExists(const char *fn)
+{
+	XnBool exists;
+	xnOSDoesFileExist(fn, &exists);
+	return exists;
+}
+
 int main()
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
 	Context context;
+	ScriptNode scriptNode;
 	EnumerationErrors errors;
 
-	nRetVal = context.InitFromXmlFile(SAMPLE_XML_PATH, &errors);
+	const char *fn = NULL;
+	if	(fileExists(SAMPLE_XML_PATH)) fn = SAMPLE_XML_PATH;
+	else if (fileExists(SAMPLE_XML_PATH_LOCAL)) fn = SAMPLE_XML_PATH_LOCAL;
+	else {
+		printf("Could not find '%s' nor '%s'. Aborting.\n" , SAMPLE_XML_PATH, SAMPLE_XML_PATH_LOCAL);
+		return XN_STATUS_ERROR;
+	}
+	printf("Reading config from: '%s'\n", fn);
+	nRetVal = context.InitFromXmlFile(fn, scriptNode, &errors);
 
 	if (nRetVal == XN_STATUS_NO_NODE_PRESENT)
 	{
@@ -97,7 +114,9 @@ int main()
 		printf("Frame %d Middle point is: %u. FPS: %f\n", depthMD.FrameID(), depthMD(depthMD.XRes() / 2, depthMD.YRes() / 2), xnFPSCalc(&xnFPS));
 	}
 
-	context.Shutdown();
+	depth.Release();
+	scriptNode.Release();
+	context.Release();
 
 	return 0;
 }
diff --git a/Samples/NiSimpleSkeleton/NiSimpleSkeleton.cpp b/Samples/NiSimpleSkeleton/NiSimpleSkeleton.cpp
new file mode 100644
index 0000000..2b8ee3c
--- /dev/null
+++ b/Samples/NiSimpleSkeleton/NiSimpleSkeleton.cpp
@@ -0,0 +1,239 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnCppWrapper.h>
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
+#define SAMPLE_XML_PATH_LOCAL "SamplesConfig.xml"
+
+//---------------------------------------------------------------------------
+// Globals
+//---------------------------------------------------------------------------
+xn::Context g_Context;
+xn::ScriptNode g_scriptNode;
+xn::DepthGenerator g_DepthGenerator;
+xn::UserGenerator g_UserGenerator;
+
+XnBool g_bNeedPose = FALSE;
+XnChar g_strPose[20] = "";
+
+#define MAX_NUM_USERS 15
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+XnBool fileExists(const char *fn)
+{
+	XnBool exists;
+	xnOSDoesFileExist(fn, &exists);
+	return exists;
+}
+
+// Callback: New user was detected
+void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
+{
+    XnUInt32 epochTime = 0;
+    xnOSGetEpochTime(&epochTime);
+    printf("%d New User %d\n", epochTime, nId);
+    // New user found
+    if (g_bNeedPose)
+    {
+        g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
+    }
+    else
+    {
+        g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
+    }
+}
+// Callback: An existing user was lost
+void XN_CALLBACK_TYPE User_LostUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
+{
+    XnUInt32 epochTime = 0;
+    xnOSGetEpochTime(&epochTime);
+    printf("%d Lost user %d\n", epochTime, nId);	
+}
+// Callback: Detected a pose
+void XN_CALLBACK_TYPE UserPose_PoseDetected(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nId, void* pCookie)
+{
+    XnUInt32 epochTime = 0;
+    xnOSGetEpochTime(&epochTime);
+    printf("%d Pose %s detected for user %d\n", epochTime, strPose, nId);
+    g_UserGenerator.GetPoseDetectionCap().StopPoseDetection(nId);
+    g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
+}
+// Callback: Started calibration
+void XN_CALLBACK_TYPE UserCalibration_CalibrationStart(xn::SkeletonCapability& capability, XnUserID nId, void* pCookie)
+{
+    XnUInt32 epochTime = 0;
+    xnOSGetEpochTime(&epochTime);
+    printf("%d Calibration started for user %d\n", epochTime, nId);
+}
+
+void XN_CALLBACK_TYPE UserCalibration_CalibrationComplete(xn::SkeletonCapability& capability, XnUserID nId, XnCalibrationStatus eStatus, void* pCookie)
+{
+    XnUInt32 epochTime = 0;
+    xnOSGetEpochTime(&epochTime);
+    if (eStatus == XN_CALIBRATION_STATUS_OK)
+    {
+        // Calibration succeeded
+        printf("%d Calibration complete, start tracking user %d\n", epochTime, nId);		
+        g_UserGenerator.GetSkeletonCap().StartTracking(nId);
+    }
+    else
+    {
+        // Calibration failed
+        printf("%d Calibration failed for user %d\n", epochTime, nId);
+        if(eStatus==XN_CALIBRATION_STATUS_MANUAL_ABORT)
+        {
+            printf("Manual abort occured, stop attempting to calibrate!");
+            return;
+        }
+        if (g_bNeedPose)
+        {
+            g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
+        }
+        else
+        {
+            g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
+        }
+    }
+}
+
+
+#define CHECK_RC(nRetVal, what)					    \
+    if (nRetVal != XN_STATUS_OK)				    \
+{								    \
+    printf("%s failed: %s\n", what, xnGetStatusString(nRetVal));    \
+    return nRetVal;						    \
+}
+
+int main(int argc, char **argv)
+{
+    XnStatus nRetVal = XN_STATUS_OK;
+    xn::EnumerationErrors errors;
+
+    const char *fn = NULL;
+    if    (fileExists(SAMPLE_XML_PATH)) fn = SAMPLE_XML_PATH;
+    else if (fileExists(SAMPLE_XML_PATH_LOCAL)) fn = SAMPLE_XML_PATH_LOCAL;
+    else {
+        printf("Could not find '%s' nor '%s'. Aborting.\n" , SAMPLE_XML_PATH, SAMPLE_XML_PATH_LOCAL);
+        return XN_STATUS_ERROR;
+    }
+    printf("Reading config from: '%s'\n", fn);
+
+    nRetVal = g_Context.InitFromXmlFile(fn, g_scriptNode, &errors);
+    if (nRetVal == XN_STATUS_NO_NODE_PRESENT)
+    {
+        XnChar strError[1024];
+        errors.ToString(strError, 1024);
+        printf("%s\n", strError);
+        return (nRetVal);
+    }
+    else if (nRetVal != XN_STATUS_OK)
+    {
+        printf("Open failed: %s\n", xnGetStatusString(nRetVal));
+        return (nRetVal);
+    }
+
+    nRetVal = g_Context.FindExistingNode(XN_NODE_TYPE_DEPTH, g_DepthGenerator);
+    CHECK_RC(nRetVal,"No depth");
+
+    nRetVal = g_Context.FindExistingNode(XN_NODE_TYPE_USER, g_UserGenerator);
+    if (nRetVal != XN_STATUS_OK)
+    {
+        nRetVal = g_UserGenerator.Create(g_Context);
+        CHECK_RC(nRetVal, "Find user generator");
+    }
+
+    XnCallbackHandle hUserCallbacks, hCalibrationStart, hCalibrationComplete, hPoseDetected;
+    if (!g_UserGenerator.IsCapabilitySupported(XN_CAPABILITY_SKELETON))
+    {
+        printf("Supplied user generator doesn't support skeleton\n");
+        return 1;
+    }
+    nRetVal = g_UserGenerator.RegisterUserCallbacks(User_NewUser, User_LostUser, NULL, hUserCallbacks);
+    CHECK_RC(nRetVal, "Register to user callbacks");
+    nRetVal = g_UserGenerator.GetSkeletonCap().RegisterToCalibrationStart(UserCalibration_CalibrationStart, NULL, hCalibrationStart);
+    CHECK_RC(nRetVal, "Register to calibration start");
+    nRetVal = g_UserGenerator.GetSkeletonCap().RegisterToCalibrationComplete(UserCalibration_CalibrationComplete, NULL, hCalibrationComplete);
+    CHECK_RC(nRetVal, "Register to calibration complete");
+
+    if (g_UserGenerator.GetSkeletonCap().NeedPoseForCalibration())
+    {
+        g_bNeedPose = TRUE;
+        if (!g_UserGenerator.IsCapabilitySupported(XN_CAPABILITY_POSE_DETECTION))
+        {
+            printf("Pose required, but not supported\n");
+            return 1;
+        }
+        nRetVal = g_UserGenerator.GetPoseDetectionCap().RegisterToPoseDetected(UserPose_PoseDetected, NULL, hPoseDetected);
+        CHECK_RC(nRetVal, "Register to Pose Detected");
+        g_UserGenerator.GetSkeletonCap().GetCalibrationPose(g_strPose);
+    }
+
+    g_UserGenerator.GetSkeletonCap().SetSkeletonProfile(XN_SKEL_PROFILE_ALL);
+
+    nRetVal = g_Context.StartGeneratingAll();
+    CHECK_RC(nRetVal, "StartGenerating");
+
+    XnUserID aUsers[MAX_NUM_USERS];
+    XnUInt16 nUsers;
+    XnSkeletonJointTransformation torsoJoint;
+
+    printf("Starting to run\n");
+    if(g_bNeedPose)
+    {
+        printf("Assume calibration pose\n");
+    }
+    XnUInt32 epochTime = 0;
+    while (!xnOSWasKeyboardHit())
+    {
+        g_Context.WaitOneUpdateAll(g_UserGenerator);
+        // print the torso information for the first user already tracking
+        nUsers=MAX_NUM_USERS;
+        g_UserGenerator.GetUsers(aUsers, nUsers);
+        int numTracked=0;
+        int userToPrint=-1;
+        for(XnUInt16 i=0; i<nUsers; i++)
+        {
+            if(g_UserGenerator.GetSkeletonCap().IsTracking(aUsers[i])==FALSE)
+                continue;
+
+            g_UserGenerator.GetSkeletonCap().GetSkeletonJoint(aUsers[i],XN_SKEL_TORSO,torsoJoint);
+                printf("user %d: head at (%6.2f,%6.2f,%6.2f)\n",aUsers[i],
+                                                                torsoJoint.position.position.X,
+                                                                torsoJoint.position.position.Y,
+                                                                torsoJoint.position.position.Z);
+        }
+        
+    }
+    g_scriptNode.Release();
+    g_DepthGenerator.Release();
+    g_UserGenerator.Release();
+    g_Context.Release();
+
+}
diff --git a/Samples/NiSimpleViewer/NiSimpleViewer.cpp b/Samples/NiSimpleViewer/NiSimpleViewer.cpp
index 6aad163..583cb9e 100644
--- a/Samples/NiSimpleViewer/NiSimpleViewer.cpp
+++ b/Samples/NiSimpleViewer/NiSimpleViewer.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -59,6 +59,7 @@ unsigned int g_nTexMapY = 0;
 unsigned int g_nViewState = DEFAULT_DISPLAY_MODE;
 
 Context g_context;
+ScriptNode g_scriptNode;
 DepthGenerator g_depth;
 ImageGenerator g_image;
 DepthMetaData g_depthMD;
@@ -245,7 +246,7 @@ int main(int argc, char* argv[])
 	XnStatus rc;
 
 	EnumerationErrors errors;
-	rc = g_context.InitFromXmlFile(SAMPLE_XML_PATH, &errors);
+	rc = g_context.InitFromXmlFile(SAMPLE_XML_PATH, g_scriptNode, &errors);
 	if (rc == XN_STATUS_NO_NODE_PRESENT)
 	{
 		XnChar strError[1024];
@@ -260,7 +261,18 @@ int main(int argc, char* argv[])
 	}
 
 	rc = g_context.FindExistingNode(XN_NODE_TYPE_DEPTH, g_depth);
+	if (rc != XN_STATUS_OK)
+	{
+		printf("No depth node exists! Check your XML.");
+		return 1;
+	}
+
 	rc = g_context.FindExistingNode(XN_NODE_TYPE_IMAGE, g_image);
+	if (rc != XN_STATUS_OK)
+	{
+		printf("No image node exists! Check your XML.");
+		return 1;
+	}
 
 	g_depth.GetMetaData(g_depthMD);
 	g_image.GetMetaData(g_imageMD);
diff --git a/Samples/NiUseExtension/NiUseExtension.cpp b/Samples/NiUseExtension/NiUseExtension.cpp
index 3a85216..af55bf0 100644
--- a/Samples/NiUseExtension/NiUseExtension.cpp
+++ b/Samples/NiUseExtension/NiUseExtension.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -65,7 +65,18 @@ int main()
 
 	RotatingDevice rotatingDevice;
 	nRetVal = rotatingDevice.Create(context);
-	CHECK_RC(nRetVal, "Create Rotating Device");
+	if (nRetVal != XN_STATUS_OK)
+	{
+		printf("Create Rotating Device failed: %s\n\n", xnGetStatusString(nRetVal));
+		printf("In order to run this sample, NiSampleExtensionModule must be registered with OpenNI.\n");
+		printf("Please run:\n");
+		printf("\tniReg NiSampleExtensionModule.dll\n");
+		printf("before running this sample, and\n");
+		printf("\tniReg -u NiSampleExtensionModule.dll\n");
+		printf("afterwards.\n");
+
+		return nRetVal;
+	}
 
 	nRetVal = rotatingDevice.SetViewAngle(2.17);
 	CHECK_RC(nRetVal, "Create Rotating Device");
diff --git a/Samples/NiUserSelection/ClosestUserSelector.cpp b/Samples/NiUserSelection/ClosestUserSelector.cpp
new file mode 100644
index 0000000..f64bba7
--- /dev/null
+++ b/Samples/NiUserSelection/ClosestUserSelector.cpp
@@ -0,0 +1,243 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "ClosestUserSelector.h"
+
+/// @brief Utility macro which validates a condition and if it fails it prints an error message.
+/// 
+/// This macro is aimed to be called from within the constructor as if it fails it invalidates the
+/// object (m_bValid=false).
+#define VALIDATE(cond, errorMsg)                                    \
+    if(!(cond))                                                     \
+{                                                                   \
+    printf("ClosestUserSelector creation failed: %s\n",errorMsg);   \
+    m_bValid=FALSE;                                                 \
+    return;                                                         \
+}                                                                   \
+
+
+/// @brief The square distance for changes of COM (set for 20cm squared) to be considered moved 
+/// in order to avoid the modifier @ref DIST_MOD_FOR_FAILURE.
+#define MIN_SQR_DIST_TO_RETRY 40000
+/// @brief A modifier for failing to calibrated (set at 10m).
+#define DIST_MOD_FOR_FAILURE 10000
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+ClosestUserSelector::ClosestUserSelector(xn::UserGenerator *pUserGenerator,
+                                         TrackingInitializer *pTrackingInitializer,
+                                         XnUInt32 nMaxNumUsers) :
+                                                            UserSelector(pUserGenerator),
+                                                            m_pTrackingInitializer(pTrackingInitializer),
+                                                            m_nMaxNumUsers(nMaxNumUsers),
+                                                            m_pUsersList(NULL)
+{
+    VALIDATE(m_bValid,"UserSelector was not initialized properly");
+    VALIDATE(pTrackingInitializer!=NULL,"NULL tracking initializer supplied");
+    VALIDATE(pTrackingInitializer->IsValid(),"tracking initializer supplied is invalid");
+    VALIDATE(m_pUserGenerator!=NULL,"NULL user generator supplied");
+    VALIDATE(m_nMaxNumUsers>0, "0 users tracking");
+    m_pUsersList=XN_NEW_ARR(UserInfo,m_nMaxNumUsers);
+}
+
+ClosestUserSelector::~ClosestUserSelector()
+{
+    m_pTrackingInitializer=NULL;
+    if(m_pUsersList!=NULL)
+    {
+        XN_DELETE_ARR(m_pUsersList);
+        m_pUsersList=NULL;
+    }
+}
+
+void ClosestUserSelector::UpdateFrame()
+{
+    // clear the user list so we can fill it out.
+    ClearUserList();
+
+    // find out who are the closest ones.
+    for(UserStateHash::Iterator iter=m_hUsersState.begin(); iter!=m_hUsersState.end(); ++iter)
+    {
+        UserSelectionState* val=iter.Value();
+        XnUserID newUser=iter.Key();
+        XnPoint3D newCom;
+        if(m_pUserGenerator->GetCoM(newUser,newCom)!=XN_STATUS_OK)
+            continue; // irrelevant user.
+        if(newCom.Z<=0)
+        {
+            continue; // this is not someone we can use.
+        }
+        if(val->m_eState == XN_SELECTION_FAILED)
+        {
+            // we failed last time so we might want to give a penalty
+            UserStatusWithCom* valWithCom=(UserStatusWithCom*)val;
+            XnFloat distSqr=0.0f;
+            XnFloat diff;
+            diff = newCom.X - valWithCom->m_COM.X;
+            distSqr += diff * diff;
+            diff = newCom.Y - valWithCom->m_COM.Y;
+            distSqr += diff * diff;
+            diff = newCom.Z - valWithCom->m_COM.Z;
+            distSqr += diff * diff;
+            if(distSqr<MIN_SQR_DIST_TO_RETRY)
+            {
+                newCom.Z+=DIST_MOD_FOR_FAILURE; // we haven't moved too much since we failed, lets give a penalty
+            }
+
+        }
+        if(val->m_eState == XN_SELECTION_SELECTED || val->m_eState == XN_SELECTION_TRACKING)
+        {
+            newCom.Z-=100.0f; // hysteresis to make the current user closer to avoid back and forth.
+            if(newCom.Z<=0)
+            {
+                newCom.Z=1.0f; // minimum dist!
+            }
+        }
+        InsertNewUser(newUser,newCom.Z); // add it to the list in an ordered manner
+    }
+
+
+    // go over the list and start or stop tracking.
+    for(UserStateHash::Iterator iter=m_hUsersState.begin(); iter!=m_hUsersState.end(); ++iter)
+    {
+        UserSelectionState* pState=iter.Value();
+        XnUInt32 curUser=iter.Key();
+        if(TestIfShouldTrack(curUser))
+        {
+            // this means the user is in the list of those which need to track
+            if(pState->m_eState == XN_SELECTION_SELECTED || pState->m_eState == XN_SELECTION_TRACKING)
+            {
+                continue; // we are already tracking so nothing to do...
+            }
+            // make the user selected
+            UpdateUserSelectionState(curUser, XN_SELECTION_SELECTED, 0);
+            XnBool bForce=FALSE;
+            if(pState->m_eState==XN_SELECTION_FAILED)
+            {
+                // if we failed in the past we can't count on the calibration data
+                bForce=TRUE;
+            }
+            // start tracking
+            m_pTrackingInitializer->StartTracking(curUser,bForce); 
+        }
+        else
+        {
+            // if we are here we shouldn't track
+            if(pState->m_eState == XN_SELECTION_SELECTED || pState->m_eState == XN_SELECTION_TRACKING)
+            {
+                // we need to unselect it...
+                m_pTrackingInitializer->AbortTracking(curUser);
+                UpdateUserSelectionState(curUser,XN_SELECTION_UNSELECTED,0);
+            }
+        }
+    }
+}
+
+void ClosestUserSelector::ClearUserList()
+{
+    // go over the internal list and make all values invalid (user 0 which is background and
+    // negative z for the COM which is impossible as it is behind the sensor
+    for(XnUInt32 i=0; i<m_nMaxNumUsers; i++)
+    {
+        m_pUsersList[i].m_userID=0;
+        m_pUsersList[i].m_COMZ=-1.0f;
+    }
+}
+
+void ClosestUserSelector::InsertNewUser(XnUserID userID, XnFloat COMZ)
+{
+    // go over all users and figure out where to put the new one
+    for(XnUInt32 i=0; i<m_nMaxNumUsers; i++)
+    {
+        if(m_pUsersList[i].m_COMZ>0 && m_pUsersList[i].m_COMZ<COMZ)
+        {
+            continue; // the current user is closer, move along
+        }
+        // if we are here then this is a place to put the new one.
+        if(m_pUsersList[i].m_COMZ>0)
+        {
+            // we need to push everyone else forward...
+            for(XnUInt32 j=i+1; j<m_nMaxNumUsers; j++)
+            {
+                m_pUsersList[j]=m_pUsersList[j-1];
+            }
+        }
+        m_pUsersList[i].m_userID=userID;
+        m_pUsersList[i].m_COMZ=COMZ;
+        return; // successfully entered.
+    }
+}
+
+XnBool ClosestUserSelector::TestIfShouldTrack(XnUserID userID)
+{
+    // go over all users and see if it is legal
+    for(XnUserID i=0; i<m_nMaxNumUsers; i++)
+    {
+        if(m_pUsersList[i].m_userID==userID)
+        {
+            return TRUE; // we found the user so it should be tracked
+        }
+        if(m_pUsersList[i].m_COMZ<0)
+        {
+            return FALSE; // we got to a negative Z so since everything is ordered this means we didn't find the user
+        }
+    }
+    return FALSE;
+}
+
+
+UserSelectionState* ClosestUserSelector::CreateUserSelectionState()
+{
+    return XN_NEW(UserStatusWithCom);
+}
+
+
+XnStatus ClosestUserSelector::UpdateUserSelectionState(XnUserID nUserId, XnSelectionState eState , XnInt64 subState)
+{
+    XnStatus nRetVal = UserSelector::UpdateUserSelectionState(nUserId,eState,subState);
+    if(nRetVal != XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+
+    if(eState != XN_SELECTION_FAILED)
+    {
+        return XN_STATUS_OK;
+    }
+
+    UserSelectionState* tmpState;
+
+    nRetVal=m_hUsersState.Get(nUserId, tmpState);
+    if(nRetVal != XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+    if(tmpState==NULL)
+    {
+        return XN_STATUS_ERROR;
+    }
+
+    UserStatusWithCom* pState=(UserStatusWithCom*)tmpState;
+    return m_pUserGenerator->GetCoM(nUserId,pState->m_COM);
+}
diff --git a/Samples/NiUserSelection/ClosestUserSelector.h b/Samples/NiUserSelection/ClosestUserSelector.h
new file mode 100644
index 0000000..33ac147
--- /dev/null
+++ b/Samples/NiUserSelection/ClosestUserSelector.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_CLOSEST_USER_SELECTOR_H_
+#define XNV_CLOSEST_USER_SELECTOR_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "UserSelector.h"
+#include "TrackingInitializer.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+
+/// @brief Closest users based selector
+/// 
+/// This user selector selects user and tracks that user. If a new user becomes closer, it stops 
+/// tracking the old one and tracks the new, closer user.
+/// @ingroup UserSelectionClosestSelectors
+class ClosestUserSelector : public UserSelector
+{
+public:
+    /// @brief Constructor
+    /// 
+    /// @param pUserGenerator The user generator to use
+    /// @param pTrackingInitializer The tracking initializer to use
+    /// @param nMaxNumUsers The maximum number of tracked users
+    ClosestUserSelector(xn::UserGenerator* pUserGenerator, TrackingInitializer* pTrackingInitializer, XnUInt32 nMaxNumUsers);
+    ~ClosestUserSelector();
+
+    virtual void UpdateFrame();
+protected:
+    virtual UserSelectionState* CreateUserSelectionState();
+
+
+    virtual XnStatus UpdateUserSelectionState(XnUserID nUserId, XnSelectionState eState , XnInt64 subState);
+
+
+    TrackingInitializer* m_pTrackingInitializer; ///< @brief The tracking initializer used to start tracking
+    XnUInt32 m_nMaxNumUsers; ///< @brief The maximum number of allowed users to track.
+
+    /// @brief Internal struct to hold the user information
+    /// 
+    /// This class is used to hold the Z of the center of mass for each user
+    /// @ingroup UserSelectionClosestSelectors
+    struct UserInfo
+    {
+        XnUserID m_userID;  ///< @brief User ID of the user
+        XnFloat m_COMZ;     ///< @brief Z value of the center of mass.
+    };
+
+    UserInfo* m_pUsersList; ///< An array holding the user info for all users (to order them).
+
+    /// @brief Internal method to clear the user list information.
+    void ClearUserList();
+    /// @brief Internal method to add a user to the list of users
+    /// 
+    /// @param userID the user ID of the user to add
+    /// @param COMZ the z value of the center of mass of the user
+    void InsertNewUser(XnUserID userID, XnFloat COMZ);
+    /// @brief Internal method to test if the user is close enough to be counted for tracking.
+    /// 
+    /// @param userID The user to test.
+    /// @return True if the user should be tracked, false otherwise.
+    XnBool TestIfShouldTrack(XnUserID userID);
+
+    /// @brief An extending class for the user selection state which holds the center of mass as an
+    /// additional value.
+    /// @ingroup UserSelectionClosestSelectors
+    class UserStatusWithCom : public UserSelectionState
+    {
+    public:
+        XnPoint3D m_COM; ///< The user's center of mass when it failed to calibrate.
+    };
+
+};
+#endif // XNV_CLOSEST_USER_SELECTOR_H_
diff --git a/Samples/NiUserSelection/DefaultTrackingInitializer.cpp b/Samples/NiUserSelection/DefaultTrackingInitializer.cpp
new file mode 100644
index 0000000..7654f0e
--- /dev/null
+++ b/Samples/NiUserSelection/DefaultTrackingInitializer.cpp
@@ -0,0 +1,171 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "DefaultTrackingInitializer.h"
+
+DefaultTrackingInitializer::DefaultTrackingInitializer(xn::UserGenerator *pUserGenerator) :
+                                                          TrackingInitializer(pUserGenerator),
+                                                          m_hCalibrationStartCallback(NULL),
+                                                          m_hCalibrationCompleteCallback(NULL),
+                                                          m_hInProgressCallback(NULL)
+{
+    if(m_pUserGenerator->IsCapabilitySupported(XN_CAPABILITY_SKELETON)==FALSE)
+    {
+        m_bValid=FALSE;
+        return; // we need a skeleton, otherwise, we don't have calibration
+    }
+
+    XnStatus res=m_pUserGenerator->GetSkeletonCap().RegisterToCalibrationStart(CalibrationStartCallback,this,m_hCalibrationStartCallback);
+    if(res!=XN_STATUS_OK)
+    {
+        m_hCalibrationStartCallback=NULL;
+        m_bValid=FALSE;
+        return; // if we can't register to the calibration, we shouldn't do anything
+    }
+    res=m_pUserGenerator->GetSkeletonCap().RegisterToCalibrationComplete(CalibrationCompleteCallback,this,m_hCalibrationStartCallback);
+    if(res!=XN_STATUS_OK)
+    {
+        m_hCalibrationStartCallback=NULL;
+        m_bValid=FALSE;
+        return; // if we can't register to the calibration, we shouldn't do anything
+    }
+    res=m_pUserGenerator->GetSkeletonCap().RegisterToCalibrationInProgress(CalibrationInProgressCallback,this,m_hInProgressCallback);
+    if(res!=XN_STATUS_OK)
+    {
+        m_hInProgressCallback=NULL;
+        m_bValid=FALSE;
+        return; // if we can't register to the calibration, we shouldn't do anything
+    }
+}
+
+DefaultTrackingInitializer::~DefaultTrackingInitializer()
+{
+    // clean up
+    if(m_pUserGenerator==NULL)
+        return;
+    if(m_hCalibrationStartCallback!=NULL)
+    {
+        m_pUserGenerator->GetSkeletonCap().UnregisterFromCalibrationStart(m_hCalibrationStartCallback);
+        m_hCalibrationStartCallback=NULL;
+    }
+
+    if(m_hCalibrationCompleteCallback!=NULL)
+    {
+        m_pUserGenerator->GetSkeletonCap().UnregisterFromCalibrationComplete(m_hCalibrationCompleteCallback);
+        m_hCalibrationCompleteCallback=NULL;
+    }
+    if(m_hInProgressCallback!=NULL)
+    {
+        m_pUserGenerator->GetSkeletonCap().UnregisterFromCalibrationInProgress(m_hInProgressCallback);
+        m_hInProgressCallback=NULL;
+    }
+}
+
+
+
+XnStatus DefaultTrackingInitializer::StartTracking(XnUserID nUserId, XnBool bForce)
+{
+    if(m_pUserGenerator->GetSkeletonCap().IsTracking(nUserId)==TRUE)
+    {
+        // we don't need to do anything (other than notifying the user selector) as we are 
+        // already tracking
+        if(m_pUserSelector!=NULL)
+        {
+            return m_pUserSelector->UpdateUserTracking(nUserId,TRUE,0); // already tracking
+        }
+        else
+            return XN_STATUS_OK;
+        
+    }
+    // request calibration.
+    return m_pUserGenerator->GetSkeletonCap().RequestCalibration(nUserId,bForce);
+}
+
+
+XnStatus DefaultTrackingInitializer::AbortTracking(XnUserID nUserId)
+{
+    // note: the assumption is that this will not be called if not either calibrating or
+    // tracking (although it will just fail if neither).
+    if(m_pUserGenerator->GetSkeletonCap().IsTracking(nUserId)==TRUE)
+    {
+        // if we are tracking we just need to stop tracking
+        XnStatus res=m_pUserGenerator->GetSkeletonCap().StopTracking(nUserId);
+        return res;
+    }
+    // if we are not tracking we need to abort the calibration.
+    return m_pUserGenerator->GetSkeletonCap().AbortCalibration(nUserId);
+}
+
+XnStatus DefaultTrackingInitializer::CalibrationStart(XnUserID nUserId)
+{
+    return XN_STATUS_OK;
+}
+XnStatus DefaultTrackingInitializer::CalibrationComplete(XnUserID nUserId,XnCalibrationStatus eStatus)
+{
+    XnBool retVal=FALSE;
+    if (eStatus == XN_CALIBRATION_STATUS_OK)
+    {
+        // we start the actual tracking!
+        if(m_pUserGenerator->GetSkeletonCap().StartTracking(nUserId)==XN_STATUS_OK) 
+        {
+            retVal=TRUE;
+        }
+        
+    }
+    if(m_pUserSelector!=NULL)
+    {
+        return m_pUserSelector->UpdateUserTracking(nUserId,retVal,eStatus);
+    }
+    return XN_STATUS_OK;
+}
+
+XnStatus DefaultTrackingInitializer::CalibrationInProgress(XnUserID nUserId,XnCalibrationStatus eStatus)
+{
+    if(m_pUserSelector!=NULL)
+        return m_pUserSelector->UpdateUserTrackingProgress(nUserId,eStatus);
+    return XN_STATUS_OK;
+}
+
+
+
+
+// Callback: Started calibration
+void XN_CALLBACK_TYPE DefaultTrackingInitializer::CalibrationStartCallback(xn::SkeletonCapability& capability, XnUserID nUserId, void* pCookie)
+{
+    DefaultTrackingInitializer *pDefaultTrackingInitializer=(DefaultTrackingInitializer *)pCookie;
+    pDefaultTrackingInitializer->CalibrationStart(nUserId);
+}
+
+void XN_CALLBACK_TYPE DefaultTrackingInitializer::CalibrationCompleteCallback(xn::SkeletonCapability& capability, XnUserID nUserId, XnCalibrationStatus eStatus, void* pCookie)
+{
+    DefaultTrackingInitializer *pDefaultTrackingInitializer=(DefaultTrackingInitializer *)pCookie;
+    pDefaultTrackingInitializer->CalibrationComplete(nUserId,eStatus);
+}
+
+void XN_CALLBACK_TYPE DefaultTrackingInitializer::CalibrationInProgressCallback(xn::SkeletonCapability& capability, XnUserID nUserId, XnCalibrationStatus eStatus, void* pCookie)
+{
+    DefaultTrackingInitializer *pDefaultTrackingInitializer=(DefaultTrackingInitializer *)pCookie;
+    pDefaultTrackingInitializer->CalibrationInProgress(nUserId,eStatus);
+}
+
diff --git a/Samples/NiUserSelection/DefaultTrackingInitializer.h b/Samples/NiUserSelection/DefaultTrackingInitializer.h
new file mode 100644
index 0000000..e704dc3
--- /dev/null
+++ b/Samples/NiUserSelection/DefaultTrackingInitializer.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_DEFAULT_TRACKING_INITIALIZER_H_
+#define XNV_DEFAULT_TRACKING_INITIALIZER_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+
+#include "TrackingInitializer.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+
+/// @brief Class to start tracking a user
+/// 
+/// The goal of this class is to start performing the actual tracking of a user. It returns the 
+/// results to the UserSelector which called it.
+/// @ingroup UserSelectionInitializers
+class DefaultTrackingInitializer : public TrackingInitializer
+{
+public:
+    virtual XnStatus StartTracking(XnUserID nUserId, XnBool bForce);
+    virtual XnStatus AbortTracking(XnUserID nUserId);
+
+    /// @brief Constructor
+    /// 
+    /// @param pUserGenerator The user generator to use
+    DefaultTrackingInitializer(xn::UserGenerator *pUserGenerator);
+    virtual ~DefaultTrackingInitializer();
+protected:
+    /// @brief Method called by the calibration start callback
+    /// 
+    /// @param nUserId The user the calibration started on
+    virtual XnStatus CalibrationStart(XnUserID nUserId);
+
+    /// @brief Method called by the calibration complete callback
+    /// 
+    /// @param nUserId The user the calibration finished on
+    /// @param eStatus The status (success/fail and why)
+    virtual XnStatus CalibrationComplete(XnUserID nUserId,XnCalibrationStatus eStatus);
+    /// @brief Method called by the calibration in progress callback
+    /// 
+    /// @param nUserId The user the calibration progress is on
+    /// @param eStatus The status (success/fail and why)
+    virtual XnStatus CalibrationInProgress(XnUserID nUserId,XnCalibrationStatus eStatus);
+
+    XnCallbackHandle m_hInProgressCallback; ///< @brief Callback handle to unregister the calibration in progress callback
+    XnCallbackHandle m_hCalibrationStartCallback; ///< @brief Callback handle to unregister the calibration start callback
+    XnCallbackHandle m_hCalibrationCompleteCallback; ///< @brief Callback handle to unregister the calibration complete callback
+
+    /// @brief Callback method for calibration start events
+    ///
+    /// @param capability The skeleton capability which raised the event.
+    /// @param nUserId The user the event relates to
+    /// @param pCookie A user supplied cookie.
+    static void XN_CALLBACK_TYPE CalibrationStartCallback(xn::SkeletonCapability& capability, XnUserID nUserId, void* pCookie);
+
+    /// @brief Callback method for calibration complete events
+    ///
+    /// @param capability The skeleton capability which raised the event.
+    /// @param nUserId The user the event relates to
+    /// @param eStatus The status (success/fail and why)
+    /// @param pCookie A user supplied cookie.
+    static void XN_CALLBACK_TYPE CalibrationCompleteCallback(xn::SkeletonCapability& capability, XnUserID nUserId, XnCalibrationStatus eStatus, void* pCookie);
+    /// @brief Callback method for calibration in progress events
+    ///
+    /// @param capability The skeleton capability which raised the event.
+    /// @param nUserId The user the event relates to
+    /// @param eStatus The status (success/fail and why)
+    /// @param pCookie A user supplied cookie.
+    static void XN_CALLBACK_TYPE CalibrationInProgressCallback(xn::SkeletonCapability& capability, XnUserID nUserId, XnCalibrationStatus eStatus, void* pCookie);
+
+};
+#endif // XNV_DEFAULT_TRACKING_INITIALIZER_H_
+
diff --git a/Samples/NiUserSelection/Documentation.h b/Samples/NiUserSelection/Documentation.h
new file mode 100644
index 0000000..4ba426d
--- /dev/null
+++ b/Samples/NiUserSelection/Documentation.h
@@ -0,0 +1,199 @@
+/** @page NIUserSelectionSampleOverview NIUserSelection Sample
+
+<H1>Overview</H1>
+<H2>Sample goals</H2>
+The goal of this sample is to present the user selection logic and provide a good starting point for
+applications needing their own user selection. In addition, this sample shows the use of pose 
+detection capability to provide behavior for exiting the program and for user selection.<br><br>
+
+<H2>What is user selection and why use it?</H2>
+
+The logic behind this sample is the fact that there could be many users in the scene and we need a
+way to figure out which users to track and which users represent which players.<br>
+
+A @b user is an entity which appears in the scene. In most cases it is a human being (who can 
+potentially play the game) but it could also be an inanimate object which the sensor decide is 
+interesting enough to be considered.<br>
+Multiple users can be part of the scene. Consider the basic case where several friends sit in the
+living room and plan to play. All of them could be users but for a single player game, only one can
+be a player.<br>
+A @b player is someone who controls the input. In this sample, the player would be the user who 
+controls the movements of the skeleton, but in general, an application could have many players controlling 
+many, different, game elements.<br><br>
+
+In addition to mapping users to players, user selection is important to limit the number of tracked
+skeletons. This is because the tracking process can be CPU intensive if many users are tracked.<br><br>
+
+There are many ways to select the users. In this sample, we can see several versions of two basic
+schemes: 
+- Choosing the closest users to be players
+- Choosing a user which is in a certain pose.
+
+A special case of user selection is the case where the user generator supports a skeleton and the
+skeleton requires a calibration pose. In this case the user needs to strike a pose in order to be
+tracked, this lends itself immediately a specific user selection paradigm: selecting a user who 
+strikes the calibration pose. 
+
+<H2>Using the sample</H2>
+The sample provides support for four types of user selection:
+- The default is to find the closest users (by default 1 but any number up to 9 is supported)
+- SingleWave which switches to the last user who waved
+- MultipleWave which start tracking anyone who waves (up to N predefined users) and unselects those 
+  that wave again
+- Using the calibration pose. This option happens implicitly if the skeleton implementation requires 
+  a calibration pose, overriding the previous three.
+
+In addition, if the user performs the exit pose (The CrossHandsPose implementation) then the program
+will exit after maintaining it for 3 seconds.
+
+
+<H3>Command line arguments</H3>
+When running the program the following command line arguments are supported to configure the way the 
+sample runs:
+
+Usage: NiUserSelection.exe [-recordingFilename Filename] [-s selectorType] [-ShowLowConfidence]<br><br>
+- @b -RecordingFilename @b Filename: Use the recording in Filename for input.
+- @b -ShowLowConfidence: Draws limbs with low confidence as dotted/dashed lines (hidden by default)
+- @b -s @b selectorType: Chooses the selector type to use (i.e. how to select which users to track).
+                         It supports the following options for @b selectorType:
+    - @b -ClosestSelector @b N: The N closest users are tracked.
+    - @b -SingleWave: Whichever user waved last is tracked.
+    - @b -MultipleWave @b N: Upto N skeleton are tracked. Wave used to select/unselect user for tracking.
+
+ at note
+- If the '-s' option is omitted,  ClosestSelector with a value of 1 is used by default.
+- The '-s' option will be ignored if calibration pose is required. In this case, anyone striking that pose will be tracked.
+
+<H2>Limitations</H2>
+To get the most out of this sample the user generator implementation should support the pose detection
+capability and that capability should support the "Wave" pose and the "CrossHandsPose". That said,
+the sample should work with any implementation but not with all options:
+- If the CrossHandsPose pose is not supported by the pose detection capability, exit pose will not work
+- If the Wave pose is not supported by the pose detection capability both SingleWave and MultipleWave
+  will fail (i.e. only closest will work)
+- If the skeleton requires a calibration pose, the user selection enforced will be using the calibration pose.
+
+<h1>Implementation</H1>
+The sample into three main modules:
+- @ref UserSelectionGraphics
+- @ref UserSelectionClasses
+- @ref UserSelectionSampleFiles
+
+The basic idea behind these modules is simple:
+The @ref UserSelectionGraphics module handles the graphics only and therefore can be mostly ignored by
+anyone who wishes to learn only the OpenNI elements.<br>
+The @ref UserSelectionSampleFiles module shows how to access various OpenNI elements (although most of
+it already appears in other, simpler samples) and the behavior itself is specific to this sample 
+(although as usual with samples, it is a good starting place for an application).<br>
+The @ref UserSelectionClasses is aimed at being taken as is by an application and extended, as such
+it designed to be as generic as possible, aimed as much as possible to simply be included in a project.
+*/
+
+/** @defgroup UserSelectionModules User selection sample.
+ at brief Module which encompasses the entire user selection sample.
+
+This module contains the NIUserSelection sample. For more information see @ref NIUserSelectionSampleOverview
+*/
+
+
+
+/** @defgroup UserSelectionGraphics User selection graphics
+ at brief Module to handle graphics for the sample
+
+The main idea behind the graphics in this sample is to hide it as best as possible. The sample uses
+OpenGL (or GLES if OpenGL is not available, in which case not all options are supported).<br>
+The @ref SceneDrawer class was designed to exclude any OpenNI behavior and therefore this entire 
+module can be ignored by anyone who just wishes to learn the OpenNI portions. All OpenNI elements
+were abstracted by @ref UserTracker.<br><br>
+
+The @ref SceneDrawer class is implemented as a singleton with a single entry point: 
+ at ref SceneDrawer::DrawScene. This method runs the sample and never exits (i.e. when it exits the 
+entire program exits). @ref SceneDrawer also defines all @b keyboard interaction with the sample 
+(as opposed to command line arguments and pose based interaction). The following keyboard options 
+are supported:
+- @b 'ESC': exits the sample
+- @b 'x': This toggles whether to show pixels at all (as opposed to just the skeleton and labels). 
+- @b 'b': Assuming pixels are shown (toggled by @b 'x' above), this toggles drawing the background. 
+          By default the background and users are both shown. This toggles between the default and 
+          showing the users only (no background). 
+- @b 's': This toggles whether or not to show the skeleton.
+- @b 'i': This toggles whether or not to show labels.
+- @b 'l': Assuming labels are shown (toggled by @b 'i' above) this toggled whether to show just the 
+          user id or additional information (such as selection state).
+- @b 'p': Toggles pausing the sample.
+ at ingroup UserSelectionModules
+*/
+
+
+/** @defgroup UserSelectionClasses User selection classes
+ at brief User selection classes and objects
+
+This module is designed to be a plug-in to an application. While not part of OpenNI interface it is
+an example implementation of user selection which can be used as is in any application and easily 
+extended to provide additional functionality.<br>
+
+The user selection module is composed of two sub modules: 
+- @ref UserSelectionSelectors which includes the various logic of how to @b choose a user
+- @ref UserSelectionInitializers which includes the various logic of how to start tracking when
+  the user was selected.
+
+The main logic would be to choose a selector with the user selection paradigm and choose an initializer
+with the desired way to start tracking and then simply activate both in a manner similar to this sample.
+ at ingroup UserSelectionModules
+*/
+
+/** @defgroup UserSelectionSelectors User selection selectors
+ at brief Module with classes to design on the logic of how to @b choose a user.
+
+This module is responsible for the user selection process, i.e. how to choose a user. It is based
+on the @ref UserSelector class which is an interface for all user selectors. The basic implementation
+here is based on two types of selection:
+- @ref UserSelectionClosestSelectors which is based on the closest user.
+- @ref UserSelectionPoseSelectors which is based on a user which strikes a pose.
+ at ingroup UserSelectionClasses
+*/
+
+/** @defgroup UserSelectionInitializers User selection initializers
+ at brief Module with classes to handle the logic of how to start tracking when the user was selected.
+
+This module is responsible for the process of starting to track the selected user. It provides a base
+class (@ref TrackingInitializer) which is used as an interface and a single, default implementation
+(@ref DefaultTrackingInitializer) which uses the standard way to start tracking (by requesting 
+calibration and when completed successfully start the tracking).
+
+ at ingroup UserSelectionClasses
+*/
+
+/** @defgroup UserSelectionClosestSelectors User selection Closest selectors
+ at brief Implementation of closest user selection.
+
+This module contains an implementation for a user selector which chooses the closest users first.
+ at ingroup UserSelectionSelectors
+*/
+
+
+/** @defgroup UserSelectionPoseSelectors User selection Pose selectors
+ at brief Implementation of pose based user selection.
+
+This module contains an implementation for user selectors which chooses users based on the pose
+the user strikes.
+ at ingroup UserSelectionSelectors
+*/
+
+/** @defgroup UserSelectionSampleFiles User selection sample files
+ at brief The sample base files
+
+This module contains the base objects provided by the sample. These include:
+- @ref UserTracker : This is the base class that abstracts OpenNI to @ref SceneDrawer and interacts
+                    with the @ref UserSelectionClasses.
+- @ref UserSelectionSampleManagers :  These are various managers responsible for doing the proper 
+                                    initialization and running of the sample
+- @ref ExitPoseDetector : An object responsible for figuring out when a user strikes the exit pose.
+- main.cpp: Contains the @ref main method of the sample.
+ at ingroup UserSelectionModules
+*/
+
+/** @defgroup UserSelectionSampleManagers User selection sample managers
+ at brief Contains managers responsible for doing the proper initialization and running of the sample
+ at ingroup UserSelectionSampleFiles
+*/
diff --git a/Samples/NiUserSelection/ExitPoseDetector.cpp b/Samples/NiUserSelection/ExitPoseDetector.cpp
new file mode 100644
index 0000000..3e40a24
--- /dev/null
+++ b/Samples/NiUserSelection/ExitPoseDetector.cpp
@@ -0,0 +1,151 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "ExitPoseDetector.h"
+
+#define CROSS_HANDS_POSE "CrossHandsPose"
+
+ExitPoseDetector::ExitPoseDetector(xn::UserGenerator userGenNode) : m_hPoseDetectCallback(NULL),
+                                                                    m_hPoseOutOfPoseDetectCallback(NULL),
+                                                                    m_hUserCallbacks(NULL),
+                                                                    m_userGenerator(userGenNode),
+                                                                    m_bValid(FALSE)
+{
+    if(!m_userGenerator.IsCapabilitySupported(XN_CAPABILITY_POSE_DETECTION))
+    {
+        return;
+    }
+    xn::PoseDetectionCapability cap=m_userGenerator.GetPoseDetectionCap();
+    if(!cap.IsPoseSupported(CROSS_HANDS_POSE))
+    {
+        return; // we need this pose to continue...
+    }
+    if(cap.RegisterToPoseDetected(PoseDetectedCallback,this,m_hPoseDetectCallback)!=XN_STATUS_OK)
+    {
+        m_hPoseDetectCallback=NULL;
+        return;
+    }
+    if(cap.RegisterToOutOfPose(OutOfPoseDetectedCallback,this,m_hPoseOutOfPoseDetectCallback)!=XN_STATUS_OK)
+    {
+        m_hPoseOutOfPoseDetectCallback=NULL;
+        return;
+    }
+    if(m_userGenerator.RegisterUserCallbacks(NewUserCallback,LostUserCallback,this,m_hUserCallbacks)!=XN_STATUS_OK)
+    {
+        m_hUserCallbacks=NULL;
+        return;
+    }
+    m_bValid=TRUE;
+}
+
+
+ExitPoseDetector::~ExitPoseDetector()
+{
+    m_bValid=FALSE;
+
+    if(m_hUserCallbacks!=NULL)
+    {
+        m_userGenerator.UnregisterUserCallbacks(m_hUserCallbacks);
+        m_hUserCallbacks=NULL;
+    }
+
+    if(!m_userGenerator.IsCapabilitySupported(XN_CAPABILITY_POSE_DETECTION))
+    {
+        return;
+    }
+    xn::PoseDetectionCapability cap=m_userGenerator.GetPoseDetectionCap();
+    if(m_hPoseDetectCallback!=NULL)
+    {
+        cap.UnregisterFromPoseDetected(m_hPoseDetectCallback);
+        m_hPoseDetectCallback=NULL;
+    }
+    if(m_hPoseOutOfPoseDetectCallback!=NULL)
+    {
+        cap.UnregisterFromOutOfPose(m_hPoseOutOfPoseDetectCallback);
+        m_hPoseOutOfPoseDetectCallback=NULL;
+    }
+}
+
+XnUInt64 ExitPoseDetector::GetExitPoseTimeStamp(XnUserID nUserId)
+{
+    if(nUserId==0)
+    {
+        XnUInt64 maxTime=0;
+        for(UserExitPoseTimes::Iterator iter=m_userExitPoseTimes.begin(); iter!=m_userExitPoseTimes.end(); ++iter)
+        {
+            XnUInt64 userTime=iter.Value();
+            if(userTime>maxTime)
+            {
+                maxTime=userTime;
+            }
+        }
+        return maxTime;
+    }
+    // we have an actual user
+    XnUInt64 userTime;
+    if(m_userExitPoseTimes.Get(nUserId,userTime)!=XN_STATUS_OK)
+    {
+        return 0; // no user data
+    }
+    return userTime;
+}
+
+
+void XN_CALLBACK_TYPE ExitPoseDetector::PoseDetectedCallback(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nUserId, void* pCookie)
+{
+    if(xnOSStrCmp(strPose,CROSS_HANDS_POSE)!=0)
+    {
+        return; // irrelevant pose
+    }
+    ExitPoseDetector *detector=(ExitPoseDetector *)pCookie;
+    XnUInt64 tmpTime;
+    if(detector->m_userExitPoseTimes.Get(nUserId,tmpTime)!=XN_STATUS_OK || tmpTime==0)
+    {
+        tmpTime=detector->m_userGenerator.GetTimestamp();
+        detector->m_userExitPoseTimes.Set(nUserId,tmpTime);
+    }
+}
+
+void XN_CALLBACK_TYPE ExitPoseDetector::OutOfPoseDetectedCallback(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nUserId, void* pCookie)
+{
+    if(xnOSStrCmp(strPose,CROSS_HANDS_POSE)!=0)
+    {
+        return; // irrelevant pose
+    }
+    ExitPoseDetector *detector=(ExitPoseDetector *)pCookie;
+    XnUInt64 tmpTime=0;
+    detector->m_userExitPoseTimes.Set(nUserId,tmpTime); // we are not in pose any more.
+}
+
+void XN_CALLBACK_TYPE ExitPoseDetector::NewUserCallback(xn::UserGenerator& generator, XnUserID nUserId, void* pCookie)
+{
+    ExitPoseDetector *detector=(ExitPoseDetector *)pCookie;
+    detector->m_userGenerator.GetPoseDetectionCap().StartPoseDetection(CROSS_HANDS_POSE,nUserId);
+}
+
+void XN_CALLBACK_TYPE ExitPoseDetector::LostUserCallback(xn::UserGenerator& generator, XnUserID nUserId, void* pCookie)
+{
+    ExitPoseDetector *detector=(ExitPoseDetector *)pCookie;
+    detector->m_userExitPoseTimes.Remove(nUserId);
+}
diff --git a/Samples/NiUserSelection/ExitPoseDetector.h b/Samples/NiUserSelection/ExitPoseDetector.h
new file mode 100644
index 0000000..566ce4d
--- /dev/null
+++ b/Samples/NiUserSelection/ExitPoseDetector.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_EXIT_POSE_DETECTOR_H_
+#define XNV_EXIT_POSE_DETECTOR_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnCppWrapper.h>
+#include <XnHash.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+
+/// @brief Class to follow exit pose state for each user
+/// 
+/// The goal of this class is to find exit and track exit pose state for each user.
+/// @ingroup UserSelectionSampleFiles
+class ExitPoseDetector
+{
+public:
+    /// @brief Constructor
+    /// 
+    /// @param userGenNode The user generator node to use
+    ExitPoseDetector(xn::UserGenerator userGenNode);
+
+    /// @brief Destructor
+    ~ExitPoseDetector();
+
+    /// @brief Returns true if the user tracker is valid.
+    XnBool Valid() { return m_bValid; };
+
+    /// @brief gets the timestamp of when a user last entered an exit pose without leaving it
+    /// 
+    /// @param nUserId The user whose state we are checking. A user of 0 means the highest value of
+    ///                all.
+    /// @return The latest time when the user entered an exit pose and have not been out
+    /// of pose since. If the user is currently out of pose, 0 is returned.
+    XnUInt64 GetExitPoseTimeStamp(XnUserID nUserId);
+
+private:
+    /// @brief Defines the UserExitPoseTimes hash which holds the last time an exit pose was found 
+    /// for each user. A value of 0 means an illegal time (e.g. because out of pose was found).
+    XN_DECLARE_DEFAULT_HASH(XnUserID,XnUInt64,UserExitPoseTimes);
+
+    UserExitPoseTimes m_userExitPoseTimes; ///< @brief holds the hash which holds the last time and exit pose was found for each user.
+
+    /// @brief A handle to unregister pose detection callbacks
+    XnCallbackHandle m_hPoseDetectCallback;             
+    /// @brief A handle to unregister out of pose detection callbacks
+    XnCallbackHandle m_hPoseOutOfPoseDetectCallback;    
+
+    XnCallbackHandle m_hUserCallbacks; ///< @brief A handle to be able to unregister the user callbacks
+
+    xn::UserGenerator m_userGenerator; ///< @brief The user generator to use.
+
+    XnBool m_bValid; ///< @brief holds true if we have a valid value. This only happens after initialization!
+
+    /// @brief Callback for pose detection
+    static void XN_CALLBACK_TYPE PoseDetectedCallback(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nUserId, void* pCookie);
+
+    /// @brief Callback for out of pose detection
+    static void XN_CALLBACK_TYPE OutOfPoseDetectedCallback(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nUserId, void* pCookie);
+ 
+    /// @brief New user callback.
+    /// 
+    /// Called when a new user is found.
+    /// @param generator The user generator which called the callback
+    /// @param nUserId The newly found user
+    /// @param pCookie A cookie which on registering is defined as the calling user selector object.
+    static void XN_CALLBACK_TYPE NewUserCallback(xn::UserGenerator& generator, XnUserID nUserId, void* pCookie);
+
+    /// @brief Lost user callback.
+    /// 
+    /// Called when a user is lost (i.e. no longer counted in the scene. Does not include exiting).
+    /// @param generator The user generator which called the callback
+    /// @param nUserId The lost user
+    /// @param pCookie A cookie which on registering is defined as the calling user selector object.
+    static void XN_CALLBACK_TYPE LostUserCallback(xn::UserGenerator& generator, XnUserID nUserId, void* pCookie);
+
+};
+
+
+#endif // XNV_EXIT_POSE_DETECTOR_H_
diff --git a/Samples/NiSimpleViewer/GL/gl.h b/Samples/NiUserSelection/GL/gl.h
similarity index 100%
copy from Samples/NiSimpleViewer/GL/gl.h
copy to Samples/NiUserSelection/GL/gl.h
diff --git a/Samples/NiSimpleViewer/GL/glext.h b/Samples/NiUserSelection/GL/glext.h
similarity index 100%
copy from Samples/NiSimpleViewer/GL/glext.h
copy to Samples/NiUserSelection/GL/glext.h
diff --git a/Samples/NiSimpleViewer/GL/glut.h b/Samples/NiUserSelection/GL/glut.h
similarity index 100%
copy from Samples/NiSimpleViewer/GL/glut.h
copy to Samples/NiUserSelection/GL/glut.h
diff --git a/Samples/NiSimpleViewer/GL/wglext.h b/Samples/NiUserSelection/GL/wglext.h
similarity index 100%
copy from Samples/NiSimpleViewer/GL/wglext.h
copy to Samples/NiUserSelection/GL/wglext.h
diff --git a/Samples/NiUserTracker/GLES/egl.h b/Samples/NiUserSelection/GLES/egl.h
similarity index 100%
copy from Samples/NiUserTracker/GLES/egl.h
copy to Samples/NiUserSelection/GLES/egl.h
diff --git a/Samples/NiUserTracker/GLES/egl_1_0.h b/Samples/NiUserSelection/GLES/egl_1_0.h
similarity index 100%
copy from Samples/NiUserTracker/GLES/egl_1_0.h
copy to Samples/NiUserSelection/GLES/egl_1_0.h
diff --git a/Samples/NiUserTracker/GLES/egltypes.h b/Samples/NiUserSelection/GLES/egltypes.h
similarity index 100%
copy from Samples/NiUserTracker/GLES/egltypes.h
copy to Samples/NiUserSelection/GLES/egltypes.h
diff --git a/Samples/NiUserTracker/GLES/gl.h b/Samples/NiUserSelection/GLES/gl.h
similarity index 100%
copy from Samples/NiUserTracker/GLES/gl.h
copy to Samples/NiUserSelection/GLES/gl.h
diff --git a/Samples/NiUserTracker/GLES/gl_1_0.h b/Samples/NiUserSelection/GLES/gl_1_0.h
similarity index 100%
copy from Samples/NiUserTracker/GLES/gl_1_0.h
copy to Samples/NiUserSelection/GLES/gl_1_0.h
diff --git a/Samples/NiSimpleViewer/Libs/glut32.lib b/Samples/NiUserSelection/Libs/glut32.lib
similarity index 100%
copy from Samples/NiSimpleViewer/Libs/glut32.lib
copy to Samples/NiUserSelection/Libs/glut32.lib
diff --git a/Samples/NiSimpleViewer/Libs/glut64.lib b/Samples/NiUserSelection/Libs/glut64.lib
similarity index 100%
copy from Samples/NiSimpleViewer/Libs/glut64.lib
copy to Samples/NiUserSelection/Libs/glut64.lib
diff --git a/Samples/NiUserSelection/PoseToggleUserSelector.cpp b/Samples/NiUserSelection/PoseToggleUserSelector.cpp
new file mode 100644
index 0000000..c84dfeb
--- /dev/null
+++ b/Samples/NiUserSelection/PoseToggleUserSelector.cpp
@@ -0,0 +1,181 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "PoseToggleUserSelector.h"
+
+
+
+#define VALIDATE(cond, errorMsg)                                        \
+    if(!cond)                                                       \
+        {                                                               \
+        printf("PoseUserSelector creation failed: %s\n",errorMsg);  \
+        m_bValid=FALSE;                                             \
+        return;                                                     \
+        }                                                               \
+
+#define VALIDATE_WITH_ACTION(cond, errorMsg, actionToDo)                \
+    if(!cond)                                                           \
+    {                                                                   \
+    printf("PoseUserSelector creation failed: %s\n",errorMsg);      \
+    actionToDo;                                                     \
+    m_bValid=FALSE;                                                 \
+    return;                                                         \
+    }                                                                   \
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+
+PoseToggleUserSelector::PoseToggleUserSelector(xn::UserGenerator* pUserGenerator,
+                                               TrackingInitializer* pTrackingInitializer, 
+                                               const char* poseToTrack,
+                                               XnUInt32 maxUsersToTrack,
+                                               XnUInt64 timeBeforeToggle) : 
+                    PoseUserSelector(pUserGenerator,pTrackingInitializer,poseToTrack),
+                    m_nMaxUsersToTrack(maxUsersToTrack),
+                    m_timeBeforeToggle(timeBeforeToggle)
+{
+    VALIDATE(m_bValid,"PoseUserSelector was not initialized properly"); // note we assume this tests the validity of the pose capability
+    XnStatus nRetVal = m_pUserGenerator->GetPoseDetectionCap().RegisterToOutOfPose(OutOfPoseCallback,this,m_hOutOfPoseDetectCallback);
+    VALIDATE_WITH_ACTION(nRetVal == XN_STATUS_OK,"Failed to register to pose detection",m_hOutOfPoseDetectCallback = NULL);
+}
+                                     
+
+    /// @brief destructor.
+PoseToggleUserSelector::~PoseToggleUserSelector()
+{
+    if(m_hOutOfPoseDetectCallback != NULL)
+    {
+        m_pUserGenerator->GetPoseDetectionCap().UnregisterFromOutOfPose(m_hOutOfPoseDetectCallback);
+        m_hOutOfPoseDetectCallback = NULL;
+    }
+}
+
+XnStatus PoseToggleUserSelector::DetectPose(XnUserID nUserId)
+{
+    UserSelectionState* pState;
+    XnStatus nRetVal = m_hUsersState.Get(nUserId, pState);
+    if(nRetVal!=XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+    XnUInt64 lastOutOfPoseTime;
+
+    nRetVal=m_usersOutOfPoseTime.Get(nUserId, lastOutOfPoseTime);
+    if(nRetVal!=XN_STATUS_OK)
+    {
+        return nRetVal; // we don't have a user time at all. This should not happen!!!
+    }
+    XnUInt64 curOutOfPoseTime=m_pUserGenerator->GetTimestamp();
+
+
+    if(pState->m_eState == XN_SELECTION_UNSELECTED || pState->m_eState == XN_SELECTION_FAILED)
+    {
+
+        // we want to select the user
+        if(lastOutOfPoseTime > 0 && (curOutOfPoseTime-lastOutOfPoseTime < m_timeBeforeToggle))
+        {
+            return XN_STATUS_OK; // not enough time has passed since out of pose
+        }
+
+        if(GetNumberOfSelectedUsers() >= m_nMaxUsersToTrack)
+        {
+            return XN_STATUS_OK; // we don't select because we already have enough selected users
+        }
+        XnUInt64 tmpTime = 0;
+        m_usersOutOfPoseTime.Set(nUserId,tmpTime); // we start so we don't care about previous out of pose any more
+        return PoseUserSelector::DetectPose(nUserId); // we select as the parent does.
+    }
+    else
+    {
+        // we might want to unselect the user.
+
+        if(lastOutOfPoseTime == 0 || (curOutOfPoseTime - lastOutOfPoseTime < m_timeBeforeToggle))
+        {
+            return XN_STATUS_OK; // not enough time has passed
+        }
+        // we need to unselect!
+        UpdateUserSelectionState(nUserId,XN_SELECTION_UNSELECTED,0);
+        m_pTrackingInitializer->AbortTracking(nUserId); // stop tracking
+        m_usersOutOfPoseTime.Set(nUserId,curOutOfPoseTime); // we are not tracking so no time is relevant
+
+    }
+    return XN_STATUS_ERROR;
+}
+
+XnStatus PoseToggleUserSelector::AddNewUser(XnUserID nUserId)
+{
+    XnStatus res=PoseUserSelector::AddNewUser(nUserId);
+    if(res!=XN_STATUS_OK)
+    {
+        return res;
+    }
+    return m_usersOutOfPoseTime.Set(nUserId,0);
+}
+
+XnStatus PoseToggleUserSelector::RemoveUser(XnUserID nUserId)
+{
+    XnStatus res=PoseUserSelector::RemoveUser(nUserId);
+    if(res!=XN_STATUS_OK)
+    {
+        return res;
+    }
+    return m_usersOutOfPoseTime.Remove(nUserId);
+}
+
+XnStatus PoseToggleUserSelector::DetectOutOfPose(XnUserID nUserId)
+{
+    XnUInt64 lastOutOfPoseTime;
+
+    UserSelectionState* pState;
+    XnStatus nRetVal=m_hUsersState.Get(nUserId, pState);
+    if(nRetVal!=XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+    nRetVal=m_usersOutOfPoseTime.Get(nUserId,lastOutOfPoseTime);
+    if(nRetVal!=XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+    if(lastOutOfPoseTime!=0)
+    {
+        return XN_STATUS_OK; // we already have a number...
+    }
+    lastOutOfPoseTime=m_pUserGenerator->GetTimestamp();
+    m_usersOutOfPoseTime.Set(nUserId,lastOutOfPoseTime);
+    return XN_STATUS_OK;
+}
+
+void XN_CALLBACK_TYPE PoseToggleUserSelector::OutOfPoseCallback(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nUserId,void* pCookie)
+{
+    PoseToggleUserSelector *pPoseUserSelector=(PoseToggleUserSelector *)pCookie;
+    if(xnOSStrCmp(strPose,pPoseUserSelector->m_strPoseToTrack)!=0)
+        return; // this is not the pose we are looking for.
+    pPoseUserSelector->DetectOutOfPose(nUserId);
+
+}
diff --git a/Samples/NiUserSelection/PoseToggleUserSelector.h b/Samples/NiUserSelection/PoseToggleUserSelector.h
new file mode 100644
index 0000000..c82803b
--- /dev/null
+++ b/Samples/NiUserSelection/PoseToggleUserSelector.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_POSE_TOGGLE_USER_SELECTOR_H_
+#define XNV_POSE_TOGGLE_USER_SELECTOR_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "PoseUserSelector.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+
+/// @brief User selector which toggles selection based on pose
+/// 
+/// This user selector allows users to be selected when the perform a pose and unselects them when
+/// they perform it again.
+/// @ingroup UserSelectionPoseSelectors
+class PoseToggleUserSelector : public PoseUserSelector
+{
+public:
+    /// @brief constructor.
+    /// 
+    /// @param pUserGenerator A pointer to the user generator node which holds the users.
+    /// @param pTrackingInitializer A pointer to the tracking initializer to use to start tracking.
+    /// @param poseToTrack The pose to use for selection.
+    /// @param maxUsersToTrack The maximum allowed users to track
+    /// @param timeBeforeToggle The pose can toggle only if this number of microseconds have passed
+    ///                         from the first out of pose for the user after starting tracking.
+    PoseToggleUserSelector(xn::UserGenerator *pUserGenerator,
+                           TrackingInitializer *pTrackingInitializer, 
+                           const char *poseToTrack,
+                           XnUInt32 maxUsersToTrack,
+                           XnUInt64 timeBeforeToggle);
+
+    /// @brief destructor.
+    ~PoseToggleUserSelector();
+protected:
+    /// @brief Internal method which is called from the callback whenever a Pose is detected.
+    /// 
+    /// @param nUserId the user who'se pose was detected
+    /// @return The success code.
+    virtual XnStatus DetectPose(XnUserID nUserId);
+
+    // override the base AddNewUser (calls the base too)
+    virtual XnStatus AddNewUser(XnUserID nUserId);
+
+    // override the base AddNewUser (calls the base too)
+    virtual XnStatus RemoveUser(XnUserID nUserId);
+
+    /// @brief Internal method which is called from the callback whenever a out of Pose is detected.
+    /// 
+    /// @param nUserId the user who'se out of pose was detected
+    /// @return The success code.
+    virtual XnStatus DetectOutOfPose(XnUserID nUserId);
+
+    /// @brief Internal hash for when a user got out of pose.
+    XN_DECLARE_DEFAULT_HASH(XnUserID,XnUInt64,UserOutOfPoseHash);
+
+    UserOutOfPoseHash m_usersOutOfPoseTime; ///< @brief holds for each user, the first time they were out of pose AFTER being tracked. 0 means no data.
+    /// @param maxUsersToTrack 
+    /// @param timeBeforeToggle 
+
+    XnUInt32 m_nMaxUsersToTrack; ///< @brief The maximum allowed users to track
+    XnUInt64 m_timeBeforeToggle; ///< @brief The pose can toggle only if this number of microseconds have passed
+
+    /// @brief A handle to unregister out of pose detection callbacks
+    XnCallbackHandle m_hOutOfPoseDetectCallback;      
+
+private:
+    /// @brief Callback for detecting out of pose.
+    static void XN_CALLBACK_TYPE OutOfPoseCallback(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nUserId,void* pCookie);
+};
+#endif // XNV_POSE_TOGGLE_USER_SELECTOR_H_
diff --git a/Samples/NiUserSelection/PoseUserSelector.cpp b/Samples/NiUserSelection/PoseUserSelector.cpp
new file mode 100644
index 0000000..89e9f7f
--- /dev/null
+++ b/Samples/NiUserSelection/PoseUserSelector.cpp
@@ -0,0 +1,197 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "PoseUserSelector.h"
+
+#define POSE_LIST_NUM_POSES 20
+#define POSE_LIST_STRING_LENGTH 50
+
+#define VALIDATE(cond, errorMsg)                                        \
+        if(!(cond))                                                     \
+        {                                                               \
+            printf("PoseUserSelector creation failed: %s\n",errorMsg);  \
+            m_bValid=FALSE;                                             \
+            return;                                                     \
+        }                                                               \
+
+#define VALIDATE_WITH_ACTION(cond, errorMsg, actionToDo)                \
+    if(!(cond))                                                         \
+    {                                                                   \
+        printf("PoseUserSelector creation failed: %s\n",errorMsg);      \
+        actionToDo;                                                     \
+        m_bValid=FALSE;                                                 \
+        return;                                                         \
+    }                                                                   \
+
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+PoseUserSelector::PoseUserSelector(xn::UserGenerator* pUserGenerator,
+                                   TrackingInitializer* pTrackingInitializer,
+                                   const char* poseToTrack) :
+                                                              UserSelector(pUserGenerator),
+                                                              m_pTrackingInitializer(pTrackingInitializer),
+                                                              m_strPoseToTrack(NULL),
+                                                              m_hPoseDetectCallback(NULL),
+                                                              m_hPoseInProgressCallback(NULL)
+{
+    VALIDATE(m_bValid , "UserSelector was not initialized properly");
+    VALIDATE(pTrackingInitializer != NULL , "NULL tracking initializer supplied");
+    VALIDATE(pTrackingInitializer->IsValid() , "tracking initializer supplied is invalid");
+    VALIDATE(m_pUserGenerator != NULL,"NULL user generator supplied");
+    VALIDATE(m_pUserGenerator->IsCapabilitySupported(XN_CAPABILITY_POSE_DETECTION) , "User generator supplied does not support pose capability");
+    VALIDATE(poseToTrack != NULL , "NULL pose provided");
+    VALIDATE(m_pUserGenerator->GetPoseDetectionCap().IsPoseSupported(poseToTrack) , "Pose detection capability does not support requested pose");
+    XnStatus nRetVal = m_pUserGenerator->GetPoseDetectionCap().RegisterToPoseDetected(PoseDetectedCallback,this,m_hPoseDetectCallback);
+    VALIDATE_WITH_ACTION(nRetVal == XN_STATUS_OK,"Failed to register to pose detection",m_hPoseDetectCallback = NULL);
+    nRetVal = m_pUserGenerator->GetPoseDetectionCap().RegisterToPoseInProgress(PoseInProgressCallback,this,m_hPoseInProgressCallback);
+    VALIDATE_WITH_ACTION(nRetVal == XN_STATUS_OK,"Failed to register to pose in progress",m_hPoseInProgressCallback = NULL);
+    
+    int len=strlen(poseToTrack)+1;
+    m_strPoseToTrack=XN_NEW_ARR(char, len); // the length is +1 to accommodate the null terminator
+    xnOSStrCopy(m_strPoseToTrack,poseToTrack,len);
+}
+
+PoseUserSelector::~PoseUserSelector()
+{
+    m_pTrackingInitializer = NULL;
+    if(m_pUserGenerator != NULL)
+    {
+        if(m_pUserGenerator->IsCapabilitySupported(XN_CAPABILITY_POSE_DETECTION))
+        {
+            for(UserStateHash::Iterator iter = m_hUsersState.begin(); iter != m_hUsersState.end(); ++iter)
+            {
+                m_pUserGenerator->GetPoseDetectionCap().StopPoseDetection(iter.Key());
+            }
+            if(m_hPoseDetectCallback != NULL)
+            {
+                m_pUserGenerator->GetPoseDetectionCap().UnregisterFromPoseDetected(m_hPoseDetectCallback);
+                m_hPoseDetectCallback = NULL;
+            }
+            if(m_hPoseInProgressCallback != NULL)        
+            {
+                m_pUserGenerator->GetPoseDetectionCap().UnregisterFromPoseInProgress(m_hPoseInProgressCallback);
+                m_hPoseInProgressCallback = NULL;
+            }        
+        }
+        m_pUserGenerator = NULL;
+    }
+    if(m_strPoseToTrack != NULL)
+    {
+        XN_DELETE_ARR(m_strPoseToTrack);
+        m_strPoseToTrack = NULL;
+    }
+}
+
+XnStatus PoseUserSelector::StartTracking(XnUserID nUserId)
+{
+    UserSelectionState* pState;
+    XnStatus nRetVal=m_hUsersState.Get(nUserId, pState);
+    if(nRetVal != XN_STATUS_OK)
+    {
+        return nRetVal; // we don't have such user ready
+    }
+    if(pState->m_eState != XN_SELECTION_UNSELECTED)
+    {
+        return XN_STATUS_ERROR; // the user is in the wrong state.
+    }
+    nRetVal=UpdateUserSelectionState(nUserId, XN_SELECTION_SELECTED, 0);
+    if(nRetVal!=XN_STATUS_OK)
+    {
+        return nRetVal; // we can't continue because we can't update the state!
+    }
+    return m_pTrackingInitializer->StartTracking(nUserId,FALSE);
+}
+
+XnStatus PoseUserSelector::AddNewUser(XnUserID nUserId)
+{
+    UserSelector::AddNewUser(nUserId);
+    return m_pUserGenerator->GetPoseDetectionCap().StartPoseDetection(m_strPoseToTrack,nUserId);
+}
+
+XnStatus PoseUserSelector::RemoveUser(XnUserID nUserId)
+{
+    UserSelector::RemoveUser(nUserId);
+    return m_pUserGenerator->GetPoseDetectionCap().StopPoseDetection(nUserId);
+}
+
+XnStatus PoseUserSelector::UpdatePoseProgress(XnUserID nUserId, XnPoseDetectionStatus ePoseError)
+{
+    UserSelectionState* pState;
+    XnStatus nRetVal=m_hUsersState.Get(nUserId, pState);
+    if(nRetVal != XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+    if(pState->m_eState != XN_SELECTION_UNSELECTED)
+    {
+        return XN_STATUS_ERROR; // the user is in the wrong state.
+    }
+    return UpdateUserSelectionState(nUserId,pState->m_eState, ePoseError);
+}
+
+XnStatus PoseUserSelector::DetectPose(XnUserID nUserId)
+{
+    return StartTracking(nUserId);
+}
+
+void XN_CALLBACK_TYPE PoseUserSelector::PoseInProgressCallback(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nUserId, XnPoseDetectionStatus ePoseError, void* pCookie)
+{
+    PoseUserSelector* pPoseUserSelector = (PoseUserSelector *)pCookie;
+    if(xnOSStrCmp(strPose,pPoseUserSelector->m_strPoseToTrack)!=0)
+    {
+        return; // this is not the pose we are looking for.
+    }
+    pPoseUserSelector->UpdatePoseProgress(nUserId,ePoseError);
+}
+
+void XN_CALLBACK_TYPE PoseUserSelector::PoseDetectedCallback(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nUserId, void* pCookie)
+{
+    PoseUserSelector* pPoseUserSelector = (PoseUserSelector *)pCookie;
+    if(xnOSStrCmp(strPose,pPoseUserSelector->m_strPoseToTrack)!=0)
+    {
+        return; // this is not the pose we are looking for.
+    }
+    pPoseUserSelector->DetectPose(nUserId);
+}
+
+const XnChar* PoseUserSelector::GetPoseErrorString(XnPoseDetectionStatus error)
+{
+    switch (error)
+    {
+    case XN_POSE_DETECTION_STATUS_OK:
+        return "OK";
+    case XN_POSE_DETECTION_STATUS_NO_USER:
+        return "NoUser";
+    case XN_POSE_DETECTION_STATUS_TOP_FOV:
+        return "Top FOV";
+    case XN_POSE_DETECTION_STATUS_SIDE_FOV:
+        return "Side FOV";
+    case XN_POSE_DETECTION_STATUS_ERROR:
+        return "General error";
+    default:
+        return "Unknown";
+    }
+}
diff --git a/Samples/NiUserSelection/PoseUserSelector.h b/Samples/NiUserSelection/PoseUserSelector.h
new file mode 100644
index 0000000..3892deb
--- /dev/null
+++ b/Samples/NiUserSelection/PoseUserSelector.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_POSE_USER_SELECTOR_H_
+#define XNV_POSE_USER_SELECTOR_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "UserSelector.h"
+#include "TrackingInitializer.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+
+/// @brief User selector based on pose
+/// 
+/// This basic user selector select users which perform a certain pose.
+/// The pose is define in initialization.
+/// The base class selects all users which perform the pose but inheriting classes can override this
+/// behavior by using the ForgetTracking method.
+/// @ingroup UserSelectionPoseSelectors
+class PoseUserSelector : public UserSelector
+{
+public:
+    /// @brief constructor.
+    /// 
+    /// @param pUserGenerator A pointer to the user generator node which holds the users.
+    /// @param pTrackingInitializer A pointer to the tracking initializer to use to start tracking.
+    /// @param poseToTrack The pose to use for selection.
+    PoseUserSelector(xn::UserGenerator *pUserGenerator,TrackingInitializer *pTrackingInitializer, const char *poseToTrack);
+
+    /// @brief destructor.
+    ~PoseUserSelector();
+protected:
+    /// @brief Internal method to do the actual tracking.
+    /// 
+    /// This method is called internally when we decide to track a user. It does all tracking elements.
+    /// @param nUserId The user we want to start tracking.
+    /// @return The success status
+    virtual XnStatus StartTracking(XnUserID nUserId);
+
+    // override the base AddNewUser (calls the base too)
+    virtual XnStatus AddNewUser(XnUserID nUserId);
+
+    // override the base AddNewUser (calls the base too)
+    virtual XnStatus RemoveUser(XnUserID nUserId);
+
+    /// @brief Internal method which is called whenever a PoseInProgressCallback callback is called.
+    /// 
+    /// @param nUserId the user whose pose progress is being updated
+    /// @param ePoseError the pose error (representing the pose progress) for the user
+    /// @return The success code.
+    virtual XnStatus UpdatePoseProgress(XnUserID nUserId,XnPoseDetectionStatus ePoseError);
+
+    /// @brief Internal method which is called from the callback whenever a Pose is detected.
+    /// 
+    /// @param nUserId the user whose pose progress was detected
+    /// @return The success code.
+    virtual XnStatus DetectPose(XnUserID nUserId);
+
+    /// @brief translate a calibration error to a string
+    /// 
+    /// @param eError The calibration error
+    /// @return The string version of the error.
+    const XnChar* GetPoseErrorString(XnPoseDetectionStatus eError);
+
+
+    TrackingInitializer *m_pTrackingInitializer; ///< @brief The tracking initializer used to start tracking
+    XnCallbackHandle m_hPoseInProgressCallback;  ///< @brief A handle to unregister the pose in progress callbacks.
+    XnCallbackHandle m_hPoseDetectCallback;      ///< @brief A handle to unregister pose detection callbacks
+
+    char *m_strPoseToTrack; ///< @brief The pose used for selection
+private:
+    /// @brief Callback for in progress updates of the pose
+    static void XN_CALLBACK_TYPE PoseInProgressCallback(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nUserId, XnPoseDetectionStatus ePoseError, void* pCookie);
+    /// @brief Callback for pose detection
+    static void XN_CALLBACK_TYPE PoseDetectedCallback(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nUserId, void* pCookie);
+};
+#endif // XNV_POSE_USER_SELECTOR_H_
diff --git a/Samples/NiUserSelection/SampleManager.cpp b/Samples/NiUserSelection/SampleManager.cpp
new file mode 100644
index 0000000..12c6773
--- /dev/null
+++ b/Samples/NiUserSelection/SampleManager.cpp
@@ -0,0 +1,214 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "SampleManager.h"
+#include "SceneDrawer.h"
+#include "DefaultTrackingInitializer.h"
+#include "SinglePoseUserSelector.h"
+#include "PoseToggleUserSelector.h"
+#include "ClosestUserSelector.h"
+
+// Utility macro. This calls cleanup, prints a message and returns.
+#define RETURN_WITH_CLEANUP(returnCode,errorMsg)                                \
+                            Cleanup();                                          \
+                            printf("Failed to start sample: %s\n", errorMsg);   \
+                            return returnCode; 
+
+
+SampleManager::SampleManager() : m_pUserTracker(NULL), 
+                                   m_pTrackingInitializer(NULL), 
+                                   m_pUserSelector(NULL)
+{
+
+}
+
+
+XnStatus SampleManager::StartSample(int argc, char **argv)
+{
+    // first we create a UserTracker object. This initializes all the openNI portions...
+    m_pUserTracker = XN_NEW(UserTracker,argc,argv,3000000); 
+
+    // make sure the initialization was a success
+    if(m_pUserTracker->Valid()==FALSE) 
+    {
+        RETURN_WITH_CLEANUP(XN_STATUS_ERROR, "User tracker invalid"); 
+    }
+
+    // set the user selector and tracking initializers. This is the main method overriden by 
+    // inheriting classes.
+    if(SetSelectors()!=XN_STATUS_OK)
+    {
+        RETURN_WITH_CLEANUP(XN_STATUS_ERROR, "Failed to initialize user selector and tracking initializers"); 
+    }
+
+    // test if we show low confidence joints (if this is true we show low confidence joints as
+    // dotted lines (confidence 0.5) or dashed lines (confidence lower than 0.5). If false we just
+    // do not draw low confidence joints.
+    XnBool bShowLowConfidence = FALSE;
+    for(int i=1; i<argc; i++)
+    {
+        if(xnOSStrCmp(argv[i] , "-ShowLowConfidence") == 0)
+        {
+            bShowLowConfidence = TRUE;
+        }
+    }
+    // start the actual running (handled by the scene drawer).
+    // note pUserTracker is deleted inside DrawScene when quitting.
+    SceneDrawer *singleton=SceneDrawer::GetInstance();
+    // This starts the actual program. NOTE: the DrawScene method never ends except for
+    // using the exit call to end the program. 
+    singleton->DrawScene(m_pUserTracker,argc,argv,this, bShowLowConfidence);
+    return XN_STATUS_OK; 
+}
+
+void SampleManager::Cleanup()
+{
+    // delete everything in an ordered manner. Make sure pointers are null afterwards.
+    if(m_pUserSelector!=NULL)
+    {
+        XN_DELETE(m_pUserSelector);
+        m_pUserSelector=NULL;
+    }
+    if(m_pTrackingInitializer!=NULL)
+    {
+        XN_DELETE(m_pTrackingInitializer);
+        m_pTrackingInitializer=NULL;
+    }
+    if(m_pUserTracker!=NULL)
+    {
+        XN_DELETE(m_pUserTracker);
+        m_pUserTracker=NULL;
+    }
+}
+SampleManager::~SampleManager()
+{
+    Cleanup();
+}
+
+DefaultInitializerWithCalibPose::DefaultInitializerWithCalibPose()
+{
+
+}
+
+XnStatus DefaultInitializerWithCalibPose::SetSelectors()
+{
+    // get the user generator (required as an input).
+    xn::UserGenerator *pUserGenerator=m_pUserTracker->GetUserGenerator();
+
+    // make sure the user generator is good.
+    if(pUserGenerator->IsCapabilitySupported(XN_CAPABILITY_SKELETON)==FALSE)
+    {
+        RETURN_WITH_CLEANUP(XN_STATUS_ERROR, "User generator does not support skeleton!"); 
+    }
+
+    // tracking initializer to use is the default one.
+    m_pTrackingInitializer=XN_NEW(DefaultTrackingInitializer,pUserGenerator); 
+    if(m_pTrackingInitializer->IsValid()==FALSE)
+    {
+        RETURN_WITH_CLEANUP(XN_STATUS_ERROR, "Failed to create tracking initializer"); 
+    }
+
+    // pick the user selector.
+
+    // make sure we have a pose detection capability (which is what this selector is all about).
+    if(pUserGenerator->IsCapabilitySupported(XN_CAPABILITY_POSE_DETECTION)==FALSE)
+    {
+        RETURN_WITH_CLEANUP(XN_STATUS_ERROR, "User tracker invalid"); 
+    }
+
+
+    // figure out which type of user selection to use.
+    // Option 1: if we need calibration pose - that is the type to use (and exit if we can't support it)
+    // Option 2: if do not need calibration pose we choose the overridden selector
+    if(pUserGenerator->GetSkeletonCap().NeedPoseForCalibration()==TRUE)
+    {
+        // first we get the pose from the skeleton capability
+        char poseString[50];
+        pUserGenerator->GetSkeletonCap().GetCalibrationPose(poseString);
+        // we now create the appropriate pose selector chooser
+        m_pUserSelector=XN_NEW(PoseUserSelector,pUserGenerator,m_pTrackingInitializer,poseString);
+    }
+    else
+    {
+        // get the overridden user selector
+        m_pUserSelector=CreateUserSelector(pUserGenerator,m_pTrackingInitializer);
+    }
+
+    // make sure the user selector is valid
+    if(m_pUserSelector->IsValid()==FALSE)
+    {
+        RETURN_WITH_CLEANUP(XN_STATUS_ERROR,"Failed to create user selector");
+    }
+
+    // initialize the tracking initializer with the relevant user selector.
+    m_pTrackingInitializer->SetUserTracker(m_pUserSelector);
+
+    // set the user selector and tracking initializer to the 
+    m_pUserTracker->InitUserSelection(m_pUserSelector,m_pTrackingInitializer);
+
+    return XN_STATUS_OK; 
+}
+
+
+
+
+
+SingleWaveSampleManager::SingleWaveSampleManager()
+{
+
+}
+
+UserSelector * SingleWaveSampleManager::CreateUserSelector(xn::UserGenerator *pUserGenerator,
+                                                           TrackingInitializer *pTrackingInitializer)
+{
+    return XN_NEW(SinglePoseUserSelector,pUserGenerator,pTrackingInitializer,"Wave");
+}
+
+
+
+MultipleWaveSampleManager::MultipleWaveSampleManager(XnUInt32 nMaxNumUsers) : m_nMaxNumUsers(nMaxNumUsers)
+{
+
+}
+
+UserSelector * MultipleWaveSampleManager::CreateUserSelector(xn::UserGenerator *pUserGenerator,
+                                                             TrackingInitializer *pTrackingInitializer)
+{
+    return XN_NEW(PoseToggleUserSelector,pUserGenerator,pTrackingInitializer,"Wave",m_nMaxNumUsers,2000000);
+}
+
+ClosestSampleManager::ClosestSampleManager(XnUInt32 nMaxNumUsers) : m_nMaxNumUsers(nMaxNumUsers)
+{
+
+}
+
+
+UserSelector * ClosestSampleManager::CreateUserSelector(xn::UserGenerator *pUserGenerator,
+                                                        TrackingInitializer *pTrackingInitializer)
+{
+    return XN_NEW(ClosestUserSelector,pUserGenerator,pTrackingInitializer,m_nMaxNumUsers);
+}
+
+
diff --git a/Samples/NiUserSelection/SampleManager.h b/Samples/NiUserSelection/SampleManager.h
new file mode 100644
index 0000000..56d991b
--- /dev/null
+++ b/Samples/NiUserSelection/SampleManager.h
@@ -0,0 +1,127 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_SAMPLE_MANAGER_H_
+#define XNV_SAMPLE_MANAGER_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "UserTracker.h"
+#include "TrackingInitializer.h"
+#include "UserSelector.h"
+
+/// @brief abstract class to create and manage the sample. 
+/// @ingroup UserSelectionSampleManagers
+class SampleManager
+{
+public:
+    /// @brief method to start running the sample.
+    /// 
+    /// @param argc The number of command line arguments (same as @ref main()).
+    /// @param argv The command line arguments array (same as @ref main()).
+    /// @return the success code.
+    virtual XnStatus StartSample(int argc, char **argv);
+    /// @brief Cleanup method.
+    /// 
+    /// This method is called by the graphics when exiting and should clean everything up.
+    virtual void Cleanup();
+    /// @brief destructor
+    virtual ~SampleManager();
+protected:
+    /// @brief constructor
+    SampleManager();
+    /// @brief Method to choose the UserSelector and TrackingInitializer
+    /// 
+    /// This is the method to overwrite when inheriting. It is responsible for filling up
+    /// m_pUserSelector with the user selector type and m_pTrackingInitializer with the tracking 
+    /// initializer type matching the require behavior.
+    virtual XnStatus SetSelectors()=0;
+    UserTracker *m_pUserTracker; ///< @brief The user tracker used when running
+    TrackingInitializer *m_pTrackingInitializer; ///< @brief The tracking initializer to use
+    UserSelector *m_pUserSelector; ///< @brief The user selector to use.
+};
+
+/// @brief an abstract SampleManager implementation which does calibration pose user selection if the
+/// skeleton requires a calibration pose and uses the default tracking initializer.
+/// @ingroup UserSelectionSampleManagers
+class DefaultInitializerWithCalibPose : public SampleManager
+{
+protected:
+    /// @brief Constructor
+    DefaultInitializerWithCalibPose();
+    virtual XnStatus SetSelectors();
+    /// @brief Internal method to construct the user selector
+    /// @param pUserGenerator The user generator to use
+    /// @param pTrackingInitializer The tracking initializer to use
+    /// @return The user selector (null if failed).
+    virtual UserSelector *CreateUserSelector(xn::UserGenerator *pUserGenerator,
+                                             TrackingInitializer *pTrackingInitializer)=0;
+};
+
+/// @brief class to implement the sample with a wave user selector (waving causes the user which
+/// waved to be selected).
+/// @ingroup UserSelectionSampleManagers
+class SingleWaveSampleManager : public DefaultInitializerWithCalibPose
+{
+public: 
+    /// @brief Constructor
+    SingleWaveSampleManager();
+protected:
+    virtual UserSelector *CreateUserSelector(xn::UserGenerator *pUserGenerator,
+                                             TrackingInitializer *pTrackingInitializer);
+};
+
+/// @brief class to implement the sample with a wave user selector (waving causes the user which
+/// waved to be selected).
+/// @ingroup UserSelectionSampleManagers
+class MultipleWaveSampleManager : public DefaultInitializerWithCalibPose
+{
+public: 
+    /// @brief Constructor
+    /// 
+    /// @param nMaxNumUsers maximum number of tracked users
+    MultipleWaveSampleManager(XnUInt32 nMaxNumUsers);
+protected:
+    virtual UserSelector *CreateUserSelector(xn::UserGenerator *pUserGenerator,
+                                             TrackingInitializer *pTrackingInitializer);
+
+    XnUInt32 m_nMaxNumUsers; ///< @brief The maximum allowed number of users
+};
+
+/// @brief class to implement the sample with a closest user selector (waving causes the closest 
+/// users to be selected).
+/// @ingroup UserSelectionSampleManagers
+class ClosestSampleManager : public DefaultInitializerWithCalibPose
+{
+public: 
+    /// @brief Constructor
+    /// 
+    /// @param nMaxNumUsers maximum number of tracked users
+    ClosestSampleManager(XnUInt32 nMaxNumUsers);
+protected:
+    virtual UserSelector *CreateUserSelector(xn::UserGenerator *pUserGenerator,
+                                             TrackingInitializer *pTrackingInitializer);
+
+    XnUInt32 m_nMaxNumUsers; ///< @brief The maximum allowed number of users
+};
+
+#endif // XNV_SAMPLE_MANAGER_H_
diff --git a/Samples/NiUserSelection/SceneDrawer.cpp b/Samples/NiUserSelection/SceneDrawer.cpp
new file mode 100644
index 0000000..a66b044
--- /dev/null
+++ b/Samples/NiUserSelection/SceneDrawer.cpp
@@ -0,0 +1,448 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "SceneDrawer.h"
+
+//---------------------------------------------------------------------------
+// definitions
+//---------------------------------------------------------------------------
+
+#ifdef USE_GLES
+static EGLDisplay display = EGL_NO_DISPLAY;
+static EGLSurface surface = EGL_NO_SURFACE;
+static EGLContext context = EGL_NO_CONTEXT;
+#endif
+
+// window size (X,Y) of the OpenGL portion
+#define GL_WIN_SIZE_X 720
+#define GL_WIN_SIZE_Y 480
+
+// Maximum allowed depth (in mm from sensor).
+#define MAX_DEPTH 10000
+// Maximum number of limbs (lines) we will draw as a skeleton.
+#define MAX_LIMBS 16
+
+//---------------------------------------------------------------------------
+// Initialize static members
+//---------------------------------------------------------------------------
+
+SceneDrawer *SceneDrawer::m_pSingleton=NULL;
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+
+void SceneDrawer::DrawScene(UserTracker *pUserTrackerObj,int argc, char **argv,SampleManager *pSample, XnBool bShowLowConfidence)
+{
+    m_pUserTrackerObj=pUserTrackerObj;
+    m_pSample=pSample;
+    m_bShowLowConfidence=bShowLowConfidence;
+
+#ifndef USE_GLES
+    glInit(&argc, argv);
+#endif
+
+    InitTexture();
+#ifndef USE_GLES
+    glutMainLoop();
+#else
+    if (!opengles_init(GL_WIN_SIZE_X, GL_WIN_SIZE_Y, &display, &surface, &context))
+    {
+        printf("Error initializing opengles\n");
+        ExitSample(EXIT_FAILURE);
+    }
+
+    glDisable(GL_DEPTH_TEST);
+    glEnable(GL_TEXTURE_2D);
+    glEnableClientState(GL_VERTEX_ARRAY);
+    glDisableClientState(GL_COLOR_ARRAY);
+
+    while (1)
+    {
+        glutDisplay();
+        eglSwapBuffers(display, surface);
+    }
+    // we should never reach here! we have a while(1) above!
+    ExitSample(EXIT_SUCCESS); 
+
+#endif
+}
+
+
+SceneDrawer *SceneDrawer::GetInstance()
+{
+    if(m_pSingleton==NULL)
+        m_pSingleton=new SceneDrawer();
+    return m_pSingleton;
+}
+
+SceneDrawer::SceneDrawer()
+{
+    // drawing defaults
+    g_bDrawBackground = TRUE;
+    g_bDrawPixels = TRUE;
+    g_bDrawSkeleton = TRUE;
+    g_bPrintID = TRUE;
+    g_bPrintState = TRUE;
+    g_bPause=FALSE;
+
+    // buffer initialization
+    pLimbsPosArr=XN_NEW_ARR(XnPoint3D,(MAX_LIMBS*2));
+    pConfidenceArr=XN_NEW_ARR(XnFloat,MAX_LIMBS);
+
+    // following are dummy assignments which will be overriden when DrawScene is called
+    // (either in DrawScene itself or in InitTexture
+    m_pUserTrackerObj=NULL; 
+    depthTexID=0;
+    pDepthTexBuf=NULL;
+    texWidth=0;
+    texHeight=0;
+    for(int i=0; i<8; i++)
+        texcoords[i] = 0;
+
+}
+
+
+
+void SceneDrawer::DrawDepthMapTexture()
+{
+    XnUInt16 g_nXRes; 
+    XnUInt16 g_nYRes; 
+    m_pUserTrackerObj->GetImageRes(g_nXRes,g_nYRes);
+
+    if (g_bDrawPixels)
+    {
+        m_pUserTrackerObj->FillTexture(pDepthTexBuf,texWidth,texHeight,g_bDrawBackground);
+    }
+    else
+    {
+        xnOSMemSet(pDepthTexBuf, 0, 3*2*g_nXRes*g_nYRes); // makes the texture empty.
+    }
+
+    // makes sure we draw the relevant texture
+    glBindTexture(GL_TEXTURE_2D, depthTexID);
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, texWidth, texHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, pDepthTexBuf);
+
+    // Display the OpenGL texture map
+    glColor4f(0.75,0.75,0.75,1);
+
+    glEnable(GL_TEXTURE_2D);
+
+    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+    glTexCoordPointer(2, GL_FLOAT, 0, texcoords);
+
+    GLfloat verts[8] = { g_nXRes, g_nYRes, g_nXRes, 0, 0, 0, 0, g_nYRes };
+    glVertexPointer(2, GL_FLOAT, 0, verts);
+    glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+
+    //TODO: Maybe glFinish needed here instead - if there's some bad graphics crap
+    glFlush();
+    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+
+    glDisable(GL_TEXTURE_2D);
+}
+
+#define MAX_USER_LABEL_LEN 50
+#define MAX_ID_LABEL_LEN 120
+void SceneDrawer::DrawLabels(XnUserID nUserId)
+{
+#ifndef USE_GLES
+    char strUserLabel[MAX_USER_LABEL_LEN] = "";
+    char strOutputLabel[MAX_ID_LABEL_LEN] = "";
+    XnFloat color[3];
+
+    XnPoint3D com;
+    xnOSMemSet(strOutputLabel, 0, sizeof(strOutputLabel));
+    XnStatus res=m_pUserTrackerObj->GetUserColor(nUserId,color);
+    XnFloat userExitPose=m_pUserTrackerObj->GetExitPoseState(nUserId)*100.0f;
+    if(res!=XN_STATUS_OK)
+        return; // bad user!
+    xnOSMemSet(strUserLabel, 0, sizeof(strUserLabel));
+    res=m_pUserTrackerObj->GetUserStringPos(nUserId,com,strUserLabel,MAX_USER_LABEL_LEN-1);
+    if(res!=XN_STATUS_OK)
+        return; // bad user!
+
+    if (!g_bPrintState)
+    {
+        if(userExitPose>0)
+        {
+            sprintf(strOutputLabel, "%d - Exit wait %3.0f%% done.", nUserId,userExitPose);
+        }
+        else
+        {
+            sprintf(strOutputLabel, "%d", nUserId);
+        }
+        
+    }
+    else 
+    {
+        if(userExitPose>0)
+        {
+            sprintf(strOutputLabel, "%d - %s - Exit wait %3.0f%% done.", nUserId,strUserLabel,userExitPose);
+        }
+        else
+        {
+            sprintf(strOutputLabel, "%d - %s", nUserId,strUserLabel);
+        }
+        
+    }
+
+    glColor4f(1-color[0], 1-color[1], 1-color[2], 1);
+
+    glRasterPos2i(com.X, com.Y);
+    int len = strlen(strOutputLabel);
+
+    for(int c=0; c<len; c++)
+    {
+        glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,strOutputLabel[c]);
+    }
+#endif
+}
+
+
+#define drawOneLine(x1,y1,x2,y2)  \
+    glVertex2f ((x1),(y1)); glVertex2f ((x2),(y2)); ;
+
+void SceneDrawer::DrawSkeleton(XnUserID nUserId)
+{
+    XnFloat color[3];
+
+    XnUInt16 numLimbs=MAX_LIMBS;
+    if(m_pUserTrackerObj->GetLimbs(nUserId,pLimbsPosArr,pConfidenceArr,numLimbs)!=XN_STATUS_OK)
+        return; // no limbs to draw
+    if(numLimbs==0)
+        return; // no limbs to draw
+    XnStatus res=m_pUserTrackerObj->GetUserColor(nUserId,color);
+    if(res!=XN_STATUS_OK)
+        return; // bad user!
+
+    glColor4f(1-color[0], 1-color[1], 1-color[2], 1);
+    for(XnUInt16 j=0; j<numLimbs; j++)
+    {
+#ifndef USE_GLES
+        if(pConfidenceArr[j]<=0.5)
+        {
+            if(m_bShowLowConfidence==FALSE)
+            {
+                continue; // we simply do not show this limb...
+            }
+            glEnable(GL_LINE_STIPPLE);
+            if(pConfidenceArr[j]==0.5)
+            {
+                glLineStipple(1,0x0101);
+            }
+            else
+            {
+                glLineStipple(1,0x00FF);
+            }            
+        }
+        glBegin(GL_LINES);
+        glVertex2f(pLimbsPosArr[j*2].X, pLimbsPosArr[j*2].Y);
+        glVertex2f(pLimbsPosArr[(j*2)+1].X, pLimbsPosArr[(j*2)+1].Y);
+        glEnd();
+        if(pConfidenceArr[j]<=0.5)
+        {
+            glDisable(GL_LINE_STIPPLE);
+        }
+#else
+        GLfloat verts[4] = {pLimbsPosArr[j*2].X, pLimbsPosArr[j*2].Y, pLimbsPosArr[(j*2)+1].X, pLimbsPosArr[(j*2)+1].Y};
+        glVertexPointer(2, GL_FLOAT, 0, verts);
+        glDrawArrays(GL_LINES, 0, 2);
+        glFlush();
+#endif
+    }
+#ifndef USE_GLES
+   // glEnd();
+#endif
+}
+
+void SceneDrawer::ExitSample(int exitCode)
+{
+#if USE_GLES
+    opengles_shutdown(display, surface, context);
+#endif
+    m_pSample->Cleanup();
+    exit(exitCode);
+}
+
+
+
+void SceneDrawer::InitTexture()
+{
+    XnUInt16 g_nXRes; 
+    XnUInt16 g_nYRes; 
+    m_pUserTrackerObj->GetImageRes(g_nXRes,g_nYRes);
+
+    // get the width and height of the texture as the nearest power of two larger than the
+    // x/y resolution respectively.
+    texWidth = 2;
+    while(texWidth < g_nXRes) texWidth<<=1;
+    texHeight = 2;
+    while(texHeight < g_nYRes) texHeight<<=1;
+
+    // initialize the texture
+    depthTexID = 0;
+    glGenTextures(1,&depthTexID);
+    pDepthTexBuf = new unsigned char[texWidth*texHeight*4];
+    glBindTexture(GL_TEXTURE_2D,depthTexID);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+
+    memset(texcoords, 0, 8*sizeof(float));
+    texcoords[0] = (float)g_nXRes/texWidth;
+    texcoords[1] = (float)g_nYRes/texHeight;
+    texcoords[2] = (float)g_nXRes/texWidth;
+    texcoords[7] = (float)g_nYRes/texHeight;
+}
+
+
+void SceneDrawer::glutDisplay (void)
+{
+    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+    // Setup the OpenGL viewpoint
+    glMatrixMode(GL_PROJECTION);
+    glPushMatrix();
+    glLoadIdentity();
+    XnUInt16 g_nXRes; 
+    XnUInt16 g_nYRes; 
+    SceneDrawer *singleton=GetInstance();
+
+    singleton->m_pUserTrackerObj->GetImageRes(g_nXRes,g_nYRes);
+
+#ifndef USE_GLES
+    glOrtho(0, g_nXRes, g_nYRes, 0, -1.0, 1.0);
+#else
+    glOrthof(0, g_nXRes, g_nYRes, 0, -1.0, 1.0);
+#endif
+
+    glDisable(GL_TEXTURE_2D);
+
+    if(singleton->g_bPause==FALSE)
+        singleton->m_pUserTrackerObj->UpdateFrame();
+    if(singleton->m_pUserTrackerObj->GetExitPoseState(0)>=1.0f)
+    {
+        singleton->ExitSample(EXIT_SUCCESS);
+    }
+    // Process the data
+    singleton->DrawDepthMapTexture();
+
+    XnUserID aUsers[15];
+    XnUInt16 nUsers = 15;
+    xn::UserGenerator *pUserGenerator=singleton->m_pUserTrackerObj->GetUserGenerator();
+    pUserGenerator->GetUsers(aUsers, nUsers);
+    for (int i = 0; i < nUsers; ++i)
+    {
+        if (singleton->g_bPrintID)
+        {
+            singleton->DrawLabels(aUsers[i]);
+        }
+        if (singleton->g_bDrawSkeleton)
+        {
+            if(pUserGenerator->GetSkeletonCap().IsTracking(aUsers[i]))
+            {
+                singleton->DrawSkeleton(aUsers[i]);
+            }
+            
+        }
+
+    }
+
+#ifndef USE_GLES
+    glutSwapBuffers();
+#endif
+}
+
+
+
+
+#ifndef USE_GLES
+void SceneDrawer::glutIdle (void)
+{
+    // Display the frame
+    glutPostRedisplay();
+}
+
+
+
+void SceneDrawer::glutKeyboard (unsigned char key, int x, int y)
+{
+    SceneDrawer *singleton=GetInstance();
+    switch (key)
+    {
+    case 27:
+        singleton->ExitSample(EXIT_SUCCESS); 
+    case 'b':
+        // Draw background?
+        singleton->g_bDrawBackground = !singleton->g_bDrawBackground;
+        break;
+    case 'x':
+        // Draw pixels at all?
+        singleton->g_bDrawPixels = !singleton->g_bDrawPixels;
+        break;
+    case 's':
+        // Draw Skeleton?
+        singleton->g_bDrawSkeleton = !singleton->g_bDrawSkeleton;
+        break;
+    case 'i':
+        // Print label?
+        singleton->g_bPrintID = !singleton->g_bPrintID;
+        break;
+    case 'l':
+        // Print ID & state as label, or only ID?
+        singleton->g_bPrintState = !singleton->g_bPrintState;
+        break;
+    case'p':
+        singleton->g_bPause=!singleton->g_bPause;
+        break;
+    }
+}
+
+
+
+
+void SceneDrawer::glInit (int * pargc, char ** argv)
+{
+    glutInit(pargc, argv);
+    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+    glutInitWindowSize(GL_WIN_SIZE_X, GL_WIN_SIZE_Y);
+    glutCreateWindow ("User Selection Sample");
+    //glutFullScreen();
+    glutSetCursor(GLUT_CURSOR_NONE);
+
+    glutKeyboardFunc(glutKeyboard);
+    glutDisplayFunc(glutDisplay);
+    glutIdleFunc(glutIdle);
+
+    glDisable(GL_DEPTH_TEST);
+    glEnable(GL_TEXTURE_2D);
+
+    glEnableClientState(GL_VERTEX_ARRAY);
+    glDisableClientState(GL_COLOR_ARRAY);
+}
+#endif // USE_GLES
+
diff --git a/Samples/NiUserSelection/SceneDrawer.h b/Samples/NiUserSelection/SceneDrawer.h
new file mode 100644
index 0000000..6a76337
--- /dev/null
+++ b/Samples/NiUserSelection/SceneDrawer.h
@@ -0,0 +1,182 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_SCENE_DRAWER_H_
+#define XNV_SCENE_DRAWER_H_
+
+#include "UserTracker.h"
+#include "SampleManager.h"
+
+#ifndef USE_GLES
+#if (XN_PLATFORM == XN_PLATFORM_MACOSX)
+#include <GLUT/glut.h>
+#else
+#include <GL/glut.h>
+#endif
+#else
+#include "opengles.h"
+#endif
+
+
+
+
+/// @brief Class to draw the scene for the sample
+/// 
+/// The goal of this class is to contain everything needed to draw the scene (image, skeleton
+/// etc.), separating the graphics implementation elements (e.g. OpenGL) from the the OpenNI elements.
+/// This should enable the user to concentrate on the UserTracker class which contains the elements
+/// relevant to OpenNI and ignore the graphics.
+/// @note This class can be ignored by anyone who wishes to learn only the OpenNI elements.
+/// 
+/// @note This class is implemented based on the singleton pattern i.e. we can only have one drawer!
+/// @ingroup UserSelectionGraphics
+class SceneDrawer
+{
+public:
+    /// @brief Start running the scene
+    /// 
+    /// This method starts running the scene. It will not return until the program exits!
+    /// @param pUserTrackerObj A pointer to the user tracker object. This is where the scene drawer
+    /// takes the information to draw and provides feedback from keyboard. @note The CleanUp method
+    /// will be called on the user tracker when the program exits from inside the DrawScene method!.
+    /// @param argc Number of command line arguments (same as @ref main()).
+    /// @param argv The command line arguments (same as @ref main()).
+    /// @param pSample The sample manager to use
+    /// @param bShowLowConfidence When this is true, low confidence limbs will be shown as dotted or 
+    ///        dashed lines instead of disappearing
+    void DrawScene(UserTracker *pUserTrackerObj,int argc, char **argv,SampleManager *pSample, XnBool bShowLowConfidence);
+
+    /// @brief gets the singleton instance.
+    static SceneDrawer *GetInstance();
+private:
+    static SceneDrawer *m_pSingleton; ///< The singleton instance
+
+
+    /// Private constructor just to make sure we can't create an object. Only GetInstance creates a 
+    /// new object.
+    SceneDrawer(); 
+
+    /// @brief Draws the texture which shows the depth and users in the scene.
+    void DrawDepthMapTexture();
+
+    /// @brief Method to draw the labels (nUserId and state) for each user in the scene
+    /// 
+    /// @param nUserId The user whose labels we will draw. 
+    void DrawLabels(XnUserID nUserId);
+
+    /// @brief Method to draw the skeleton for each user in the scene
+    /// 
+    /// @param nUserId The user whose skeleton we will draw. 
+    void DrawSkeleton(XnUserID nUserId);
+
+    /// @brief Method to exit from the DrawScene method (and the program as a whole)
+    /// 
+    /// @param exitCode The exit code we will exit with.
+    /// 
+    /// @note this will call the CleanUp method on the m_pUserTrackerObj member!
+    void ExitSample(int exitCode);
+
+    /// @brief Does all initialization required for texture drawing.
+    void InitTexture();
+
+    /// @brief An internal callback which is called from inside DrawScene main loop to do the drawing.
+    ///
+    /// This method does the single frame update including both updating the user tracker and calling
+    /// the various internal methods to draw the texture, labels and skeleton.
+    /// @note this is a callback for glutMainLoop if using glut (rather than GLES) and called all 
+    /// the time in the while loop if we are using GLES.
+    static void glutDisplay (void);
+
+#ifndef USE_GLES
+    /// @brief An internal callback which is called from inside DrawScene main loop for background 
+    /// frames.
+    /// 
+    /// This callback is called by glutMainLoop whenever the program is in the background and no drawing
+    /// is required.
+    static void glutIdle (void);
+
+    /// @brief An internal callback which is called from inside DrawScene main loop whenever there is
+    /// a keyboard event.
+    /// 
+    /// This callback is called by glutMainLoop whenever a keyboard event occurs when the program 
+    /// window is in focus. 
+    /// @param key The key pressed
+    /// @param x The x position of the mouse when the key was pressed in windows relative coordinates
+    /// @param y The y position of the mouse when the key was pressed in windows relative coordinates
+    static void glutKeyboard (unsigned char key, int x, int y);
+
+    /// @brief Internal method to perform initialization for OpenGL when using glut (rather than GLES)
+    /// 
+    /// @param pargc Number of command line arguments (same as @ref main()).
+    /// @param pargv The command line arguments (same as @ref main()).
+    void glInit (int * pargc, char ** pargv);
+#endif // USE_GLES
+
+
+
+    // members
+
+    /// @brief A pointer to the user tracker object. This is where the scene drawer
+    /// takes the information to draw and provides feedback from keyboard.
+    UserTracker *m_pUserTrackerObj; 
+
+
+    /// @name TextureInitializationMembers
+    /// members used for initializing the texture
+    /// @{
+
+    GLuint depthTexID;
+    unsigned char* pDepthTexBuf;
+    int texWidth, texHeight;
+    GLfloat texcoords[8];
+    /// @}
+    XnPoint3D* pLimbsPosArr; ///< @brief used to store the limbs information
+    XnFloat * pConfidenceArr; ///< @brief used to store the confidence of the limbs information
+
+
+    /// @name PrintMemebers
+    /// members used for deciding what to draw
+    /// @{
+  
+    /// @brief True when we want to draw the background image
+    XnBool g_bDrawBackground;
+    /// @brief True when we want to draw any texture
+    XnBool g_bDrawPixels;
+    /// @brief True when we want to draw the skeleton
+    XnBool g_bDrawSkeleton;
+    /// @brief True when we want to draw any labels on users
+    XnBool g_bPrintID;
+    /// @brief True when we want to draw full labels 
+    ///     
+    /// If false and g_bPrintID is true we will only draw the user id.
+    XnBool g_bPrintState;
+
+    XnBool g_bPause; ///< @brief True when pausing (i.e. UserTracker not updated).
+
+    /// @brief When this is true, low confidence limbs will be shown as dotted or 
+    ///        dashed lines instead of disappearing
+    XnBool m_bShowLowConfidence; 
+
+    SampleManager *m_pSample;
+    /// @}
+};
+
+#endif // XNV_SCENE_DRAWER_H_
diff --git a/Samples/NiUserSelection/SinglePoseUserSelector.cpp b/Samples/NiUserSelection/SinglePoseUserSelector.cpp
new file mode 100644
index 0000000..800d61f
--- /dev/null
+++ b/Samples/NiUserSelection/SinglePoseUserSelector.cpp
@@ -0,0 +1,65 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "SinglePoseUserSelector.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+SinglePoseUserSelector::SinglePoseUserSelector(xn::UserGenerator* pUserGenerator,
+                                               TrackingInitializer* pTrackingInitializer, 
+                                               const char* poseToTrack) : 
+              PoseUserSelector(pUserGenerator, pTrackingInitializer, poseToTrack)
+{
+}
+SinglePoseUserSelector::~SinglePoseUserSelector()
+{
+
+}
+
+XnStatus SinglePoseUserSelector::StartTracking(XnUserID nUserId)
+{
+    XnStatus nRetVal = PoseUserSelector::StartTracking(nUserId);
+    if(nRetVal != XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+
+    // stop tracking for everyone other than the current one.
+    for(UserStateHash::Iterator iter = m_hUsersState.begin(); iter != m_hUsersState.end(); ++iter)
+    {
+        if(iter.Key() == nUserId)
+        {
+            continue; // this is the new one, not interesting...
+        }
+        if(iter.Value()->m_eState!=XN_SELECTION_FAILED)
+        {
+            UpdateUserSelectionState(iter.Key(),XN_SELECTION_UNSELECTED,0);
+        }        
+        m_pTrackingInitializer->AbortTracking(iter.Key()); // stop tracking
+    }
+    return XN_STATUS_OK;
+}
diff --git a/Samples/NiUserSelection/SinglePoseUserSelector.h b/Samples/NiUserSelection/SinglePoseUserSelector.h
new file mode 100644
index 0000000..1854bd6
--- /dev/null
+++ b/Samples/NiUserSelection/SinglePoseUserSelector.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_SINGLE_POSE_USER_SELECTOR_H_
+#define XNV_SINGLE_POSE_USER_SELECTOR_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "PoseUserSelector.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+/// @brief User selector of one user based on pose
+/// 
+/// This basic user selector select users which perform a certain pose. The difference between this
+/// and PoseUserSelector is that when a user is selected in this selector, all others stop tracking.
+/// @ingroup UserSelectionPoseSelectors
+class  SinglePoseUserSelector : public PoseUserSelector
+{
+public:
+    /// @brief Constructor
+    /// 
+    /// @param pUserGenerator The user generator to use
+    /// @param pTrackingInitializer The tracking initializer to use
+    /// @param poseToTrack The pose name used to select
+    SinglePoseUserSelector(xn::UserGenerator *pUserGenerator,TrackingInitializer *pTrackingInitializer, const char *poseToTrack);
+    ~SinglePoseUserSelector();
+protected:
+    virtual XnStatus StartTracking(XnUserID nUserId);
+};
+#endif // XNV_POSE_USER_SELECTOR_H_
diff --git a/Samples/NiUserSelection/TrackingInitializer.cpp b/Samples/NiUserSelection/TrackingInitializer.cpp
new file mode 100644
index 0000000..0844b14
--- /dev/null
+++ b/Samples/NiUserSelection/TrackingInitializer.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "TrackingInitializer.h"
+
+TrackingInitializer::TrackingInitializer(xn::UserGenerator *pUserGenerato) : 
+                                                       m_pUserSelector(NULL),
+                                                       m_pUserGenerator(pUserGenerato),
+                                                       m_bValid(FALSE)
+{
+    if(m_pUserGenerator==NULL)
+        return; // nothing to work with so we stay invalid.
+    m_bValid=TRUE;
+}
+
+TrackingInitializer::~TrackingInitializer()
+{
+
+}
+
+XnStatus TrackingInitializer::SetUserTracker(UserSelector *pUserSelector)
+{
+    if(m_pUserSelector!=NULL)
+        return XN_STATUS_ERROR; // we already have a user selector
+    m_pUserSelector=pUserSelector;
+    return XN_STATUS_OK;
+}
+
diff --git a/Samples/NiUserSelection/TrackingInitializer.h b/Samples/NiUserSelection/TrackingInitializer.h
new file mode 100644
index 0000000..6e44de2
--- /dev/null
+++ b/Samples/NiUserSelection/TrackingInitializer.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_TRACKING_INITIALIZER_H_
+#define XNV_TRACKING_INITIALIZER_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+
+#include <XnCppWrapper.h>
+#include "UserSelector.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+
+/// @brief Class to start tracking a user
+/// 
+/// The goal of this class is to start performing the actual tracking of a user. It returns the 
+/// results to the UserSelector which called it.
+/// @ingroup UserSelectionInitializers
+class TrackingInitializer
+{
+public:
+    /// @brief Method to start the tracking process
+    /// 
+    /// This method is called when we want to track a specific user and it starts the process.
+    /// @param nUserId The user to track
+    /// @param bForce If this is true then the tracking will forget all previous tracking information
+    /// @return The success status 
+    virtual XnStatus StartTracking(XnUserID nUserId, XnBool bForce)=0;
+
+    /// @brief Method to stop tracking a user
+    /// 
+    /// @param nUserId The user to stop track
+    /// @return The success status 
+    virtual XnStatus AbortTracking(XnUserID nUserId)=0;
+    /// @brief Returns true if the Tracking Initializer is valid and false otherwise.
+    XnBool IsValid() { return m_bValid; };
+
+    /// @brief Sets the user selector to use to send feedback on tracking progress.
+    /// 
+    /// @note This will fail if the user selector is not NULL before setting.
+    /// @param pUserSelector The user selector
+    /// @return success status
+    virtual XnStatus SetUserTracker(UserSelector *pUserSelector);
+
+    /// @brief Destructor
+    virtual ~TrackingInitializer();
+protected:
+    /// @brief Constructor
+    /// 
+    /// @param pUserGenerator The user selector to update
+    TrackingInitializer(xn::UserGenerator *pUserGenerator);
+
+    UserSelector *m_pUserSelector; ///< @brief The user selector to update
+    xn::UserGenerator *m_pUserGenerator; ///< @brief The user generator which holds the users
+    XnBool m_bValid; ///< @brief True if the Tracking Initializer is valid and false otherwise
+
+};
+#endif // XNV_TRACKING_INITIALIZER_H_
+
diff --git a/Samples/NiUserSelection/UserSelectionStructures.h b/Samples/NiUserSelection/UserSelectionStructures.h
new file mode 100644
index 0000000..c908acd
--- /dev/null
+++ b/Samples/NiUserSelection/UserSelectionStructures.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_USER_SELECTION_STRUCTURE_H_
+#define XNV_USER_SELECTION_STRUCTURE_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+/// @brief Enumeration of legal user selection states
+/// @ingroup UserSelectionClasses
+typedef enum XnSelectionState 
+{
+    XN_SELECTION_UNSELECTED = 0,  ///< @brief The user is not selected and is available for selection
+    XN_SELECTION_SELECTED = 1,    ///< @brief The user have been selected but is not tracked yet
+    XN_SELECTION_TRACKING = 2,    ///< @brief The user is being tracked
+    XN_SELECTION_FAILED = 3       ///< @brief The user is not selected and not tracked and in the past when selected it failed to be tracked. 
+
+} XnSelectionState; ///< @brief Enum for states of a user
+
+/// @brief Holds the state and sub state of a user.
+/// @ingroup UserSelectionClasses
+class UserSelectionState
+{
+public:
+    XnSelectionState m_eState;  ///< @brief The basic state of the user
+    XnInt64 m_subState;         ///< @brief The progress of the basic state. The meaning of this changes based on the state.
+
+    UserSelectionState()
+    {
+        m_eState=XN_SELECTION_UNSELECTED;
+        m_subState=0;
+    }
+    ~UserSelectionState() {};
+};
+
+#endif // XNV_USER_SELECTION_STRUCTURE_H_
diff --git a/Samples/NiUserSelection/UserSelector.cpp b/Samples/NiUserSelection/UserSelector.cpp
new file mode 100644
index 0000000..2347379
--- /dev/null
+++ b/Samples/NiUserSelection/UserSelector.cpp
@@ -0,0 +1,261 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "UserSelector.h"
+#include <XnLog.h>
+
+XnStatus UserSelector::GetUserState(XnUserID nUserId, UserSelectionState& newState)
+{
+    UserSelectionState* pState;
+    XnStatus nRetVal = m_hUsersState.Get(nUserId, pState);
+    if(nRetVal != XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+    newState = *pState;
+    return XN_STATUS_OK;
+}
+
+
+UserSelector::UserSelector(xn::UserGenerator* pUserGenerator) : m_bValid(FALSE), 
+                                                                m_pUserGenerator(pUserGenerator),
+                                                                m_hUserCallbacks(NULL)
+{ 
+    if(m_pUserGenerator == NULL)
+    {
+        return; // no user generator
+    }
+   XnStatus nRetVal = m_pUserGenerator->RegisterUserCallbacks(NewUserCallback, LostUserCallback, this, m_hUserCallbacks);
+   if(nRetVal != XN_STATUS_OK)
+   {
+       m_hUserCallbacks = NULL;
+       return; // failed to register callbacks..
+   }
+    m_bValid = TRUE;
+
+}
+
+UserSelector::~UserSelector()
+{
+    while(m_hUsersState.begin() != m_hUsersState.end())
+    {
+        UserStateHash::Iterator iter=m_hUsersState.begin();
+        if(iter.Value() != NULL)
+        {
+            XN_DELETE(iter.Value());
+        }
+        m_hUsersState.Remove(iter);
+    }
+    if(m_pUserGenerator != NULL)
+    {
+        if(m_hUserCallbacks != NULL)
+        {
+            m_pUserGenerator->UnregisterUserCallbacks(m_hUserCallbacks);
+            m_hUserCallbacks = NULL;
+        }        
+        m_pUserGenerator = NULL;
+    }
+}
+
+XnStatus UserSelector::UpdateUserTrackingProgress(XnUserID nUserId, XnInt64 newSubState)
+{
+    // update by getting the current state, making sure it is ok and then change the relevant
+    // sub state
+    UserSelectionState* pState;
+    XnStatus nRetVal = m_hUsersState.Get(nUserId , pState);
+    if(nRetVal != XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+    if(pState == NULL || pState->m_eState != XN_SELECTION_SELECTED)
+    {
+        xnLogError("SAMPLE","User %d should have been in an unselected state but was instead in %d state.\n", nUserId, pState->m_eState);
+        return XN_STATUS_ERROR; // this should be only called when a user is selected!
+    }
+    return UpdateUserSelectionState(nUserId, pState->m_eState, newSubState);
+}
+XnStatus UserSelector::UpdateUserTracking(XnUserID nUserId, XnBool bTracked, XnInt64 newSubState)
+{
+    // update by checking the current state is ok and then update it based on the success and the 
+    // sub state.
+    UserSelectionState* pState;
+    XnStatus nRetVal = m_hUsersState.Get(nUserId,pState);
+    if(nRetVal!=XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+    if(pState == NULL || pState->m_eState != XN_SELECTION_SELECTED)
+    {
+        xnLogError("SAMPLE","User %d should have been in an unselected state but was instead in %d state.\n", nUserId, pState->m_eState);
+        return XN_STATUS_ERROR; // this should be only called when a user is selected!
+    }
+    XnSelectionState newState = bTracked ? XN_SELECTION_TRACKING : XN_SELECTION_FAILED;
+
+    return UpdateUserSelectionState(nUserId, newState, newSubState);
+}
+
+XnStatus UserSelector::AddNewUser(XnUserID nUserId)
+{
+    UserSelectionState* pState;
+    if(m_hUsersState.Get(nUserId, pState)==XN_STATUS_OK)
+    {
+        // the user already exists. We should remove it first as the old one is irrelevant anymore!
+        RemoveUser(nUserId);
+    }
+
+    pState = CreateUserSelectionState();
+    if(pState == NULL)
+    {
+        return XN_STATUS_ERROR;
+    }
+    m_hUsersState.Set(nUserId,pState); // the initial state is created in the CreateUserSelectionState
+    return XN_STATUS_OK;
+}
+
+XnStatus UserSelector::RemoveUser(XnUserID nUserId)
+{
+    UserSelectionState* pState;
+    if(m_hUsersState.Get(nUserId, pState)!=XN_STATUS_OK || pState == NULL)
+    {
+        return XN_STATUS_ERROR;
+    }
+    XN_DELETE(pState);
+    return m_hUsersState.Remove(nUserId);
+}
+
+
+void XN_CALLBACK_TYPE UserSelector::NewUserCallback(xn::UserGenerator& generator, XnUserID nUserId, void* pCookie)
+{
+    UserSelector* pUserSelector=(UserSelector *)pCookie;
+    pUserSelector->AddNewUser(nUserId);
+}
+void XN_CALLBACK_TYPE UserSelector::LostUserCallback(xn::UserGenerator& generator, XnUserID nUserId, void* pCookie)
+{
+    UserSelector* pUserSelector=(UserSelector *)pCookie;
+    pUserSelector->RemoveUser(nUserId);
+}
+
+const XnChar* UserSelector::GetCalibrationErrorString(XnCalibrationStatus eError)
+{
+    switch (eError)
+    {
+    case XN_CALIBRATION_STATUS_OK:
+        return "OK";
+    case XN_CALIBRATION_STATUS_NO_USER:
+        return "NoUser";
+    case XN_CALIBRATION_STATUS_ARM:
+        return "Arm";
+    case XN_CALIBRATION_STATUS_LEG:
+        return "Leg";
+    case XN_CALIBRATION_STATUS_HEAD:
+        return "Head";
+    case XN_CALIBRATION_STATUS_TORSO:
+        return "Torso";
+    case XN_CALIBRATION_STATUS_TOP_FOV:
+        return "Top FOV";
+    case XN_CALIBRATION_STATUS_SIDE_FOV:
+        return "Side FOV";
+    case XN_CALIBRATION_STATUS_POSE:
+        return "Pose";
+    default:
+        return "Unknown";
+    }
+}
+
+XnStatus UserSelector::GetUserLabel(XnUserID nUserId, char* strLabel, XnUInt32 maxStrLen)
+{
+    UserSelectionState* pState;
+    XnStatus nRetVal=m_hUsersState.Get(nUserId, pState);
+    
+    if(nRetVal!=XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+    return TranslateStateToLabel(pState,strLabel,maxStrLen);
+}
+
+XnStatus UserSelector::TranslateStateToLabel(const UserSelectionState* pUserState, char *strLabel, XnUInt32 maxStrLen)
+{
+    switch(pUserState->m_eState)
+    {
+    case XN_SELECTION_UNSELECTED:
+        xnOSStrCopy(strLabel,"Not selected",maxStrLen);
+        return XN_STATUS_OK;
+    case XN_SELECTION_SELECTED:
+        xnOSStrCopy(strLabel,"Selected [",maxStrLen);
+        xnOSStrAppend(strLabel,GetCalibrationErrorString((XnCalibrationStatus)pUserState->m_subState),maxStrLen);
+        xnOSStrAppend(strLabel,"]",maxStrLen);
+        return XN_STATUS_OK;
+    case XN_SELECTION_TRACKING:
+        xnOSStrCopy(strLabel,"Tracking",maxStrLen);
+        return XN_STATUS_OK;
+    case XN_SELECTION_FAILED:
+        xnOSStrCopy(strLabel,"Failed to track [",maxStrLen);
+        xnOSStrAppend(strLabel,GetCalibrationErrorString((XnCalibrationStatus)pUserState->m_subState),maxStrLen);
+        xnOSStrAppend(strLabel,"]",maxStrLen);
+        return XN_STATUS_OK;
+    default:
+        xnOSStrCopy(strLabel,"User in illegal state!\n",maxStrLen);
+        return XN_STATUS_ERROR;
+    }
+}
+
+
+XnUInt32 UserSelector::GetNumberOfSelectedUsers()
+{
+    XnUInt32 nUsers=0;
+    for(UserStateHash::Iterator iter=m_hUsersState.begin(); iter!=m_hUsersState.end(); ++iter)
+    {
+        UserSelectionState* val=iter.Value();
+        if(val->m_eState==XN_SELECTION_SELECTED || val->m_eState==XN_SELECTION_TRACKING)
+        {
+            nUsers++;
+        }
+    }
+    return nUsers;
+}
+
+UserSelectionState* UserSelector::CreateUserSelectionState()
+{
+    return XN_NEW(UserSelectionState);
+}
+
+
+XnStatus UserSelector::UpdateUserSelectionState(XnUserID nUserId, XnSelectionState eState , XnInt64 subState)
+{
+    UserSelectionState* tmpState;
+
+    XnStatus nRetVal=m_hUsersState.Get(nUserId, tmpState);
+    if(nRetVal != XN_STATUS_OK)
+    {
+        return nRetVal;
+    }
+    if(tmpState==NULL)
+    {
+        return XN_STATUS_ERROR;
+    }
+    tmpState->m_eState=eState;
+    tmpState->m_subState=subState;
+    return XN_STATUS_OK;
+}
diff --git a/Samples/NiUserSelection/UserSelector.h b/Samples/NiUserSelection/UserSelector.h
new file mode 100644
index 0000000..24f7a63
--- /dev/null
+++ b/Samples/NiUserSelection/UserSelector.h
@@ -0,0 +1,177 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_USER_SELECTOR_H_
+#define XNV_USER_SELECTOR_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnCppWrapper.h>
+#include <XnHash.h>
+#include "UserSelectionStructures.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+
+/// @brief Class to select which users to track
+/// 
+/// The goal of this class is to decide which users to track. This is an abstract class
+/// used as an interface for all user selection implementations. The assumption is that the user
+/// selector will receive a user generator node and will output which users are at which state as
+/// well as deciding which users to track.
+/// @ingroup UserSelectionClasses
+class UserSelector
+{
+public:
+    /// @brief This method is aimed to be called by the TrackingInitializer to update the sub
+    /// state of a user when trying to track.
+    /// 
+    /// This is an update of the progress of starting to track the user, i.e. the user is in state
+    /// selected (and not yet tracking) and the sub state represents the progress.
+    /// @param nUserId The user whose progress is to be updated
+    /// @param newSubState The new sub state achieved in the progress of starting to track.
+   /// @return The success status
+    virtual XnStatus UpdateUserTrackingProgress(XnUserID nUserId, XnInt64 newSubState);
+
+   /// @brief This method is aimed to be called by the TrackingInitializer when the user 
+   /// tracking initialization is complete.
+   /// 
+   /// This tells the user selector how a selection went (succeed or failed).
+   /// @param nUserId The user whose progress is to be updated
+   /// @param bTracked True if the user is now being tracked and false otherwise.
+   /// @param newSubState The new sub state achieved in the tracking (mainly has meaning on failure).
+   /// @return The success status
+   virtual XnStatus UpdateUserTracking(XnUserID nUserId, XnBool bTracked, XnInt64 newSubState);
+
+   /// @brief This method should be called every frame.
+   /// 
+   /// @note The default implementation is to do nothing as many implementations would be event driven.
+   virtual void UpdateFrame() {};
+
+   /// @brief Method to get the current state (and sub state) of a user.
+   /// 
+   /// @param nUserId The user whose state we want to know
+   /// @param newState The state to fill with new data 
+   /// @return The success status
+   virtual XnStatus GetUserState(XnUserID nUserId, UserSelectionState& newState);
+
+
+   /// @brief Method to Fill in the string label for a user (state + sub state).
+   /// 
+   /// @param nUserId The user whose label we want
+   /// @param strLabel Where to put the label
+   /// @param maxStrLen The maximum allowed string length.
+   /// @return The success status
+   XnStatus GetUserLabel(XnUserID nUserId, char* strLabel, XnUInt32 maxStrLen);
+
+   /// @brief Returns true if the user selector is valid and false otherwise.
+   XnBool IsValid() { return m_bValid; };
+
+   /// @brief Destructor
+   virtual ~UserSelector();
+protected:
+
+    /// @brief A utility function to get the number of currently selected users (both tracking and not yet tracking).
+    XnUInt32 GetNumberOfSelectedUsers();
+
+    /// @brief Translates a state to a string
+    ///
+    /// @param pUserState The user state to translate
+    /// @param strLabel Where to put the label
+    /// @param maxStrLen The maximum allowed string length.
+    /// @return The success status
+   XnStatus TranslateStateToLabel(const UserSelectionState* pUserState, char* strLabel, XnUInt32 maxStrLen);
+
+    /// @brief constructor
+    /// 
+    /// @param pUserGenerator The user generator which holds all the users.
+    UserSelector(xn::UserGenerator* pUserGenerator);
+
+    /// @brief Adds a new user to the hash
+    ///
+    /// Called internally from the NewUserCallback callback.
+    /// @param nUserId The user we are adding
+    /// @return The success status
+    virtual XnStatus AddNewUser(XnUserID nUserId);
+
+    /// @brief Remove a user from the hash
+    ///
+    /// Called internally from the LostUserCallback callback.
+    /// @param nUserId The user we are removing
+    /// @return The success status
+    virtual XnStatus RemoveUser(XnUserID nUserId);
+
+    /// @brief translate a calibration error to a string
+    /// 
+    /// @param eError The calibration error
+    /// @return The string version of the error.
+    const XnChar* GetCalibrationErrorString(XnCalibrationStatus eError);
+
+    /// @brief Creates a new user selection state object of the appropriate type
+    /// 
+    /// @return A pointer to the new object (NULL if failed).
+    virtual UserSelectionState* CreateUserSelectionState();
+
+
+    /// @brief Updates the user selection state object of the appropriate type
+    /// 
+    /// @param nUserId the user whose state we want to update
+    /// @param eState The new state of the user
+    /// @param subState The new sub state of the user
+    /// @return The success code.
+    virtual XnStatus UpdateUserSelectionState(XnUserID nUserId, XnSelectionState eState , XnInt64 subState);
+
+    /// @brief Defines the UserHash hash which holds a state for each user
+    XN_DECLARE_DEFAULT_HASH(XnUserID,UserSelectionState *,UserStateHash);
+
+    xn::UserGenerator *m_pUserGenerator; ///< @brief the user generator to get user information from
+    /// @brief A hash for user states.
+    /// 
+    /// This is a hash which holds for each user in the scene a state and substate.
+    /// @see @ref UserSelectionState
+    UserStateHash m_hUsersState; 
+    XnBool m_bValid; ///< @brief Holds true if the user selector is valid and false otherwise
+    XnCallbackHandle m_hUserCallbacks; ///< @brief A handle to be able to unregister the user callbacks
+
+
+private:
+    /// @brief New user callback.
+    /// 
+    /// Called when a new user is found.
+    /// @param generator The user generator which called the callback
+    /// @param nUserId The newly found user
+    /// @param pCookie A cookie which on registering is defined as the calling user selector object.
+    static void XN_CALLBACK_TYPE NewUserCallback(xn::UserGenerator& generator, XnUserID nUserId, void* pCookie);
+
+    /// @brief Lost user callback.
+    /// 
+    /// Called when a user is lost (i.e. no longer counted in the scene. Does not include exiting).
+    /// @param generator The user generator which called the callback
+    /// @param nUserId The lost user
+    /// @param pCookie A cookie which on registering is defined as the calling user selector object.
+    static void XN_CALLBACK_TYPE LostUserCallback(xn::UserGenerator& generator, XnUserID nUserId, void* pCookie);
+
+};
+#endif // XNV_USER_SELECTOR_H_
diff --git a/Samples/NiUserSelection/UserTracker.cpp b/Samples/NiUserSelection/UserTracker.cpp
new file mode 100644
index 0000000..b22e17b
--- /dev/null
+++ b/Samples/NiUserSelection/UserTracker.cpp
@@ -0,0 +1,434 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+
+#include "UserTracker.h"
+
+// the maximum allowed depth number (for creating a histogram)
+#define MAX_DEPTH 10000
+
+// the filename for saving/loading calibration.
+#define XN_CALIBRATION_FILE_NAME "UserCalibration.bin"
+
+#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
+
+
+float *UserTracker::s_pDepthHist=NULL;
+
+// initialization of different colors for different users
+XnFloat UserTracker::s_Colors[][3] =
+{
+    {0,1,1},
+    {0,0,1},
+    {0,1,0},
+    {1,1,0},
+    {1,0,0},
+    {1,.5,0},
+    {.5,1,0},
+    {0,.5,1},
+    {.5,0,1},
+    {1,1,.5},
+    {1,1,1}
+};
+XnUInt32 UserTracker::s_nColors = 10;
+
+
+#define CHECK_RC(nRetVal, what)										\
+    if (nRetVal != XN_STATUS_OK)									\
+{																\
+    printf("%s failed: %s\n", what, xnGetStatusString(nRetVal));\
+    return;												\
+}
+
+
+UserTracker::UserTracker(int argc, char **argv, XnUInt64 timeSpanForExitPose) : m_bValid(FALSE), 
+                                                                                m_timeSpanForExitPose(timeSpanForExitPose),
+                                                                                m_pExitPoseDetector(NULL)
+{
+    m_bRecord=FALSE;
+    XnStatus nRetVal = XN_STATUS_OK;
+
+    XnBool OpenedRecording=FALSE;
+
+    if(argc>1)
+    {
+        for(int i=1; i<argc-1; i++)
+        {
+            if(xnOSStrCmp(argv[i],"-RecordingFilename")==0)
+            {
+                // initialize the context from scratch
+                nRetVal = m_Context.Init();
+                CHECK_RC(nRetVal, "Context Initialization");
+                // try to open the recording as the source for sensor data
+                nRetVal = m_Context.OpenFileRecording(argv[i+1], m_Player);
+                CHECK_RC(nRetVal, "Couldn't open recording with command line argument");
+                OpenedRecording=TRUE;
+                break; // we only support one recording at a time..
+            }
+        }
+    }
+    if(OpenedRecording==FALSE)
+    {
+        xn::EnumerationErrors errors;
+        nRetVal = m_Context.InitFromXmlFile(SAMPLE_XML_PATH, m_ScriptNode, &errors);
+        if (nRetVal == XN_STATUS_NO_NODE_PRESENT)
+        {
+            XnChar strError[1024];
+            errors.ToString(strError, 1024);
+            printf("%s\n", strError);
+            return;
+        }
+        CHECK_RC(nRetVal, "Open XML failed");
+    }
+
+    nRetVal = m_Context.FindExistingNode(XN_NODE_TYPE_DEPTH, m_DepthGenerator);
+    if (nRetVal != XN_STATUS_OK)
+    {
+        printf("No depth generator found. Using a default one...");
+        xn::MockDepthGenerator mockDepth;
+        nRetVal = mockDepth.Create(m_Context);
+        CHECK_RC(nRetVal, "Create mock depth");
+
+        // set some defaults
+        XnMapOutputMode defaultMode;
+        defaultMode.nXRes = 320;
+        defaultMode.nYRes = 240;
+        defaultMode.nFPS = 30;
+        nRetVal = mockDepth.SetMapOutputMode(defaultMode);
+        CHECK_RC(nRetVal, "set default mode");
+
+        // set FOV
+        XnFieldOfView fov;
+        fov.fHFOV = 1.0225999419141749;
+        fov.fVFOV = 0.79661567681716894;
+        nRetVal = mockDepth.SetGeneralProperty(XN_PROP_FIELD_OF_VIEW, sizeof(fov), &fov);
+        CHECK_RC(nRetVal, "set FOV");
+
+        XnUInt32 nDataSize = defaultMode.nXRes * defaultMode.nYRes * sizeof(XnDepthPixel);
+        XnDepthPixel* pData = (XnDepthPixel*)xnOSCallocAligned(nDataSize, 1, XN_DEFAULT_MEM_ALIGN);
+
+        nRetVal = mockDepth.SetData(1, 0, nDataSize, pData);
+        CHECK_RC(nRetVal, "set empty depth map");
+
+        m_DepthGenerator = mockDepth;
+    }
+
+    nRetVal = m_Context.FindExistingNode(XN_NODE_TYPE_USER, m_UserGenerator);
+    if (nRetVal != XN_STATUS_OK)
+    {
+        nRetVal = m_UserGenerator.Create(m_Context);
+        CHECK_RC(nRetVal, "Find user generator");
+    }
+
+    if (!m_UserGenerator.IsCapabilitySupported(XN_CAPABILITY_SKELETON))
+    {
+        printf("Supplied user generator doesn't support skeleton\n");
+        return;
+    }
+    m_UserGenerator.GetSkeletonCap().SetSkeletonProfile(XN_SKEL_PROFILE_ALL);
+    nRetVal = m_Context.StartGeneratingAll();
+    CHECK_RC(nRetVal, "StartGenerating");
+
+    m_pExitPoseDetector=XN_NEW(ExitPoseDetector,m_UserGenerator);
+    if(!(m_pExitPoseDetector->Valid()))
+    {
+        printf("Exit pose is not supported by user node. Therefore will continue to run without support for exit pose\n");
+        XN_DELETE(m_pExitPoseDetector);
+        m_pExitPoseDetector=NULL;
+    }
+    m_bValid=TRUE;
+}
+
+
+XnStatus UserTracker::InitUserSelection(UserSelector *pUserSelector,TrackingInitializer *pTrackingInitializer)
+{
+    m_pUserSelector=pUserSelector;
+    m_pTrackingInitializer=pTrackingInitializer;
+    return XN_STATUS_OK;
+}
+
+
+void UserTracker::CalcHistogram(const XnDepthPixel* pDepth, XnUInt16 xRes,XnUInt16 yRes)
+{
+    if(s_pDepthHist==NULL)
+        s_pDepthHist=XN_NEW_ARR(float,MAX_DEPTH); // initialize the histogram's buffer
+
+
+    XnUInt32 nNumberOfPoints = 0; // will hold the number of points in the histogram
+    XnDepthPixel nValue; // will hold temporary pixel values. 
+
+    xnOSMemSet(s_pDepthHist, 0, MAX_DEPTH*sizeof(float)); // clear everything, we start from scratch
+
+    // calculate the basic histogram (i.e. the buffer in position X will hold the number of pixels
+    // in the depth map which have a value of X.
+    // NOTE: a value of 0 is not counted (i.e. m_pDepthHist[0] will always be 0) and we assume
+    // MAX_DEPTH is large enough so that we never have a value larger than it.
+    for (XnUInt16 nY=0; nY<yRes; nY++)
+    {
+        for (XnUInt16 nX=0; nX<xRes; nX++)
+        {
+            nValue = *pDepth;
+
+            if (nValue != 0)
+            {
+                s_pDepthHist[nValue]++;
+                nNumberOfPoints++;
+            }
+            pDepth++;
+        }
+    }
+
+    if(nNumberOfPoints==0)
+        return; // nothing to do, there are no values.
+    // turn the histogram to a cumulative histogram
+    for (XnUInt16 nIndex=1; nIndex<MAX_DEPTH; nIndex++)
+    {
+        s_pDepthHist[nIndex] += s_pDepthHist[nIndex-1];
+    }
+    // normalize the values to a value between 0 and 256. This is the color we want to see elements
+    // of this value as (multiplier).
+
+    for (XnUInt16 nIndex=1; nIndex<MAX_DEPTH; nIndex++)
+    {
+        s_pDepthHist[nIndex] = (256 * (1.0f - (s_pDepthHist[nIndex] / nNumberOfPoints)));
+    }
+}
+
+void UserTracker::FillTexture(unsigned char* pTexBuf, XnUInt16 nTexWidth, XnUInt16 nTexHeight, XnBool bDrawBackground)
+{
+    // get the size of the depth map and its pixels.
+    XnUInt16 xRes,yRes;
+    GetImageRes(xRes, yRes);
+    const XnDepthPixel* pDepth = GetDepthData(); // holds the depth map, i.e. the depth for each pixel
+
+    CalcHistogram(pDepth, xRes, yRes);
+
+    XnDepthPixel nValue; // will hold temporary pixel values. 
+
+    const XnLabel* pLabels = GetUsersPixelsData(); // holds a label map, i.e. the label (user ID) for each pixel
+
+    // Prepare the texture map, i.e. go over all relevant elements and set their value based
+    // on the depth and user.
+    // NOTE: we go over the original map and the assumption is that the texture size is equal or larger
+    // to the depth map resolution and that anything larger (e.g. because we increase to the closest,
+    // larger power of two) is not changed (therefore will remain whatever color was set before which
+    // in the initialization is probably 0). 
+    for (XnUInt16 nY=0; nY<yRes; nY++)
+    {
+        for (XnUInt16 nX=0; nX < xRes; nX++)
+        {
+            // init to 0 (just in case we don't have better data.
+            pTexBuf[0] = 0;
+            pTexBuf[1] = 0;
+            pTexBuf[2] = 0;
+            // if pLabels is 0 it is background. Therefore we only set the color of the background
+            // if bDrawBackground is true.
+            if (bDrawBackground || *pLabels != 0)
+            {
+                nValue = *pDepth; // the depth of the current pixel
+                XnLabel label = *pLabels; // the label of the current pixel
+                XnUInt32 nColorID = label % s_nColors; // the color for the current label
+                if (label == 0)
+                {
+                    nColorID = s_nColors; // special background color
+                }
+
+                if (nValue != 0)
+                {
+                    XnFloat newValue = s_pDepthHist[nValue]; // translate to the multiplier from the histogram
+
+                    pTexBuf[0] = (unsigned char)(newValue * s_Colors[nColorID][0]); 
+                    pTexBuf[1] = (unsigned char)(newValue * s_Colors[nColorID][1]);
+                    pTexBuf[2] = (unsigned char)(newValue * s_Colors[nColorID][2]);
+                }
+            }
+
+            pDepth++;
+            pLabels++;
+            pTexBuf+=3; // each element is RGB so we move 3 at a time.
+        }
+
+        pTexBuf += (nTexWidth - xRes) *3; // move to the next line
+    }
+}
+
+XnStatus UserTracker::GetUserColor(XnUserID nUserId, XnFloat* userColor)
+{
+    XnUInt32 nColorID = nUserId % s_nColors; // the color for the user
+    userColor[0]=s_Colors[nColorID][0];
+    userColor[1]=s_Colors[nColorID][1];
+    userColor[2]=s_Colors[nColorID][2];
+    return XN_STATUS_OK;
+}
+
+XnFloat UserTracker::GetExitPoseState(XnUserID nUserId)
+{
+    if(m_pExitPoseDetector==NULL)
+    {
+        return 0.0f; // no exit pose detector.
+    }
+    XnUInt64 tmpTime=m_pExitPoseDetector->GetExitPoseTimeStamp(nUserId);
+    if(tmpTime==0)
+    {
+        return 0.0f;
+    }
+    tmpTime=m_UserGenerator.GetTimestamp()-tmpTime;
+    if(tmpTime>=m_timeSpanForExitPose)
+    {
+        return 1.0f;
+    }
+    return ((XnFloat)tmpTime)/((XnFloat)m_timeSpanForExitPose);
+}
+
+
+XnStatus UserTracker::GetUserStringPos(XnUserID nUserId, XnPoint3D &com, char *strLabel, XnUInt32 maxStrLen)
+{
+    XnStatus res;
+    res=m_UserGenerator.GetCoM(nUserId, com);
+    if(res!=XN_STATUS_OK)
+        return res;
+    res=m_DepthGenerator.ConvertRealWorldToProjective(1, &com, &com);
+    if(res!=XN_STATUS_OK)
+        return res;
+
+    m_pUserSelector->GetUserLabel(nUserId,strLabel,maxStrLen);
+    return XN_STATUS_OK;
+}
+
+XnStatus UserTracker::GetLimbs(XnUserID nUserID, XnPoint3D *pLimbs,XnFloat *pConfidence, XnUInt16 &numLimbs)
+{
+    // following is a static array of the limbs to draw. Each pair represents a line which
+    // should be drawn
+    static XnSkeletonJoint jointsToPrint[][2] = 
+    {
+        { XN_SKEL_HEAD, XN_SKEL_NECK },
+        { XN_SKEL_NECK, XN_SKEL_LEFT_SHOULDER },
+        { XN_SKEL_LEFT_SHOULDER, XN_SKEL_LEFT_ELBOW },
+        { XN_SKEL_LEFT_ELBOW, XN_SKEL_LEFT_HAND },
+        { XN_SKEL_NECK, XN_SKEL_RIGHT_SHOULDER },
+        { XN_SKEL_RIGHT_SHOULDER, XN_SKEL_RIGHT_ELBOW },
+        { XN_SKEL_RIGHT_ELBOW, XN_SKEL_RIGHT_HAND },
+        { XN_SKEL_LEFT_SHOULDER, XN_SKEL_TORSO },
+        { XN_SKEL_RIGHT_SHOULDER, XN_SKEL_TORSO },
+        { XN_SKEL_TORSO, XN_SKEL_LEFT_HIP },
+        { XN_SKEL_LEFT_HIP, XN_SKEL_LEFT_KNEE },
+        { XN_SKEL_LEFT_KNEE, XN_SKEL_LEFT_FOOT },
+        { XN_SKEL_TORSO, XN_SKEL_RIGHT_HIP },
+        { XN_SKEL_RIGHT_HIP, XN_SKEL_RIGHT_KNEE },
+        { XN_SKEL_RIGHT_KNEE, XN_SKEL_RIGHT_FOOT },
+        { XN_SKEL_LEFT_HIP, XN_SKEL_RIGHT_HIP },
+    };
+    static XnUInt16 MaxNumLimbs=16;
+
+	if (!m_UserGenerator.GetSkeletonCap().IsTracking(nUserID))
+	{
+		return XN_STATUS_NO_SUCH_USER;
+	}
+
+    XnUInt16 limbCount=0;
+    XnSkeletonJointPosition joint1, joint2;
+    for(XnUInt16 i=0; i<MaxNumLimbs; i++)
+    {
+        if(limbCount>=numLimbs)
+            break; // we can't put any new ones
+
+        if(m_UserGenerator.GetSkeletonCap().GetSkeletonJointPosition(nUserID, jointsToPrint[i][0], joint1)!=XN_STATUS_OK)
+        {
+            continue; // bad joint
+        }
+        if(m_UserGenerator.GetSkeletonCap().GetSkeletonJointPosition(nUserID, jointsToPrint[i][1], joint2)!=XN_STATUS_OK)
+        {
+            continue; // bad joint
+        }
+
+        pConfidence[limbCount]=joint1.fConfidence;
+        if(pConfidence[limbCount]>joint2.fConfidence)
+        {
+            pConfidence[limbCount]=joint2.fConfidence;
+        }
+        pLimbs[limbCount*2] = joint1.position;
+        pLimbs[(limbCount*2)+1] = joint2.position;
+        limbCount++;
+    }
+    if(limbCount>0)
+        m_DepthGenerator.ConvertRealWorldToProjective(limbCount*2, pLimbs, pLimbs);
+    numLimbs=limbCount;
+    return XN_STATUS_OK;
+}
+
+
+
+UserTracker::~UserTracker()
+{
+    if(m_bValid==TRUE)
+        CleanUp();
+}
+
+void UserTracker::CleanUp()
+{
+    if(m_pExitPoseDetector!=NULL)
+    {
+        XN_DELETE(m_pExitPoseDetector);
+        m_pExitPoseDetector=NULL;
+    }
+    m_ScriptNode.Release();
+    m_DepthGenerator.Release();
+    m_UserGenerator.Release();
+    m_Player.Release();
+    m_Context.Release();
+    m_bValid=FALSE;
+}
+
+
+void UserTracker::UpdateFrame()
+{
+    // Read next available data
+    m_Context.WaitOneUpdateAll(m_UserGenerator);
+    m_pUserSelector->UpdateFrame();
+    // now we need to update the users for tracking the exit pose.
+}
+
+
+void UserTracker::GetImageRes(XnUInt16 &xRes, XnUInt16 &yRes)
+{
+    xn::DepthMetaData depthMD;
+    m_DepthGenerator.GetMetaData(depthMD);
+    xRes=depthMD.XRes();
+    yRes=depthMD.YRes();
+}
+
+const XnDepthPixel* UserTracker::GetDepthData()
+{
+    xn::DepthMetaData depthMD;
+    m_DepthGenerator.GetMetaData(depthMD);
+    return depthMD.Data();
+}
+const XnLabel* UserTracker::GetUsersPixelsData()
+{
+    xn::SceneMetaData sceneMD;
+    m_UserGenerator.GetUserPixels(0, sceneMD);
+    return sceneMD.Data();
+}
+
+
diff --git a/Samples/NiUserSelection/UserTracker.h b/Samples/NiUserSelection/UserTracker.h
new file mode 100644
index 0000000..87b0339
--- /dev/null
+++ b/Samples/NiUserSelection/UserTracker.h
@@ -0,0 +1,194 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef XNV_USER_TRACKER_H_
+#define XNV_USER_TRACKER_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOpenNI.h>
+#include <XnCodecIDs.h>
+#include <XnCppWrapper.h>
+#include <XnPropNames.h>
+#include "UserSelector.h"
+#include "TrackingInitializer.h"
+#include "ExitPoseDetector.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+
+
+/// @brief Class to provide the OpenNI portions of the user selection sample
+/// 
+/// The goal of this class is to contain all elements of the user selection sample which are
+/// OpenNI related (as opposed from the "main" and any drawing (OpenGL or otherwise).
+/// since the drawing would require various inputs to know what to draw, this class exposes 
+/// interfaces for this purpose.
+/// @ingroup UserSelectionSampleFiles
+class UserTracker
+{
+public:
+    /// @brief Constructor
+    /// 
+    /// @param argc The number of command line arguments (same as @ref main())
+    /// @param argv The command line arguments (same as @ref main())
+    /// @param timeSpanForExitPose the number of microseconds exit pose must be 
+    UserTracker(int argc, char **argv, XnUInt64 timeSpanForExitPose);
+
+
+    /// @brief Destructor
+    virtual ~UserTracker();
+
+    /// @brief Method to initialize the user selector and tracking initializer to use.
+    /// 
+    /// @brief pUserSelector A pointer to the user selector to use
+    /// @brief pTrackingInitializer A pointer to the tracking initializer to use.
+    XnStatus InitUserSelection(UserSelector *pUserSelector,TrackingInitializer *pTrackingInitializer);
+
+    /// @brief Returns true if the user tracker is valid.
+    XnBool Valid() { return m_bValid; };
+
+    /// @brief accessor to the user generator.
+    xn::UserGenerator *GetUserGenerator() { return &m_UserGenerator; };
+
+    /// @name MainLoopInterfaceMethods
+    /// Methods used as an interface for the graphics part of the applications handled by the main
+    /// loop and inputs.(i.e. enable the external graphic elements to control the OpenNI portions
+    /// @{
+
+    /// @brief Updates a single frame (mainly updating the OpenNI portions)
+    void UpdateFrame();
+
+    /// @brief cleans up elements before exiting
+    void CleanUp();
+
+    /// @}
+
+    /// @name GraphicsInterfaceMethods
+    /// Methods used as an interface for the graphics part of the applications to get the data
+    /// to display.
+    /// @{
+
+    /// @brief gets the resolution of the depth node.
+    /// 
+    /// @param xRes The x resolution of the depth (the size of the map to draw on the screen)
+    /// @param yRes The x resolution of the depth (the size of the map to draw on the screen)
+    void GetImageRes(XnUInt16 &xRes, XnUInt16 &yRes);
+
+    /// @brief Fills a texture with data to display.
+    /// 
+    /// This method fills the input textures with a color (RGB) for each pixel which represents the
+    /// depth in intensity (multiplier) and the user (label) in color.
+    /// @param pTexBuf the texture to fill. It is assumed the texture is RGB arranged in lines based
+    /// on the height and width supplied. @note only the resolution defined by GetImageRes will be filled,
+    /// Everything outside of it will not be changed.
+    /// @param nTexWidth the width of the texture
+    /// @param nTexHeight the height of the texture
+    /// @param bDrawBackground If this is true then the background will have its own color, otherwise
+    ///                        the background will not be drawn.
+    void FillTexture(unsigned char* pTexBuf, XnUInt16 nTexWidth, XnUInt16 nTexHeight, XnBool bDrawBackground);
+
+    /// @brief Gets the center of mass (com) and a label to show (state/error) for a specific user. 
+    /// 
+    /// @param nUserId The user to get info on
+    /// @param com The center of mass to fill.
+    /// @param strLabel A string to display (showing the state/error for the user).
+    /// @param maxStrLen The maximum allowed size of the string.
+    /// @return The success status (data irrelevant if not XN_STATUS_OK)
+    XnStatus GetUserStringPos(XnUserID nUserId, XnPoint3D &com, char *strLabel, XnUInt32 maxStrLen);
+
+    /// @brief Fills the limbs array. 
+    /// 
+    /// This method fills an array of limbs to draw. These limbs represent the skeleton.
+    /// @param nUserId the user whose limbs we need.
+    /// @param pLimbs An array of points. The array is of size 2*numLimbs as each limb is defined by 
+    /// two points (i.e. Limb 'i' will be defined by limbs[i*2] and limbs[i*2+1]).
+    /// @param pConfidence An array of floats. The array is the size of numLimbs and holds the 
+    /// confidence for each limb (the worst of the two joints connecting it).
+    /// @param numLimbs The maximum allowed number of limbs in the input and is changed to the
+    ///                 number of actually found limbs.
+    /// @return The success status (data irrelevant if not XN_STATUS_OK)
+    XnStatus GetLimbs(XnUserID nUserId, XnPoint3D *pLimbs,XnFloat *pConfidence, XnUInt16 &numLimbs);
+
+    /// @brief gets the color (an array of 3 floats) for a specific user.
+    /// 
+    /// @param nUserId the user whose color we need.
+    /// @param userColor An array (assumed to be of size 3) to be filled with the color in RGB format
+    /// @return The success status (data irrelevant if not XN_STATUS_OK)
+    XnStatus GetUserColor(XnUserID nUserId, XnFloat* userColor);
+    
+
+    /// @brief gets a value between 0 and 1 of the exit pose state
+    /// 
+    /// When the value is 0, no exit pose has been detected. The value then slowly rises to
+    /// 1 to show the progress of being in the exit pose for a timeout.
+    /// @param nUserId The user whose state we are checking. A user of 0 means the highest value of
+    ///                all.
+    XnFloat GetExitPoseState(XnUserID nUserId);
+    /// @}
+
+protected:
+    /// @brief Internal method calculate the cumulative histogram. 
+    /// 
+    /// The accumulative histogram is used to decide on the color for each depth value.
+    /// This method receives the texture of depth data and fills the internal static histogram with
+    /// data.
+    /// @param pDepth The texture itself
+    /// @param xRes The size (x axis) of the texture
+    /// @param yRes The size (y axis) of the texture
+    void CalcHistogram(const XnDepthPixel* pDepth, XnUInt16 xRes,XnUInt16 yRes);
+    /// @brief Gets the depth data. 
+    ///
+    /// This method provides an accessor to the depth texture.
+    /// @return The depth texutre
+    const XnDepthPixel*GetDepthData();
+    /// @brief gets the scene data. 
+    /// 
+    /// This method receives the labels of user pixels in the scene
+    /// @return The user labels matrix.
+    const XnLabel*GetUsersPixelsData();
+
+
+    UserSelector *m_pUserSelector; ///< @brief a pointer to the user selector to use
+    TrackingInitializer *m_pTrackingInitializer; ///< @brief a pointer to the tracking initializer to use
+    xn::Context m_Context; ///< @brief The context of all OpenNI behavior
+    xn::ScriptNode m_ScriptNode; ///< @brief the script node used when opening using XML. Used for orderly release
+    xn::DepthGenerator m_DepthGenerator; ///< @brief A depth generator (the base for depth info)
+    xn::UserGenerator m_UserGenerator; ///< @brief A user generator (will hold user and skeleton data).
+    xn::Player m_Player; ///< @brief The node used for the player (to play recordings).
+
+    ExitPoseDetector *m_pExitPoseDetector; ///< @brief a pointer to the exit pose detector (used to exit the game with a pose).
+    XnUInt64 m_timeSpanForExitPose; ///< @brief the time (in microseconds) to hold the exit pose for exiting
+private:
+    static float* s_pDepthHist; ///< @brief The cumulative histogram. This is created each frame from scratch.
+    static XnFloat s_Colors[][3]; ///< @brief The list of colors
+    static XnUInt32 s_nColors; ///< @brief The number of colors
+
+
+    XnBool m_bRecord; ///< @brief If we are recording or not.
+    XnBool m_bValid; ///< @brief Holds true if we have a valid value. This only happens after initialization!
+};
+
+
+#endif // XNV_USER_TRACKER_H_
diff --git a/Samples/NiSimpleViewer/glh/glh_array.h b/Samples/NiUserSelection/glh/glh_array.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_array.h
copy to Samples/NiUserSelection/glh/glh_array.h
diff --git a/Samples/NiSimpleViewer/glh/glh_convenience.h b/Samples/NiUserSelection/glh/glh_convenience.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_convenience.h
copy to Samples/NiUserSelection/glh/glh_convenience.h
diff --git a/Samples/NiSimpleViewer/glh/glh_cube_map.h b/Samples/NiUserSelection/glh/glh_cube_map.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_cube_map.h
copy to Samples/NiUserSelection/glh/glh_cube_map.h
diff --git a/Samples/NiSimpleViewer/glh/glh_extensions.h b/Samples/NiUserSelection/glh/glh_extensions.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_extensions.h
copy to Samples/NiUserSelection/glh/glh_extensions.h
diff --git a/Samples/NiSimpleViewer/glh/glh_genext.h b/Samples/NiUserSelection/glh/glh_genext.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_genext.h
copy to Samples/NiUserSelection/glh/glh_genext.h
diff --git a/Samples/NiSimpleViewer/glh/glh_glut.h b/Samples/NiUserSelection/glh/glh_glut.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_glut.h
copy to Samples/NiUserSelection/glh/glh_glut.h
diff --git a/Samples/NiSimpleViewer/glh/glh_glut2.h b/Samples/NiUserSelection/glh/glh_glut2.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_glut2.h
copy to Samples/NiUserSelection/glh/glh_glut2.h
diff --git a/Samples/NiSimpleViewer/glh/glh_glut_callfunc.h b/Samples/NiUserSelection/glh/glh_glut_callfunc.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_glut_callfunc.h
copy to Samples/NiUserSelection/glh/glh_glut_callfunc.h
diff --git a/Samples/NiSimpleViewer/glh/glh_glut_replay.h b/Samples/NiUserSelection/glh/glh_glut_replay.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_glut_replay.h
copy to Samples/NiUserSelection/glh/glh_glut_replay.h
diff --git a/Samples/NiSimpleViewer/glh/glh_glut_text.h b/Samples/NiUserSelection/glh/glh_glut_text.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_glut_text.h
copy to Samples/NiUserSelection/glh/glh_glut_text.h
diff --git a/Samples/NiSimpleViewer/glh/glh_interactors.h b/Samples/NiUserSelection/glh/glh_interactors.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_interactors.h
copy to Samples/NiUserSelection/glh/glh_interactors.h
diff --git a/Samples/NiSimpleViewer/glh/glh_linear.h b/Samples/NiUserSelection/glh/glh_linear.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_linear.h
copy to Samples/NiUserSelection/glh/glh_linear.h
diff --git a/Samples/NiSimpleViewer/glh/glh_mipmaps.h b/Samples/NiUserSelection/glh/glh_mipmaps.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_mipmaps.h
copy to Samples/NiUserSelection/glh/glh_mipmaps.h
diff --git a/Samples/NiSimpleViewer/glh/glh_obs.h b/Samples/NiUserSelection/glh/glh_obs.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_obs.h
copy to Samples/NiUserSelection/glh/glh_obs.h
diff --git a/Samples/NiSimpleViewer/glh/glh_text.h b/Samples/NiUserSelection/glh/glh_text.h
similarity index 100%
copy from Samples/NiSimpleViewer/glh/glh_text.h
copy to Samples/NiUserSelection/glh/glh_text.h
diff --git a/Samples/NiUserSelection/main.cpp b/Samples/NiUserSelection/main.cpp
new file mode 100644
index 0000000..a4b0e4c
--- /dev/null
+++ b/Samples/NiUserSelection/main.cpp
@@ -0,0 +1,123 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#include "SampleManager.h"
+
+/// @defgroup UserSelectionMain User selection main
+/// @brief User selection main.cpp functions
+/// @ingroup UserSelectionSampleFiles
+
+/// @brief Method which prints the usage and exits the program.
+///
+/// @param filename The filename of the executable
+/// @ingroup UserSelectionMain
+void UsageAndExit(char* filename)
+{
+    printf("\nUsage: %s [-recordingFilename Filename] [-s selectorType] [-ShowLowConfidence]\n\n\n" , filename);
+    printf("-RecordingFilename Filename         Use the recording in Filename for input.\n\n");
+    printf("-ShowLowConfidence                  Draws limbs with low confidence as dotted/dashed lines (hidden by default)\n\n");
+    printf("-s selectorType                     Chooses the selector type to use (i.e. how to select which users to track).\n");
+    printf("                -ClosestSelector N: The N closest users are tracked.\n");
+    printf("                -SingleWave:        Whichever user waved last is tracked.\n");
+    printf("                -MultipleWave N:    Upto N skeleton are tracked. Wave used to select/unselect user for tracking.\n\n");
+    printf("   Note:\n");
+    printf("        - If the '-s' option is omitted,  ClosestSelector with a value of 1 is used by default.\n");
+    printf("        - The '-s' option will be ignored if calibration pose is required. In this case, anyone striking that pose will be tracked.\n\n");
+
+    exit(EXIT_FAILURE);
+}
+
+
+
+/// @brief The main function of the sample
+/// 
+/// This is the main function of the sample. Its purpose is to be the starting point for the
+/// sample and according to the command line arguments, to decide which sample behavior to use.
+/// @ingroup UserSelectionMain
+int main(int argc, char** argv)
+{    
+    SampleManager* pSampleManager=NULL; // will hold the sample manager which initializes and runs the sample
+    if(argc>1)
+    {
+        // check if the argument is asking for help...
+        if(xnOSStrCmp(argv[1],"--help")==0 ||
+           xnOSStrCmp(argv[1],"-help")==0 ||
+           xnOSStrCmp(argv[1],"/help")==0 ||
+           xnOSStrCmp(argv[1],"\\help")==0 ||
+           xnOSStrCmp(argv[1],"?")==0 ||
+           xnOSStrCmp(argv[1],"--?")==0 ||
+           xnOSStrCmp(argv[1],"-?")==0 ||
+           xnOSStrCmp(argv[1],"/?")==0 ||
+           xnOSStrCmp(argv[1],"\\?")==0)
+        {
+            UsageAndExit(argv[0]);
+        }
+
+        // go over the arguments and see if we have the '-s' switch. If so it means we
+        // are going to choose the selector type.
+        for(int i=1; i<argc-1; i++)
+        {
+            if(xnOSStrCmp(argv[i],"-s")==0)
+            {
+                if(xnOSStrCmp(argv[i+1],"ClosestSelector")==0)
+                {
+                    // we are in the option '-s ClosestSelector N'. 
+                    if(argc<=i+2 || strlen(argv[i+2])>2)
+                    {
+                        UsageAndExit(argv[0]); // either there is no N at all or it is more than 1 digit
+                    }
+                    XnUInt32 n=argv[i+2][0]-'0'; // translate digit to number
+                    pSampleManager=XN_NEW(ClosestSampleManager,n); // choose ClosestSelector with n
+                }
+                else if(xnOSStrCmp(argv[i+1],"SingleWave")==0)
+                {
+                    // option is '-s SingleWave'
+                    pSampleManager=XN_NEW(SingleWaveSampleManager);
+                }
+                else if(xnOSStrCmp(argv[i+1],"MultipleWave")==0)
+                {
+                    // option is '-s SingleWave N'
+                    if(argc<=i+2 || strlen(argv[i+2])>2)
+                    {
+                        UsageAndExit(argv[0]); // either there is no N at all or it is more than 1 digit
+                    }
+                    XnUInt32 n=argv[i+2][0]-'0'; // translate digit to number
+                    pSampleManager=XN_NEW(MultipleWaveSampleManager,n);
+                }
+                else
+                {
+                    // an illegal option was used...
+                    UsageAndExit(argv[0]);
+                }
+                break; // we found the switch so we ignore all others
+            }
+        }
+    }
+    if(pSampleManager==NULL) // by default we use the closest detector option
+    {
+        pSampleManager=XN_NEW(ClosestSampleManager,1); // choose the default.
+    }
+
+    if(pSampleManager->StartSample(argc,argv)!=XN_STATUS_OK) 
+    {
+        UsageAndExit(argv[0]); // The manager will only return if it fails to initialize...
+    }
+}
diff --git a/Samples/NiUserSelection/opengles.cpp b/Samples/NiUserSelection/opengles.cpp
new file mode 100644
index 0000000..36097f2
--- /dev/null
+++ b/Samples/NiUserSelection/opengles.cpp
@@ -0,0 +1,182 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifdef USE_GLES
+
+#include <stdio.h>
+#include "opengles.h"
+
+bool TestEGLError(char* pszLocation)
+{
+	/*
+		eglGetError returns the last error that has happened using egl,
+		not the status of the last called function. The user has to
+		check after every single egl call or at least once every frame.
+	*/
+	EGLint iErr = eglGetError();
+	if (iErr != EGL_SUCCESS)
+	{
+		printf("%s failed (%d).\n", pszLocation, iErr);
+		return false;
+	}
+
+	return true;
+}
+
+static bool setup_egl(NativeDisplayType nativeDisplay, NativeWindowType nativeWindow, EGLDisplay* peglDisplay, EGLSurface* peglSurface, EGLContext* peglContext)
+{
+	EGLDisplay eglDisplay = EGL_NO_DISPLAY;
+	EGLSurface eglSurface = EGL_NO_SURFACE;
+	EGLContext eglContext = EGL_NO_CONTEXT;
+	EGLConfig  eglConfig  = 0;
+
+	/*
+	Step 1 - Get the default display.
+		EGL uses the concept of a "display" which in most environments
+		corresponds to a single physical screen. Since we usually want
+		to draw to the main screen or only have a single screen to begin
+		with, we let EGL pick the default display.
+		Querying other displays is platform specific.
+	*/
+	eglDisplay = eglGetDisplay(nativeDisplay);
+
+	/*
+		Step 2 - Initialize EGL.
+		EGL has to be initialized with the display obtained in the
+		previous step. We cannot use other EGL functions except
+		eglGetDisplay and eglGetError before eglInitialize has been
+		called.
+		If we're not interested in the EGL version number we can just
+		pass NULL for the second and third parameters.
+	*/
+	EGLint iMajorVersion = 0,
+	       iMinorVersion = 0;
+
+	if (!eglInitialize(eglDisplay, &iMajorVersion, &iMinorVersion))
+	{
+		printf("Error: eglInitialize() failed.\n");
+		return false;
+	}
+
+	/*
+		Step 3 - Specify the required configuration attributes.
+		An EGL "configuration" describes the pixel format and type of
+		surfaces that can be used for drawing.
+		For now we just want to use a 16 bit RGB surface that is a
+		Window surface, i.e. it will be visible on screen. The list
+		has to contain key/value pairs, terminated with EGL_NONE.
+	 */
+	EGLint configAttrs[] =
+	{
+		EGL_BUFFER_SIZE,       32,
+	        EGL_DEPTH_SIZE,        24,
+        	EGL_NONE
+	};
+	
+	/*
+		Step 4 - Find a config that matches all requirements.
+		eglChooseConfig provides a list of all available configurations
+		that meet or exceed the requirements given as the second
+		argument. In most cases we just want the first config that meets
+		all criteria, so we can limit the number of configs returned to 1.
+	*/
+	int iConfigs;
+	if (!eglChooseConfig(eglDisplay, configAttrs, &eglConfig, 1, &iConfigs) || (iConfigs != 1))
+	{
+		int errcode = eglGetError();
+		printf("Error: eglChooseConfig() failed. with ErrorCode : 0x%08X\n", errcode);
+		eglTerminate(eglDisplay);
+		return false;
+	}
+
+	/*
+		Step 5 - Create a surface to draw to.
+		Use the config picked in the previous step and the native window
+		handle when available to create a window surface. A window surface
+		is one that will be visible on screen inside the native display (or
+		fullscreen if there is no windowing system).
+		Pixmaps and pbuffers are surfaces which only exist in off-screen
+		memory.
+	*/
+	eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, nativeWindow, NULL);
+	if (!TestEGLError("eglCreateWindowSurface"))
+	{
+		eglTerminate(eglDisplay);
+		return false;
+	}
+
+	/*
+		Step 6 - Create a context.
+		EGL has to create a context for OpenGL ES. Our OpenGL ES resources
+		like textures will only be valid inside this context
+		(or shared contexts)
+	*/
+	eglContext = eglCreateContext(eglDisplay, eglConfig, NULL, NULL);
+	if (!TestEGLError("eglCreateContext"))
+	{
+		eglTerminate(eglDisplay);
+		return false;
+	}
+
+	/*
+		Step 7 - Bind the context to the current thread and use our
+		window surface for drawing and reading.
+		Contexts are bound to a thread. This means you don't have to
+		worry about other threads and processes interfering with your
+		OpenGL ES application.
+		We need to specify a surface that will be the target of all
+		subsequent drawing operations, and one that will be the source
+		of read operations. They can be the same surface.
+	*/
+	eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext);
+	if (!TestEGLError("eglMakeCurrent"))
+	{
+		eglTerminate(eglDisplay);
+		return false;
+	}
+
+	(*peglDisplay) = eglDisplay;
+	(*peglSurface) = eglSurface;
+	(*peglContext) = eglContext;
+
+	return true;
+}
+
+bool opengles_init(int width, int height, EGLDisplay* peglDisplay, EGLSurface* peglSurface, EGLContext* peglContext)
+{
+	NativeDisplayType display = (NativeDisplayType)EGL_DEFAULT_DISPLAY;
+	NativeWindowType window;
+
+	setup_egl(display, window, peglDisplay, peglSurface, peglContext);
+
+	return true;
+}
+
+void opengles_shutdown(EGLDisplay eglDisplay, EGLSurface eglSurface, EGLContext eglContext)
+{
+    eglDestroyContext(eglDisplay, eglContext);
+    eglDestroySurface(eglDisplay, eglSurface);
+	eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+	eglTerminate(eglDisplay);
+
+}
+
+#endif
\ No newline at end of file
diff --git a/Samples/NiUserSelection/opengles.h b/Samples/NiUserSelection/opengles.h
new file mode 100644
index 0000000..003159f
--- /dev/null
+++ b/Samples/NiUserSelection/opengles.h
@@ -0,0 +1,32 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef _OPENGLES_
+#define _OPENGLES_
+
+#include "GLES/gl.h"
+#include "GLES/egl.h"
+
+bool opengles_init(int width, int height, EGLDisplay* peglDisplay, EGLSurface* peglSurface, EGLContext* peglContext);
+void opengles_shutdown(EGLDisplay eglDisplay, EGLSurface eglSurface, EGLContext eglContext);
+
+#endif //_OPENGLES_
+
diff --git a/Samples/NiUserTracker/SceneDrawer.cpp b/Samples/NiUserTracker/SceneDrawer.cpp
index 167af7f..6f6b0c6 100644
--- a/Samples/NiUserTracker/SceneDrawer.cpp
+++ b/Samples/NiUserTracker/SceneDrawer.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -43,6 +43,16 @@ extern XnBool g_bDrawSkeleton;
 extern XnBool g_bPrintID;
 extern XnBool g_bPrintState;
 
+#include <map>
+std::map<XnUInt32, std::pair<XnCalibrationStatus, XnPoseDetectionStatus> > m_Errors;
+void XN_CALLBACK_TYPE MyCalibrationInProgress(xn::SkeletonCapability& capability, XnUserID id, XnCalibrationStatus calibrationError, void* pCookie)
+{
+	m_Errors[id].first = calibrationError;
+}
+void XN_CALLBACK_TYPE MyPoseInProgress(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID id, XnPoseDetectionStatus poseError, void* pCookie)
+{
+	m_Errors[id].second = poseError;
+}
 
 #define MAX_DEPTH 10000
 float g_pDepthHist[MAX_DEPTH];
@@ -147,11 +157,56 @@ void DrawLimb(XnUserID player, XnSkeletonJoint eJoint1, XnSkeletonJoint eJoint2)
 #else
 	GLfloat verts[4] = {pt[0].X, pt[0].Y, pt[1].X, pt[1].Y};
 	glVertexPointer(2, GL_FLOAT, 0, verts);
-	glDrawArrays(GL_TRIANGLE_FAN, 0, 2);
+	glDrawArrays(GL_LINES, 0, 2);
 	glFlush();
 #endif
 }
 
+const XnChar* GetCalibrationErrorString(XnCalibrationStatus error)
+{
+	switch (error)
+	{
+	case XN_CALIBRATION_STATUS_OK:
+		return "OK";
+	case XN_CALIBRATION_STATUS_NO_USER:
+		return "NoUser";
+	case XN_CALIBRATION_STATUS_ARM:
+		return "Arm";
+	case XN_CALIBRATION_STATUS_LEG:
+		return "Leg";
+	case XN_CALIBRATION_STATUS_HEAD:
+		return "Head";
+	case XN_CALIBRATION_STATUS_TORSO:
+		return "Torso";
+	case XN_CALIBRATION_STATUS_TOP_FOV:
+		return "Top FOV";
+	case XN_CALIBRATION_STATUS_SIDE_FOV:
+		return "Side FOV";
+	case XN_CALIBRATION_STATUS_POSE:
+		return "Pose";
+	default:
+		return "Unknown";
+	}
+}
+const XnChar* GetPoseErrorString(XnPoseDetectionStatus error)
+{
+	switch (error)
+	{
+	case XN_POSE_DETECTION_STATUS_OK:
+		return "OK";
+	case XN_POSE_DETECTION_STATUS_NO_USER:
+		return "NoUser";
+	case XN_POSE_DETECTION_STATUS_TOP_FOV:
+		return "Top FOV";
+	case XN_POSE_DETECTION_STATUS_SIDE_FOV:
+		return "Side FOV";
+	case XN_POSE_DETECTION_STATUS_ERROR:
+		return "General error";
+	default:
+		return "Unknown";
+	}
+}
+
 
 void DrawDepthMap(const xn::DepthMetaData& dmd, const xn::SceneMetaData& smd)
 {
@@ -160,16 +215,15 @@ void DrawDepthMap(const xn::DepthMetaData& dmd, const xn::SceneMetaData& smd)
 	static unsigned char* pDepthTexBuf;
 	static int texWidth, texHeight;
 
-	 float topLeftX;
-	 float topLeftY;
-	 float bottomRightY;
-	 float bottomRightX;
+	float topLeftX;
+	float topLeftY;
+	float bottomRightY;
+	float bottomRightX;
 	float texXpos;
 	float texYpos;
 
 	if(!bInitialized)
 	{
-
 		texWidth =  getClosestPowerOfTwo(dmd.XRes());
 		texHeight = getClosestPowerOfTwo(dmd.YRes());
 
@@ -188,8 +242,8 @@ void DrawDepthMap(const xn::DepthMetaData& dmd, const xn::SceneMetaData& smd)
 
 		memset(texcoords, 0, 8*sizeof(float));
 		texcoords[0] = texXpos, texcoords[1] = texYpos, texcoords[2] = texXpos, texcoords[7] = texYpos;
-
 	}
+
 	unsigned int nValue = 0;
 	unsigned int nHistValue = 0;
 	unsigned int nIndex = 0;
@@ -317,12 +371,12 @@ void DrawDepthMap(const xn::DepthMetaData& dmd, const xn::SceneMetaData& smd)
 			else if (g_UserGenerator.GetSkeletonCap().IsCalibrating(aUsers[i]))
 			{
 				// Calibrating
-				sprintf(strLabel, "%d - Calibrating...", aUsers[i]);
+				sprintf(strLabel, "%d - Calibrating [%s]", aUsers[i], GetCalibrationErrorString(m_Errors[aUsers[i]].first));
 			}
 			else
 			{
 				// Nothing
-				sprintf(strLabel, "%d - Looking for pose", aUsers[i]);
+				sprintf(strLabel, "%d - Looking for pose [%s]", aUsers[i], GetPoseErrorString(m_Errors[aUsers[i]].second));
 			}
 
 
diff --git a/Samples/NiUserTracker/SceneDrawer.h b/Samples/NiUserTracker/SceneDrawer.h
index a8a0a34..ef74485 100644
--- a/Samples/NiUserTracker/SceneDrawer.h
+++ b/Samples/NiUserTracker/SceneDrawer.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -26,4 +26,6 @@
 
 void DrawDepthMap(const xn::DepthMetaData& dmd, const xn::SceneMetaData& smd);
 
+void XN_CALLBACK_TYPE MyCalibrationInProgress(xn::SkeletonCapability& capability, XnUserID id, XnCalibrationStatus calibrationError, void* pCookie);
+void XN_CALLBACK_TYPE MyPoseInProgress(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID id, XnPoseDetectionStatus poseError, void* pCookie);
 #endif
diff --git a/Samples/NiUserTracker/main.cpp b/Samples/NiUserTracker/main.cpp
index 6f7a423..491d140 100644
--- a/Samples/NiUserTracker/main.cpp
+++ b/Samples/NiUserTracker/main.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -26,13 +26,16 @@
 #include <XnCodecIDs.h>
 #include <XnCppWrapper.h>
 #include "SceneDrawer.h"
+#include <XnPropNames.h>
 
 //---------------------------------------------------------------------------
 // Globals
 //---------------------------------------------------------------------------
 xn::Context g_Context;
+xn::ScriptNode g_scriptNode;
 xn::DepthGenerator g_DepthGenerator;
 xn::UserGenerator g_UserGenerator;
+xn::Player g_Player;
 
 XnBool g_bNeedPose = FALSE;
 XnChar g_strPose[20] = "";
@@ -72,7 +75,11 @@ XnBool g_bQuit = false;
 
 void CleanupExit()
 {
-	g_Context.Shutdown();
+	g_scriptNode.Release();
+	g_DepthGenerator.Release();
+	g_UserGenerator.Release();
+	g_Player.Release();
+	g_Context.Release();
 
 	exit (1);
 }
@@ -80,7 +87,9 @@ void CleanupExit()
 // Callback: New user was detected
 void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
 {
-	printf("New User %d\n", nId);
+	XnUInt32 epochTime = 0;
+	xnOSGetEpochTime(&epochTime);
+	printf("%d New User %d\n", epochTime, nId);
 	// New user found
 	if (g_bNeedPose)
 	{
@@ -94,33 +103,46 @@ void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& generator, XnUserID nId, v
 // Callback: An existing user was lost
 void XN_CALLBACK_TYPE User_LostUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
 {
-	printf("Lost user %d\n", nId);
+	XnUInt32 epochTime = 0;
+	xnOSGetEpochTime(&epochTime);
+	printf("%d Lost user %d\n", epochTime, nId);	
 }
 // Callback: Detected a pose
 void XN_CALLBACK_TYPE UserPose_PoseDetected(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nId, void* pCookie)
 {
-	printf("Pose %s detected for user %d\n", strPose, nId);
+	XnUInt32 epochTime = 0;
+	xnOSGetEpochTime(&epochTime);
+	printf("%d Pose %s detected for user %d\n", epochTime, strPose, nId);
 	g_UserGenerator.GetPoseDetectionCap().StopPoseDetection(nId);
 	g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
 }
 // Callback: Started calibration
 void XN_CALLBACK_TYPE UserCalibration_CalibrationStart(xn::SkeletonCapability& capability, XnUserID nId, void* pCookie)
 {
-	printf("Calibration started for user %d\n", nId);
+	XnUInt32 epochTime = 0;
+	xnOSGetEpochTime(&epochTime);
+	printf("%d Calibration started for user %d\n", epochTime, nId);
 }
 // Callback: Finished calibration
-void XN_CALLBACK_TYPE UserCalibration_CalibrationEnd(xn::SkeletonCapability& capability, XnUserID nId, XnBool bSuccess, void* pCookie)
+void XN_CALLBACK_TYPE UserCalibration_CalibrationComplete(xn::SkeletonCapability& capability, XnUserID nId, XnCalibrationStatus eStatus, void* pCookie)
 {
-	if (bSuccess)
+	XnUInt32 epochTime = 0;
+	xnOSGetEpochTime(&epochTime);
+	if (eStatus == XN_CALIBRATION_STATUS_OK)
 	{
 		// Calibration succeeded
-		printf("Calibration complete, start tracking user %d\n", nId);
+		printf("%d Calibration complete, start tracking user %d\n", epochTime, nId);		
 		g_UserGenerator.GetSkeletonCap().StartTracking(nId);
 	}
 	else
 	{
 		// Calibration failed
-		printf("Calibration failed for user %d\n", nId);
+		printf("%d Calibration failed for user %d\n", epochTime, nId);
+        if(eStatus==XN_CALIBRATION_STATUS_MANUAL_ABORT)
+        {
+            printf("Manual abort occured, stop attempting to calibrate!");
+            return;
+        }
 		if (g_bNeedPose)
 		{
 			g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
@@ -200,7 +222,7 @@ void glutDisplay (void)
 	if (!g_bPause)
 	{
 		// Read next available data
-		g_Context.WaitOneUpdateAll(g_DepthGenerator);
+		g_Context.WaitOneUpdateAll(g_UserGenerator);
 	}
 
 		// Process the data
@@ -266,7 +288,7 @@ void glInit (int * pargc, char ** argv)
 	glutInit(pargc, argv);
 	glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
 	glutInitWindowSize(GL_WIN_SIZE_X, GL_WIN_SIZE_Y);
-	glutCreateWindow ("Prime Sense User Tracker Viewer");
+	glutCreateWindow ("User Tracker Viewer");
 	//glutFullScreen();
 	glutSetCursor(GLUT_CURSOR_NONE);
 
@@ -299,7 +321,7 @@ int main(int argc, char **argv)
 	{
 		nRetVal = g_Context.Init();
 		CHECK_RC(nRetVal, "Init");
-		nRetVal = g_Context.OpenFileRecording(argv[1]);
+		nRetVal = g_Context.OpenFileRecording(argv[1], g_Player);
 		if (nRetVal != XN_STATUS_OK)
 		{
 			printf("Can't open recording %s: %s\n", argv[1], xnGetStatusString(nRetVal));
@@ -309,7 +331,7 @@ int main(int argc, char **argv)
 	else
 	{
 		xn::EnumerationErrors errors;
-		nRetVal = g_Context.InitFromXmlFile(SAMPLE_XML_PATH, &errors);
+		nRetVal = g_Context.InitFromXmlFile(SAMPLE_XML_PATH, g_scriptNode, &errors);
 		if (nRetVal == XN_STATUS_NO_NODE_PRESENT)
 		{
 			XnChar strError[1024];
@@ -325,7 +347,37 @@ int main(int argc, char **argv)
 	}
 
 	nRetVal = g_Context.FindExistingNode(XN_NODE_TYPE_DEPTH, g_DepthGenerator);
-	CHECK_RC(nRetVal, "Find depth generator");
+	if (nRetVal != XN_STATUS_OK)
+	{
+		printf("No depth generator found. Using a default one...");
+		xn::MockDepthGenerator mockDepth;
+		nRetVal = mockDepth.Create(g_Context);
+		CHECK_RC(nRetVal, "Create mock depth");
+
+		// set some defaults
+		XnMapOutputMode defaultMode;
+		defaultMode.nXRes = 320;
+		defaultMode.nYRes = 240;
+		defaultMode.nFPS = 30;
+		nRetVal = mockDepth.SetMapOutputMode(defaultMode);
+		CHECK_RC(nRetVal, "set default mode");
+
+		// set FOV
+		XnFieldOfView fov;
+		fov.fHFOV = 1.0225999419141749;
+		fov.fVFOV = 0.79661567681716894;
+		nRetVal = mockDepth.SetGeneralProperty(XN_PROP_FIELD_OF_VIEW, sizeof(fov), &fov);
+		CHECK_RC(nRetVal, "set FOV");
+
+		XnUInt32 nDataSize = defaultMode.nXRes * defaultMode.nYRes * sizeof(XnDepthPixel);
+		XnDepthPixel* pData = (XnDepthPixel*)xnOSCallocAligned(nDataSize, 1, XN_DEFAULT_MEM_ALIGN);
+
+		nRetVal = mockDepth.SetData(1, 0, nDataSize, pData);
+		CHECK_RC(nRetVal, "set empty depth map");
+
+		g_DepthGenerator = mockDepth;
+	}
+
 	nRetVal = g_Context.FindExistingNode(XN_NODE_TYPE_USER, g_UserGenerator);
 	if (nRetVal != XN_STATUS_OK)
 	{
@@ -333,14 +385,18 @@ int main(int argc, char **argv)
 		CHECK_RC(nRetVal, "Find user generator");
 	}
 
-	XnCallbackHandle hUserCallbacks, hCalibrationCallbacks, hPoseCallbacks;
+	XnCallbackHandle hUserCallbacks, hCalibrationStart, hCalibrationComplete, hPoseDetected, hCalibrationInProgress, hPoseInProgress;
 	if (!g_UserGenerator.IsCapabilitySupported(XN_CAPABILITY_SKELETON))
 	{
 		printf("Supplied user generator doesn't support skeleton\n");
 		return 1;
 	}
-	g_UserGenerator.RegisterUserCallbacks(User_NewUser, User_LostUser, NULL, hUserCallbacks);
-	g_UserGenerator.GetSkeletonCap().RegisterCalibrationCallbacks(UserCalibration_CalibrationStart, UserCalibration_CalibrationEnd, NULL, hCalibrationCallbacks);
+	nRetVal = g_UserGenerator.RegisterUserCallbacks(User_NewUser, User_LostUser, NULL, hUserCallbacks);
+	CHECK_RC(nRetVal, "Register to user callbacks");
+	nRetVal = g_UserGenerator.GetSkeletonCap().RegisterToCalibrationStart(UserCalibration_CalibrationStart, NULL, hCalibrationStart);
+	CHECK_RC(nRetVal, "Register to calibration start");
+	nRetVal = g_UserGenerator.GetSkeletonCap().RegisterToCalibrationComplete(UserCalibration_CalibrationComplete, NULL, hCalibrationComplete);
+	CHECK_RC(nRetVal, "Register to calibration complete");
 
 	if (g_UserGenerator.GetSkeletonCap().NeedPoseForCalibration())
 	{
@@ -350,12 +406,19 @@ int main(int argc, char **argv)
 			printf("Pose required, but not supported\n");
 			return 1;
 		}
-		g_UserGenerator.GetPoseDetectionCap().RegisterToPoseCallbacks(UserPose_PoseDetected, NULL, NULL, hPoseCallbacks);
+		nRetVal = g_UserGenerator.GetPoseDetectionCap().RegisterToPoseDetected(UserPose_PoseDetected, NULL, hPoseDetected);
+		CHECK_RC(nRetVal, "Register to Pose Detected");
 		g_UserGenerator.GetSkeletonCap().GetCalibrationPose(g_strPose);
 	}
 
 	g_UserGenerator.GetSkeletonCap().SetSkeletonProfile(XN_SKEL_PROFILE_ALL);
 
+	nRetVal = g_UserGenerator.GetSkeletonCap().RegisterToCalibrationInProgress(MyCalibrationInProgress, NULL, hCalibrationInProgress);
+	CHECK_RC(nRetVal, "Register to calibration in progress");
+
+	nRetVal = g_UserGenerator.GetPoseDetectionCap().RegisterToPoseInProgress(MyPoseInProgress, NULL, hPoseInProgress);
+	CHECK_RC(nRetVal, "Register to pose in progress");
+
 	nRetVal = g_Context.StartGeneratingAll();
 	CHECK_RC(nRetVal, "StartGenerating");
 
diff --git a/Samples/NiUserTracker/opengles.cpp b/Samples/NiUserTracker/opengles.cpp
index bb42ec3..36097f2 100644
--- a/Samples/NiUserTracker/opengles.cpp
+++ b/Samples/NiUserTracker/opengles.cpp
@@ -1,157 +1,182 @@
-#include <stdio.h>
-#include "opengles.h"
-
-bool TestEGLError(char* pszLocation)
-{
-	/*
-		eglGetError returns the last error that has happened using egl,
-		not the status of the last called function. The user has to
-		check after every single egl call or at least once every frame.
-	*/
-	EGLint iErr = eglGetError();
-	if (iErr != EGL_SUCCESS)
-	{
-		printf("%s failed (%d).\n", pszLocation, iErr);
-		return false;
-	}
-
-	return true;
-}
-
-static bool setup_egl(NativeDisplayType nativeDisplay, NativeWindowType nativeWindow, EGLDisplay* peglDisplay, EGLSurface* peglSurface, EGLContext* peglContext)
-{
-	EGLDisplay eglDisplay = EGL_NO_DISPLAY;
-	EGLSurface eglSurface = EGL_NO_SURFACE;
-	EGLContext eglContext = EGL_NO_CONTEXT;
-	EGLConfig  eglConfig  = 0;
-
-	/*
-	Step 1 - Get the default display.
-		EGL uses the concept of a "display" which in most environments
-		corresponds to a single physical screen. Since we usually want
-		to draw to the main screen or only have a single screen to begin
-		with, we let EGL pick the default display.
-		Querying other displays is platform specific.
-	*/
-	eglDisplay = eglGetDisplay(nativeDisplay);
-
-	/*
-		Step 2 - Initialize EGL.
-		EGL has to be initialized with the display obtained in the
-		previous step. We cannot use other EGL functions except
-		eglGetDisplay and eglGetError before eglInitialize has been
-		called.
-		If we're not interested in the EGL version number we can just
-		pass NULL for the second and third parameters.
-	*/
-	EGLint iMajorVersion = 0,
-	       iMinorVersion = 0;
-
-	if (!eglInitialize(eglDisplay, &iMajorVersion, &iMinorVersion))
-	{
-		printf("Error: eglInitialize() failed.\n");
-		return false;
-	}
-
-	/*
-		Step 3 - Specify the required configuration attributes.
-		An EGL "configuration" describes the pixel format and type of
-		surfaces that can be used for drawing.
-		For now we just want to use a 16 bit RGB surface that is a
-		Window surface, i.e. it will be visible on screen. The list
-		has to contain key/value pairs, terminated with EGL_NONE.
-	 */
-	EGLint configAttrs[] =
-	{
-		EGL_BUFFER_SIZE,       16,
-	        EGL_DEPTH_SIZE,        15,
-        	EGL_NONE
-	};
-	
-	/*
-		Step 4 - Find a config that matches all requirements.
-		eglChooseConfig provides a list of all available configurations
-		that meet or exceed the requirements given as the second
-		argument. In most cases we just want the first config that meets
-		all criteria, so we can limit the number of configs returned to 1.
-	*/
-	int iConfigs;
-	if (!eglChooseConfig(eglDisplay, configAttrs, &eglConfig, 1, &iConfigs) || (iConfigs != 1))
-	{
-		int errcode = eglGetError();
-		printf("Error: eglChooseConfig() failed. with ErrorCode : 0x%08X\n", errcode);
-		eglTerminate(eglDisplay);
-		return false;
-	}
-
-	/*
-		Step 5 - Create a surface to draw to.
-		Use the config picked in the previous step and the native window
-		handle when available to create a window surface. A window surface
-		is one that will be visible on screen inside the native display (or
-		fullscreen if there is no windowing system).
-		Pixmaps and pbuffers are surfaces which only exist in off-screen
-		memory.
-	*/
-	eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, nativeWindow, NULL);
-	if (!TestEGLError("eglCreateWindowSurface"))
-	{
-		eglTerminate(eglDisplay);
-		return false;
-	}
-
-	/*
-		Step 6 - Create a context.
-		EGL has to create a context for OpenGL ES. Our OpenGL ES resources
-		like textures will only be valid inside this context
-		(or shared contexts)
-	*/
-	eglContext = eglCreateContext(eglDisplay, eglConfig, NULL, NULL);
-	if (!TestEGLError("eglCreateContext"))
-	{
-		eglTerminate(eglDisplay);
-		return false;
-	}
-
-	/*
-		Step 7 - Bind the context to the current thread and use our
-		window surface for drawing and reading.
-		Contexts are bound to a thread. This means you don't have to
-		worry about other threads and processes interfering with your
-		OpenGL ES application.
-		We need to specify a surface that will be the target of all
-		subsequent drawing operations, and one that will be the source
-		of read operations. They can be the same surface.
-	*/
-	eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext);
-	if (!TestEGLError("eglMakeCurrent"))
-	{
-		eglTerminate(eglDisplay);
-		return false;
-	}
-
-	(*peglDisplay) = eglDisplay;
-	(*peglSurface) = eglSurface;
-	(*peglContext) = eglContext;
-
-	return true;
-}
-
-bool opengles_init(int width, int height, EGLDisplay* peglDisplay, EGLSurface* peglSurface, EGLContext* peglContext)
-{
-	NativeDisplayType display = (NativeDisplayType)EGL_DEFAULT_DISPLAY;
-	NativeWindowType window;
-
-	setup_egl(display, window, peglDisplay, peglSurface, peglContext);
-
-	return true;
-}
-
-void opengles_shutdown(EGLDisplay eglDisplay, EGLSurface eglSurface, EGLContext eglContext)
-{
-    eglDestroyContext(eglDisplay, eglContext);
-    eglDestroySurface(eglDisplay, eglSurface);
-	eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-	eglTerminate(eglDisplay);
-
-}
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifdef USE_GLES
+
+#include <stdio.h>
+#include "opengles.h"
+
+bool TestEGLError(char* pszLocation)
+{
+	/*
+		eglGetError returns the last error that has happened using egl,
+		not the status of the last called function. The user has to
+		check after every single egl call or at least once every frame.
+	*/
+	EGLint iErr = eglGetError();
+	if (iErr != EGL_SUCCESS)
+	{
+		printf("%s failed (%d).\n", pszLocation, iErr);
+		return false;
+	}
+
+	return true;
+}
+
+static bool setup_egl(NativeDisplayType nativeDisplay, NativeWindowType nativeWindow, EGLDisplay* peglDisplay, EGLSurface* peglSurface, EGLContext* peglContext)
+{
+	EGLDisplay eglDisplay = EGL_NO_DISPLAY;
+	EGLSurface eglSurface = EGL_NO_SURFACE;
+	EGLContext eglContext = EGL_NO_CONTEXT;
+	EGLConfig  eglConfig  = 0;
+
+	/*
+	Step 1 - Get the default display.
+		EGL uses the concept of a "display" which in most environments
+		corresponds to a single physical screen. Since we usually want
+		to draw to the main screen or only have a single screen to begin
+		with, we let EGL pick the default display.
+		Querying other displays is platform specific.
+	*/
+	eglDisplay = eglGetDisplay(nativeDisplay);
+
+	/*
+		Step 2 - Initialize EGL.
+		EGL has to be initialized with the display obtained in the
+		previous step. We cannot use other EGL functions except
+		eglGetDisplay and eglGetError before eglInitialize has been
+		called.
+		If we're not interested in the EGL version number we can just
+		pass NULL for the second and third parameters.
+	*/
+	EGLint iMajorVersion = 0,
+	       iMinorVersion = 0;
+
+	if (!eglInitialize(eglDisplay, &iMajorVersion, &iMinorVersion))
+	{
+		printf("Error: eglInitialize() failed.\n");
+		return false;
+	}
+
+	/*
+		Step 3 - Specify the required configuration attributes.
+		An EGL "configuration" describes the pixel format and type of
+		surfaces that can be used for drawing.
+		For now we just want to use a 16 bit RGB surface that is a
+		Window surface, i.e. it will be visible on screen. The list
+		has to contain key/value pairs, terminated with EGL_NONE.
+	 */
+	EGLint configAttrs[] =
+	{
+		EGL_BUFFER_SIZE,       32,
+	        EGL_DEPTH_SIZE,        24,
+        	EGL_NONE
+	};
+	
+	/*
+		Step 4 - Find a config that matches all requirements.
+		eglChooseConfig provides a list of all available configurations
+		that meet or exceed the requirements given as the second
+		argument. In most cases we just want the first config that meets
+		all criteria, so we can limit the number of configs returned to 1.
+	*/
+	int iConfigs;
+	if (!eglChooseConfig(eglDisplay, configAttrs, &eglConfig, 1, &iConfigs) || (iConfigs != 1))
+	{
+		int errcode = eglGetError();
+		printf("Error: eglChooseConfig() failed. with ErrorCode : 0x%08X\n", errcode);
+		eglTerminate(eglDisplay);
+		return false;
+	}
+
+	/*
+		Step 5 - Create a surface to draw to.
+		Use the config picked in the previous step and the native window
+		handle when available to create a window surface. A window surface
+		is one that will be visible on screen inside the native display (or
+		fullscreen if there is no windowing system).
+		Pixmaps and pbuffers are surfaces which only exist in off-screen
+		memory.
+	*/
+	eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, nativeWindow, NULL);
+	if (!TestEGLError("eglCreateWindowSurface"))
+	{
+		eglTerminate(eglDisplay);
+		return false;
+	}
+
+	/*
+		Step 6 - Create a context.
+		EGL has to create a context for OpenGL ES. Our OpenGL ES resources
+		like textures will only be valid inside this context
+		(or shared contexts)
+	*/
+	eglContext = eglCreateContext(eglDisplay, eglConfig, NULL, NULL);
+	if (!TestEGLError("eglCreateContext"))
+	{
+		eglTerminate(eglDisplay);
+		return false;
+	}
+
+	/*
+		Step 7 - Bind the context to the current thread and use our
+		window surface for drawing and reading.
+		Contexts are bound to a thread. This means you don't have to
+		worry about other threads and processes interfering with your
+		OpenGL ES application.
+		We need to specify a surface that will be the target of all
+		subsequent drawing operations, and one that will be the source
+		of read operations. They can be the same surface.
+	*/
+	eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext);
+	if (!TestEGLError("eglMakeCurrent"))
+	{
+		eglTerminate(eglDisplay);
+		return false;
+	}
+
+	(*peglDisplay) = eglDisplay;
+	(*peglSurface) = eglSurface;
+	(*peglContext) = eglContext;
+
+	return true;
+}
+
+bool opengles_init(int width, int height, EGLDisplay* peglDisplay, EGLSurface* peglSurface, EGLContext* peglContext)
+{
+	NativeDisplayType display = (NativeDisplayType)EGL_DEFAULT_DISPLAY;
+	NativeWindowType window;
+
+	setup_egl(display, window, peglDisplay, peglSurface, peglContext);
+
+	return true;
+}
+
+void opengles_shutdown(EGLDisplay eglDisplay, EGLSurface eglSurface, EGLContext eglContext)
+{
+    eglDestroyContext(eglDisplay, eglContext);
+    eglDestroySurface(eglDisplay, eglSurface);
+	eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+	eglTerminate(eglDisplay);
+
+}
+
+#endif
\ No newline at end of file
diff --git a/Samples/NiUserTracker/opengles.h b/Samples/NiUserTracker/opengles.h
index 4d19c4f..003159f 100644
--- a/Samples/NiUserTracker/opengles.h
+++ b/Samples/NiUserTracker/opengles.h
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 #ifndef _OPENGLES_
 #define _OPENGLES_
 
diff --git a/Samples/NiViewer/Audio.cpp b/Samples/NiViewer/Audio.cpp
index 0838e19..36ecedc 100644
--- a/Samples/NiViewer/Audio.cpp
+++ b/Samples/NiViewer/Audio.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -54,7 +54,7 @@ typedef struct AudioData
 	int nAudioNextBuffer;
 	bool bFlush;
 	int nFirstToCheck;
-	XnDump SyncDump;
+	XnDumpFile* SyncDump;
 } AudioData;
 
 AudioData g_AudioData;
@@ -74,7 +74,7 @@ void audioPlay()
 	if (g_AudioData.bFlush)
 	{
 		printf("Audio is falling behind. Flushing all queue.\n");
-		xnDumpWriteString(g_AudioData.SyncDump, "Flushing queue...\n");
+		xnDumpFileWriteString(g_AudioData.SyncDump, "Flushing queue...\n");
 
 		// mark not to check all dropped headers
 		g_AudioData.nFirstToCheck = g_AudioData.nAudioNextBuffer;
@@ -146,7 +146,7 @@ void audioPlay()
 	// place end-time as a timestamp
 	g_AudioData.pAudioTimestamps[g_AudioData.nAudioNextBuffer] = (XnUInt64)(pAudioMD->Timestamp() + nBufferSize / (pAudioMD->BitsPerSample() / 8.0) / pAudioMD->NumberOfChannels() / (pAudioMD->SampleRate() / 1e6));
 
-	xnDumpWriteString(g_AudioData.SyncDump, "Queued index %d with timestamp %llu (%u bytes, %f ms, end timestamp: %llu)\n", g_AudioData.nAudioNextBuffer, pAudioMD->Timestamp(), nBufferSize, nBufferSize / 2.0 / pAudioMD->NumberOfChannels() / (pAudioMD->SampleRate() / 1e3), g_AudioData.pAudioTimestamps[g_AudioData.nAudioNextBuffer]);
+	xnDumpFileWriteString(g_AudioData.SyncDump, "Queued index %d with timestamp %llu (%u bytes, %f ms, end timestamp: %llu)\n", g_AudioData.nAudioNextBuffer, pAudioMD->Timestamp(), nBufferSize, nBufferSize / 2.0 / pAudioMD->NumberOfChannels() / (pAudioMD->SampleRate() / 1e3), g_AudioData.pAudioTimestamps[g_AudioData.nAudioNextBuffer]);
 
 	g_AudioData.nAudioNextBuffer = (g_AudioData.nAudioNextBuffer + 1) % NUMBER_OF_AUDIO_BUFFERS;
 }
@@ -158,7 +158,7 @@ void CALLBACK audioCallback(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, DWORD
 		WAVEHDR* pHeader = (WAVEHDR*)dwParam1;
 		XnUInt32 nIndex = pHeader->dwUser;
 
-		xnDumpWriteString(g_AudioData.SyncDump, "Done playing index %d.", nIndex);
+		xnDumpFileWriteString(g_AudioData.SyncDump, "Done playing index %d.", nIndex);
 
 		if (g_AudioData.nFirstToCheck == -1 || g_AudioData.nFirstToCheck == nIndex)
 		{
@@ -171,18 +171,18 @@ void CALLBACK audioCallback(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, DWORD
 			XnUInt32 nLastQueuedIndex = (g_AudioData.nAudioNextBuffer + NUMBER_OF_AUDIO_BUFFERS - 1) % NUMBER_OF_AUDIO_BUFFERS;
 			XnUInt64 nLastQueuedTimestamp = g_AudioData.pAudioTimestamps[nLastQueuedIndex];
 
-			xnDumpWriteString(g_AudioData.SyncDump, " %f ms in queue.", (nLastQueuedTimestamp - nPlayedTimestamp) / 1e3);
+			xnDumpFileWriteString(g_AudioData.SyncDump, " %f ms in queue.", (nLastQueuedTimestamp - nPlayedTimestamp) / 1e3);
 
 			if (nLastQueuedTimestamp - nPlayedTimestamp > AUDIO_LATENCY_THRESHOLD)
 			{
 				g_AudioData.bFlush = true;
-				xnDumpWriteString(g_AudioData.SyncDump, " Will flush queue.\n");
+				xnDumpFileWriteString(g_AudioData.SyncDump, " Will flush queue.\n");
 			}
 			else
-				xnDumpWriteString(g_AudioData.SyncDump, "\n");
+				xnDumpFileWriteString(g_AudioData.SyncDump, "\n");
 		}
 		else
-			xnDumpWriteString(g_AudioData.SyncDump, "\n");
+			xnDumpFileWriteString(g_AudioData.SyncDump, "\n");
 	}
 }
 
@@ -191,7 +191,7 @@ void audioInit()
 	g_AudioData.hWaveOut = NULL;
 	g_AudioData.bFlush = false;
 	g_AudioData.nFirstToCheck = -1;
-	g_AudioData.SyncDump = XN_DUMP_CLOSED;
+	g_AudioData.SyncDump = xnDumpFileOpen(AUDIO_SYNC_DUMP_MASK, "%s.txt", AUDIO_SYNC_DUMP_MASK);;
 
 	// check if device audio is enabled
 	const AudioMetaData* pAudioMD = getAudioMetaData();
@@ -230,7 +230,6 @@ void audioInit()
 	}
 
 	g_AudioData.nAudioNextBuffer = 0;
-	xnDumpInit(&g_AudioData.SyncDump, AUDIO_SYNC_DUMP_MASK, "", "%s.txt", AUDIO_SYNC_DUMP_MASK);
 }
 
 void audioShutdown()
diff --git a/Samples/NiViewer/Audio.h b/Samples/NiViewer/Audio.h
index 89feedd..fe7f3d1 100644
--- a/Samples/NiViewer/Audio.h
+++ b/Samples/NiViewer/Audio.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/Capture.cpp b/Samples/NiViewer/Capture.cpp
index 20de1b3..87e04f2 100644
--- a/Samples/NiViewer/Capture.cpp
+++ b/Samples/NiViewer/Capture.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -189,12 +189,10 @@ bool captureOpenWriteDevice()
 	START_CAPTURE_CHECK_RC(nRetVal, "Enumerate recorders");
 	// take first
 	NodeInfo chosen = *recordersList.Begin();
-	nRetVal = g_Context.CreateProductionTree(chosen);
-	START_CAPTURE_CHECK_RC(nRetVal, "Create recorder");
 
 	g_Capture.pRecorder = new Recorder;
-	nRetVal = chosen.GetInstance(*g_Capture.pRecorder);
-	START_CAPTURE_CHECK_RC(nRetVal, "Get recorder instance");
+	nRetVal = g_Context.CreateProductionTree(chosen, *g_Capture.pRecorder);
+	START_CAPTURE_CHECK_RC(nRetVal, "Create recorder");
 
 	nRetVal = g_Capture.pRecorder->SetDestination(XN_RECORD_MEDIUM_FILE, g_Capture.csFileName);
 	START_CAPTURE_CHECK_RC(nRetVal, "Set output file");
@@ -219,7 +217,6 @@ void captureBrowse(int)
 	ofn.lpstrFile = g_Capture.csFileName;
 	ofn.nMaxFile = sizeof(g_Capture.csFileName);
 	ofn.lpstrTitle = TEXT("Capture to...");
-	ofn.nMaxFileTitle = sizeof (ofn.lpstrTitle);
 	ofn.Flags = OFN_EXPLORER | OFN_NOCHANGEDIR;
 
 	GetSaveFileName(&ofn); 
diff --git a/Samples/NiViewer/Capture.h b/Samples/NiViewer/Capture.h
index 6ef030f..0778499 100644
--- a/Samples/NiViewer/Capture.h
+++ b/Samples/NiViewer/Capture.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/Device.cpp b/Samples/NiViewer/Device.cpp
index 7a409d7..3bd2e95 100644
--- a/Samples/NiViewer/Device.cpp
+++ b/Samples/NiViewer/Device.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -36,6 +36,7 @@
 // Global Variables
 // --------------------------------
 Context g_Context;
+ScriptNode g_scriptNode;
 
 DeviceStringProperty g_PrimaryStream;
 DeviceParameter g_Registration;
@@ -173,7 +174,7 @@ XnStatus openDeviceFile(const char* csFile)
 {
 	XnStatus nRetVal = g_Context.Init();
 	XN_IS_STATUS_OK(nRetVal);
-	nRetVal = g_Context.OpenFileRecording(csFile);
+	nRetVal = g_Context.OpenFileRecording(csFile, g_Player);
 	XN_IS_STATUS_OK(nRetVal);
 	openCommon();
 
@@ -184,7 +185,7 @@ XnStatus openDeviceFromXml(const char* csXmlFile, EnumerationErrors& errors)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
-	nRetVal = g_Context.InitFromXmlFile(csXmlFile, &errors);
+	nRetVal = g_Context.InitFromXmlFile(csXmlFile, g_scriptNode, &errors);
 	XN_IS_STATUS_OK(nRetVal);
 
 	openCommon();
@@ -217,8 +218,7 @@ XnStatus openDeviceFromXmlWithChoice(const char* csXmlFile, EnumerationErrors& e
 		XnBool bExists = deviceNode.IsValid();
 		if (!bExists)
 		{
-			g_Context.CreateProductionTree(deviceNodeInfo);
-			deviceNodeInfo.GetInstance(deviceNode);
+			g_Context.CreateProductionTree(deviceNodeInfo, deviceNode);
 			// this might fail.
 		}
 
@@ -249,7 +249,7 @@ XnStatus openDeviceFromXmlWithChoice(const char* csXmlFile, EnumerationErrors& e
 	printf("Choose device to open (1): ");
 
 	int chosen = 1;
-	scanf("%d", &chosen);
+	int nRetval = scanf("%d", &chosen);
 
 	// create it
 	NodeInfoList::Iterator it = list.Begin();
@@ -259,11 +259,11 @@ XnStatus openDeviceFromXmlWithChoice(const char* csXmlFile, EnumerationErrors& e
 	}
 
 	NodeInfo deviceNode = *it;
-	nRetVal = g_Context.CreateProductionTree(deviceNode);
+	nRetVal = g_Context.CreateProductionTree(deviceNode, g_Device);
 	XN_IS_STATUS_OK(nRetVal);
 
 	// now run the rest of the XML
-	nRetVal = g_Context.RunXmlScriptFromFile(csXmlFile, &errors);
+	nRetVal = g_Context.RunXmlScriptFromFile(csXmlFile, g_scriptNode, &errors);
 	XN_IS_STATUS_OK(nRetVal);
 
 	openCommon();
@@ -273,7 +273,14 @@ XnStatus openDeviceFromXmlWithChoice(const char* csXmlFile, EnumerationErrors& e
 
 void closeDevice()
 {
-	g_Context.Shutdown();
+	g_Player.Release();
+	g_Device.Release();
+	g_Depth.Release();
+	g_Image.Release();
+	g_IR.Release();
+	g_Audio.Release();
+	g_scriptNode.Release();
+	g_Context.Release();
 }
 
 void readFrame()
@@ -401,7 +408,7 @@ void toggleStream(Generator& generator, XnProductionNodeType type, bool* bIsOn)
 	}
 	else
 	{
-		generator.StartGenerating();
+		nRetVal = generator.StartGenerating();
 		if (nRetVal != XN_STATUS_OK)
 		{
 			displayMessage("Failed to turn on %s: %s", generator.GetInfo().GetInstanceName(), xnGetStatusString(nRetVal));
diff --git a/Samples/NiViewer/Device.h b/Samples/NiViewer/Device.h
index 591d673..b8a993d 100644
--- a/Samples/NiViewer/Device.h
+++ b/Samples/NiViewer/Device.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/Draw.cpp b/Samples/NiViewer/Draw.cpp
index 2420c7c..6169f81 100644
--- a/Samples/NiViewer/Draw.cpp
+++ b/Samples/NiViewer/Draw.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -116,7 +116,7 @@ typedef struct DrawUserInput
 
 DrawUserInput g_DrawUserInput;
 
-float g_fMaxDepth;
+float g_fMaxDepth = 0;
 
 DrawConfigPreset g_Presets[PRESET_COUNT] = 
 {
@@ -527,11 +527,6 @@ void drawInit()
 
 	TextureMapUpdate(&g_texBackground);
 
-	if (getDepthGenerator() != NULL)
-	{
-		g_fMaxDepth = getDepthGenerator()->GetDeviceMaxDepth();
-	}
-
 	mouseInputRegisterForSelectionRectangle(drawSelectionChanged);
 	mouseInputRegisterForCursorMovement(drawCursorMoved);
 }
@@ -1128,6 +1123,7 @@ void drawPointerMode(UIntPair* pPointer)
 	}
 
 	int nYLocation = WIN_SIZE_Y - 88;
+	glColor3f(1,0,0);
 	glRasterPos2i(10,nYLocation);
 	glPrintString(GLUT_BITMAP_HELVETICA_18, buf);
 	nYLocation -= 26;
@@ -1509,6 +1505,7 @@ void drawFrame()
 	const DepthMetaData* pDepthMD = getDepthMetaData();
 	if (isDepthOn())
 	{
+		g_fMaxDepth = getDepthGenerator()->GetDeviceMaxDepth();
 		TextureMapInit(&g_texDepth, pDepthMD->FullXRes(), pDepthMD->FullYRes(), 4, pDepthMD->XRes(), pDepthMD->YRes());
 		fixLocation(&g_DrawConfig.DepthLocation, pDepthMD->FullXRes(), pDepthMD->FullYRes());
 	}
diff --git a/Samples/NiViewer/Draw.h b/Samples/NiViewer/Draw.h
index 9a732a6..d4297f9 100644
--- a/Samples/NiViewer/Draw.h
+++ b/Samples/NiViewer/Draw.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/Keyboard.cpp b/Samples/NiViewer/Keyboard.cpp
index f956516..c665fb7 100644
--- a/Samples/NiViewer/Keyboard.cpp
+++ b/Samples/NiViewer/Keyboard.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/Keyboard.h b/Samples/NiViewer/Keyboard.h
index 39f39da..d64d61e 100644
--- a/Samples/NiViewer/Keyboard.h
+++ b/Samples/NiViewer/Keyboard.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/Menu.cpp b/Samples/NiViewer/Menu.cpp
index 068ec7f..31d9aaf 100644
--- a/Samples/NiViewer/Menu.cpp
+++ b/Samples/NiViewer/Menu.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/Menu.h b/Samples/NiViewer/Menu.h
index 8c6b2d7..bceb998 100644
--- a/Samples/NiViewer/Menu.h
+++ b/Samples/NiViewer/Menu.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/MouseInput.cpp b/Samples/NiViewer/MouseInput.cpp
index 93a9905..e25b344 100644
--- a/Samples/NiViewer/MouseInput.cpp
+++ b/Samples/NiViewer/MouseInput.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/MouseInput.h b/Samples/NiViewer/MouseInput.h
index cf4fe3f..e14f011 100644
--- a/Samples/NiViewer/MouseInput.h
+++ b/Samples/NiViewer/MouseInput.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/NiViewer.cpp b/Samples/NiViewer/NiViewer.cpp
index 1a04dfe..3e3e342 100644
--- a/Samples/NiViewer/NiViewer.cpp
+++ b/Samples/NiViewer/NiViewer.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -214,7 +214,6 @@ void closeSample(int errCode)
 {
 	captureStop(0);
 	closeDevice();
-	g_Context.Shutdown();
 
 	if (errCode != ERR_OK)
 	{
diff --git a/Samples/NiViewer/Statistics.cpp b/Samples/NiViewer/Statistics.cpp
index 1f19d66..274e8d6 100644
--- a/Samples/NiViewer/Statistics.cpp
+++ b/Samples/NiViewer/Statistics.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/NiViewer/Statistics.h b/Samples/NiViewer/Statistics.h
index 1236e5c..ecfb6f5 100644
--- a/Samples/NiViewer/Statistics.h
+++ b/Samples/NiViewer/Statistics.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Samples/SimpleRead.java/org/OpenNI/Samples/SimpleRead/SimpleRead.java b/Samples/SimpleRead.java/org/OpenNI/Samples/SimpleRead/SimpleRead.java
new file mode 100644
index 0000000..32896a0
--- /dev/null
+++ b/Samples/SimpleRead.java/org/OpenNI/Samples/SimpleRead/SimpleRead.java
@@ -0,0 +1,66 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI.Samples.SimpleRead;
+
+import org.OpenNI.*;
+
+public class SimpleRead implements IObserver<ErrorStateEventArgs>
+{
+	public static final String SAMPLES_XML = "../../../../Data/SamplesConfig.xml";
+	
+	public static void main(String[] args) 
+	{
+		try 
+		{
+			OutArg<ScriptNode> scriptNodeArg = new OutArg<ScriptNode>();
+			Context context = Context.createFromXmlFile(SAMPLES_XML, scriptNodeArg);
+			
+			SimpleRead pThis = new SimpleRead();
+			
+			context.getErrorStateChangedEvent().addObserver(pThis);
+			
+			DepthGenerator depth = (DepthGenerator)context.findExistingNode(NodeType.DEPTH);
+			
+			DepthMetaData depthMD = new DepthMetaData();
+			
+			while (true)
+			{
+				context.waitAnyUpdateAll();
+				
+				depth.getMetaData(depthMD);
+				
+				System.out.printf("Frame %d Middle point is: %d.\n", depthMD.getFrameID(), depthMD.getData().readPixel(depthMD.getXRes() / 2, depthMD.getYRes() / 2));
+			}
+		} 
+		catch (Throwable e) 
+		{
+			e.printStackTrace();
+		}
+	}
+	
+	@Override
+	public void update(IObservable<ErrorStateEventArgs> arg0, ErrorStateEventArgs arg1)
+	{
+		System.out.printf("Global error state has changed: %s", arg1.getCurrentError());
+		System.exit(1);
+	}
+}
diff --git a/Samples/SimpleRead.net/AssemblyInfo.cs b/Samples/SimpleRead.net/AssemblyInfo.cs
index d64dcd4..b5720d6 100644
--- a/Samples/SimpleRead.net/AssemblyInfo.cs
+++ b/Samples/SimpleRead.net/AssemblyInfo.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
diff --git a/Samples/SimpleRead.net/Program.cs b/Samples/SimpleRead.net/Program.cs
index 635547e..c8b638d 100644
--- a/Samples/SimpleRead.net/Program.cs
+++ b/Samples/SimpleRead.net/Program.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -12,7 +33,8 @@ namespace SimpleRead.net
 		{
 			string SAMPLE_XML_FILE = @"../../../../Data/SamplesConfig.xml";
 
-			Context context = new Context(SAMPLE_XML_FILE);
+			ScriptNode scriptNode;
+			Context context = Context.CreateFromXmlFile(SAMPLE_XML_FILE, out scriptNode);
 
 			DepthGenerator depth = context.FindExistingNode(NodeType.Depth) as DepthGenerator;
 			if (depth == null)
diff --git a/Samples/SimpleViewer.java/org/OpenNI/Samples/SimpleViewer/SimpleViewer.java b/Samples/SimpleViewer.java/org/OpenNI/Samples/SimpleViewer/SimpleViewer.java
new file mode 100644
index 0000000..82eded4
--- /dev/null
+++ b/Samples/SimpleViewer.java/org/OpenNI/Samples/SimpleViewer/SimpleViewer.java
@@ -0,0 +1,142 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI.Samples.SimpleViewer;
+
+import org.OpenNI.*;
+
+import java.nio.ShortBuffer;
+import java.awt.*;
+import java.awt.image.*;
+
+class SimpleViewer extends Component {
+
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private OutArg<ScriptNode> scriptNode;
+    private Context context;
+    private DepthGenerator depthGen;
+    private byte[] imgbytes;
+    private float histogram[];
+
+    private BufferedImage bimg;
+    int width, height;
+
+    private final String SAMPLE_XML_FILE = "../../../../Data/SamplesConfig.xml";    
+    public SimpleViewer() {
+
+        try {
+            scriptNode = new OutArg<ScriptNode>();
+            context = Context.createFromXmlFile(SAMPLE_XML_FILE, scriptNode);
+
+            depthGen = DepthGenerator.create(context);
+            DepthMetaData depthMD = depthGen.getMetaData();
+
+            histogram = new float[10000];
+            width = depthMD.getFullXRes();
+            height = depthMD.getFullYRes();
+            
+            imgbytes = new byte[width*height];
+            
+            DataBufferByte dataBuffer = new DataBufferByte(imgbytes, width*height);
+            Raster raster = Raster.createPackedRaster(dataBuffer, width, height, 8, null);
+            bimg = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_GRAY);
+            bimg.setData(raster);
+
+        } catch (GeneralException e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+    
+    private void calcHist(DepthMetaData depthMD)
+    {
+        // reset
+        for (int i = 0; i < histogram.length; ++i)
+            histogram[i] = 0;
+        
+        ShortBuffer depth = depthMD.getData().createShortBuffer();
+        depth.rewind();
+
+        int points = 0;
+        while(depth.remaining() > 0)
+        {
+            short depthVal = depth.get();
+            if (depthVal != 0)
+            {
+                histogram[depthVal]++;
+                points++;
+            }
+        }
+        
+        for (int i = 1; i < histogram.length; i++)
+        {
+            histogram[i] += histogram[i-1];
+        }
+
+        if (points > 0)
+        {
+            for (int i = 1; i < histogram.length; i++)
+            {
+                histogram[i] = (int)(256 * (1.0f - (histogram[i] / (float)points)));
+            }
+        }
+    }
+
+
+    void updateDepth()
+    {
+        try {
+            DepthMetaData depthMD = depthGen.getMetaData();
+
+            context.waitAnyUpdateAll();
+            
+            calcHist(depthMD);
+            ShortBuffer depth = depthMD.getData().createShortBuffer();
+            depth.rewind();
+            
+            while(depth.remaining() > 0)
+            {
+                int pos = depth.position();
+                short pixel = depth.get();
+                imgbytes[pos] = (byte)histogram[pixel];
+            }
+        } catch (GeneralException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    public Dimension getPreferredSize() {
+        return new Dimension(width, height);
+    }
+
+    public void paint(Graphics g) {
+        DataBufferByte dataBuffer = new DataBufferByte(imgbytes, width*height);
+        Raster raster = Raster.createPackedRaster(dataBuffer, width, height, 8, null);
+        bimg.setData(raster);
+
+        g.drawImage(bimg, 0, 0, null);
+    }
+}
+
diff --git a/Samples/SimpleViewer.java/org/OpenNI/Samples/SimpleViewer/SimpleViewerApplication.java b/Samples/SimpleViewer.java/org/OpenNI/Samples/SimpleViewer/SimpleViewerApplication.java
new file mode 100644
index 0000000..86ed489
--- /dev/null
+++ b/Samples/SimpleViewer.java/org/OpenNI/Samples/SimpleViewer/SimpleViewerApplication.java
@@ -0,0 +1,82 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI.Samples.SimpleViewer;
+
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JFrame;
+
+public class SimpleViewerApplication
+{
+
+    private SimpleViewer viewer;
+	private boolean shouldRun = true;
+	private JFrame frame;
+
+    public SimpleViewerApplication (JFrame frame)
+    {
+        {
+        	this.frame = frame;
+        	frame.addKeyListener(new KeyListener()
+    		{
+    			@Override
+    			public void keyTyped(KeyEvent arg0) {}
+    			@Override
+    			public void keyReleased(KeyEvent arg0) {}
+    			@Override
+    			public void keyPressed(KeyEvent arg0) {
+    				if (arg0.getKeyCode() == KeyEvent.VK_ESCAPE)
+    				{
+    					shouldRun = false;
+    				}
+    			}
+    		});
+        }
+    }
+
+    public static void main(String s[]) {
+        JFrame f = new JFrame("OpenNI Simple Viewer");
+        f.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {System.exit(0);}
+        });
+        SimpleViewerApplication app = new SimpleViewerApplication(f);
+        
+        app.viewer = new SimpleViewer();
+        f.add("Center", app.viewer);
+        f.pack();
+        f.setVisible(true);
+        
+        app.run();
+    }
+
+    void run() {
+        while(shouldRun) {
+            viewer.updateDepth();
+            viewer.repaint();
+        }
+        frame.dispose();
+    }
+    
+}
diff --git a/Samples/SimpleViewer.net/AssemblyInfo.cs b/Samples/SimpleViewer.net/AssemblyInfo.cs
index b4466e8..eaa1c48 100644
--- a/Samples/SimpleViewer.net/AssemblyInfo.cs
+++ b/Samples/SimpleViewer.net/AssemblyInfo.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
diff --git a/Samples/SimpleViewer.net/MainWindow.Designer.cs b/Samples/SimpleViewer.net/MainWindow.Designer.cs
index 7b14d9c..89f62ae 100644
--- a/Samples/SimpleViewer.net/MainWindow.Designer.cs
+++ b/Samples/SimpleViewer.net/MainWindow.Designer.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 namespace SimpleViewer.net
 {
 	partial class MainWindow
diff --git a/Samples/SimpleViewer.net/MainWindow.cs b/Samples/SimpleViewer.net/MainWindow.cs
index bef7779..8a9a0db 100644
--- a/Samples/SimpleViewer.net/MainWindow.cs
+++ b/Samples/SimpleViewer.net/MainWindow.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -16,7 +37,7 @@ namespace SimpleViewer.net
 		{
 			InitializeComponent();
 
-			this.context = new Context(SAMPLE_XML_FILE);
+			this.context = Context.CreateFromXmlFile(SAMPLE_XML_FILE, out scriptNode);
 			this.depth = context.FindExistingNode(NodeType.Depth) as DepthGenerator;
 			if (this.depth == null)
 			{
@@ -152,6 +173,7 @@ namespace SimpleViewer.net
 		private readonly string SAMPLE_XML_FILE = @"../../../../Data/SamplesConfig.xml";
 
 		private Context context;
+		private ScriptNode scriptNode;
 		private DepthGenerator depth;
 		private Thread readerThread;
 		private bool shouldRun;
diff --git a/Samples/SimpleViewer.net/Program.cs b/Samples/SimpleViewer.net/Program.cs
index ddd5a62..ba2fa0b 100644
--- a/Samples/SimpleViewer.net/Program.cs
+++ b/Samples/SimpleViewer.net/Program.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Linq;
diff --git a/Samples/UserTracker.java/org/OpenNI/Samples/UserTracker/UserTracker.java b/Samples/UserTracker.java/org/OpenNI/Samples/UserTracker/UserTracker.java
new file mode 100644
index 0000000..7d15b13
--- /dev/null
+++ b/Samples/UserTracker.java/org/OpenNI/Samples/UserTracker/UserTracker.java
@@ -0,0 +1,402 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI.Samples.UserTracker;
+
+import org.OpenNI.*;
+
+import java.nio.ShortBuffer;
+import java.util.HashMap;
+import java.awt.*;
+import java.awt.color.ColorSpace;
+import java.awt.image.*;
+
+public class UserTracker extends Component
+{
+	class NewUserObserver implements IObserver<UserEventArgs>
+	{
+		@Override
+		public void update(IObservable<UserEventArgs> observable,
+				UserEventArgs args)
+		{
+			System.out.println("New user " + args.getId());
+			try
+			{
+				if (skeletonCap.needPoseForCalibration())
+				{
+					poseDetectionCap.startPoseDetection(calibPose, args.getId());
+				}
+				else
+				{
+					skeletonCap.requestSkeletonCalibration(args.getId(), true);
+				}
+			} catch (StatusException e)
+			{
+				e.printStackTrace();
+			}
+		}
+	}
+	class LostUserObserver implements IObserver<UserEventArgs>
+	{
+		@Override
+		public void update(IObservable<UserEventArgs> observable,
+				UserEventArgs args)
+		{
+			System.out.println("Lost user " + args.getId());
+			joints.remove(args.getId());
+		}
+	}
+	
+	class CalibrationCompleteObserver implements IObserver<CalibrationProgressEventArgs>
+	{
+		@Override
+		public void update(IObservable<CalibrationProgressEventArgs> observable,
+				CalibrationProgressEventArgs args)
+		{
+			System.out.println("Calibraion complete: " + args.getStatus());
+			try
+			{
+			if (args.getStatus() == CalibrationProgressStatus.OK)
+			{
+				System.out.println("starting tracking "  +args.getUser());
+					skeletonCap.startTracking(args.getUser());
+	                joints.put(new Integer(args.getUser()), new HashMap<SkeletonJoint, SkeletonJointPosition>());
+			}
+			else if (args.getStatus() != CalibrationProgressStatus.MANUAL_ABORT)
+			{
+				if (skeletonCap.needPoseForCalibration())
+				{
+					poseDetectionCap.startPoseDetection(calibPose, args.getUser());
+				}
+				else
+				{
+					skeletonCap.requestSkeletonCalibration(args.getUser(), true);
+				}
+			}
+			} catch (StatusException e)
+			{
+				e.printStackTrace();
+			}
+		}
+	}
+	class PoseDetectedObserver implements IObserver<PoseDetectionEventArgs>
+	{
+		@Override
+		public void update(IObservable<PoseDetectionEventArgs> observable,
+				PoseDetectionEventArgs args)
+		{
+			System.out.println("Pose " + args.getPose() + " detected for " + args.getUser());
+			try
+			{
+				poseDetectionCap.stopPoseDetection(args.getUser());
+				skeletonCap.requestSkeletonCalibration(args.getUser(), true);
+			} catch (StatusException e)
+			{
+				e.printStackTrace();
+			}
+		}
+	}
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private OutArg<ScriptNode> scriptNode;
+    private Context context;
+    private DepthGenerator depthGen;
+    private UserGenerator userGen;
+    private SkeletonCapability skeletonCap;
+    private PoseDetectionCapability poseDetectionCap;
+    private byte[] imgbytes;
+    private float histogram[];
+    String calibPose = null;
+    HashMap<Integer, HashMap<SkeletonJoint, SkeletonJointPosition>> joints;
+
+    private boolean drawBackground = true;
+    private boolean drawPixels = true;
+    private boolean drawSkeleton = true;
+    private boolean printID = true;
+    private boolean printState = true;
+    
+    
+    private BufferedImage bimg;
+    int width, height;
+    
+    private final String SAMPLE_XML_FILE = "../../../../Data/SamplesConfig.xml";
+    public UserTracker()
+    {
+
+        try {
+            scriptNode = new OutArg<ScriptNode>();
+            context = Context.createFromXmlFile(SAMPLE_XML_FILE, scriptNode);
+
+            depthGen = DepthGenerator.create(context);
+            DepthMetaData depthMD = depthGen.getMetaData();
+
+            histogram = new float[10000];
+            width = depthMD.getFullXRes();
+            height = depthMD.getFullYRes();
+            
+            imgbytes = new byte[width*height*3];
+
+            userGen = UserGenerator.create(context);
+            skeletonCap = userGen.getSkeletonCapability();
+            poseDetectionCap = userGen.getPoseDetectionCapability();
+            
+            userGen.getNewUserEvent().addObserver(new NewUserObserver());
+            userGen.getLostUserEvent().addObserver(new LostUserObserver());
+            skeletonCap.getCalibrationCompleteEvent().addObserver(new CalibrationCompleteObserver());
+            poseDetectionCap.getPoseDetectedEvent().addObserver(new PoseDetectedObserver());
+            
+            calibPose = skeletonCap.getSkeletonCalibrationPose();
+            joints = new HashMap<Integer, HashMap<SkeletonJoint,SkeletonJointPosition>>();
+            
+            skeletonCap.setSkeletonProfile(SkeletonProfile.ALL);
+			
+			context.startGeneratingAll();
+        } catch (GeneralException e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+    
+    private void calcHist(ShortBuffer depth)
+    {
+        // reset
+        for (int i = 0; i < histogram.length; ++i)
+            histogram[i] = 0;
+        
+        depth.rewind();
+
+        int points = 0;
+        while(depth.remaining() > 0)
+        {
+            short depthVal = depth.get();
+            if (depthVal != 0)
+            {
+                histogram[depthVal]++;
+                points++;
+            }
+        }
+        
+        for (int i = 1; i < histogram.length; i++)
+        {
+            histogram[i] += histogram[i-1];
+        }
+
+        if (points > 0)
+        {
+            for (int i = 1; i < histogram.length; i++)
+            {
+                histogram[i] = 1.0f - (histogram[i] / (float)points);
+            }
+        }
+    }
+
+
+    void updateDepth()
+    {
+        try {
+
+            context.waitAnyUpdateAll();
+
+            DepthMetaData depthMD = depthGen.getMetaData();
+            SceneMetaData sceneMD = userGen.getUserPixels(0);
+
+            ShortBuffer scene = sceneMD.getData().createShortBuffer();
+            ShortBuffer depth = depthMD.getData().createShortBuffer();
+            calcHist(depth);
+            depth.rewind();
+            
+            while(depth.remaining() > 0)
+            {
+                int pos = depth.position();
+                short pixel = depth.get();
+                short user = scene.get();
+                
+        		imgbytes[3*pos] = 0;
+        		imgbytes[3*pos+1] = 0;
+        		imgbytes[3*pos+2] = 0;                	
+
+                if (drawBackground || pixel != 0)
+                {
+                	int colorID = user % (colors.length-1);
+                	if (user == 0)
+                	{
+                		colorID = colors.length-1;
+                	}
+                	if (pixel != 0)
+                	{
+                		float histValue = histogram[pixel];
+                		imgbytes[3*pos] = (byte)(histValue*colors[colorID].getRed());
+                		imgbytes[3*pos+1] = (byte)(histValue*colors[colorID].getGreen());
+                		imgbytes[3*pos+2] = (byte)(histValue*colors[colorID].getBlue());
+                	}
+                }
+            }
+        } catch (GeneralException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    public Dimension getPreferredSize() {
+        return new Dimension(width, height);
+    }
+
+    Color colors[] = {Color.RED, Color.BLUE, Color.CYAN, Color.GREEN, Color.MAGENTA, Color.PINK, Color.YELLOW, Color.WHITE};
+    public void getJoint(int user, SkeletonJoint joint) throws StatusException
+    {
+        SkeletonJointPosition pos = skeletonCap.getSkeletonJointPosition(user, joint);
+		if (pos.getPosition().getZ() != 0)
+		{
+			joints.get(user).put(joint, new SkeletonJointPosition(depthGen.convertRealWorldToProjective(pos.getPosition()), pos.getConfidence()));
+		}
+		else
+		{
+			joints.get(user).put(joint, new SkeletonJointPosition(new Point3D(), 0));
+		}
+    }
+    public void getJoints(int user) throws StatusException
+    {
+    	getJoint(user, SkeletonJoint.HEAD);
+    	getJoint(user, SkeletonJoint.NECK);
+    	
+    	getJoint(user, SkeletonJoint.LEFT_SHOULDER);
+    	getJoint(user, SkeletonJoint.LEFT_ELBOW);
+    	getJoint(user, SkeletonJoint.LEFT_HAND);
+
+    	getJoint(user, SkeletonJoint.RIGHT_SHOULDER);
+    	getJoint(user, SkeletonJoint.RIGHT_ELBOW);
+    	getJoint(user, SkeletonJoint.RIGHT_HAND);
+
+    	getJoint(user, SkeletonJoint.TORSO);
+
+    	getJoint(user, SkeletonJoint.LEFT_HIP);
+        getJoint(user, SkeletonJoint.LEFT_KNEE);
+        getJoint(user, SkeletonJoint.LEFT_FOOT);
+
+    	getJoint(user, SkeletonJoint.RIGHT_HIP);
+        getJoint(user, SkeletonJoint.RIGHT_KNEE);
+        getJoint(user, SkeletonJoint.RIGHT_FOOT);
+
+    }
+    void drawLine(Graphics g, HashMap<SkeletonJoint, SkeletonJointPosition> jointHash, SkeletonJoint joint1, SkeletonJoint joint2)
+    {
+		Point3D pos1 = jointHash.get(joint1).getPosition();
+		Point3D pos2 = jointHash.get(joint2).getPosition();
+
+		if (jointHash.get(joint1).getConfidence() == 0 || jointHash.get(joint2).getConfidence() == 0)
+			return;
+
+		g.drawLine((int)pos1.getX(), (int)pos1.getY(), (int)pos2.getX(), (int)pos2.getY());
+    }
+    public void drawSkeleton(Graphics g, int user) throws StatusException
+    {
+    	getJoints(user);
+    	HashMap<SkeletonJoint, SkeletonJointPosition> dict = joints.get(new Integer(user));
+
+    	drawLine(g, dict, SkeletonJoint.HEAD, SkeletonJoint.NECK);
+
+    	drawLine(g, dict, SkeletonJoint.LEFT_SHOULDER, SkeletonJoint.TORSO);
+    	drawLine(g, dict, SkeletonJoint.RIGHT_SHOULDER, SkeletonJoint.TORSO);
+
+    	drawLine(g, dict, SkeletonJoint.NECK, SkeletonJoint.LEFT_SHOULDER);
+    	drawLine(g, dict, SkeletonJoint.LEFT_SHOULDER, SkeletonJoint.LEFT_ELBOW);
+    	drawLine(g, dict, SkeletonJoint.LEFT_ELBOW, SkeletonJoint.LEFT_HAND);
+
+    	drawLine(g, dict, SkeletonJoint.NECK, SkeletonJoint.RIGHT_SHOULDER);
+    	drawLine(g, dict, SkeletonJoint.RIGHT_SHOULDER, SkeletonJoint.RIGHT_ELBOW);
+    	drawLine(g, dict, SkeletonJoint.RIGHT_ELBOW, SkeletonJoint.RIGHT_HAND);
+
+    	drawLine(g, dict, SkeletonJoint.LEFT_HIP, SkeletonJoint.TORSO);
+    	drawLine(g, dict, SkeletonJoint.RIGHT_HIP, SkeletonJoint.TORSO);
+    	drawLine(g, dict, SkeletonJoint.LEFT_HIP, SkeletonJoint.RIGHT_HIP);
+
+    	drawLine(g, dict, SkeletonJoint.LEFT_HIP, SkeletonJoint.LEFT_KNEE);
+    	drawLine(g, dict, SkeletonJoint.LEFT_KNEE, SkeletonJoint.LEFT_FOOT);
+
+    	drawLine(g, dict, SkeletonJoint.RIGHT_HIP, SkeletonJoint.RIGHT_KNEE);
+    	drawLine(g, dict, SkeletonJoint.RIGHT_KNEE, SkeletonJoint.RIGHT_FOOT);
+
+    }
+    
+    public void paint(Graphics g)
+    {
+    	if (drawPixels)
+    	{
+            DataBufferByte dataBuffer = new DataBufferByte(imgbytes, width*height*3);
+
+            WritableRaster raster = Raster.createInterleavedRaster(dataBuffer, width, height, width * 3, 3, new int[]{0, 1, 2}, null); 
+
+            ColorModel colorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), new int[]{8, 8, 8}, false, false, ComponentColorModel.OPAQUE, DataBuffer.TYPE_BYTE);
+
+            bimg = new BufferedImage(colorModel, raster, false, null);
+
+    		g.drawImage(bimg, 0, 0, null);
+    	}
+        try
+		{
+			int[] users = userGen.getUsers();
+			for (int i = 0; i < users.length; ++i)
+			{
+		    	Color c = colors[users[i]%colors.length];
+		    	c = new Color(255-c.getRed(), 255-c.getGreen(), 255-c.getBlue());
+
+		    	g.setColor(c);
+				if (drawSkeleton && skeletonCap.isSkeletonTracking(users[i]))
+				{
+					drawSkeleton(g, users[i]);
+				}
+				
+				if (printID)
+				{
+					Point3D com = depthGen.convertRealWorldToProjective(userGen.getUserCoM(users[i]));
+					String label = null;
+					if (!printState)
+					{
+						label = new String(""+users[i]);
+					}
+					else if (skeletonCap.isSkeletonTracking(users[i]))
+					{
+						// Tracking
+						label = new String(users[i] + " - Tracking");
+					}
+					else if (skeletonCap.isSkeletonCalibrating(users[i]))
+					{
+						// Calibrating
+						label = new String(users[i] + " - Calibrating");
+					}
+					else
+					{
+						// Nothing
+						label = new String(users[i] + " - Looking for pose (" + calibPose + ")");
+					}
+
+					g.drawString(label, (int)com.getX(), (int)com.getY());
+				}
+			}
+		} catch (StatusException e)
+		{
+			e.printStackTrace();
+		}
+    }
+}
+
diff --git a/Samples/UserTracker.java/org/OpenNI/Samples/UserTracker/UserTrackerApplication.java b/Samples/UserTracker.java/org/OpenNI/Samples/UserTracker/UserTrackerApplication.java
new file mode 100644
index 0000000..aaae4eb
--- /dev/null
+++ b/Samples/UserTracker.java/org/OpenNI/Samples/UserTracker/UserTrackerApplication.java
@@ -0,0 +1,83 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI.Samples.UserTracker;
+
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JFrame;
+
+public class UserTrackerApplication {
+
+    /**
+	 * 
+	 */
+	public UserTracker viewer;
+	private boolean shouldRun = true;
+	private JFrame frame;
+
+    public UserTrackerApplication (JFrame frame)
+    {
+    	this.frame = frame;
+    	frame.addKeyListener(new KeyListener()
+		{
+			@Override
+			public void keyTyped(KeyEvent arg0) {}
+			@Override
+			public void keyReleased(KeyEvent arg0) {}
+			@Override
+			public void keyPressed(KeyEvent arg0) {
+				if (arg0.getKeyCode() == KeyEvent.VK_ESCAPE)
+				{
+					shouldRun = false;
+				}
+			}
+		});
+    }
+
+    public static void main(String s[])
+    {
+        JFrame f = new JFrame("OpenNI User Tracker");
+        f.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {System.exit(0);}
+        });
+        UserTrackerApplication app = new UserTrackerApplication(f);
+        
+        app.viewer = new UserTracker();
+        f.add("Center", app.viewer);
+        f.pack();
+        f.setVisible(true);
+        app.run();
+    }
+
+    void run()
+    {
+        while(shouldRun) {
+            viewer.updateDepth();
+            viewer.repaint();
+        }
+        frame.dispose();
+    }
+    
+}
diff --git a/Samples/UserTracker.net/AssemblyInfo.cs b/Samples/UserTracker.net/AssemblyInfo.cs
index 6fef1f7..4eae710 100644
--- a/Samples/UserTracker.net/AssemblyInfo.cs
+++ b/Samples/UserTracker.net/AssemblyInfo.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
diff --git a/Samples/UserTracker.net/MainWindow.cs b/Samples/UserTracker.net/MainWindow.cs
index 1f8fd23..39e1bb2 100644
--- a/Samples/UserTracker.net/MainWindow.cs
+++ b/Samples/UserTracker.net/MainWindow.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -17,7 +38,7 @@ namespace UserTracker.net
 		{
 			InitializeComponent();
 
-			this.context = new Context(SAMPLE_XML_FILE);
+			this.context = Context.CreateFromXmlFile(SAMPLE_XML_FILE, out scriptNode);
 			this.depth = context.FindExistingNode(NodeType.Depth) as DepthGenerator;
 			if (this.depth == null)
 			{
@@ -32,7 +53,7 @@ namespace UserTracker.net
             this.userGenerator.NewUser += userGenerator_NewUser;
             this.userGenerator.LostUser += userGenerator_LostUser;
             this.poseDetectionCapability.PoseDetected += poseDetectionCapability_PoseDetected;
-            this.skeletonCapbility.CalibrationEnd += skeletonCapbility_CalibrationEnd;
+            this.skeletonCapbility.CalibrationComplete += skeletonCapbility_CalibrationComplete;
 
             this.skeletonCapbility.SetSkeletonProfile(SkeletonProfile.All);
             this.joints = new Dictionary<int,Dictionary<SkeletonJoint,SkeletonJointPosition>>();
@@ -49,16 +70,23 @@ namespace UserTracker.net
 			this.readerThread.Start();
 		}
 
-        void skeletonCapbility_CalibrationEnd(object sender, CalibrationEndEventArgs e)
+        void skeletonCapbility_CalibrationComplete(object sender, CalibrationProgressEventArgs e)
         {
-            if (e.Success)
+            if (e.Status == CalibrationStatus.OK)
             {
                 this.skeletonCapbility.StartTracking(e.ID);
                 this.joints.Add(e.ID, new Dictionary<SkeletonJoint, SkeletonJointPosition>());
             }
-            else
+            else if (e.Status != CalibrationStatus.ManualAbort)
             {
-                this.poseDetectionCapability.StartPoseDetection(calibPose, e.ID);
+                if (this.skeletonCapbility.DoesNeedPoseForCalibration)
+                {
+                    this.poseDetectionCapability.StartPoseDetection(calibPose, e.ID);
+                }
+                else
+                {
+                    this.skeletonCapbility.RequestCalibration(e.ID, true);
+                }
             }
         }
 
@@ -70,7 +98,14 @@ namespace UserTracker.net
 
         void userGenerator_NewUser(object sender, NewUserEventArgs e)
         {
-            this.poseDetectionCapability.StartPoseDetection(this.calibPose, e.ID);
+            if (this.skeletonCapbility.DoesNeedPoseForCalibration)
+            {
+                this.poseDetectionCapability.StartPoseDetection(this.calibPose, e.ID);
+            }
+            else
+            {
+                this.skeletonCapbility.RequestCalibration(e.ID, true);
+            }
         }
 
 		void userGenerator_LostUser(object sender, UserLostEventArgs e)
@@ -348,6 +383,7 @@ namespace UserTracker.net
 		private readonly string SAMPLE_XML_FILE = @"../../../../Data/SamplesConfig.xml";
 
 		private Context context;
+		private ScriptNode scriptNode;
 		private DepthGenerator depth;
         private UserGenerator userGenerator;
         private SkeletonCapability skeletonCapbility;
diff --git a/Samples/UserTracker.net/MainWindow.designer.cs b/Samples/UserTracker.net/MainWindow.designer.cs
index 9a5c534..7067163 100644
--- a/Samples/UserTracker.net/MainWindow.designer.cs
+++ b/Samples/UserTracker.net/MainWindow.designer.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 namespace UserTracker.net
 {
 	partial class MainWindow
diff --git a/Samples/UserTracker.net/Program.cs b/Samples/UserTracker.net/Program.cs
index 9b61b5d..3e19d4c 100644
--- a/Samples/UserTracker.net/Program.cs
+++ b/Samples/UserTracker.net/Program.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Linq;
diff --git a/Source/DoxyGen/Doxyfile b/Source/DoxyGen/Doxyfile
index e1a1219..20ea331 100644
--- a/Source/DoxyGen/Doxyfile
+++ b/Source/DoxyGen/Doxyfile
@@ -1,4 +1,4 @@
-# Doxyfile 1.6.3
+# Doxyfile 1.7.5.1
 
 # This file describes the settings to be used by the documentation system
 # doxygen (www.doxygen.org) for a project
@@ -22,10 +22,11 @@
 
 DOXYFILE_ENCODING      = UTF-8
 
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project.
+# The PROJECT_NAME tag is a single word (or sequence of words) that should 
+# identify the project. Note that if you do not use Doxywizard you need 
+# to put quotes around the project name if it contains spaces.
 
-PROJECT_NAME           = "OpenNI 1.0.0"
+PROJECT_NAME = "OpenNI 1.5.2"
 
 # The PROJECT_NUMBER tag can be used to enter a project or revision number. 
 # This could be handy for archiving the generated documentation or 
@@ -33,6 +34,19 @@ PROJECT_NAME           = "OpenNI 1.0.0"
 
 PROJECT_NUMBER         = 
 
+# Using the PROJECT_BRIEF tag one can provide an optional one line description 
+# for a project that appears at the top of each page and should give viewer 
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          = 
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is 
+# included in the documentation. The maximum height of the logo should not 
+# exceed 55 pixels and the maximum width should not exceed 200 pixels. 
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           = OpenNILogo.bmp
+
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
 # base path where the generated documentation will be put. 
 # If a relative path is entered, it will be relative to the location 
@@ -57,7 +71,7 @@ CREATE_SUBDIRS         = NO
 # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 
 # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 
 # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, 
 # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
 
 OUTPUT_LANGUAGE        = English
@@ -136,7 +150,7 @@ STRIP_FROM_PATH        =
 STRIP_FROM_INC_PATH    = 
 
 # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
-# (but less readable) file names. This can be useful is your file systems 
+# (but less readable) file names. This can be useful if your file system 
 # doesn't support long names like on DOS, Mac, or CD-ROM.
 
 SHORT_NAMES            = NO
@@ -217,15 +231,15 @@ OPTIMIZE_FOR_FORTRAN   = NO
 
 OPTIMIZE_OUTPUT_VHDL   = NO
 
-# Doxygen selects the parser to use depending on the extension of the files it parses. 
-# With this tag you can assign which parser to use for a given extension. 
-# Doxygen has a built-in mapping, but you can override or extend it using this tag. 
-# The format is ext=language, where ext is a file extension, and language is one of 
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, 
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat 
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), 
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set
-# FILE_PATTERNS otherwise the files are not read by doxygen.
+# Doxygen selects the parser to use depending on the extension of the files it 
+# parses. With this tag you can assign which parser to use for a given extension. 
+# Doxygen has a built-in mapping, but you can override or extend it using this 
+# tag. The format is ext=language, where ext is a file extension, and language 
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, 
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make 
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C 
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions 
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
 
 EXTENSION_MAPPING      = 
 
@@ -233,7 +247,7 @@ EXTENSION_MAPPING      =
 # to include (a tag file for) the STL sources as input, then you should 
 # set this tag to YES in order to let doxygen match functions declarations and 
 # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
-# func(std::string) {}). This also make the inheritance and collaboration 
+# func(std::string) {}). This also makes the inheritance and collaboration 
 # diagrams that involve STL classes more complete and accurate.
 
 BUILTIN_STL_SUPPORT    = NO
@@ -251,7 +265,7 @@ SIP_SUPPORT            = NO
 
 # For Microsoft's IDL there are propget and propput attributes to indicate getter 
 # and setter methods for a property. Setting this option to YES (the default) 
-# will make doxygen to replace the get and set methods by a property in the 
+# will make doxygen replace the get and set methods by a property in the 
 # documentation. This will only work if the methods are indeed getting or 
 # setting a simple type. If this is not the case, or you want to show the 
 # methods anyway, you should set this option to NO.
@@ -273,6 +287,22 @@ DISTRIBUTE_GROUP_DOC   = NO
 
 SUBGROUPING            = YES
 
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and 
+# unions are shown inside the group in which they are included (e.g. using 
+# @ingroup) instead of on a separate page (for HTML and Man pages) or 
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and 
+# unions with only public data fields will be shown inline in the documentation 
+# of the scope in which they are defined (i.e. file, namespace, or group 
+# documentation), provided this scope is documented. If set to NO (the default), 
+# structs, classes, and unions are shown on a separate page (for HTML and Man 
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
 # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
 # is documented as struct, union, or enum with the name of the typedef. So 
 # typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
@@ -289,10 +319,10 @@ TYPEDEF_HIDES_STRUCT   = NO
 # For small to medium size projects (<1000 input files) the default value is 
 # probably good enough. For larger projects a too small cache size can cause 
 # doxygen to be busy swapping symbols to and from disk most of the time 
-# causing a significant performance penality. 
+# causing a significant performance penalty. 
 # If the system has enough physical memory increasing the cache will improve the 
 # performance by keeping more symbols in memory. Note that the value works on 
-# a logarithmic scale so increasing the size by one will rougly double the 
+# a logarithmic scale so increasing the size by one will roughly double the 
 # memory usage. The cache size is given by this formula: 
 # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 
 # corresponding to a cache size of 2^16 = 65536 symbols
@@ -337,7 +367,7 @@ EXTRACT_LOCAL_METHODS  = NO
 # extracted and appear in the documentation as a namespace called 
 # 'anonymous_namespace{file}', where file will be replaced with the base 
 # name of the file that contains the anonymous namespace. By default 
-# anonymous namespace are hidden.
+# anonymous namespaces are hidden.
 
 EXTRACT_ANON_NSPACES   = NO
 
@@ -422,12 +452,12 @@ SORT_MEMBER_DOCS       = YES
 
 SORT_BRIEF_DOCS        = NO
 
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen 
+# will sort the (brief and detailed) documentation of class members so that 
+# constructors and destructors are listed first. If set to NO (the default) 
+# the constructors will appear in the respective orders defined by 
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. 
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO 
 # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
 
 SORT_MEMBERS_CTORS_1ST = YES
@@ -448,6 +478,15 @@ SORT_GROUP_NAMES       = NO
 
 SORT_BY_SCOPE_NAME     = NO
 
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to 
+# do proper type resolution of all parameters of a function it will reject a 
+# match between the prototype and the implementation of a member function even 
+# if there is only one candidate or it is obvious which candidate to choose 
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen 
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
 # The GENERATE_TODOLIST tag can be used to enable (YES) or 
 # disable (NO) the todo list. This list is created by putting \todo 
 # commands in the documentation.
@@ -478,10 +517,10 @@ GENERATE_DEPRECATEDLIST= YES
 ENABLED_SECTIONS       = 
 
 # The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
-# the initial value of a variable or define consists of for it to appear in 
+# the initial value of a variable or macro consists of for it to appear in 
 # the documentation. If the initializer consists of more lines than specified 
 # here it will be hidden. Use a value of 0 to hide initializers completely. 
-# The appearance of the initializer of individual variables and defines in the 
+# The appearance of the initializer of individual variables and macros in the 
 # documentation can be controlled using \showinitializer or \hideinitializer 
 # command in the documentation regardless of this setting.
 
@@ -521,15 +560,24 @@ SHOW_NAMESPACES        = YES
 
 FILE_VERSION_FILTER    = 
 
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 
-# doxygen. The layout file controls the global structure of the generated output files 
-# in an output format independent way. The create the layout file that represents 
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a 
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name 
-# of the layout file.
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed 
+# by doxygen. The layout file controls the global structure of the generated 
+# output files in an output format independent way. The create the layout file 
+# that represents doxygen's defaults, run doxygen with the -l option. 
+# You can optionally specify a file name after the option, if omitted 
+# DoxygenLayout.xml will be used as the name of the layout file.
 
 LAYOUT_FILE            = 
 
+# The CITE_BIB_FILES tag can be used to specify one or more bib files 
+# containing the references data. This must be a list of .bib files. The 
+# .bib extension is automatically appended if omitted. Using this command 
+# requires the bibtex tool to be installed. See also 
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style 
+# of the bibliography can be controlled using LATEX_BIB_STYLE.
+
+CITE_BIB_FILES         = 
+
 #---------------------------------------------------------------------------
 # configuration options related to warning and progress messages
 #---------------------------------------------------------------------------
@@ -558,7 +606,7 @@ WARN_IF_UNDOCUMENTED   = YES
 
 WARN_IF_DOC_ERROR      = YES
 
-# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for 
 # functions that are documented, but have no documentation for their parameters 
 # or return value. If set to NO (the default) doxygen will only warn about 
 # wrong or incomplete parameter documentation, but not about the absence of 
@@ -611,8 +659,9 @@ INPUT_ENCODING         = UTF-8
 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
 # and *.h) to filter out the source-files in the directories. If left 
 # blank the following patterns are tested: 
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh 
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py 
+# *.f90 *.f *.for *.vhd *.vhdl
 
 FILE_PATTERNS          = *.c \
                          *.cc \
@@ -654,12 +703,13 @@ RECURSIVE              = NO
 
 # The EXCLUDE tag can be used to specify files and/or directories that should 
 # excluded from the INPUT source files. This way you can easily exclude a 
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# subdirectory from a directory tree whose root is specified with the INPUT tag. 
+# Note that relative paths are relative to directory from which doxygen is run.
 
 EXCLUDE                = 
 
 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
-# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# directories that are symbolic links (a Unix file system feature) are excluded 
 # from the input.
 
 EXCLUDE_SYMLINKS       = NO
@@ -720,8 +770,8 @@ INPUT_FILTER           =
 # basis.  Doxygen will compare the file name with each pattern and apply the 
 # filter if there is a match.  The filters are a list of the form: 
 # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
-# is applied to all files.
+# info on how filters are used. If FILTER_PATTERNS is empty or if 
+# non of the patterns match the file name, INPUT_FILTER is applied.
 
 FILTER_PATTERNS        = 
 
@@ -731,6 +781,14 @@ FILTER_PATTERNS        =
 
 FILTER_SOURCE_FILES    = NO
 
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file 
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) 
+# and it is also possible to disable source filtering for a specific pattern 
+# using *.ext= (so without naming a filter). This option only has effect when 
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS = 
+
 #---------------------------------------------------------------------------
 # configuration options related to source browsing
 #---------------------------------------------------------------------------
@@ -832,7 +890,14 @@ HTML_FILE_EXTENSION    = .html
 
 # The HTML_HEADER tag can be used to specify a personal HTML header for 
 # each generated HTML page. If it is left blank doxygen will generate a 
-# standard header.
+# standard header. Note that when using a custom header you are responsible  
+# for the proper inclusion of any scripts and style sheets that doxygen 
+# needs, which is dependent on the configuration options used. 
+# It is adviced to generate a default header using "doxygen -w html 
+# header.html footer.html stylesheet.css YourConfigFile" and then modify 
+# that header. Note that the header is subject to change so you typically 
+# have to redo this when upgrading to a newer version of doxygen or when 
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
 
 HTML_HEADER            = 
 
@@ -851,6 +916,40 @@ HTML_FOOTER            =
 
 HTML_STYLESHEET        = 
 
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or 
+# other source files which should be copied to the HTML output directory. Note 
+# that these files will be copied to the base HTML output directory. Use the 
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these 
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that 
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       = 
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. 
+# Doxygen will adjust the colors in the stylesheet and background images 
+# according to this color. Hue is specified as an angle on a colorwheel, 
+# see http://en.wikipedia.org/wiki/Hue for more information. 
+# For instance the value 0 represents red, 60 is yellow, 120 is green, 
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. 
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of 
+# the colors in the HTML output. For a value of 0 the output will use 
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to 
+# the luminance component of the colors in the HTML output. Values below 
+# 100 gradually make the output lighter, whereas values above 100 make 
+# the output darker. The value divided by 100 is the actual gamma applied, 
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, 
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 
 # page will contain the date and time when the page was generated. Setting 
 # this to NO can help when comparing the output of multiple runs.
@@ -879,7 +978,8 @@ HTML_DYNAMIC_SECTIONS  = NO
 # directory and running "make install" will install the docset in 
 # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
 # it at startup. 
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html 
+# for more information.
 
 GENERATE_DOCSET        = NO
 
@@ -897,6 +997,16 @@ DOCSET_FEEDNAME        = "Doxygen generated docs"
 
 DOCSET_BUNDLE_ID       = org.doxygen.Project
 
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify 
+# the documentation publisher. This should be a reverse domain-name style 
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.OpenNI
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = OpenNI
+
 # If the GENERATE_HTMLHELP tag is set to YES, additional index files 
 # will be generated that can be used as input for tools like the 
 # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 
@@ -941,10 +1051,10 @@ BINARY_TOC             = NO
 
 TOC_EXPAND             = NO
 
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 
-# are set, an additional index file will be generated that can be used as input for 
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 
-# HTML documentation.
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and 
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated 
+# that can be used as input for Qt's qhelpgenerator to generate a 
+# Qt Compressed Help (.qch) of the generated HTML documentation.
 
 GENERATE_QHP           = NO
 
@@ -966,20 +1076,24 @@ QHP_NAMESPACE          = org.doxygen.Project
 
 QHP_VIRTUAL_FOLDER     = doc
 
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. 
-# For more information please see 
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to 
+# add. For more information please see 
 # http://doc.trolltech.com/qthelpproject.html#custom-filters
 
 QHP_CUST_FILTER_NAME   = 
 
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see 
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the 
+# custom filter to add. For more information please see 
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters"> 
+# Qt Help Project / Custom Filters</a>.
 
 QHP_CUST_FILTER_ATTRS  = 
 
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's 
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this 
+# project's 
 # filter section matches. 
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes"> 
+# Qt Help Project / Filter Attributes</a>.
 
 QHP_SECT_FILTER_ATTRS  = 
 
@@ -991,12 +1105,12 @@ QHP_SECT_FILTER_ATTRS  =
 QHG_LOCATION           = 
 
 # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  
-# will be generated, which together with the HTML files, form an Eclipse help  
+# will be generated, which together with the HTML files, form an Eclipse help 
 # plugin. To install this plugin and make it available under the help contents 
 # menu in Eclipse, the contents of the directory containing the HTML and XML 
 # files needs to be copied into the plugins directory of eclipse. The name of 
 # the directory within the plugins directory should be the same as 
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before 
 # the help appears.
 
 GENERATE_ECLIPSEHELP   = NO
@@ -1013,8 +1127,10 @@ ECLIPSE_DOC_ID         = org.doxygen.Project
 
 DISABLE_INDEX          = NO
 
-# This tag can be used to set the number of enum values (range [1..20]) 
-# that doxygen will group on one line in the generated HTML documentation.
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values 
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML 
+# documentation. Note that a value of 0 will completely suppress the enum 
+# values from appearing in the overview section.
 
 ENUM_VALUES_PER_LINE   = 4
 
@@ -1039,6 +1155,11 @@ USE_INLINE_TREES       = NO
 
 TREEVIEW_WIDTH         = 250
 
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open 
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
 # Use this tag to change the font size of Latex formulas included 
 # as images in the HTML documentation. The default is 10. Note that 
 # when you change the font size after a successful doxygen run you need 
@@ -1047,22 +1168,55 @@ TREEVIEW_WIDTH         = 250
 
 FORMULA_FONTSIZE       = 10
 
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images 
+# generated for formulas are transparent PNGs. Transparent PNGs are 
+# not supported properly for IE 6.0, but are supported on all modern browsers. 
+# Note that when changing this option you need to delete any form_*.png files 
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax 
+# (see http://www.mathjax.org) which uses client side Javascript for the 
+# rendering instead of using prerendered bitmaps. Use this if you do not 
+# have LaTeX installed or if you want to formulas look prettier in the HTML 
+# output. When enabled you also need to install MathJax separately and 
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the 
+# HTML output directory using the MATHJAX_RELPATH option. The destination 
+# directory should contain the MathJax.js script. For instance, if the mathjax 
+# directory is located at the same level as the HTML output directory, then 
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the 
+# mathjax.org site, so you can quickly see the result without installing 
+# MathJax, but it is strongly recommended to install a local copy of MathJax 
+# before deployment.
+
+MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension 
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     = 
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box 
 # for the HTML output. The underlying search engine uses javascript 
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# and DHTML and should work on any modern browser. Note that when using 
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets 
 # (GENERATE_DOCSET) there is already a search function so this one should 
 # typically be disabled. For large projects the javascript based search engine 
 # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
 
 SEARCHENGINE           = NO
 
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a PHP enabled web server instead of at the web client
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be 
+# implemented using a PHP enabled web server instead of at the web client 
 # using Javascript. Doxygen will generate the search PHP script and index 
-# file to put on the web server. The advantage of the server
-# based approach is that it scales better to large projects and allows
-# full text search. The disadvances is that it is more difficult to setup 
+# file to put on the web server. The advantage of the server 
+# based approach is that it scales better to large projects and allows 
+# full text search. The disadvantages are that it is more difficult to setup 
 # and does not have live searching capabilities.
 
 SERVER_BASED_SEARCH    = NO
@@ -1103,7 +1257,7 @@ MAKEINDEX_CMD_NAME     = makeindex
 COMPACT_LATEX          = NO
 
 # The PAPER_TYPE tag can be used to set the paper type that is used 
-# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# by the printer. Possible values are: a4, letter, legal and 
 # executive. If left blank a4wide will be used.
 
 PAPER_TYPE             = a4wide
@@ -1120,6 +1274,13 @@ EXTRA_PACKAGES         =
 
 LATEX_HEADER           = 
 
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for 
+# the generated latex document. The footer should contain everything after 
+# the last chapter. If it is left blank doxygen will generate a 
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           = 
+
 # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
 # is prepared for conversion to pdf (using ps2pdf). The pdf file will 
 # contain links (just like the HTML output) instead of page references 
@@ -1146,13 +1307,19 @@ LATEX_BATCHMODE        = NO
 
 LATEX_HIDE_INDICES     = NO
 
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include 
+# source code with syntax highlighting in the LaTeX output. 
+# Note that which sources are shown also depends on other settings 
 # such as SOURCE_BROWSER.
 
 LATEX_SOURCE_CODE      = NO
 
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the 
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See 
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
 #---------------------------------------------------------------------------
 # configuration options related to the RTF output
 #---------------------------------------------------------------------------
@@ -1327,7 +1494,7 @@ MACRO_EXPANSION        = YES
 EXPAND_ONLY_PREDEF     = YES
 
 # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
 
 SEARCH_INCLUDES        = YES
 
@@ -1353,20 +1520,22 @@ INCLUDE_FILE_PATTERNS  =
 # instead of the = operator.
 
 PREDEFINED             = XN_CALLBACK_TYPE= \
-                         XN_API_DEPRECATED(x)=
+                         XN_API_DEPRECATED(x)= \
+                         __XN_NO_BC__ \
+                         XN_PLATFORM_VAARGS_TYPE=XN_PLATFORM_USE_WIN32_VAARGS_STYLE
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
 # this tag can be used to specify a list of macro names that should be expanded. 
 # The macro definition that is found in the sources will be used. 
-# Use the PREDEFINED tag if you want to use a different macro definition.
+# Use the PREDEFINED tag if you want to use a different macro definition that 
+# overrules the definition found in the source code.
 
 EXPAND_AS_DEFINED      = 
 
 # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
-# doxygen's preprocessor will remove all function-like macros that are alone 
-# on a line, have an all uppercase name, and do not end with a semicolon. Such 
-# function macros are typically used for boiler-plate code, and will confuse 
-# the parser if not removed.
+# doxygen's preprocessor will remove all references to function-like macros 
+# that are alone on a line, have an all uppercase name, and do not end with a 
+# semicolon, because these will confuse the parser if not removed.
 
 SKIP_FUNCTION_MACROS   = YES
 
@@ -1420,9 +1589,8 @@ PERL_PATH              = /usr/bin/perl
 # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
 # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
 # or super classes. Setting the tag to NO turns the diagrams off. Note that 
-# this option is superseded by the HAVE_DOT option below. This is only a 
-# fallback. It is recommended to install and use dot, since it yields more 
-# powerful graphs.
+# this option also works with HAVE_DOT disabled, but it is recommended to 
+# install and use dot, since it yields more powerful graphs.
 
 CLASS_DIAGRAMS         = YES
 
@@ -1448,14 +1616,20 @@ HIDE_UNDOC_RELATIONS   = YES
 
 HAVE_DOT               = YES
 
-# By default doxygen will write a font called FreeSans.ttf to the output 
-# directory and reference it in all dot files that doxygen generates. This 
-# font does not include all possible unicode characters however, so when you need 
-# these (or just want a differently looking font) you can specify the font name 
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font, 
-# which can be done by putting it in a standard location or by setting the 
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 
-# containing the font.
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is 
+# allowed to run in parallel. When set to 0 (the default) doxygen will 
+# base this on the number of processors available in the system. You can set it 
+# explicitly to a value larger than 0 to get control over the balance 
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that 
+# doxygen generates. When you want a differently looking font you can specify 
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find 
+# the font, which can be done by putting it in a standard location or by setting 
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the 
+# directory containing the font.
 
 DOT_FONTNAME           = FreeSans
 
@@ -1464,10 +1638,9 @@ DOT_FONTNAME           = FreeSans
 
 DOT_FONTSIZE           = 10
 
-# By default doxygen will tell dot to use the output directory to look for the 
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a 
-# different font using DOT_FONTNAME you can set the path where dot 
-# can find it using this tag.
+# By default doxygen will tell dot to use the Helvetica font. 
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to 
+# set the path where dot can find it.
 
 DOT_FONTPATH           = 
 
@@ -1532,7 +1705,7 @@ CALL_GRAPH             = NO
 CALLER_GRAPH           = NO
 
 # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
-# will graphical hierarchy of all classes instead of a textual one.
+# will generate a graphical hierarchy of all classes instead of a textual one.
 
 GRAPHICAL_HIERARCHY    = YES
 
@@ -1544,11 +1717,22 @@ GRAPHICAL_HIERARCHY    = YES
 DIRECTORY_GRAPH        = NO
 
 # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
-# generated by dot. Possible values are png, jpg, or gif 
-# If left blank png will be used.
+# generated by dot. Possible values are svg, png, jpg, or gif. 
+# If left blank png will be used. If you choose svg you need to set 
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files 
+# visible in IE 9+ (other browsers do not have this requirement).
 
 DOT_IMAGE_FORMAT       = png
 
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to 
+# enable generation of interactive SVG images that allow zooming and panning. 
+# Note that this requires a modern browser other than Internet Explorer. 
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you 
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files 
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
 # The tag DOT_PATH can be used to specify the path where the dot tool can be 
 # found. If left blank, it is assumed the dot tool can be found in the path.
 
@@ -1560,6 +1744,12 @@ DOT_PATH               =
 
 DOTFILE_DIRS           = 
 
+# The MSCFILE_DIRS tag can be used to specify one or more directories that 
+# contain msc files that are included in the documentation (see the 
+# \mscfile command).
+
+MSCFILE_DIRS           = 
+
 # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
 # nodes that will be shown in the graph. If the number of nodes in a graph 
 # becomes larger than this value, doxygen will truncate the graph, which is 
diff --git a/Source/DoxyGen/OpenNILogo.bmp b/Source/DoxyGen/OpenNILogo.bmp
new file mode 100644
index 0000000..dd17c33
Binary files /dev/null and b/Source/DoxyGen/OpenNILogo.bmp differ
diff --git a/Source/External/TinyXml/changes.txt b/Source/External/TinyXml/changes.txt
new file mode 100644
index 0000000..9d8c93b
--- /dev/null
+++ b/Source/External/TinyXml/changes.txt
@@ -0,0 +1,299 @@
+Changes in version 1.0.1:
+- Fixed comment tags which were outputing as '<?--' instead of 
+  the correct '<!--'.
+- Implemented the Next and Prev methods of the TiXmlAttribute class.
+- Renamed 'LastAttribtute' to 'LastAttribute'
+- Fixed bad pointer to 'isspace' that could occur while parsing text.
+- Errors finding beginning and end of tags no longer throw it into an
+  infinite loop. (Hopefully.)
+
+Changes in version 1.0.2
+- Minor documentation fixes.
+
+Changes in version 1.0.3
+- After nodes are added to a document, they return a pointer
+  to the new node instead of a bool for success.
+- Elements can be constructed with a value, which is the
+  element name. Every element must have a value or it will be
+  invalid, but the code changes to enforce this are not fully
+  in place.
+
+Changes in version 1.1.0
+- Added the	TiXmlAttributeSet class to pull the attributes into
+  a seperate container.
+- Moved the doubly liked list out of XmlBase. Now XmlBase only
+  requires the Print() function and defines some utility functions.
+- Moved errors into a seperate file. (With the idea of internationalization
+  to the other latin-1 languages.)
+- Added the "NodeType"
+- Fixed white space parsing in text to conform with the standard. 
+  Basically, all white space becomes just one space.
+- Added the TiXmlDeclaration class to read xml declarations.
+
+Changes in version 1.2.0
+- Removed the factory. The factory was not really in the spirit 
+  of small and simple, confused the code, and was of limited value.
+- Added FirstChildElement and NextSiblingElement, because they
+  are such common functions.
+- Re-wrote the example to test and demonstrate more functionality.
+
+Changes in version 1.2.1
+- Fixed a bug where comments couldn't be inside elements.
+- Loading now clears out existing XML rather than appending.
+- Added the "Clear" method on a node to delete all its children.
+
+Changes in version 1.2.2
+- Fixed TiXmlAttribute::Previous actually returning "next." Thanks
+  to Rickard Troedsson for the bug fix.
+
+Changes in version 1.2.3
+- Added the TIXML prefix to the error strings to resolve conflicts
+  with #defines in OS headers. Thanks to Steve Lhomme.
+- Fixed a delete buf that should be a delete [] buf. 
+  Thanks to Ephi Sinowitz.
+
+Changes in version 1.2.4
+- ReplaceChild() was almost guarenteed to fail. Should be fixed,
+  thanks to Joe Smith. Joe also pointed out that the Print() functions
+  should take stream references: I agree, and would like to overload
+  the Print() method to take either format, but I don't want to do 
+  this in a dot release.
+- Some compilers seem to need an extra <ctype.h> include. Thanks
+  to Steve Lhomme for that.
+
+Changes in version 2.0.0 BETA
+- Made the ToXXX() casts safe if 'this' is null. 
+  When "LoadFile" is called with a filename, the value will correctly get set.
+  Thanks to Brian Yoder.
+- Fixed bug where isalpha() and isalnum() would get called with a negative value for 
+  high ascii numbers. Thanks to Alesky Aksenov.
+- Fixed some errors codes that were not getting set.
+- Made methods "const" that were not.
+- Added a switch to enable or disable the ignoring of white space. ( TiXmlDocument::SetIgnoreWhiteSpace() )
+- Greater standardization and code re-use in the parser.
+- Added a stream out operator.
+- Added a stream in operator.
+- Entity support, of predefined entites. &#x entities are untouched by input or output.
+- Improved text out formatting.
+- Fixed ReplaceChild bug, thanks to Tao Chen.
+
+Changes in version 2.0.1
+- Fixed hanging on loading a 0 length file. Thanks to Jeff Scozzafava.
+- Fixed crashing on InsertBeforeChild and InsertAfterChild. Also possibility of bad links being
+  created by same function. Thanks to Frank De prins.
+- Added missing licence text. Thanks to Lars Willemsens.
+- Added <ctype.h> include, at the suggestion of Steve Walters.
+
+Changes in version 2.1.0
+- Yves Berquin brings us the STL switch. The forum on SourceForge, and various emails to
+  me, have long debated all out STL vs. no STL at all. And now you can have it both ways.
+  TinyXml will compile either way.
+
+Changes in version 2.1.1
+- Compilation warnings.
+
+Changes in version 2.1.2
+- Uneeded code is not compiled in the STL case.
+- Changed headers so that STL can be turned on or off in tinyxml.h
+
+Changes in version 2.1.3
+- Fixed non-const reference in API; now uses a pointer.
+- Copy constructor of TiXmlString not checking for assignment to self.
+- Nimrod Cohen found a truly evil bug in the STL implementation that occurs
+  when a string is converted to a c_str and then assigned to self. Search for
+  STL_STRING_BUG for a full description. I'm asserting this is a Microsoft STL
+  bug, since &string and string.c_str() should never be the same. Nevertheless,
+  the code works around it.
+- Urivan Saaib pointed out a compiler conflict, where the C headers define
+  the isblank macro, which was wiping out the TiXmlString::isblank() method.
+  The method was unused and has been removed.
+
+Changes in version 2.1.4
+- Reworked the entity code. Entities were not correctly surving round trip input and output.
+  Will now automatically create entities for high ascii in output.
+
+Changes in version 2.1.5
+- Bug fix by kylotan : infinite loop on some input (tinyxmlparser.cpp rev 1.27)
+- Contributed by Ivica Aracic (bytelord) : 1 new VC++ project to compile versions as static libraries (tinyxml_lib.dsp), 
+  and an example usage in xmltest.dsp
+  (Patch request ID 678605)
+- A suggestion by Ronald Fenner Jr (dormlock) to add #include <istream> and <ostream> for Apple's Project Builder 
+  (Patch request ID 697642)
+- A patch from ohommes that allows to parse correctly dots in element names and attribute names
+  (Patch request 602600 and kylotan 701728)
+- A patch from  hermitgeek ( James ) and wasteland for improper error reporting
+- Reviewed by Lee, with the following changes:
+	- Got sick of fighting the STL/non-STL thing in the windows build. Broke
+	  them out as seperate projects.
+	- I have too long not included the dsw. Added.
+	- TinyXmlText had a protected Print. Odd.
+	- Made LinkEndChild public, with docs and appropriate warnings.
+	- Updated the docs.
+
+2.2.0
+- Fixed an uninitialized pointer in the TiXmlAttributes
+- Fixed STL compilation problem in MinGW (and gcc 3?) - thanks Brian Yoder for finding this one
+- Fixed a syntax error in TiXmlDeclaration - thanks Brian Yoder
+- Fletcher Dunn proposed and submitted new error handling that tracked the row and column. Lee
+  modified it to not have performance impact.
+- General cleanup suggestions from Fletcher Dunn.
+- In error handling, general errors will no longer clear the error state of specific ones.
+- Fix error in documentation : comments starting with "<?--" instead of "<!--" (thanks ion_pulse)
+- Added the TiXmlHandle. An easy, safe way to browse XML DOMs with less code.
+- Added QueryAttribute calls which have better error messaging. (Proposed by Fletcher Dunn)
+- Nodes and attributes can now print themselves to strings. (Yves suggestion)
+- Fixed bug where entities with one character would confuse parser. (Thanks Roman)
+
+2.2.1
+- Additional testing (no more bugs found to be fixed in this release)
+- Significant performance improvement to the cursor code.
+
+2.3.0
+- User Data are now defined in TiXmlBase instead of TiXmlNode
+- Character Entities are now UCS-2
+- Character Entities can be decimal or hexadecimal
+- UTF-8 conversion.
+- Fixed many, many bugs.
+
+2.3.1
+- Fixed bug in handling nulls embedded in the input.
+- Make UTF-8 parser tolerant of bad text encoding.
+- Added encoding detection. 
+- Many fixes and input from John-Philip Leonard Johansson (JP) and Ellers, 
+  including UTF-8 feedback, bug reports, and patches. Thanks!
+- Added version # constants - a suggestion from JP and Ellers.
+- [ 979180 ] Missing ; in entity reference, fix from Rob Laveaux.
+- Copy constructors and assignment have been a long time coming. Thanks to
+  Fokke and JP.
+
+2.3.2
+- Made the IsAlpha and IsAlphaNum much more tolerant of non-UTF-8 encodings. Thanks
+  Volker Boerchers for finding the issue.
+- Ran the program though the magnificent Valgrind - http://valgrind.kde.org - to check
+  for memory errors. Fixed some minor issues.
+
+2.3.3
+- Fixed crash when test program was run from incorrect directory.
+- Fixed bug 1070717 - empty document not returned correctly - thanks Katsuhisa Yuasa.
+- Bug 1079301 resolved - deprecated stdlib calls. Thanks Adrian Boeing.
+- Bug 1035218 fixed - documentation errors. Xunji Luo
+- Other bug fixes have accumulated and been fixed on the way as well; my apologies to
+  authors not credited!
+- Big fix / addition is to correctly return const values. TinyXml could basically
+  remove const in a method like this: TiXmlElement* Foo() const, where the returned element
+  was a pointer to internal data. That is now: const TiXmlElement* Foo() const and
+  TiXmlElement* Foo().
+
+2.3.4
+- Fixed additional const errors, thanks Kent Gibson.
+- Correctly re-enable warnings after tinyxml header. Thanks Cory Nelson.
+- Variety of type cleanup and warning fixes. Thanks Warren Stevens.
+- Cleaned up unneeded constructor calls in TinyString - thanks to Geoff Carlton and
+  the discussion group on sourceforge.
+
+2.4.0
+- Improved string class, thanks Tyge Lovset (whose name gets mangled in English - sorry)
+- Type cast compiler warning, thanks Rob van den Bogaard
+- Added GetText() convenience function. Thanks Ilya Parniuk & Andrew Ellers for input.
+- Many thanks to marlonism for finding an infinite loop in bad xml.
+- A patch to cleanup warnings from Robert Gebis.
+- Added ValueStr() to get the value of a node as a string.
+- TiXmlText can now parse and output as CDATA
+- Additional string improvement from James (z2895)
+- Removed extraneous 'const', thanks David Aldrich
+- First pass at switching to the "safe" stdlib functions. Many people have suggested and
+  pushed on this, but Warren Stevens put together the first proposal.
+- TinyXml now will do EOL normalization before parsing, consistent with the W3C XML spec.
+- Documents loaded with the UTF-8 BOM will now save with the UTF-8 BOM. Good suggestion 
+  from 'instructor_'
+- Ellers submitted his very popular tutorials, which have been added to the distribution.
+
+2.4.1
+- Fixed CDATA output formatting
+- Fixed memory allocators in TinyString to work with overloaded new/delete
+
+2.4.2
+- solosnake pointed out that TIXML_LOG causes problems on an XBOX. The definition in the header
+  was superflous and was moved inside of DEBUG_PARSING
+
+2.4.3
+- Fixed a test bug that caused a crash in 'xmltest'. TinyXML was fine, but it isn't good
+  to ship with a broken test suite.
+- Started converting some functions to not cast between std::string and const char* 
+  quite as often.
+- Added FILE* versions of the document loads - good suggestion from Wade Brainerd
+- Empty documents might not always return the errors they should. [1398915] Thanks to igor v.
+- Added some asserts for multiply adding a node, regardng bug [1391937] suggested by Paco Arjonilla.
+
+2.4.4
+- Bug find thanks to andre-gross found a memory leak that occured when a document failed to load.
+- Bug find (and good analysis) by VirtualJim who found a case where attribute parsing 
+  should be throwing an error and wasn't.
+- Steve Hyatt suggested the QueryValueAttribute method, which is now implemented.
+- DavidA identified a chunk of dead code.
+- Andrew Baxter sent in some compiler warnings that were good clean up points.
+
+2.5
+- Added the Visit() API. Many thanks to both Andrew Ellerton and John-Philip for all their
+  work, code, suggestion, and just general pushing that it should be done.
+- Removed existing streaming code and use TiXmlPrinter instead.
+- [ tinyxml-Bugs-1527079 ] Compile error in tinystr.cpp fixed, thanks to Paul Suggs
+- [ tinyxml-Bugs-1522890 ] SaveFile has no error checks fixed, thanks to Ivan Dobrokotov
+- Ivan Dobrokotov also reported redundant memory allocation in the Attribute() method, which
+  upon investigation was a mess. The attribute should now be fixed for both const char* and 
+  std::string, and the return types match the input parameters.
+- Feature [ 1511105 ] Make TiXmlComment constructor accept a string / char*, implemented.
+  Thanks to Karl Itschen for the feedback.
+- [ 1480108 ] Stream parsing fails when CDATA contains tags was found by Tobias Grimm, who also
+  submitted a test case and patch. A significant bug in CDATA streaming (operator>>) has now
+  been fixed.
+
+2.5.2
+- Lieven, and others, pointed out a missing const-cast that upset the Open Watcom compiler.
+  Should now be fixed.
+- ErrorRow and ErrorCol should have been const, and weren't. Fixed thanks to Dmitry Polutov.
+
+2.5.3
+- zloe_zlo identified a missing string specialization for QueryValueAttribute() [ 1695429 ]. Worked
+  on this bug, but not sure how to fix it in a safe, cross-compiler way.
+- increased warning level to 4 and turned on detect 64 bit portability issues for VC2005.
+  May address [ 1677737 ] VS2005: /Wp64 warnings
+- grosheck identified several problems with the Document copy. Many thanks for [ 1660367 ]
+- Nice catch, and suggested fix, be Gilad Novik on the Printer dropping entities.
+  "[ 1600650 ] Bug when printing xml text" is now fixed.
+- A subtle fix from Nicos Gollan in the tinystring initializer: 
+  [ 1581449 ] Fix initialiser of TiXmlString::nullrep_
+- Great catch, although there isn't a submitter for the bug. [ 1475201 ] TinyXML parses entities in comments. 
+  Comments should not, in fact, parse entities. Fixed the code path and added tests.
+- We were not catching all the returns from ftell. Thanks to Bernard for catching that.
+  
+2.5.4
+- A TiXMLDocument can't be a sub-node. Block this from happening in the 'replace'. Thanks Noam.
+- [ 1714831 ] TiXmlBase::location is not copied by copy-ctors, fix reported and suggested by Nicola Civran.
+- Fixed possible memory overrun in the comment reading code - thanks gcarlton77
+
+2.5.5
+- Alex van der Wal spotted incorrect types (lf) being used in print and scan. robertnestor pointed out some problems with the simple solution. Types updated.
+- Johannes Hillert pointed out some bug typos.
+- Christian Mueller identified inconsistent error handling with Attributes.
+- olivier barthelemy also reported a problem with double truncation, also related to the %lf issue.
+- zaelsius came up with a great (and simple) suggestion to fix QueryValueAttribute truncating strings.
+- added some null pointer checks suggested by hansenk
+- Sami Väisänen found a (rare) buffer overrun that could occur in parsing.
+- vi tri filed a bug that led to a refactoring of the attribute setting mess (as well as adding a missing SetDoubleAttribute() )
+- removed TIXML_ERROR_OUT_OF_MEMORY. TinyXML does not systematically address OOO, and the notion it does is misleading.
+- vanneto, keithmarshall, others all reported the warning from IsWhiteSpace() usage. Cleaned this up - many thanks to everyone who reported this one.
+- tibur found a bug in end tag parsing
+
+
+2.6.2
+- Switched over to VC 2010
+- Fixed up all the build issues arising from that. (Lots of latent build problems.)
+- Removed the old, now unmaintained and likely not working, build files.
+- Fixed some static analysis issues reported by orbitcowboy from cppcheck. 
+- Bayard 95 sent in analysis from a different analyzer - fixes applied from that as well.
+- Tim Kosse sent a patch fixing an infinite loop.
+- Ma Anguo identified a doc issue.
+- Eddie Cohen identified a missing qualifier resulting in a compilation error on some systems.
+- Fixed a line ending bug. (What year is this? Can we all agree on a format for text files? Please? ...oh well.)
+
diff --git a/Source/External/TinyXml/docs/annotated.html b/Source/External/TinyXml/docs/annotated.html
new file mode 100644
index 0000000..a40de88
--- /dev/null
+++ b/Source/External/TinyXml/docs/annotated.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>Class List</h1>Here are the classes, structs, unions and interfaces with brief descriptions:<table>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td class="indexvalue">An attribute is a name-value pair </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td class="indexvalue"><a class="el" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a> is a base class for every class in TinyXml </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td class="indexvalue">An XML comment </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td class="indexvalue">In correct XML the declaration is the first entry in the file </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td class="indexvalue">Always the top level node </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td class="indexvalue">The element is a container class </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td class="indexvalue">A <a class="el" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> is a class that wraps a node pointer with null checks; this is an incredibly useful thing </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td class="indexvalue">The parent class for everything in the Document Object Model </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td class="indexvalue">Print to memory functionality </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td class="indexvalue">XML text </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td class="indexvalue">Any tag that tinyXml doesn't recognize is saved as an unknown </td></tr>
+  <tr><td class="indexkey"><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td class="indexvalue">Implements the interface to the "Visitor pattern" (see the Accept() method </td></tr>
+</table>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlAttribute-members.html b/Source/External/TinyXml/docs/classTiXmlAttribute-members.html
new file mode 100644
index 0000000..1ce019b
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlAttribute-members.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlAttribute Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a2880ddef53fc7522c99535273954d230">DoubleValue</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#aa1a20ad59dc7e89a0ab265396360d50f">IntValue</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a298a57287d305904ba6bd96ae6f78d3d">Name</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a1c78e92e223a40843f644ba48ef69f67">Next</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a6ebbfe333fe76cd834bd6cbcca3130cf">Previous</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#acc04956c1d5c4c31fe74f7a7528d109a">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#ac87b2a8489906a5d7aa2875f20be3513">QueryDoubleValue</a>(double *_value) const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#ad6c93088ee21af41a107931223339344">QueryIntValue</a>(int *_value) const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a0316da31373496c4368ad549bf711394">SetDoubleValue</a>(double _value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a7e065df640116a62ea4f4b7da5449cc8">SetIntValue</a>(int _value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#ab7fa3d21ff8d7c5764cf9af15b667a99">SetName</a>(const char *_name)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#ab296ff0c9a8c701055cd257a8a976e57">SetName</a>(const std::string &_name)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a2dae44178f668b3cb48101be4f2236a0">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#ab43f67a0cc3ec1d80e62606500f0925f">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a9cfa3c8179873fd485d83003b114f8e1">TiXmlAttribute</a>()</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a052213522caac3979960e0714063861d">TiXmlAttribute</a>(const std::string &_name, const std::string &_value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a759d0b76fb8fcf765ecab243bc14f05e">TiXmlAttribute</a>(const char *_name, const char *_value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a0f874490eac8ca00ee0070765d0e97e3">Value</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a87705c3ccf9ee9417beb4f7cbacd4d33">ValueStr</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlAttribute.html b/Source/External/TinyXml/docs/classTiXmlAttribute.html
new file mode 100644
index 0000000..284971c
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlAttribute.html
@@ -0,0 +1,173 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlAttribute Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlAttribute Class Reference</h1><!-- doxytag: class="TiXmlAttribute" --><!-- doxytag: inherits="TiXmlBase" -->
+<p>An attribute is a name-value pair.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlAttribute:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlAttribute.png" usemap="#TiXmlAttribute_map" alt=""/>
+  <map id="TiXmlAttribute_map" name="TiXmlAttribute_map">
+<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,90,24"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlAttribute-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9cfa3c8179873fd485d83003b114f8e1"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="a9cfa3c8179873fd485d83003b114f8e1" args="()" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a9cfa3c8179873fd485d83003b114f8e1">TiXmlAttribute</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an empty attribute. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a052213522caac3979960e0714063861d"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="a052213522caac3979960e0714063861d" args="(const std::string &_name, const std::string &_value)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a052213522caac3979960e0714063861d">TiXmlAttribute</a> (const std::string &_name, const std::string &_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">std::string constructor. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a759d0b76fb8fcf765ecab243bc14f05e"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="a759d0b76fb8fcf765ecab243bc14f05e" args="(const char *_name, const char *_value)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a759d0b76fb8fcf765ecab243bc14f05e">TiXmlAttribute</a> (const char *_name, const char *_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an attribute with a name and value. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a298a57287d305904ba6bd96ae6f78d3d"></a><!-- doxytag: member="TiXmlAttribute::Name" ref="a298a57287d305904ba6bd96ae6f78d3d" args="() const " -->
+const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a298a57287d305904ba6bd96ae6f78d3d">Name</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the name of this attribute. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0f874490eac8ca00ee0070765d0e97e3"></a><!-- doxytag: member="TiXmlAttribute::Value" ref="a0f874490eac8ca00ee0070765d0e97e3" args="() const " -->
+const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a0f874490eac8ca00ee0070765d0e97e3">Value</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of this attribute. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a87705c3ccf9ee9417beb4f7cbacd4d33"></a><!-- doxytag: member="TiXmlAttribute::ValueStr" ref="a87705c3ccf9ee9417beb4f7cbacd4d33" args="() const " -->
+const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a87705c3ccf9ee9417beb4f7cbacd4d33">ValueStr</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of this attribute. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa1a20ad59dc7e89a0ab265396360d50f"></a><!-- doxytag: member="TiXmlAttribute::IntValue" ref="aa1a20ad59dc7e89a0ab265396360d50f" args="() const " -->
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#aa1a20ad59dc7e89a0ab265396360d50f">IntValue</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of this attribute, converted to an integer. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2880ddef53fc7522c99535273954d230"></a><!-- doxytag: member="TiXmlAttribute::DoubleValue" ref="a2880ddef53fc7522c99535273954d230" args="() const " -->
+double </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a2880ddef53fc7522c99535273954d230">DoubleValue</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of this attribute, converted to a double. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#ad6c93088ee21af41a107931223339344">QueryIntValue</a> (int *_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryIntValue examines the value string.  <a href="#ad6c93088ee21af41a107931223339344"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac87b2a8489906a5d7aa2875f20be3513"></a><!-- doxytag: member="TiXmlAttribute::QueryDoubleValue" ref="ac87b2a8489906a5d7aa2875f20be3513" args="(double *_value) const " -->
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#ac87b2a8489906a5d7aa2875f20be3513">QueryDoubleValue</a> (double *_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryDoubleValue examines the value string. See <a class="el" href="classTiXmlAttribute.html#ad6c93088ee21af41a107931223339344" title="QueryIntValue examines the value string.">QueryIntValue()</a>. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab7fa3d21ff8d7c5764cf9af15b667a99"></a><!-- doxytag: member="TiXmlAttribute::SetName" ref="ab7fa3d21ff8d7c5764cf9af15b667a99" args="(const char *_name)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#ab7fa3d21ff8d7c5764cf9af15b667a99">SetName</a> (const char *_name)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the name of this attribute. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2dae44178f668b3cb48101be4f2236a0"></a><!-- doxytag: member="TiXmlAttribute::SetValue" ref="a2dae44178f668b3cb48101be4f2236a0" args="(const char *_value)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a2dae44178f668b3cb48101be4f2236a0">SetValue</a> (const char *_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the value. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7e065df640116a62ea4f4b7da5449cc8"></a><!-- doxytag: member="TiXmlAttribute::SetIntValue" ref="a7e065df640116a62ea4f4b7da5449cc8" args="(int _value)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a7e065df640116a62ea4f4b7da5449cc8">SetIntValue</a> (int _value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the value from an integer. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0316da31373496c4368ad549bf711394"></a><!-- doxytag: member="TiXmlAttribute::SetDoubleValue" ref="a0316da31373496c4368ad549bf711394" args="(double _value)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a0316da31373496c4368ad549bf711394">SetDoubleValue</a> (double _value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the value from a double. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab296ff0c9a8c701055cd257a8a976e57"></a><!-- doxytag: member="TiXmlAttribute::SetName" ref="ab296ff0c9a8c701055cd257a8a976e57" args="(const std::string &_name)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#ab296ff0c9a8c701055cd257a8a976e57">SetName</a> (const std::string &_name)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab43f67a0cc3ec1d80e62606500f0925f"></a><!-- doxytag: member="TiXmlAttribute::SetValue" ref="ab43f67a0cc3ec1d80e62606500f0925f" args="(const std::string &_value)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#ab43f67a0cc3ec1d80e62606500f0925f">SetValue</a> (const std::string &_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1c78e92e223a40843f644ba48ef69f67"></a><!-- doxytag: member="TiXmlAttribute::Next" ref="a1c78e92e223a40843f644ba48ef69f67" args="() const " -->
+const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a1c78e92e223a40843f644ba48ef69f67">Next</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the next sibling attribute in the DOM. Returns null at end. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6ebbfe333fe76cd834bd6cbcca3130cf"></a><!-- doxytag: member="TiXmlAttribute::Previous" ref="a6ebbfe333fe76cd834bd6cbcca3130cf" args="() const " -->
+const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a6ebbfe333fe76cd834bd6cbcca3130cf">Previous</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the previous sibling attribute in the DOM. Returns null at beginning. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#acc04956c1d5c4c31fe74f7a7528d109a">Print</a> (FILE *cfile, int depth) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.  <a href="#acc04956c1d5c4c31fe74f7a7528d109a"></a><br/></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>An attribute is a name-value pair. </p>
+<p>Elements have an arbitrary number of attributes, each with a unique name.</p>
+<dl class="note"><dt><b>Note:</b></dt><dd>The attributes are not TiXmlNodes, since they are not part of the tinyXML document object model. There are other suggested ways to look at this problem. </dd></dl>
+<hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="acc04956c1d5c4c31fe74f7a7528d109a"></a><!-- doxytag: member="TiXmlAttribute::Print" ref="acc04956c1d5c4c31fe74f7a7528d109a" args="(FILE *cfile, int depth) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual void TiXmlAttribute::Print </td>
+          <td>(</td>
+          <td class="paramtype">FILE * </td>
+          <td class="paramname"> <em>cfile</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>depth</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const<code> [inline, virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. </p>
+<p>) Either or both cfile and str can be null.</p>
+<p>This is a formatted print, and will insert tabs and newlines.</p>
+<p>(For an unformatted stream, use the << operator.) </p>
+
+<p>Implements <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ad6c93088ee21af41a107931223339344"></a><!-- doxytag: member="TiXmlAttribute::QueryIntValue" ref="ad6c93088ee21af41a107931223339344" args="(int *_value) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int TiXmlAttribute::QueryIntValue </td>
+          <td>(</td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"> <em>_value</em></td>
+          <td> ) </td>
+          <td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>QueryIntValue examines the value string. </p>
+<p>It is an alternative to the <a class="el" href="classTiXmlAttribute.html#aa1a20ad59dc7e89a0ab265396360d50f" title="Return the value of this attribute, converted to an integer.">IntValue()</a> method with richer error checking. If the value is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE.</p>
+<p>A specialized but useful call. Note that for success it returns 0, which is the opposite of almost all other TinyXml calls. </p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlAttribute.png b/Source/External/TinyXml/docs/classTiXmlAttribute.png
new file mode 100644
index 0000000..0f8e593
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlAttribute.png differ
diff --git a/Source/External/TinyXml/docs/classTiXmlBase-members.html b/Source/External/TinyXml/docs/classTiXmlBase-members.html
new file mode 100644
index 0000000..df6a52f
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlBase-members.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlBase Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlBase.html">TiXmlBase</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">Print</a>(FILE *cfile, int depth) const =0</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [pure virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlBase.html b/Source/External/TinyXml/docs/classTiXmlBase.html
new file mode 100644
index 0000000..a6fe95b
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlBase.html
@@ -0,0 +1,226 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlBase Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlBase Class Reference</h1><!-- doxytag: class="TiXmlBase" -->
+<p><a class="el" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a> is a base class for every class in TinyXml.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlBase:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlBase.png" usemap="#TiXmlBase_map" alt=""/>
+  <map id="TiXmlBase_map" name="TiXmlBase_map">
+<area href="classTiXmlAttribute.html" alt="TiXmlAttribute" shape="rect" coords="0,56,108,80"/>
+<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="295,56,403,80"/>
+<area href="classTiXmlComment.html" alt="TiXmlComment" shape="rect" coords="0,112,108,136"/>
+<area href="classTiXmlDeclaration.html" alt="TiXmlDeclaration" shape="rect" coords="118,112,226,136"/>
+<area href="classTiXmlDocument.html" alt="TiXmlDocument" shape="rect" coords="236,112,344,136"/>
+<area href="classTiXmlElement.html" alt="TiXmlElement" shape="rect" coords="354,112,462,136"/>
+<area href="classTiXmlText.html" alt="TiXmlText" shape="rect" coords="472,112,580,136"/>
+<area href="classTiXmlUnknown.html" alt="TiXmlUnknown" shape="rect" coords="590,112,698,136"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlBase-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">Print</a> (FILE *cfile, int depth) const =0</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.  <a href="#a0de56b3f2ef14c65091a3b916437b512"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">Row</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the position, in the original source file, of this node or attribute.  <a href="#a024bceb070188df92c2a8d8852dd0853"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab54bfb9b70fe6dd276e7b279cab7f003"></a><!-- doxytag: member="TiXmlBase::Column" ref="ab54bfb9b70fe6dd276e7b279cab7f003" args="() const " -->
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">Column</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">See <a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853" title="Return the position, in the original source file, of this node or attribute.">Row()</a>. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac6b3e0f790930d4970ec30764e937b5d"></a><!-- doxytag: member="TiXmlBase::SetUserData" ref="ac6b3e0f790930d4970ec30764e937b5d" args="(void *user)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">SetUserData</a> (void *user)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a pointer to arbitrary user data. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6559a530ca6763fc301a14d77ed28c17"></a><!-- doxytag: member="TiXmlBase::GetUserData" ref="a6559a530ca6763fc301a14d77ed28c17" args="()" -->
+void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">GetUserData</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a pointer to arbitrary user data. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad0120210e4680ef2088601753ce0ede4"></a><!-- doxytag: member="TiXmlBase::GetUserData" ref="ad0120210e4680ef2088601753ce0ede4" args="() const " -->
+const void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">GetUserData</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a pointer to arbitrary user data. <br/></td></tr>
+<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a> (bool condense)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">The world does not agree on whether white space should be kept or not.  <a href="#a0f799ec645bfb8d8a969e83478f379c1"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad4b1472531c647a25b1840a87ae42438"></a><!-- doxytag: member="TiXmlBase::IsWhiteSpaceCondensed" ref="ad4b1472531c647a25b1840a87ae42438" args="()" -->
+static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the current white space setting. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">EncodeString</a> (const TIXML_STRING &str, TIXML_STRING *out)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Expands entities in a string.  <a href="#a6bd8c315c1acb09e34107b8736505948"></a><br/></td></tr>
+<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab242c01590191f644569fa89a080d97c"></a><!-- doxytag: member="TiXmlBase::userData" ref="ab242c01590191f644569fa89a080d97c" args="" -->
+void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">userData</a></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Field containing a generic user pointer. <br/></td></tr>
+<tr><td colspan="2"><h2>Friends</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a218872a0d985ae30e78c55adc4bdb196"></a><!-- doxytag: member="TiXmlBase::TiXmlNode" ref="a218872a0d985ae30e78c55adc4bdb196" args="" -->
+class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#a218872a0d985ae30e78c55adc4bdb196">TiXmlNode</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab6592e32cb9132be517cc12a70564c4b"></a><!-- doxytag: member="TiXmlBase::TiXmlElement" ref="ab6592e32cb9132be517cc12a70564c4b" args="" -->
+class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#ab6592e32cb9132be517cc12a70564c4b">TiXmlElement</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a173617f6dfe902cf484ce5552b950475"></a><!-- doxytag: member="TiXmlBase::TiXmlDocument" ref="a173617f6dfe902cf484ce5552b950475" args="" -->
+class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#a173617f6dfe902cf484ce5552b950475">TiXmlDocument</a></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p><a class="el" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a> is a base class for every class in TinyXml. </p>
+<p>It does little except to establish that TinyXml classes can be printed and provide some utility functions.</p>
+<p>In XML, the document and elements can contain other elements and other types of nodes.</p>
+<div class="fragment"><pre class="fragment">
+	A Document can contain:	Element	(container or leaf)
+							Comment (leaf)
+							Unknown (leaf)
+							Declaration( leaf )
+
+	An Element can contain:	Element (container or leaf)
+							Text	(leaf)
+							Attributes (not on tree)
+							Comment (leaf)
+							Unknown (leaf)
+
+	A Decleration contains: Attributes (not on tree)
+	</pre></div> <hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="a6bd8c315c1acb09e34107b8736505948"></a><!-- doxytag: member="TiXmlBase::EncodeString" ref="a6bd8c315c1acb09e34107b8736505948" args="(const TIXML_STRING &str, TIXML_STRING *out)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void TiXmlBase::EncodeString </td>
+          <td>(</td>
+          <td class="paramtype">const TIXML_STRING & </td>
+          <td class="paramname"> <em>str</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">TIXML_STRING * </td>
+          <td class="paramname"> <em>out</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td><code> [static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Expands entities in a string. </p>
+<p>Note this should not contian the tag's '<', '>', etc, or they will be transformed into entities! </p>
+
+</div>
+</div>
+<a class="anchor" id="a0de56b3f2ef14c65091a3b916437b512"></a><!-- doxytag: member="TiXmlBase::Print" ref="a0de56b3f2ef14c65091a3b916437b512" args="(FILE *cfile, int depth) const =0" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual void TiXmlBase::Print </td>
+          <td>(</td>
+          <td class="paramtype">FILE * </td>
+          <td class="paramname"> <em>cfile</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>depth</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const<code> [pure virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. </p>
+<p>) Either or both cfile and str can be null.</p>
+<p>This is a formatted print, and will insert tabs and newlines.</p>
+<p>(For an unformatted stream, use the << operator.) </p>
+
+<p>Implemented in <a class="el" href="classTiXmlAttribute.html#acc04956c1d5c4c31fe74f7a7528d109a">TiXmlAttribute</a>, <a class="el" href="classTiXmlElement.html#afbf52736e70fc91ec9d760721d6f4fd2">TiXmlElement</a>, <a class="el" href="classTiXmlComment.html#a6b316527aaa8da0370cd68c22a5a0f5f">TiXmlComment</a>, <a class="el" href="classTiXmlText.html#a0cafbf6f236c7f02d12b2bffc2b7976b">TiXmlText</a>, <a class="el" href="classTiXmlDeclaration.html#abf6303db4bd05b5be554036817ff1cb4">TiXmlDeclaration</a>, <a class="el" href="classTiXmlUnknown.html#a31ba089a40fb5a1869750fce09b0bacb">TiXmlUnknown</a>, and <a class="el" href="classTiXmlDocument.html#a8701fda1fa31b25abbc9c0df42da10e8">TiXmlDocument</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a024bceb070188df92c2a8d8852dd0853"></a><!-- doxytag: member="TiXmlBase::Row" ref="a024bceb070188df92c2a8d8852dd0853" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int TiXmlBase::Row </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return the position, in the original source file, of this node or attribute. </p>
+<p>The row and column are 1-based. (That is the first row and first column is 1,1). If the returns values are 0 or less, then the parser does not have a row and column value.</p>
+<p>Generally, the row and column value will be set when the TiXmlDocument::Load(), <a class="el" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f" title="Load a file using the current document value.">TiXmlDocument::LoadFile()</a>, or any TiXmlNode::Parse() is called. It will NOT be set when the DOM was created from operator>>.</p>
+<p>The values reflect the initial load. Once the DOM is modified programmatically (by adding or changing nodes and attributes) the new values will NOT update to reflect changes in the document.</p>
+<p>There is a minor performance cost to computing the row and column. Computation can be disabled if <a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e" title="SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to...">TiXmlDocument::SetTabSize()</a> is called with 0 as the value.</p>
+<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e" title="SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to...">TiXmlDocument::SetTabSize()</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a0f799ec645bfb8d8a969e83478f379c1"></a><!-- doxytag: member="TiXmlBase::SetCondenseWhiteSpace" ref="a0f799ec645bfb8d8a969e83478f379c1" args="(bool condense)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">static void TiXmlBase::SetCondenseWhiteSpace </td>
+          <td>(</td>
+          <td class="paramtype">bool </td>
+          <td class="paramname"> <em>condense</em></td>
+          <td> ) </td>
+          <td><code> [inline, static]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>The world does not agree on whether white space should be kept or not. </p>
+<p>In order to make everyone happy, these global, static functions are provided to set whether or not TinyXml will condense all white space into a single space or not. The default is to condense. Note changing this value is not thread safe. </p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlBase.png b/Source/External/TinyXml/docs/classTiXmlBase.png
new file mode 100644
index 0000000..ca9d0de
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlBase.png differ
diff --git a/Source/External/TinyXml/docs/classTiXmlComment-members.html b/Source/External/TinyXml/docs/classTiXmlComment-members.html
new file mode 100644
index 0000000..b34941b
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlComment-members.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlComment Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlComment.html">TiXmlComment</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#af3ac1b99fbbe9ea4fb6e14146156e43e">Accept</a>(TiXmlVisitor *visitor) const </td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#a0d6662bdc52488b9e12b3c7a0453d028">Clone</a>() const </td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#accda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#adfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#a6b316527aaa8da0370cd68c22a5a0f5f">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#aaa3252031d3e8bd3a2bf51a1c61201b7">TiXmlComment</a>()</td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#a37e7802ef17bc03ebe5ae79bf0713d47">TiXmlComment</a>(const char *_value)</td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#a00fb4215c20a2399ea05ac9b9e7e68a0">ToComment</a>() const </td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#acc7c7e07e13c23f17797d642981511df">ToComment</a>()</td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlComment.html b/Source/External/TinyXml/docs/classTiXmlComment.html
new file mode 100644
index 0000000..cc7bf09
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlComment.html
@@ -0,0 +1,115 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlComment Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlComment Class Reference</h1><!-- doxytag: class="TiXmlComment" --><!-- doxytag: inherits="TiXmlNode" -->
+<p>An XML comment.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlComment:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlComment.png" usemap="#TiXmlComment_map" alt=""/>
+  <map id="TiXmlComment_map" name="TiXmlComment_map">
+<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,94,80"/>
+<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,94,24"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlComment-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa3252031d3e8bd3a2bf51a1c61201b7"></a><!-- doxytag: member="TiXmlComment::TiXmlComment" ref="aaa3252031d3e8bd3a2bf51a1c61201b7" args="()" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#aaa3252031d3e8bd3a2bf51a1c61201b7">TiXmlComment</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs an empty comment. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a37e7802ef17bc03ebe5ae79bf0713d47"></a><!-- doxytag: member="TiXmlComment::TiXmlComment" ref="a37e7802ef17bc03ebe5ae79bf0713d47" args="(const char *_value)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#a37e7802ef17bc03ebe5ae79bf0713d47">TiXmlComment</a> (const char *_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct a comment from text. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0d6662bdc52488b9e12b3c7a0453d028"></a><!-- doxytag: member="TiXmlComment::Clone" ref="a0d6662bdc52488b9e12b3c7a0453d028" args="() const " -->
+virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#a0d6662bdc52488b9e12b3c7a0453d028">Clone</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a copy of this Comment. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#a6b316527aaa8da0370cd68c22a5a0f5f">Print</a> (FILE *cfile, int depth) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.  <a href="#a6b316527aaa8da0370cd68c22a5a0f5f"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a00fb4215c20a2399ea05ac9b9e7e68a0"></a><!-- doxytag: member="TiXmlComment::ToComment" ref="a00fb4215c20a2399ea05ac9b9e7e68a0" args="() const " -->
+virtual const <a class="el" href="classTiXmlComment.html">TiXmlComment</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#a00fb4215c20a2399ea05ac9b9e7e68a0">ToComment</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acc7c7e07e13c23f17797d642981511df"></a><!-- doxytag: member="TiXmlComment::ToComment" ref="acc7c7e07e13c23f17797d642981511df" args="()" -->
+virtual <a class="el" href="classTiXmlComment.html">TiXmlComment</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#acc7c7e07e13c23f17797d642981511df">ToComment</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af3ac1b99fbbe9ea4fb6e14146156e43e"></a><!-- doxytag: member="TiXmlComment::Accept" ref="af3ac1b99fbbe9ea4fb6e14146156e43e" args="(TiXmlVisitor *visitor) const " -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#af3ac1b99fbbe9ea4fb6e14146156e43e">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *visitor) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br/></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>An XML comment. </p>
+<hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="a6b316527aaa8da0370cd68c22a5a0f5f"></a><!-- doxytag: member="TiXmlComment::Print" ref="a6b316527aaa8da0370cd68c22a5a0f5f" args="(FILE *cfile, int depth) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual void TiXmlComment::Print </td>
+          <td>(</td>
+          <td class="paramtype">FILE * </td>
+          <td class="paramname"> <em>cfile</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>depth</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const<code> [virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. </p>
+<p>) Either or both cfile and str can be null.</p>
+<p>This is a formatted print, and will insert tabs and newlines.</p>
+<p>(For an unformatted stream, use the << operator.) </p>
+
+<p>Implements <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>.</p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlComment.png b/Source/External/TinyXml/docs/classTiXmlComment.png
new file mode 100644
index 0000000..5fb1d1d
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlComment.png differ
diff --git a/Source/External/TinyXml/docs/classTiXmlDeclaration-members.html b/Source/External/TinyXml/docs/classTiXmlDeclaration-members.html
new file mode 100644
index 0000000..dea10fe
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlDeclaration-members.html
@@ -0,0 +1,113 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlDeclaration Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#a22315a535983b86535cdba3458669e3e">Accept</a>(TiXmlVisitor *visitor) const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#a7cf459186040141cda7a180a6585ce2e">Clone</a>() const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#a5d974231f9e9a2f0542f15f3a46cdb76">Encoding</a>() const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#accda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#adfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#abf6303db4bd05b5be554036817ff1cb4">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#a9ff06afc033d7ef730ec7c6825b97ad9">Standalone</a>() const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#aa0484d059bea0ea1acb47c9094382d79">TiXmlDeclaration</a>()</td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#acd5556007c3c72209465081de39d9836">TiXmlDeclaration</a>(const std::string &_version, const std::string &_encoding, const std::string &_standalone)</td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#a3b618d1c30c25e4b7a71f31a595ee298">TiXmlDeclaration</a>(const char *_version, const char *_encoding, const char *_standalone)</td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#a1e085d3fefd1dbf5ccdbff729931a967">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#a6bd3d1daddcaeb9543c24bfd090969ce">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#a02ee557b1a4545c3219ed377c103ec76">Version</a>() const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlDeclaration.html b/Source/External/TinyXml/docs/classTiXmlDeclaration.html
new file mode 100644
index 0000000..102d704
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlDeclaration.html
@@ -0,0 +1,131 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlDeclaration Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlDeclaration Class Reference</h1><!-- doxytag: class="TiXmlDeclaration" --><!-- doxytag: inherits="TiXmlNode" -->
+<p>In correct XML the declaration is the first entry in the file.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlDeclaration:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlDeclaration.png" usemap="#TiXmlDeclaration_map" alt=""/>
+  <map id="TiXmlDeclaration_map" name="TiXmlDeclaration_map">
+<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,108,80"/>
+<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,108,24"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlDeclaration-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa0484d059bea0ea1acb47c9094382d79"></a><!-- doxytag: member="TiXmlDeclaration::TiXmlDeclaration" ref="aa0484d059bea0ea1acb47c9094382d79" args="()" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#aa0484d059bea0ea1acb47c9094382d79">TiXmlDeclaration</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an empty declaration. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acd5556007c3c72209465081de39d9836"></a><!-- doxytag: member="TiXmlDeclaration::TiXmlDeclaration" ref="acd5556007c3c72209465081de39d9836" args="(const std::string &_version, const std::string &_encoding, const std::string &_standalone)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#acd5556007c3c72209465081de39d9836">TiXmlDeclaration</a> (const std::string &_version, const std::string &_encoding, const std::string &_standalone)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3b618d1c30c25e4b7a71f31a595ee298"></a><!-- doxytag: member="TiXmlDeclaration::TiXmlDeclaration" ref="a3b618d1c30c25e4b7a71f31a595ee298" args="(const char *_version, const char *_encoding, const char *_standalone)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#a3b618d1c30c25e4b7a71f31a595ee298">TiXmlDeclaration</a> (const char *_version, const char *_encoding, const char *_standalone)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02ee557b1a4545c3219ed377c103ec76"></a><!-- doxytag: member="TiXmlDeclaration::Version" ref="a02ee557b1a4545c3219ed377c103ec76" args="() const " -->
+const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#a02ee557b1a4545c3219ed377c103ec76">Version</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Version. Will return an empty string if none was found. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5d974231f9e9a2f0542f15f3a46cdb76"></a><!-- doxytag: member="TiXmlDeclaration::Encoding" ref="a5d974231f9e9a2f0542f15f3a46cdb76" args="() const " -->
+const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#a5d974231f9e9a2f0542f15f3a46cdb76">Encoding</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Encoding. Will return an empty string if none was found. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9ff06afc033d7ef730ec7c6825b97ad9"></a><!-- doxytag: member="TiXmlDeclaration::Standalone" ref="a9ff06afc033d7ef730ec7c6825b97ad9" args="() const " -->
+const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#a9ff06afc033d7ef730ec7c6825b97ad9">Standalone</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Is this a standalone document? <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7cf459186040141cda7a180a6585ce2e"></a><!-- doxytag: member="TiXmlDeclaration::Clone" ref="a7cf459186040141cda7a180a6585ce2e" args="() const " -->
+virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#a7cf459186040141cda7a180a6585ce2e">Clone</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a copy of this Declaration and returns it. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#abf6303db4bd05b5be554036817ff1cb4">Print</a> (FILE *cfile, int depth) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.  <a href="#abf6303db4bd05b5be554036817ff1cb4"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1e085d3fefd1dbf5ccdbff729931a967"></a><!-- doxytag: member="TiXmlDeclaration::ToDeclaration" ref="a1e085d3fefd1dbf5ccdbff729931a967" args="() const " -->
+virtual const <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#a1e085d3fefd1dbf5ccdbff729931a967">ToDeclaration</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6bd3d1daddcaeb9543c24bfd090969ce"></a><!-- doxytag: member="TiXmlDeclaration::ToDeclaration" ref="a6bd3d1daddcaeb9543c24bfd090969ce" args="()" -->
+virtual <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#a6bd3d1daddcaeb9543c24bfd090969ce">ToDeclaration</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a22315a535983b86535cdba3458669e3e"></a><!-- doxytag: member="TiXmlDeclaration::Accept" ref="a22315a535983b86535cdba3458669e3e" args="(TiXmlVisitor *visitor) const " -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#a22315a535983b86535cdba3458669e3e">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *visitor) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br/></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>In correct XML the declaration is the first entry in the file. </p>
+<div class="fragment"><pre class="fragment">
+		<?xml version="1.0" standalone="yes"?>
+	</pre></div><p>TinyXml will happily read or write files without a declaration, however. There are 3 possible attributes to the declaration: version, encoding, and standalone.</p>
+<p>Note: In this version of the code, the attributes are handled as special cases, not generic attributes, simply because there can only be at most 3 and they are always the same. </p>
+<hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="abf6303db4bd05b5be554036817ff1cb4"></a><!-- doxytag: member="TiXmlDeclaration::Print" ref="abf6303db4bd05b5be554036817ff1cb4" args="(FILE *cfile, int depth) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual void TiXmlDeclaration::Print </td>
+          <td>(</td>
+          <td class="paramtype">FILE * </td>
+          <td class="paramname"> <em>cfile</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>depth</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const<code> [inline, virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. </p>
+<p>) Either or both cfile and str can be null.</p>
+<p>This is a formatted print, and will insert tabs and newlines.</p>
+<p>(For an unformatted stream, use the << operator.) </p>
+
+<p>Implements <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>.</p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlDeclaration.png b/Source/External/TinyXml/docs/classTiXmlDeclaration.png
new file mode 100644
index 0000000..c16d71b
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlDeclaration.png differ
diff --git a/Source/External/TinyXml/docs/classTiXmlDocument-members.html b/Source/External/TinyXml/docs/classTiXmlDocument-members.html
new file mode 100644
index 0000000..93270cc
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlDocument-members.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlDocument Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#aa545aae325d9752ad64120bc4ecf939a">Accept</a>(TiXmlVisitor *content) const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#ac66b8c28db86363315712a3574e87c35">ClearError</a>()</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a4968661cab4a1f44a23329c6f8db1907">Clone</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [protected, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a6dfc01a6e5d58e56acd537dfd3bdeb29">Error</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649">ErrorCol</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#af96fc2f3f9ec6422782bfe916c9e778f">ErrorId</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e">ErrorRow</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#accda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#adfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f">LoadFile</a>(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a879cdf5e981b8b2d2ef82f2546dd28fb">LoadFile</a>(const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a41f6fe7200864d1dca663d230caf8db6">LoadFile</a>(FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a18ae6ed34fed7991ebc220862dfac884">LoadFile</a>(const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a17ebabe36926ef398e78dec0d0ad0378">Parse</a>(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#af08389ec70ee9b2de7f800e206a18510">Print</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a8701fda1fa31b25abbc9c0df42da10e8">Print</a>(FILE *cfile, int depth=0) const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#ad09d17927f908f40efb406af2fb873be">RootElement</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#ae869f5ebf7fc54c4a1d737fb4689fd44">SaveFile</a>(const char *filename) const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#acf1672b4538c6d1d441f9f108aea2bf4">SaveFile</a>(FILE *) const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a3d4fae0463f3f03679ba0b7cf6f2df52">SaveFile</a>(const std::string &filename) const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e">SetTabSize</a>(int _tabsize)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a9f5e84335708fde98400230f9f12659c">TiXmlDocument</a>()</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#ae4508b452d0c3061db085f3db27b8396">TiXmlDocument</a>(const char *documentName)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a2c6e58fb99bfa76cc613f16840022225">TiXmlDocument</a>(const std::string &documentName)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a1dc977bde3e4fe85a8eb9d88a35ef5a4">ToDocument</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a1025d942a1f328fd742d545e37efdd42">ToDocument</a>()</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlDocument.html b/Source/External/TinyXml/docs/classTiXmlDocument.html
new file mode 100644
index 0000000..20d5233
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlDocument.html
@@ -0,0 +1,437 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlDocument Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlDocument Class Reference</h1><!-- doxytag: class="TiXmlDocument" --><!-- doxytag: inherits="TiXmlNode" -->
+<p>Always the top level node.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlDocument:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlDocument.png" usemap="#TiXmlDocument_map" alt=""/>
+  <map id="TiXmlDocument_map" name="TiXmlDocument_map">
+<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,99,80"/>
+<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,99,24"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlDocument-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9f5e84335708fde98400230f9f12659c"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="a9f5e84335708fde98400230f9f12659c" args="()" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a9f5e84335708fde98400230f9f12659c">TiXmlDocument</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an empty document, that has no name. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae4508b452d0c3061db085f3db27b8396"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="ae4508b452d0c3061db085f3db27b8396" args="(const char *documentName)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ae4508b452d0c3061db085f3db27b8396">TiXmlDocument</a> (const char *documentName)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a document with a name. The name of the document is also the filename of the xml. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2c6e58fb99bfa76cc613f16840022225"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="a2c6e58fb99bfa76cc613f16840022225" args="(const std::string &documentName)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a2c6e58fb99bfa76cc613f16840022225">TiXmlDocument</a> (const std::string &documentName)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f">LoadFile</a> (TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a file using the current document value.  <a href="#a4c852a889c02cf251117fd1d9fe1845f"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a21c0aeb0d0a720169ad4ac89523ebe93"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="a21c0aeb0d0a720169ad4ac89523ebe93" args="() const " -->
+bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a file using the current document value. Returns true if successful. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a879cdf5e981b8b2d2ef82f2546dd28fb"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a879cdf5e981b8b2d2ef82f2546dd28fb" args="(const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
+bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a879cdf5e981b8b2d2ef82f2546dd28fb">LoadFile</a> (const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a file using the given filename. Returns true if successful. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae869f5ebf7fc54c4a1d737fb4689fd44"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="ae869f5ebf7fc54c4a1d737fb4689fd44" args="(const char *filename) const " -->
+bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ae869f5ebf7fc54c4a1d737fb4689fd44">SaveFile</a> (const char *filename) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a file using the given filename. Returns true if successful. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a41f6fe7200864d1dca663d230caf8db6">LoadFile</a> (FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a file using the given FILE*.  <a href="#a41f6fe7200864d1dca663d230caf8db6"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acf1672b4538c6d1d441f9f108aea2bf4"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="acf1672b4538c6d1d441f9f108aea2bf4" args="(FILE *) const " -->
+bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#acf1672b4538c6d1d441f9f108aea2bf4">SaveFile</a> (FILE *) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a file using the given FILE*. Returns true if successful. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a18ae6ed34fed7991ebc220862dfac884">LoadFile</a> (const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3d4fae0463f3f03679ba0b7cf6f2df52"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="a3d4fae0463f3f03679ba0b7cf6f2df52" args="(const std::string &filename) const " -->
+bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a3d4fae0463f3f03679ba0b7cf6f2df52">SaveFile</a> (const std::string &filename) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">< STL std::string version. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a17ebabe36926ef398e78dec0d0ad0378">Parse</a> (const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Parse the given null terminated block of xml data.  <a href="#a17ebabe36926ef398e78dec0d0ad0378"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ad09d17927f908f40efb406af2fb873be">RootElement</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the root element -- the only top level element -- of the document.  <a href="#ad09d17927f908f40efb406af2fb873be"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a6dfc01a6e5d58e56acd537dfd3bdeb29">Error</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">If an error occurs, Error will be set to true.  <a href="#a6dfc01a6e5d58e56acd537dfd3bdeb29"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9d0f689f6e09ea494ea547be8d79c25e"></a><!-- doxytag: member="TiXmlDocument::ErrorDesc" ref="a9d0f689f6e09ea494ea547be8d79c25e" args="() const " -->
+const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Contains a textual (english) description of the error if one occurs. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#af96fc2f3f9ec6422782bfe916c9e778f">ErrorId</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Generally, you probably want the error string ( <a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e" title="Contains a textual (english) description of the error if one occurs.">ErrorDesc()</a> ).  <a href="#af96fc2f3f9ec6422782bfe916c9e778f"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e">ErrorRow</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the location (if known) of the error.  <a href="#af30efc75e804aa2e92fb8be3a8cb676e"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa90bc630ee5203c6109ca5fad3323649"></a><!-- doxytag: member="TiXmlDocument::ErrorCol" ref="aa90bc630ee5203c6109ca5fad3323649" args="() const " -->
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649">ErrorCol</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">The column where the error occured. See <a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e" title="Returns the location (if known) of the error.">ErrorRow()</a>. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e">SetTabSize</a> (int _tabsize)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e" title="SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to...">SetTabSize()</a> allows the error reporting functions (<a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e" title="Returns the location (if known) of the error.">ErrorRow()</a> and <a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649" title="The column where the error occured. See ErrorRow().">ErrorCol()</a>) to report the correct values for row and column.  <a href="#a51dac56316f89b35bdb7d0d433ba988e"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#ac66b8c28db86363315712a3574e87c35">ClearError</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">If you have handled the error, it can be reset with this call.  <a href="#ac66b8c28db86363315712a3574e87c35"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#af08389ec70ee9b2de7f800e206a18510">Print</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Write the document to standard out using formatted printing ("pretty print").  <a href="#af08389ec70ee9b2de7f800e206a18510"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8701fda1fa31b25abbc9c0df42da10e8"></a><!-- doxytag: member="TiXmlDocument::Print" ref="a8701fda1fa31b25abbc9c0df42da10e8" args="(FILE *cfile, int depth=0) const " -->
+virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a8701fda1fa31b25abbc9c0df42da10e8">Print</a> (FILE *cfile, int depth=0) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Print this Document to a FILE stream. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1dc977bde3e4fe85a8eb9d88a35ef5a4"></a><!-- doxytag: member="TiXmlDocument::ToDocument" ref="a1dc977bde3e4fe85a8eb9d88a35ef5a4" args="() const " -->
+virtual const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a1dc977bde3e4fe85a8eb9d88a35ef5a4">ToDocument</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1025d942a1f328fd742d545e37efdd42"></a><!-- doxytag: member="TiXmlDocument::ToDocument" ref="a1025d942a1f328fd742d545e37efdd42" args="()" -->
+virtual <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a1025d942a1f328fd742d545e37efdd42">ToDocument</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa545aae325d9752ad64120bc4ecf939a"></a><!-- doxytag: member="TiXmlDocument::Accept" ref="aa545aae325d9752ad64120bc4ecf939a" args="(TiXmlVisitor *content) const " -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#aa545aae325d9752ad64120bc4ecf939a">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *content) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br/></td></tr>
+<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a4968661cab4a1f44a23329c6f8db1907">Clone</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an exact duplicate of this node and return it.  <a href="#a4968661cab4a1f44a23329c6f8db1907"></a><br/></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>Always the top level node. </p>
+<p>A document binds together all the XML pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name. </p>
+<hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="ac66b8c28db86363315712a3574e87c35"></a><!-- doxytag: member="TiXmlDocument::ClearError" ref="ac66b8c28db86363315712a3574e87c35" args="()" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlDocument::ClearError </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td><code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>If you have handled the error, it can be reset with this call. </p>
+<p>The error state is automatically cleared if you Parse a new XML block. </p>
+
+</div>
+</div>
+<a class="anchor" id="a4968661cab4a1f44a23329c6f8db1907"></a><!-- doxytag: member="TiXmlDocument::Clone" ref="a4968661cab4a1f44a23329c6f8db1907" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlDocument::Clone </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [protected, virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Create an exact duplicate of this node and return it. </p>
+<p>The memory must be deleted by the caller. </p>
+
+<p>Implements <a class="el" href="classTiXmlNode.html#a4508cc3a2d7a98e96a54cc09c37a78a4">TiXmlNode</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a6dfc01a6e5d58e56acd537dfd3bdeb29"></a><!-- doxytag: member="TiXmlDocument::Error" ref="a6dfc01a6e5d58e56acd537dfd3bdeb29" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool TiXmlDocument::Error </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>If an error occurs, Error will be set to true. </p>
+<p>Also,</p>
+<ul>
+<li>The <a class="el" href="classTiXmlDocument.html#af96fc2f3f9ec6422782bfe916c9e778f" title="Generally, you probably want the error string ( ErrorDesc() ).">ErrorId()</a> will contain the integer identifier of the error (not generally useful)</li>
+<li>The <a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e" title="Contains a textual (english) description of the error if one occurs.">ErrorDesc()</a> method will return the name of the error. (very useful)</li>
+<li>The <a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e" title="Returns the location (if known) of the error.">ErrorRow()</a> and <a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649" title="The column where the error occured. See ErrorRow().">ErrorCol()</a> will return the location of the error (if known) </li>
+</ul>
+
+</div>
+</div>
+<a class="anchor" id="af96fc2f3f9ec6422782bfe916c9e778f"></a><!-- doxytag: member="TiXmlDocument::ErrorId" ref="af96fc2f3f9ec6422782bfe916c9e778f" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int TiXmlDocument::ErrorId </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Generally, you probably want the error string ( <a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e" title="Contains a textual (english) description of the error if one occurs.">ErrorDesc()</a> ). </p>
+<p>But if you prefer the ErrorId, this function will fetch it. </p>
+
+</div>
+</div>
+<a class="anchor" id="af30efc75e804aa2e92fb8be3a8cb676e"></a><!-- doxytag: member="TiXmlDocument::ErrorRow" ref="af30efc75e804aa2e92fb8be3a8cb676e" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int TiXmlDocument::ErrorRow </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Returns the location (if known) of the error. </p>
+<p>The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.)</p>
+<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e" title="SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to...">SetTabSize</a>, <a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853" title="Return the position, in the original source file, of this node or attribute.">Row</a>, <a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003" title="See Row().">Column</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a18ae6ed34fed7991ebc220862dfac884"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a18ae6ed34fed7991ebc220862dfac884" args="(const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool TiXmlDocument::LoadFile </td>
+          <td>(</td>
+          <td class="paramtype">const std::string & </td>
+          <td class="paramname"> <em>filename</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">TiXmlEncoding </td>
+          <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td><code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<dl><dt><b>Parameters:</b></dt><dd>
+  <table border="0" cellspacing="2" cellpadding="0">
+    <tr><td valign="top"></td><td valign="top"><em>encoding</em> </td><td>STL std::string version. </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>References <a class="el" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f">LoadFile()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a41f6fe7200864d1dca663d230caf8db6"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a41f6fe7200864d1dca663d230caf8db6" args="(FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool TiXmlDocument::LoadFile </td>
+          <td>(</td>
+          <td class="paramtype">FILE * </td>
+          <td class="paramname">, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">TiXmlEncoding </td>
+          <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Load a file using the given FILE*. </p>
+<p>Returns true if successful. Note that this method doesn't stream - the entire object pointed at by the FILE* will be interpreted as an XML file. TinyXML doesn't stream in XML from the current file location. Streaming may be added in the future. </p>
+
+</div>
+</div>
+<a class="anchor" id="a4c852a889c02cf251117fd1d9fe1845f"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="a4c852a889c02cf251117fd1d9fe1845f" args="(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">bool TiXmlDocument::LoadFile </td>
+          <td>(</td>
+          <td class="paramtype">TiXmlEncoding </td>
+          <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td>
+          <td> ) </td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Load a file using the current document value. </p>
+<p>Returns true if successful. Will delete any existing document data before loading. </p>
+
+<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01432">LoadFile()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a17ebabe36926ef398e78dec0d0ad0378"></a><!-- doxytag: member="TiXmlDocument::Parse" ref="a17ebabe36926ef398e78dec0d0ad0378" args="(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual const char* TiXmlDocument::Parse </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>p</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">TiXmlParsingData * </td>
+          <td class="paramname"> <em>data</em> = <code>0</code>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">TiXmlEncoding </td>
+          <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td><code> [virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Parse the given null terminated block of xml data. </p>
+<p>Passing in an encoding to this method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml to use that encoding, regardless of what TinyXml might otherwise try to detect. </p>
+
+<p>Implements <a class="el" href="classTiXmlBase.html">TiXmlBase</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="af08389ec70ee9b2de7f800e206a18510"></a><!-- doxytag: member="TiXmlDocument::Print" ref="af08389ec70ee9b2de7f800e206a18510" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlDocument::Print </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Write the document to standard out using formatted printing ("pretty print"). </p>
+
+<p>References <a class="el" href="tinyxml_8h_source.html#l01519">Print()</a>.</p>
+
+<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01519">Print()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ad09d17927f908f40efb406af2fb873be"></a><!-- doxytag: member="TiXmlDocument::RootElement" ref="ad09d17927f908f40efb406af2fb873be" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlDocument::RootElement </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Get the root element -- the only top level element -- of the document. </p>
+<p>In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level. </p>
+
+<p>References <a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">TiXmlNode::FirstChildElement()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a51dac56316f89b35bdb7d0d433ba988e"></a><!-- doxytag: member="TiXmlDocument::SetTabSize" ref="a51dac56316f89b35bdb7d0d433ba988e" args="(int _tabsize)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlDocument::SetTabSize </td>
+          <td>(</td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>_tabsize</em></td>
+          <td> ) </td>
+          <td><code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p><a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e" title="SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to...">SetTabSize()</a> allows the error reporting functions (<a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e" title="Returns the location (if known) of the error.">ErrorRow()</a> and <a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649" title="The column where the error occured. See ErrorRow().">ErrorCol()</a>) to report the correct values for row and column. </p>
+<p>It does not change the output or input in any way.</p>
+<p>By calling this method, with a tab size greater than 0, the row and column of each node and attribute is stored when the file is loaded. Very useful for tracking the DOM back in to the source file.</p>
+<p>The tab size is required for calculating the location of nodes. If not set, the default of 4 is used. The tabsize is set per document. Setting the tabsize to 0 disables row/column tracking.</p>
+<p>Note that row and column tracking is not supported when using operator>>.</p>
+<p>The tab size needs to be enabled before the parse or load. Correct usage: </p>
+<div class="fragment"><pre class="fragment">
+		TiXmlDocument doc;
+		doc.SetTabSize( 8 );
+		doc.Load( "myfile.xml" );
+		</pre></div><dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853" title="Return the position, in the original source file, of this node or attribute.">Row</a>, <a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003" title="See Row().">Column</a> </dd></dl>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlDocument.png b/Source/External/TinyXml/docs/classTiXmlDocument.png
new file mode 100644
index 0000000..d27aca2
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlDocument.png differ
diff --git a/Source/External/TinyXml/docs/classTiXmlElement-members.html b/Source/External/TinyXml/docs/classTiXmlElement-members.html
new file mode 100644
index 0000000..e002572
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlElement-members.html
@@ -0,0 +1,129 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlElement Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlElement.html">TiXmlElement</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a71a81b2afb0d42be1543d1c404dee6f5">Accept</a>(TiXmlVisitor *visitor) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a>(const char *name) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a0ed8348fdc56b72a6b4900ce5bac1849">Attribute</a>(const char *name, int *i) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#aeaff99d4f0ea5b34f7aee202aad457ba">Attribute</a>(const char *name, double *d) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#aa464535ea1994db337cb6a8ce4b588b5">Clone</a>() const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a516054c9073647d6cb29b6abe9fa0592">FirstAttribute</a>() const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#accda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87">GetText</a>() const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#adfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a86191b49f9177be132b85b14655f1381">LastAttribute</a>() const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#afbf52736e70fc91ec9d760721d6f4fd2">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#af4a1d3f88c28eb0f3115dc39ebd83fff">QueryBoolAttribute</a>(const char *name, bool *_value) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a898d7730ecc341f0bffc7a9dadbf1ce7">QueryDoubleAttribute</a>(const char *name, double *_value) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#aa04d3af11601ef5a5f88295203a843be">QueryFloatAttribute</a>(const char *name, float *_value) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9">QueryIntAttribute</a>(const char *name, int *_value) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a14321ac360efe906ed449d9db3fd9961">QueryStringAttribute</a>(const char *name, std::string *_value) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#ae48df644f890ab86fa19839ac401f00d">QueryUnsignedAttribute</a>(const char *name, unsigned *_value) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#ae3b9a03b0a56663a40801c7256683576">QueryValueAttribute</a>(const std::string &name, T *outValue) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a56979767deca794376b1dfa69a525b2a">RemoveAttribute</a>(const char *name)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a1afa6aea716511326a608e4c05df4f3a">RemoveAttribute</a>(const std::string &name)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#abf0b3bd7f0e4c746a89ec6e7f101fc32">SetAttribute</a>(const char *name, const char *_value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a80ed65b1d194c71c6c9986ae42337d7d">SetAttribute</a>(const std::string &name, const std::string &_value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a6f18d54fbe25bbc527936ee65363b3c5">SetAttribute</a>(const std::string &name, int _value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#ace6f4be75e373726d4774073d666d1a7">SetAttribute</a>(const char *name, int value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a0d1dd975d75496778177e35abfe0ec0b">SetDoubleAttribute</a>(const char *name, double value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a01bc3ab372d35da08efcbbe65ad90c60">TiXmlElement</a>(const char *in_value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a40fc2e3c1a955e2f78e1a32350d180e7">TiXmlElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#ac5b8d0e25fa23fd9acbb6d146082901c">ToElement</a>() const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a9def86337ea7a755eb41cac980f60c7a">ToElement</a>()</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlElement.html b/Source/External/TinyXml/docs/classTiXmlElement.html
new file mode 100644
index 0000000..aedce2c
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlElement.html
@@ -0,0 +1,474 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlElement Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlElement Class Reference</h1><!-- doxytag: class="TiXmlElement" --><!-- doxytag: inherits="TiXmlNode" -->
+<p>The element is a container class.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlElement:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlElement.png" usemap="#TiXmlElement_map" alt=""/>
+  <map id="TiXmlElement_map" name="TiXmlElement_map">
+<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,87,80"/>
+<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,87,24"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlElement-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a01bc3ab372d35da08efcbbe65ad90c60"></a><!-- doxytag: member="TiXmlElement::TiXmlElement" ref="a01bc3ab372d35da08efcbbe65ad90c60" args="(const char *in_value)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a01bc3ab372d35da08efcbbe65ad90c60">TiXmlElement</a> (const char *in_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an element. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a40fc2e3c1a955e2f78e1a32350d180e7"></a><!-- doxytag: member="TiXmlElement::TiXmlElement" ref="a40fc2e3c1a955e2f78e1a32350d180e7" args="(const std::string &_value)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a40fc2e3c1a955e2f78e1a32350d180e7">TiXmlElement</a> (const std::string &_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">std::string constructor. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae419a442a9701a62b0c3d8fd1cbdd12d"></a><!-- doxytag: member="TiXmlElement::Attribute" ref="ae419a442a9701a62b0c3d8fd1cbdd12d" args="(const char *name) const " -->
+const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a> (const char *name) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Given an attribute name, <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> returns the value for the attribute of that name, or null if none exists. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a0ed8348fdc56b72a6b4900ce5bac1849">Attribute</a> (const char *name, int *i) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Given an attribute name, <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> returns the value for the attribute of that name, or null if none exists.  <a href="#a0ed8348fdc56b72a6b4900ce5bac1849"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#aeaff99d4f0ea5b34f7aee202aad457ba">Attribute</a> (const char *name, double *d) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Given an attribute name, <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> returns the value for the attribute of that name, or null if none exists.  <a href="#aeaff99d4f0ea5b34f7aee202aad457ba"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9">QueryIntAttribute</a> (const char *name, int *_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryIntAttribute examines the attribute - it is an alternative to the <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> method with richer error checking.  <a href="#aea0bfe471380f281c5945770ddbf52b9"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae48df644f890ab86fa19839ac401f00d"></a><!-- doxytag: member="TiXmlElement::QueryUnsignedAttribute" ref="ae48df644f890ab86fa19839ac401f00d" args="(const char *name, unsigned *_value) const " -->
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ae48df644f890ab86fa19839ac401f00d">QueryUnsignedAttribute</a> (const char *name, unsigned *_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryUnsignedAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#af4a1d3f88c28eb0f3115dc39ebd83fff">QueryBoolAttribute</a> (const char *name, bool *_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryBoolAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>.  <a href="#af4a1d3f88c28eb0f3115dc39ebd83fff"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a898d7730ecc341f0bffc7a9dadbf1ce7"></a><!-- doxytag: member="TiXmlElement::QueryDoubleAttribute" ref="a898d7730ecc341f0bffc7a9dadbf1ce7" args="(const char *name, double *_value) const " -->
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a898d7730ecc341f0bffc7a9dadbf1ce7">QueryDoubleAttribute</a> (const char *name, double *_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryDoubleAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa04d3af11601ef5a5f88295203a843be"></a><!-- doxytag: member="TiXmlElement::QueryFloatAttribute" ref="aa04d3af11601ef5a5f88295203a843be" args="(const char *name, float *_value) const " -->
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#aa04d3af11601ef5a5f88295203a843be">QueryFloatAttribute</a> (const char *name, float *_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryFloatAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a14321ac360efe906ed449d9db3fd9961"></a><!-- doxytag: member="TiXmlElement::QueryStringAttribute" ref="a14321ac360efe906ed449d9db3fd9961" args="(const char *name, std::string *_value) const " -->
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a14321ac360efe906ed449d9db3fd9961">QueryStringAttribute</a> (const char *name, std::string *_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryStringAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. <br/></td></tr>
+<tr><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
+<tr><td class="memTemplItemLeft" align="right" valign="top">int </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ae3b9a03b0a56663a40801c7256683576">QueryValueAttribute</a> (const std::string &name, T *outValue) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Template form of the attribute query which will try to read the attribute into the specified type.  <a href="#ae3b9a03b0a56663a40801c7256683576"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#abf0b3bd7f0e4c746a89ec6e7f101fc32">SetAttribute</a> (const char *name, const char *_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets an attribute of name to a given value.  <a href="#abf0b3bd7f0e4c746a89ec6e7f101fc32"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a80ed65b1d194c71c6c9986ae42337d7d">SetAttribute</a> (const std::string &name, const std::string &_value)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6f18d54fbe25bbc527936ee65363b3c5"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="a6f18d54fbe25bbc527936ee65363b3c5" args="(const std::string &name, int _value)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a6f18d54fbe25bbc527936ee65363b3c5">SetAttribute</a> (const std::string &name, int _value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ace6f4be75e373726d4774073d666d1a7">SetAttribute</a> (const char *name, int value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets an attribute of name to a given value.  <a href="#ace6f4be75e373726d4774073d666d1a7"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a0d1dd975d75496778177e35abfe0ec0b">SetDoubleAttribute</a> (const char *name, double value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets an attribute of name to a given value.  <a href="#a0d1dd975d75496778177e35abfe0ec0b"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a56979767deca794376b1dfa69a525b2a"></a><!-- doxytag: member="TiXmlElement::RemoveAttribute" ref="a56979767deca794376b1dfa69a525b2a" args="(const char *name)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a56979767deca794376b1dfa69a525b2a">RemoveAttribute</a> (const char *name)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes an attribute with the given name. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1afa6aea716511326a608e4c05df4f3a"></a><!-- doxytag: member="TiXmlElement::RemoveAttribute" ref="a1afa6aea716511326a608e4c05df4f3a" args="(const std::string &name)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a1afa6aea716511326a608e4c05df4f3a">RemoveAttribute</a> (const std::string &name)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a516054c9073647d6cb29b6abe9fa0592"></a><!-- doxytag: member="TiXmlElement::FirstAttribute" ref="a516054c9073647d6cb29b6abe9fa0592" args="() const " -->
+const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a516054c9073647d6cb29b6abe9fa0592">FirstAttribute</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Access the first attribute in this element. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a86191b49f9177be132b85b14655f1381"></a><!-- doxytag: member="TiXmlElement::LastAttribute" ref="a86191b49f9177be132b85b14655f1381" args="() const " -->
+const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a86191b49f9177be132b85b14655f1381">LastAttribute</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Access the last attribute in this element. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87">GetText</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function for easy access to the text inside an element.  <a href="#af3282294986cdb216646ea1f67af2c87"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa464535ea1994db337cb6a8ce4b588b5"></a><!-- doxytag: member="TiXmlElement::Clone" ref="aa464535ea1994db337cb6a8ce4b588b5" args="() const " -->
+virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#aa464535ea1994db337cb6a8ce4b588b5">Clone</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a new Element and returns it - the returned element is a copy. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#afbf52736e70fc91ec9d760721d6f4fd2">Print</a> (FILE *cfile, int depth) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.  <a href="#afbf52736e70fc91ec9d760721d6f4fd2"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac5b8d0e25fa23fd9acbb6d146082901c"></a><!-- doxytag: member="TiXmlElement::ToElement" ref="ac5b8d0e25fa23fd9acbb6d146082901c" args="() const " -->
+virtual const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ac5b8d0e25fa23fd9acbb6d146082901c">ToElement</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9def86337ea7a755eb41cac980f60c7a"></a><!-- doxytag: member="TiXmlElement::ToElement" ref="a9def86337ea7a755eb41cac980f60c7a" args="()" -->
+virtual <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a9def86337ea7a755eb41cac980f60c7a">ToElement</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a71a81b2afb0d42be1543d1c404dee6f5"></a><!-- doxytag: member="TiXmlElement::Accept" ref="a71a81b2afb0d42be1543d1c404dee6f5" args="(TiXmlVisitor *visitor) const " -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a71a81b2afb0d42be1543d1c404dee6f5">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *visitor) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br/></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>The element is a container class. </p>
+<p>It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes. </p>
+<hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="aeaff99d4f0ea5b34f7aee202aad457ba"></a><!-- doxytag: member="TiXmlElement::Attribute" ref="aeaff99d4f0ea5b34f7aee202aad457ba" args="(const char *name, double *d) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const char* TiXmlElement::Attribute </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>name</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"> <em>d</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Given an attribute name, <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> returns the value for the attribute of that name, or null if none exists. </p>
+<p>If the attribute exists and can be converted to an double, the double value will be put in the return 'd', if 'd' is non-null. </p>
+
+</div>
+</div>
+<a class="anchor" id="a0ed8348fdc56b72a6b4900ce5bac1849"></a><!-- doxytag: member="TiXmlElement::Attribute" ref="a0ed8348fdc56b72a6b4900ce5bac1849" args="(const char *name, int *i) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const char* TiXmlElement::Attribute </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>name</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"> <em>i</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Given an attribute name, <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> returns the value for the attribute of that name, or null if none exists. </p>
+<p>If the attribute exists and can be converted to an integer, the integer value will be put in the return 'i', if 'i' is non-null. </p>
+
+</div>
+</div>
+<a class="anchor" id="af3282294986cdb216646ea1f67af2c87"></a><!-- doxytag: member="TiXmlElement::GetText" ref="af3282294986cdb216646ea1f67af2c87" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const char* TiXmlElement::GetText </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Convenience function for easy access to the text inside an element. </p>
+<p>Although easy and concise, <a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87" title="Convenience function for easy access to the text inside an element.">GetText()</a> is limited compared to getting the <a class="el" href="classTiXmlText.html" title="XML text.">TiXmlText</a> child and accessing it directly.</p>
+<p>If the first child of 'this' is a <a class="el" href="classTiXmlText.html" title="XML text.">TiXmlText</a>, the <a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87" title="Convenience function for easy access to the text inside an element.">GetText()</a> returns the character string of the Text node, else null is returned.</p>
+<p>This is a convenient method for getting the text of simple contained text: </p>
+<div class="fragment"><pre class="fragment">
+		<foo>This is text</foo>
+		const char* str = fooElement->GetText();
+		</pre></div><p>'str' will be a pointer to "This is text".</p>
+<p>Note that this function can be misleading. If the element foo was created from this XML: </p>
+<div class="fragment"><pre class="fragment">
+		<foo><b>This is text</b></foo> 
+		</pre></div><p>then the value of str would be null. The first child node isn't a text node, it is another element. From this XML: </p>
+<div class="fragment"><pre class="fragment">
+		<foo>This is <b>text</b></foo> 
+		</pre></div><p> <a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87" title="Convenience function for easy access to the text inside an element.">GetText()</a> will return "This is ".</p>
+<p>WARNING: <a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87" title="Convenience function for easy access to the text inside an element.">GetText()</a> accesses a child node - don't become confused with the similarly named <a class="el" href="classTiXmlHandle.html#a9fc739c8a18d160006f82572fc143d13">TiXmlHandle::Text()</a> and <a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03" title="Cast to a more defined type. Will return null if not of the requested type.">TiXmlNode::ToText()</a> which are safe type casts on the referenced node. </p>
+
+</div>
+</div>
+<a class="anchor" id="afbf52736e70fc91ec9d760721d6f4fd2"></a><!-- doxytag: member="TiXmlElement::Print" ref="afbf52736e70fc91ec9d760721d6f4fd2" args="(FILE *cfile, int depth) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual void TiXmlElement::Print </td>
+          <td>(</td>
+          <td class="paramtype">FILE * </td>
+          <td class="paramname"> <em>cfile</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>depth</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const<code> [virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. </p>
+<p>) Either or both cfile and str can be null.</p>
+<p>This is a formatted print, and will insert tabs and newlines.</p>
+<p>(For an unformatted stream, use the << operator.) </p>
+
+<p>Implements <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="af4a1d3f88c28eb0f3115dc39ebd83fff"></a><!-- doxytag: member="TiXmlElement::QueryBoolAttribute" ref="af4a1d3f88c28eb0f3115dc39ebd83fff" args="(const char *name, bool *_value) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int TiXmlElement::QueryBoolAttribute </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>name</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">bool * </td>
+          <td class="paramname"> <em>_value</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>QueryBoolAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. </p>
+<p>Note that '1', 'true', or 'yes' are considered true, while '0', 'false' and 'no' are considered false. </p>
+
+</div>
+</div>
+<a class="anchor" id="aea0bfe471380f281c5945770ddbf52b9"></a><!-- doxytag: member="TiXmlElement::QueryIntAttribute" ref="aea0bfe471380f281c5945770ddbf52b9" args="(const char *name, int *_value) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int TiXmlElement::QueryIntAttribute </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>name</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"> <em>_value</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>QueryIntAttribute examines the attribute - it is an alternative to the <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> method with richer error checking. </p>
+<p>If the attribute is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. If the attribute does not exist, then TIXML_NO_ATTRIBUTE is returned. </p>
+
+</div>
+</div>
+<a class="anchor" id="ae3b9a03b0a56663a40801c7256683576"></a><!-- doxytag: member="TiXmlElement::QueryValueAttribute" ref="ae3b9a03b0a56663a40801c7256683576" args="(const std::string &name, T *outValue) const " -->
+<div class="memitem">
+<div class="memproto">
+<div class="memtemplate">
+template<typename T > </div>
+      <table class="memname">
+        <tr>
+          <td class="memname">int TiXmlElement::QueryValueAttribute </td>
+          <td>(</td>
+          <td class="paramtype">const std::string & </td>
+          <td class="paramname"> <em>name</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">T * </td>
+          <td class="paramname"> <em>outValue</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Template form of the attribute query which will try to read the attribute into the specified type. </p>
+<p>Very easy, very powerful, but be careful to make sure to call this with the correct type.</p>
+<p>NOTE: This method doesn't work correctly for 'string' types that contain spaces.</p>
+<dl class="return"><dt><b>Returns:</b></dt><dd>TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE </dd></dl>
+
+<p>References <a class="el" href="tinyxml_8h_source.html#l00814">TiXmlAttribute::ValueStr()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ace6f4be75e373726d4774073d666d1a7"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="ace6f4be75e373726d4774073d666d1a7" args="(const char *name, int value)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlElement::SetAttribute </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>name</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>value</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Sets an attribute of name to a given value. </p>
+<p>The attribute will be created if it does not exist, or changed if it does. </p>
+
+</div>
+</div>
+<a class="anchor" id="a80ed65b1d194c71c6c9986ae42337d7d"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="a80ed65b1d194c71c6c9986ae42337d7d" args="(const std::string &name, const std::string &_value)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlElement::SetAttribute </td>
+          <td>(</td>
+          <td class="paramtype">const std::string & </td>
+          <td class="paramname"> <em>name</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const std::string & </td>
+          <td class="paramname"> <em>_value</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<p>STL std::string form. </p>
+
+</div>
+</div>
+<a class="anchor" id="abf0b3bd7f0e4c746a89ec6e7f101fc32"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="abf0b3bd7f0e4c746a89ec6e7f101fc32" args="(const char *name, const char *_value)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlElement::SetAttribute </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>name</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>_value</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Sets an attribute of name to a given value. </p>
+<p>The attribute will be created if it does not exist, or changed if it does. </p>
+
+</div>
+</div>
+<a class="anchor" id="a0d1dd975d75496778177e35abfe0ec0b"></a><!-- doxytag: member="TiXmlElement::SetDoubleAttribute" ref="a0d1dd975d75496778177e35abfe0ec0b" args="(const char *name, double value)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlElement::SetDoubleAttribute </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>name</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">double </td>
+          <td class="paramname"> <em>value</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Sets an attribute of name to a given value. </p>
+<p>The attribute will be created if it does not exist, or changed if it does. </p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlElement.png b/Source/External/TinyXml/docs/classTiXmlElement.png
new file mode 100644
index 0000000..21e8c8f
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlElement.png differ
diff --git a/Source/External/TinyXml/docs/classTiXmlHandle-members.html b/Source/External/TinyXml/docs/classTiXmlHandle-members.html
new file mode 100644
index 0000000..a15207a
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlHandle-members.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlHandle Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#a072492b4be1acdb0db2d03cd8f71ccc4">Child</a>(const char *value, int index) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#af9cf6a7d08a5da94a8924425ad0cd5ac">Child</a>(int index) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#a979a3f850984a176ee884e394c7eed2d">ChildElement</a>(const char *value, int index) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#a8786475b9d1f1518492e3a46704c7ef0">ChildElement</a>(int index) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#acb5fe8388a526289ea65e817a51e05e7">Element</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#acdb1faaf88a700b40ca2c8d9aee21139">FirstChild</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#a8c61f64ae9365d89c264f289085541f8">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#a24d1112e995e937e4dddb202d4113d4a">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#af0aea751320f5e430fac6f8fff3b8dd4">FirstChildElement</a>(const char *value) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#ab44b723a8dc9af72838a303c079d0376">Node</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#a9fc739c8a18d160006f82572fc143d13">Text</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#aba18fd7bdefb942ecdea4bf4b8e29ec8">TiXmlHandle</a>(TiXmlNode *_node)</td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#a236d7855e1e56ccc7b980630c48c7fd7">TiXmlHandle</a>(const TiXmlHandle &ref)</td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#abc6e7ed383a5fe1e52b0c0004b457b9e">ToElement</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#af678e5088e83be67baf76f699756f2c3">ToNode</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#a4ac53a652296203a5b5e13854d923586">ToText</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#a1381c17507a130767b1e23afc93b3674">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#a49675b74357ba2aae124657a9a1ef465">Unknown</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlHandle.html b/Source/External/TinyXml/docs/classTiXmlHandle.html
new file mode 100644
index 0000000..42547a9
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlHandle.html
@@ -0,0 +1,412 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlHandle Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlHandle Class Reference</h1><!-- doxytag: class="TiXmlHandle" -->
+<p>A <a class="el" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> is a class that wraps a node pointer with null checks; this is an incredibly useful thing.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+
+<p><a href="classTiXmlHandle-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aba18fd7bdefb942ecdea4bf4b8e29ec8"></a><!-- doxytag: member="TiXmlHandle::TiXmlHandle" ref="aba18fd7bdefb942ecdea4bf4b8e29ec8" args="(TiXmlNode *_node)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#aba18fd7bdefb942ecdea4bf4b8e29ec8">TiXmlHandle</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *_node)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a handle from any node (at any depth of the tree.) This can be a null pointer. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a236d7855e1e56ccc7b980630c48c7fd7"></a><!-- doxytag: member="TiXmlHandle::TiXmlHandle" ref="a236d7855e1e56ccc7b980630c48c7fd7" args="(const TiXmlHandle &ref)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#a236d7855e1e56ccc7b980630c48c7fd7">TiXmlHandle</a> (const <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> &ref)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acdb1faaf88a700b40ca2c8d9aee21139"></a><!-- doxytag: member="TiXmlHandle::FirstChild" ref="acdb1faaf88a700b40ca2c8d9aee21139" args="() const " -->
+<a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#acdb1faaf88a700b40ca2c8d9aee21139">FirstChild</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the first child node. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8c61f64ae9365d89c264f289085541f8"></a><!-- doxytag: member="TiXmlHandle::FirstChild" ref="a8c61f64ae9365d89c264f289085541f8" args="(const char *value) const " -->
+<a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#a8c61f64ae9365d89c264f289085541f8">FirstChild</a> (const char *value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the first child node with the given name. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a24d1112e995e937e4dddb202d4113d4a"></a><!-- doxytag: member="TiXmlHandle::FirstChildElement" ref="a24d1112e995e937e4dddb202d4113d4a" args="() const " -->
+<a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#a24d1112e995e937e4dddb202d4113d4a">FirstChildElement</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the first child element. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af0aea751320f5e430fac6f8fff3b8dd4"></a><!-- doxytag: member="TiXmlHandle::FirstChildElement" ref="af0aea751320f5e430fac6f8fff3b8dd4" args="(const char *value) const " -->
+<a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#af0aea751320f5e430fac6f8fff3b8dd4">FirstChildElement</a> (const char *value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the first child element with the given name. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#a072492b4be1acdb0db2d03cd8f71ccc4">Child</a> (const char *value, int index) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the "index" child with the given name.  <a href="#a072492b4be1acdb0db2d03cd8f71ccc4"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#af9cf6a7d08a5da94a8924425ad0cd5ac">Child</a> (int index) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the "index" child.  <a href="#af9cf6a7d08a5da94a8924425ad0cd5ac"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#a979a3f850984a176ee884e394c7eed2d">ChildElement</a> (const char *value, int index) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the "index" child element with the given name.  <a href="#a979a3f850984a176ee884e394c7eed2d"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#a8786475b9d1f1518492e3a46704c7ef0">ChildElement</a> (int index) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the "index" child element.  <a href="#a8786475b9d1f1518492e3a46704c7ef0"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#af678e5088e83be67baf76f699756f2c3">ToNode</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the handle as a <a class="el" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>.  <a href="#af678e5088e83be67baf76f699756f2c3"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#abc6e7ed383a5fe1e52b0c0004b457b9e">ToElement</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the handle as a <a class="el" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>.  <a href="#abc6e7ed383a5fe1e52b0c0004b457b9e"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#a4ac53a652296203a5b5e13854d923586">ToText</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the handle as a <a class="el" href="classTiXmlText.html" title="XML text.">TiXmlText</a>.  <a href="#a4ac53a652296203a5b5e13854d923586"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#a1381c17507a130767b1e23afc93b3674">ToUnknown</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the handle as a <a class="el" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn't recognize is saved as an unknown.">TiXmlUnknown</a>.  <a href="#a1381c17507a130767b1e23afc93b3674"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#ab44b723a8dc9af72838a303c079d0376">Node</a> () const </td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#acb5fe8388a526289ea65e817a51e05e7">Element</a> () const </td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#a9fc739c8a18d160006f82572fc143d13">Text</a> () const </td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#a49675b74357ba2aae124657a9a1ef465">Unknown</a> () const </td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>A <a class="el" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> is a class that wraps a node pointer with null checks; this is an incredibly useful thing. </p>
+<p>Note that <a class="el" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> is not part of the TinyXml DOM structure. It is a separate utility class.</p>
+<p>Take an example: </p>
+<div class="fragment"><pre class="fragment">
+	<Document>
+		<Element attributeA = "valueA">
+			<Child attributeB = "value1" />
+			<Child attributeB = "value2" />
+		</Element>
+	<Document>
+	</pre></div><p>Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very easy to write a *lot* of code that looks like:</p>
+<div class="fragment"><pre class="fragment">
+	TiXmlElement* root = document.FirstChildElement( "Document" );
+	if ( root )
+	{
+		TiXmlElement* element = root->FirstChildElement( "Element" );
+		if ( element )
+		{
+			TiXmlElement* child = element->FirstChildElement( "Child" );
+			if ( child )
+			{
+				TiXmlElement* child2 = child->NextSiblingElement( "Child" );
+				if ( child2 )
+				{
+					// Finally do something useful.
+	</pre></div><p>And that doesn't even cover "else" cases. <a class="el" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> addresses the verbosity of such code. A <a class="el" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> checks for null pointers so it is perfectly safe and correct to use:</p>
+<div class="fragment"><pre class="fragment">
+	TiXmlHandle docHandle( &document );
+	TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement();
+	if ( child2 )
+	{
+		// do something useful
+	</pre></div><p>Which is MUCH more concise and useful.</p>
+<p>It is also safe to copy handles - internally they are nothing more than node pointers. </p>
+<div class="fragment"><pre class="fragment">
+	TiXmlHandle handleCopy = handle;
+	</pre></div><p>What they should not be used for is iteration:</p>
+<div class="fragment"><pre class="fragment">
+	int i=0; 
+	while ( true )
+	{
+		TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement();
+		if ( !child )
+			break;
+		// do something
+		++i;
+	}
+	</pre></div><p>It seems reasonable, but it is in fact two embedded while loops. The Child method is a linear walk to find the element, so this code would iterate much more than it needs to. Instead, prefer:</p>
+<div class="fragment"><pre class="fragment">
+	TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement();
+
+	for( child; child; child=child->NextSiblingElement() )
+	{
+		// do something
+	}
+	</pre></div> <hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="af9cf6a7d08a5da94a8924425ad0cd5ac"></a><!-- doxytag: member="TiXmlHandle::Child" ref="af9cf6a7d08a5da94a8924425ad0cd5ac" args="(int index) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> TiXmlHandle::Child </td>
+          <td>(</td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>index</em></td>
+          <td> ) </td>
+          <td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return a handle to the "index" child. </p>
+<p>The first child is 0, the second 1, etc. </p>
+
+</div>
+</div>
+<a class="anchor" id="a072492b4be1acdb0db2d03cd8f71ccc4"></a><!-- doxytag: member="TiXmlHandle::Child" ref="a072492b4be1acdb0db2d03cd8f71ccc4" args="(const char *value, int index) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> TiXmlHandle::Child </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>value</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>index</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return a handle to the "index" child with the given name. </p>
+<p>The first child is 0, the second 1, etc. </p>
+
+</div>
+</div>
+<a class="anchor" id="a8786475b9d1f1518492e3a46704c7ef0"></a><!-- doxytag: member="TiXmlHandle::ChildElement" ref="a8786475b9d1f1518492e3a46704c7ef0" args="(int index) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> TiXmlHandle::ChildElement </td>
+          <td>(</td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>index</em></td>
+          <td> ) </td>
+          <td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return a handle to the "index" child element. </p>
+<p>The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. </p>
+
+</div>
+</div>
+<a class="anchor" id="a979a3f850984a176ee884e394c7eed2d"></a><!-- doxytag: member="TiXmlHandle::ChildElement" ref="a979a3f850984a176ee884e394c7eed2d" args="(const char *value, int index) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> TiXmlHandle::ChildElement </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>value</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>index</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return a handle to the "index" child element with the given name. </p>
+<p>The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. </p>
+
+</div>
+</div>
+<a class="anchor" id="acb5fe8388a526289ea65e817a51e05e7"></a><!-- doxytag: member="TiXmlHandle::Element" ref="acb5fe8388a526289ea65e817a51e05e7" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlHandle::Element </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>use ToElement. Return the handle as a <a class="el" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>. This may return null. </dd></dl>
+
+<p>References <a class="el" href="tinyxml_8h_source.html#l01688">ToElement()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ab44b723a8dc9af72838a303c079d0376"></a><!-- doxytag: member="TiXmlHandle::Node" ref="ab44b723a8dc9af72838a303c079d0376" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlHandle::Node </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>use ToNode. Return the handle as a <a class="el" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>. This may return null. </dd></dl>
+
+<p>References <a class="el" href="tinyxml_8h_source.html#l01685">ToNode()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a9fc739c8a18d160006f82572fc143d13"></a><!-- doxytag: member="TiXmlHandle::Text" ref="a9fc739c8a18d160006f82572fc143d13" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlText.html">TiXmlText</a>* TiXmlHandle::Text </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000003">Deprecated:</a></b></dt><dd>use <a class="el" href="classTiXmlHandle.html#a4ac53a652296203a5b5e13854d923586" title="Return the handle as a TiXmlText.">ToText()</a> Return the handle as a <a class="el" href="classTiXmlText.html" title="XML text.">TiXmlText</a>. This may return null. </dd></dl>
+
+<p>References <a class="el" href="tinyxml_8h_source.html#l01691">ToText()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="abc6e7ed383a5fe1e52b0c0004b457b9e"></a><!-- doxytag: member="TiXmlHandle::ToElement" ref="abc6e7ed383a5fe1e52b0c0004b457b9e" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlHandle::ToElement </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return the handle as a <a class="el" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>. </p>
+<p>This may return null. </p>
+
+<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01703">Element()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="af678e5088e83be67baf76f699756f2c3"></a><!-- doxytag: member="TiXmlHandle::ToNode" ref="af678e5088e83be67baf76f699756f2c3" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlHandle::ToNode </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return the handle as a <a class="el" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>. </p>
+<p>This may return null. </p>
+
+<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01699">Node()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a4ac53a652296203a5b5e13854d923586"></a><!-- doxytag: member="TiXmlHandle::ToText" ref="a4ac53a652296203a5b5e13854d923586" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlText.html">TiXmlText</a>* TiXmlHandle::ToText </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return the handle as a <a class="el" href="classTiXmlText.html" title="XML text.">TiXmlText</a>. </p>
+<p>This may return null. </p>
+
+<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01707">Text()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a1381c17507a130767b1e23afc93b3674"></a><!-- doxytag: member="TiXmlHandle::ToUnknown" ref="a1381c17507a130767b1e23afc93b3674" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>* TiXmlHandle::ToUnknown </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return the handle as a <a class="el" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn't recognize is saved as an unknown.">TiXmlUnknown</a>. </p>
+<p>This may return null. </p>
+
+<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01711">Unknown()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a49675b74357ba2aae124657a9a1ef465"></a><!-- doxytag: member="TiXmlHandle::Unknown" ref="a49675b74357ba2aae124657a9a1ef465" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>* TiXmlHandle::Unknown </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000004">Deprecated:</a></b></dt><dd>use <a class="el" href="classTiXmlHandle.html#a1381c17507a130767b1e23afc93b3674" title="Return the handle as a TiXmlUnknown.">ToUnknown()</a> Return the handle as a <a class="el" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn't recognize is saved as an unknown.">TiXmlUnknown</a>. This may return null. </dd></dl>
+
+<p>References <a class="el" href="tinyxml_8h_source.html#l01694">ToUnknown()</a>.</p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlNode-members.html b/Source/External/TinyXml/docs/classTiXmlNode-members.html
new file mode 100644
index 0000000..5d6743b
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlNode-members.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlNode Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlNode.html">TiXmlNode</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#acc0f88b7462c6cb73809d410a4f5bb86">Accept</a>(TiXmlVisitor *visitor) const =0</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [pure virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a4508cc3a2d7a98e96a54cc09c37a78a4">Clone</a>() const =0</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [pure virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#accda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#adfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">Print</a>(FILE *cfile, int depth) const =0</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [pure virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlNode.html b/Source/External/TinyXml/docs/classTiXmlNode.html
new file mode 100644
index 0000000..e0ed582
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlNode.html
@@ -0,0 +1,718 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlNode Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlNode Class Reference</h1><!-- doxytag: class="TiXmlNode" --><!-- doxytag: inherits="TiXmlBase" -->
+<p>The parent class for everything in the Document Object Model.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlNode:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlNode.png" usemap="#TiXmlNode_map" alt=""/>
+  <map id="TiXmlNode_map" name="TiXmlNode_map">
+<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="295,0,403,24"/>
+<area href="classTiXmlComment.html" alt="TiXmlComment" shape="rect" coords="0,112,108,136"/>
+<area href="classTiXmlDeclaration.html" alt="TiXmlDeclaration" shape="rect" coords="118,112,226,136"/>
+<area href="classTiXmlDocument.html" alt="TiXmlDocument" shape="rect" coords="236,112,344,136"/>
+<area href="classTiXmlElement.html" alt="TiXmlElement" shape="rect" coords="354,112,462,136"/>
+<area href="classTiXmlText.html" alt="TiXmlText" shape="rect" coords="472,112,580,136"/>
+<area href="classTiXmlUnknown.html" alt="TiXmlUnknown" shape="rect" coords="590,112,698,136"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlNode-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Types</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">NodeType</a> </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight"><p>The types of XML nodes supported by TinyXml. </p>
+ <a href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">More...</a><br/></td></tr>
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">Value</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">The meaning of 'value' changes for the specific type of <a class="el" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>.  <a href="#a77943eb90d12c2892b1337a9f5918b41"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return <a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41" title="The meaning of 'value' changes for the specific type of TiXmlNode.">Value()</a> as a std::string.  <a href="#a6d9e505619d39bf50bfd9609c9169ea5"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90">SetValue</a> (const char *_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Changes the value of the node.  <a href="#a2a38329ca5d3f28f98ce932b8299ae90"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2598d5f448042c1abbeae4503dd45ff2"></a><!-- doxytag: member="TiXmlNode::SetValue" ref="a2598d5f448042c1abbeae4503dd45ff2" args="(const std::string &_value)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">SetValue</a> (const std::string &_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a708e7f953df61d4d2d12f73171550a4b"></a><!-- doxytag: member="TiXmlNode::Clear" ref="a708e7f953df61d4d2d12f73171550a4b" args="()" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b">Clear</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete all the children of this node. Does not affect 'this'. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab643043132ffd794f8602685d34a982e"></a><!-- doxytag: member="TiXmlNode::Parent" ref="ab643043132ffd794f8602685d34a982e" args="()" -->
+<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">Parent</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">One step up the DOM. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a44c8eee26bbe2d1b2762038df9dde2f0"></a><!-- doxytag: member="TiXmlNode::FirstChild" ref="a44c8eee26bbe2d1b2762038df9dde2f0" args="() const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">The first child of this node. Will be null if there are no children. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a1f05828d023150706eeb16d6fb3f6355">FirstChild</a> (const char *value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">The first child of this node with the matching 'value'.  <a href="#a1f05828d023150706eeb16d6fb3f6355"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abc8bf32be6419ec453a731868de19554"></a><!-- doxytag: member="TiXmlNode::FirstChild" ref="abc8bf32be6419ec453a731868de19554" args="(const char *_value)" -->
+<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#abc8bf32be6419ec453a731868de19554">FirstChild</a> (const char *_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">The first child of this node with the matching 'value'. Will be null if none found. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6432d2b2495f6caf9cb4278df706a031"></a><!-- doxytag: member="TiXmlNode::LastChild" ref="a6432d2b2495f6caf9cb4278df706a031" args="()" -->
+<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">LastChild</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">The last child of this node. Will be null if there are no children. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abad5bf1059c48127b958711ef89e8e5d"></a><!-- doxytag: member="TiXmlNode::LastChild" ref="abad5bf1059c48127b958711ef89e8e5d" args="(const char *_value)" -->
+<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#abad5bf1059c48127b958711ef89e8e5d">LastChild</a> (const char *_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">The last child of this node matching 'value'. Will be null if there are no children. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a07f6200a5956c723c5b52d70f29c46f6"></a><!-- doxytag: member="TiXmlNode::FirstChild" ref="a07f6200a5956c723c5b52d70f29c46f6" args="(const std::string &_value) const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">FirstChild</a> (const std::string &_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a10d2669ccb5e29e02fcb0e4408685ef6"></a><!-- doxytag: member="TiXmlNode::FirstChild" ref="a10d2669ccb5e29e02fcb0e4408685ef6" args="(const std::string &_value)" -->
+<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a> (const std::string &_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a256d0cdbfcfeccae83f3a1c9747a8b63"></a><!-- doxytag: member="TiXmlNode::LastChild" ref="a256d0cdbfcfeccae83f3a1c9747a8b63" args="(const std::string &_value) const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a> (const std::string &_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a69772c9202f70553f940b15c06b07be3"></a><!-- doxytag: member="TiXmlNode::LastChild" ref="a69772c9202f70553f940b15c06b07be3" args="(const std::string &_value)" -->
+<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3">LastChild</a> (const std::string &_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6">IterateChildren</a> (const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> *previous) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">An alternate way to walk the children of a node.  <a href="#a8621196ba3705fa226bef4a761cc51b6"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adfaef35a076b9343adc1420757376c39"></a><!-- doxytag: member="TiXmlNode::IterateChildren" ref="adfaef35a076b9343adc1420757376c39" args="(const char *value, const TiXmlNode *previous) const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#adfaef35a076b9343adc1420757376c39">IterateChildren</a> (const char *value, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> *previous) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">This flavor of IterateChildren searches for children with a particular 'value'. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1cbaaf8e82c09ad763d52616d75724df"></a><!-- doxytag: member="TiXmlNode::IterateChildren" ref="a1cbaaf8e82c09ad763d52616d75724df" args="(const std::string &_value, const TiXmlNode *previous) const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a> (const std::string &_value, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> *previous) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a16e9ad53e2f5445b14bf325c90aa862c"></a><!-- doxytag: member="TiXmlNode::IterateChildren" ref="a16e9ad53e2f5445b14bf325c90aa862c" args="(const std::string &_value, const TiXmlNode *previous)" -->
+<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a> (const std::string &_value, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> *previous)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a> (const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &addThis)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a new node related to this.  <a href="#ad7d4630e1a2a916edda16be22448a8ba"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6">LinkEndChild</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *addThis)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a new node related to this.  <a href="#a5d29442ae46de6d0168429156197bfc6"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *beforeThis, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &addThis)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a new node related to this.  <a href="#a0c146fa2fff0157b681594102f48cbc7"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *afterThis, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &addThis)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a new node related to this.  <a href="#ad9b75e54ec19301c8b4d5ff583d0b3d5"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *replaceThis, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &withThis)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Replace a child of this node.  <a href="#a0c49e739a17b9938050c22cd89617fbd"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae19d8510efc90596552f4feeac9a8fbf"></a><!-- doxytag: member="TiXmlNode::RemoveChild" ref="ae19d8510efc90596552f4feeac9a8fbf" args="(TiXmlNode *removeThis)" -->
+bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf">RemoveChild</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *removeThis)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a child of this node. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac2cd892768726270e511b2ab32de4d10"></a><!-- doxytag: member="TiXmlNode::PreviousSibling" ref="ac2cd892768726270e511b2ab32de4d10" args="() const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">PreviousSibling</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Navigate to a sibling node. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5bdd49327eec1e609b7d22af706b8316"></a><!-- doxytag: member="TiXmlNode::PreviousSibling" ref="a5bdd49327eec1e609b7d22af706b8316" args="(const char *) const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a> (const char *) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Navigate to a sibling node. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a658276f57d35d5d4256d1dc1a2c398ab"></a><!-- doxytag: member="TiXmlNode::PreviousSibling" ref="a658276f57d35d5d4256d1dc1a2c398ab" args="(const std::string &_value) const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a> (const std::string &_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acc8a0434c7f401d4a3b6dee77c1a5912"></a><!-- doxytag: member="TiXmlNode::PreviousSibling" ref="acc8a0434c7f401d4a3b6dee77c1a5912" args="(const std::string &_value)" -->
+<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a> (const std::string &_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1b94d2f7fa7ab25a5a8e8d4340c449c9"></a><!-- doxytag: member="TiXmlNode::NextSibling" ref="a1b94d2f7fa7ab25a5a8e8d4340c449c9" args="(const std::string &_value) const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a> (const std::string &_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1757c1f4d01e8c9596ffdbd561c76aea"></a><!-- doxytag: member="TiXmlNode::NextSibling" ref="a1757c1f4d01e8c9596ffdbd561c76aea" args="(const std::string &_value)" -->
+<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a> (const std::string &_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af854baeba384f5fe9859f5aee03b548e"></a><!-- doxytag: member="TiXmlNode::NextSibling" ref="af854baeba384f5fe9859f5aee03b548e" args="() const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e">NextSibling</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Navigate to a sibling node. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2e61c0b89a77e36a0e8c60490003cb46"></a><!-- doxytag: member="TiXmlNode::NextSibling" ref="a2e61c0b89a77e36a0e8c60490003cb46" args="(const char *) const " -->
+const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a> (const char *) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Navigate to a sibling node with the given 'value'. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function to get through elements.  <a href="#a73acf929d49d10bd0e5fb3d31b0372d1"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a> (const char *) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function to get through elements.  <a href="#a071ba77fd7ab79402fa84b7e9b8607b3"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7572d0af9d1e696ee3f05d8bb5ebb463"></a><!-- doxytag: member="TiXmlNode::NextSiblingElement" ref="a7572d0af9d1e696ee3f05d8bb5ebb463" args="(const std::string &_value) const " -->
+const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a> (const std::string &_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a506958e34406729a4e4c5326ea39d081"></a><!-- doxytag: member="TiXmlNode::NextSiblingElement" ref="a506958e34406729a4e4c5326ea39d081" args="(const std::string &_value)" -->
+<a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081">NextSiblingElement</a> (const std::string &_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af4fb652f6bd79ae0d5ce7d0f7d3c0fba"></a><!-- doxytag: member="TiXmlNode::FirstChildElement" ref="af4fb652f6bd79ae0d5ce7d0f7d3c0fba" args="() const " -->
+const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function to get through elements. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="accda2c6b45c25bb5a6f9c3407a644e61"></a><!-- doxytag: member="TiXmlNode::FirstChildElement" ref="accda2c6b45c25bb5a6f9c3407a644e61" args="(const char *_value) const " -->
+const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#accda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a> (const char *_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function to get through elements. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a327ad4bbd90073c5dfc931b07314f5f7"></a><!-- doxytag: member="TiXmlNode::FirstChildElement" ref="a327ad4bbd90073c5dfc931b07314f5f7" args="(const std::string &_value) const " -->
+const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a> (const std::string &_value) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7f1d7291880534c1e5cdeb392d8c1f45"></a><!-- doxytag: member="TiXmlNode::FirstChildElement" ref="a7f1d7291880534c1e5cdeb392d8c1f45" args="(const std::string &_value)" -->
+<a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a> (const std::string &_value)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">Type</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Query the type (as an enumerated value, above) of this node.  <a href="#a57b99d5c97d67a42b9752f5210a1ba5e"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3">GetDocument</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a pointer to the Document this node lives in.  <a href="#a80e397fa973cf5323e33b07154b024f3"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeed21ad30630ef6e7faf096127edc9f3"></a><!-- doxytag: member="TiXmlNode::NoChildren" ref="aeed21ad30630ef6e7faf096127edc9f3" args="() const " -->
+bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">NoChildren</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if this node has no children. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8a4cda4b15c29f64cff419309aebed08"></a><!-- doxytag: member="TiXmlNode::ToDocument" ref="a8a4cda4b15c29f64cff419309aebed08" args="() const " -->
+virtual const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08">ToDocument</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a72abed96dc9667ab9e0a2a275301bb1c"></a><!-- doxytag: member="TiXmlNode::ToElement" ref="a72abed96dc9667ab9e0a2a275301bb1c" args="() const " -->
+virtual const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c">ToElement</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa0a5086f9eaee910bbfdc7f975e26574"></a><!-- doxytag: member="TiXmlNode::ToComment" ref="aa0a5086f9eaee910bbfdc7f975e26574" args="() const " -->
+virtual const <a class="el" href="classTiXmlComment.html">TiXmlComment</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574">ToComment</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afd7205cf31d7a376929f8a36930627a2"></a><!-- doxytag: member="TiXmlNode::ToUnknown" ref="afd7205cf31d7a376929f8a36930627a2" args="() const " -->
+virtual const <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2">ToUnknown</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a95a46a52c525992d6b4ee08beb14cd69"></a><!-- doxytag: member="TiXmlNode::ToText" ref="a95a46a52c525992d6b4ee08beb14cd69" args="() const " -->
+virtual const <a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a95a46a52c525992d6b4ee08beb14cd69">ToText</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9f43e6984fc7d4afd6eb32714c6b7b72"></a><!-- doxytag: member="TiXmlNode::ToDeclaration" ref="a9f43e6984fc7d4afd6eb32714c6b7b72" args="() const " -->
+virtual const <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6a4c8ac28ee7a745d059db6691e03bae"></a><!-- doxytag: member="TiXmlNode::ToDocument" ref="a6a4c8ac28ee7a745d059db6691e03bae" args="()" -->
+virtual <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa65d000223187d22a4dcebd7479e9ebc"></a><!-- doxytag: member="TiXmlNode::ToElement" ref="aa65d000223187d22a4dcebd7479e9ebc" args="()" -->
+virtual <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#aa65d000223187d22a4dcebd7479e9ebc">ToElement</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a383e06a0787f7063953934867990f849"></a><!-- doxytag: member="TiXmlNode::ToComment" ref="a383e06a0787f7063953934867990f849" args="()" -->
+virtual <a class="el" href="classTiXmlComment.html">TiXmlComment</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a383e06a0787f7063953934867990f849">ToComment</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a06de5af852668c7e4af0d09c205f0b0d"></a><!-- doxytag: member="TiXmlNode::ToUnknown" ref="a06de5af852668c7e4af0d09c205f0b0d" args="()" -->
+virtual <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3ddfbcac78fbea041fad57e5c6d60a03"></a><!-- doxytag: member="TiXmlNode::ToText" ref="a3ddfbcac78fbea041fad57e5c6d60a03" args="()" -->
+virtual <a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03">ToText</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4027136ca820ff4a636b607231b6a6df"></a><!-- doxytag: member="TiXmlNode::ToDeclaration" ref="a4027136ca820ff4a636b607231b6a6df" args="()" -->
+virtual <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a4027136ca820ff4a636b607231b6a6df">ToDeclaration</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a4508cc3a2d7a98e96a54cc09c37a78a4">Clone</a> () const =0</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an exact duplicate of this node and return it.  <a href="#a4508cc3a2d7a98e96a54cc09c37a78a4"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#acc0f88b7462c6cb73809d410a4f5bb86">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *visitor) const =0</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Accept a hierchical visit the nodes in the TinyXML DOM.  <a href="#acc0f88b7462c6cb73809d410a4f5bb86"></a><br/></td></tr>
+<tr><td colspan="2"><h2>Friends</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a173617f6dfe902cf484ce5552b950475"></a><!-- doxytag: member="TiXmlNode::TiXmlDocument" ref="a173617f6dfe902cf484ce5552b950475" args="" -->
+class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a173617f6dfe902cf484ce5552b950475">TiXmlDocument</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab6592e32cb9132be517cc12a70564c4b"></a><!-- doxytag: member="TiXmlNode::TiXmlElement" ref="ab6592e32cb9132be517cc12a70564c4b" args="" -->
+class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#ab6592e32cb9132be517cc12a70564c4b">TiXmlElement</a></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">std::istream & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9">operator>></a> (std::istream &in, <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &base)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">An input stream operator, for every class.  <a href="#ab57bd426563c926844f65a78412e18b9"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">std::ostream & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7">operator<<</a> (std::ostream &out, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &base)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">An output stream operator, for every class.  <a href="#a86cd49cfb17a844c0010b3136ac966c7"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a52ef17e7080df2490cf87bde380685ab"></a><!-- doxytag: member="TiXmlNode::operator<<" ref="a52ef17e7080df2490cf87bde380685ab" args="(std::string &out, const TiXmlNode &base)" -->
+std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a52ef17e7080df2490cf87bde380685ab">operator<<</a> (std::string &out, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &base)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Appends the XML node or attribute to a std::string. <br/></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>The parent class for everything in the Document Object Model. </p>
+<p>(Except for attributes). Nodes have siblings, a parent, and children. A node can be in a document, or stand on its own. The type of a <a class="el" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a> can be queried, and it can be cast to its more defined type. </p>
+<hr/><h2>Member Enumeration Documentation</h2>
+<a class="anchor" id="a836eded4920ab9e9ef28496f48cd95a2"></a><!-- doxytag: member="TiXmlNode::NodeType" ref="a836eded4920ab9e9ef28496f48cd95a2" args="" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">enum <a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">TiXmlNode::NodeType</a></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>The types of XML nodes supported by TinyXml. </p>
+<p>(All the unsupported types are picked up by UNKNOWN.) </p>
+
+</div>
+</div>
+<hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="acc0f88b7462c6cb73809d410a4f5bb86"></a><!-- doxytag: member="TiXmlNode::Accept" ref="acc0f88b7462c6cb73809d410a4f5bb86" args="(TiXmlVisitor *visitor) const =0" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual bool TiXmlNode::Accept </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> * </td>
+          <td class="paramname"> <em>visitor</em></td>
+          <td> ) </td>
+          <td> const<code> [pure virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Accept a hierchical visit the nodes in the TinyXML DOM. </p>
+<p>Every node in the XML tree will be conditionally visited and the host will be called back via the <a class="el" href="classTiXmlVisitor.html" title="Implements the interface to the "Visitor pattern" (see the Accept() method...">TiXmlVisitor</a> interface.</p>
+<p>This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML is unchanged by using this interface versus any other.)</p>
+<p>The interface has been based on ideas from:</p>
+<ul>
+<li><a href="http://www.saxproject.org/">http://www.saxproject.org/</a></li>
+<li><a href="http://c2.com/cgi/wiki?HierarchicalVisitorPattern">http://c2.com/cgi/wiki?HierarchicalVisitorPattern</a></li>
+</ul>
+<p>Which are both good references for "visiting".</p>
+<p>An example of using <a class="el" href="classTiXmlNode.html#acc0f88b7462c6cb73809d410a4f5bb86" title="Accept a hierchical visit the nodes in the TinyXML DOM.">Accept()</a>: </p>
+<div class="fragment"><pre class="fragment">
+		TiXmlPrinter printer;
+		tinyxmlDoc.Accept( &printer );
+		const char* xmlcstr = printer.CStr();
+		</pre></div> 
+<p>Implemented in <a class="el" href="classTiXmlElement.html#a71a81b2afb0d42be1543d1c404dee6f5">TiXmlElement</a>, <a class="el" href="classTiXmlComment.html#af3ac1b99fbbe9ea4fb6e14146156e43e">TiXmlComment</a>, <a class="el" href="classTiXmlText.html#a8483d4415ce9de6c4fa8f63d067d5de6">TiXmlText</a>, <a class="el" href="classTiXmlDeclaration.html#a22315a535983b86535cdba3458669e3e">TiXmlDeclaration</a>, <a class="el" href="classTiXmlUnknown.html#ad7122e5135581b3c832a1a3217760a93">TiXmlUnknown</a>, and <a class="el" href="classTiXmlDocument.html#aa545aae325d9752ad64120bc4ecf939a">TiXmlDocument</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a4508cc3a2d7a98e96a54cc09c37a78a4"></a><!-- doxytag: member="TiXmlNode::Clone" ref="a4508cc3a2d7a98e96a54cc09c37a78a4" args="() const =0" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::Clone </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [pure virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Create an exact duplicate of this node and return it. </p>
+<p>The memory must be deleted by the caller. </p>
+
+<p>Implemented in <a class="el" href="classTiXmlElement.html#aa464535ea1994db337cb6a8ce4b588b5">TiXmlElement</a>, <a class="el" href="classTiXmlComment.html#a0d6662bdc52488b9e12b3c7a0453d028">TiXmlComment</a>, <a class="el" href="classTiXmlText.html#a0c411e93a27537369479d034cc82da3b">TiXmlText</a>, <a class="el" href="classTiXmlDeclaration.html#a7cf459186040141cda7a180a6585ce2e">TiXmlDeclaration</a>, <a class="el" href="classTiXmlUnknown.html#a0960bb7428b3f341da46244229604d73">TiXmlUnknown</a>, and <a class="el" href="classTiXmlDocument.html#a4968661cab4a1f44a23329c6f8db1907">TiXmlDocument</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a1f05828d023150706eeb16d6fb3f6355"></a><!-- doxytag: member="TiXmlNode::FirstChild" ref="a1f05828d023150706eeb16d6fb3f6355" args="(const char *value) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::FirstChild </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>value</em></td>
+          <td> ) </td>
+          <td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>The first child of this node with the matching 'value'. </p>
+<p>Will be null if none found. </p>
+
+</div>
+</div>
+<a class="anchor" id="a80e397fa973cf5323e33b07154b024f3"></a><!-- doxytag: member="TiXmlNode::GetDocument" ref="a80e397fa973cf5323e33b07154b024f3" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a>* TiXmlNode::GetDocument </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return a pointer to the Document this node lives in. </p>
+<p>Returns null if not in a document. </p>
+
+</div>
+</div>
+<a class="anchor" id="ad9b75e54ec19301c8b4d5ff583d0b3d5"></a><!-- doxytag: member="TiXmlNode::InsertAfterChild" ref="ad9b75e54ec19301c8b4d5ff583d0b3d5" args="(TiXmlNode *afterThis, const TiXmlNode &addThis)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::InsertAfterChild </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td>
+          <td class="paramname"> <em>afterThis</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td>
+          <td class="paramname"> <em>addThis</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Add a new node related to this. </p>
+<p>Adds a child after the specified child. Returns a pointer to the new object or NULL if an error occured. </p>
+
+</div>
+</div>
+<a class="anchor" id="a0c146fa2fff0157b681594102f48cbc7"></a><!-- doxytag: member="TiXmlNode::InsertBeforeChild" ref="a0c146fa2fff0157b681594102f48cbc7" args="(TiXmlNode *beforeThis, const TiXmlNode &addThis)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::InsertBeforeChild </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td>
+          <td class="paramname"> <em>beforeThis</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td>
+          <td class="paramname"> <em>addThis</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Add a new node related to this. </p>
+<p>Adds a child before the specified child. Returns a pointer to the new object or NULL if an error occured. </p>
+
+</div>
+</div>
+<a class="anchor" id="ad7d4630e1a2a916edda16be22448a8ba"></a><!-- doxytag: member="TiXmlNode::InsertEndChild" ref="ad7d4630e1a2a916edda16be22448a8ba" args="(const TiXmlNode &addThis)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::InsertEndChild </td>
+          <td>(</td>
+          <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td>
+          <td class="paramname"> <em>addThis</em></td>
+          <td> ) </td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Add a new node related to this. </p>
+<p>Adds a child past the LastChild. Returns a pointer to the new object or NULL if an error occured. </p>
+
+</div>
+</div>
+<a class="anchor" id="a8621196ba3705fa226bef4a761cc51b6"></a><!-- doxytag: member="TiXmlNode::IterateChildren" ref="a8621196ba3705fa226bef4a761cc51b6" args="(const TiXmlNode *previous) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::IterateChildren </td>
+          <td>(</td>
+          <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td>
+          <td class="paramname"> <em>previous</em></td>
+          <td> ) </td>
+          <td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>An alternate way to walk the children of a node. </p>
+<p>One way to iterate over nodes is: </p>
+<div class="fragment"><pre class="fragment">
+			for( child = parent->FirstChild(); child; child = child->NextSibling() )
+		</pre></div><p>IterateChildren does the same thing with the syntax: </p>
+<div class="fragment"><pre class="fragment">
+			child = 0;
+			while( child = parent->IterateChildren( child ) )
+		</pre></div><p>IterateChildren takes the previous child as input and finds the next one. If the previous child is null, it returns the first. IterateChildren will return null when done. </p>
+
+</div>
+</div>
+<a class="anchor" id="a5d29442ae46de6d0168429156197bfc6"></a><!-- doxytag: member="TiXmlNode::LinkEndChild" ref="a5d29442ae46de6d0168429156197bfc6" args="(TiXmlNode *addThis)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::LinkEndChild </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td>
+          <td class="paramname"> <em>addThis</em></td>
+          <td> ) </td>
+          <td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Add a new node related to this. </p>
+<p>Adds a child past the LastChild.</p>
+<p>NOTE: the node to be added is passed by pointer, and will be henceforth owned (and deleted) by tinyXml. This method is efficient and avoids an extra copy, but should be used with care as it uses a different memory model than the other insert functions.</p>
+<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba" title="Add a new node related to this.">InsertEndChild</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a071ba77fd7ab79402fa84b7e9b8607b3"></a><!-- doxytag: member="TiXmlNode::NextSiblingElement" ref="a071ba77fd7ab79402fa84b7e9b8607b3" args="(const char *) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlNode::NextSiblingElement </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Convenience function to get through elements. </p>
+<p>Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element. </p>
+
+</div>
+</div>
+<a class="anchor" id="a73acf929d49d10bd0e5fb3d31b0372d1"></a><!-- doxytag: member="TiXmlNode::NextSiblingElement" ref="a73acf929d49d10bd0e5fb3d31b0372d1" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlNode::NextSiblingElement </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const</td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Convenience function to get through elements. </p>
+<p>Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element. </p>
+
+</div>
+</div>
+<a class="anchor" id="a0c49e739a17b9938050c22cd89617fbd"></a><!-- doxytag: member="TiXmlNode::ReplaceChild" ref="a0c49e739a17b9938050c22cd89617fbd" args="(TiXmlNode *replaceThis, const TiXmlNode &withThis)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::ReplaceChild </td>
+          <td>(</td>
+          <td class="paramtype"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td>
+          <td class="paramname"> <em>replaceThis</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td>
+          <td class="paramname"> <em>withThis</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Replace a child of this node. </p>
+<p>Returns a pointer to the new object or NULL if an error occured. </p>
+
+</div>
+</div>
+<a class="anchor" id="a2a38329ca5d3f28f98ce932b8299ae90"></a><!-- doxytag: member="TiXmlNode::SetValue" ref="a2a38329ca5d3f28f98ce932b8299ae90" args="(const char *_value)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlNode::SetValue </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>_value</em></td>
+          <td> ) </td>
+          <td><code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Changes the value of the node. </p>
+<p>Defined as: </p>
+<div class="fragment"><pre class="fragment">
+		Document:	filename of the xml file
+		Element:	name of the element
+		Comment:	the comment text
+		Unknown:	the tag contents
+		Text:		the text string
+		</pre></div> 
+<p>Referenced by <a class="el" href="tinyxml_8h_source.html#l01168">TiXmlComment::TiXmlComment()</a>, and <a class="el" href="tinyxml_8h_source.html#l01220">TiXmlText::TiXmlText()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="a57b99d5c97d67a42b9752f5210a1ba5e"></a><!-- doxytag: member="TiXmlNode::Type" ref="a57b99d5c97d67a42b9752f5210a1ba5e" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int TiXmlNode::Type </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Query the type (as an enumerated value, above) of this node. </p>
+<p>The possible types are: TINYXML_DOCUMENT, TINYXML_ELEMENT, TINYXML_COMMENT, TINYXML_UNKNOWN, TINYXML_TEXT, and TINYXML_DECLARATION. </p>
+
+</div>
+</div>
+<a class="anchor" id="a77943eb90d12c2892b1337a9f5918b41"></a><!-- doxytag: member="TiXmlNode::Value" ref="a77943eb90d12c2892b1337a9f5918b41" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const char* TiXmlNode::Value </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>The meaning of 'value' changes for the specific type of <a class="el" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>. </p>
+<div class="fragment"><pre class="fragment">
+		Document:	filename of the xml file
+		Element:	name of the element
+		Comment:	the comment text
+		Unknown:	the tag contents
+		Text:		the text string
+		</pre></div><p>The subclasses will wrap this function. </p>
+
+</div>
+</div>
+<a class="anchor" id="a6d9e505619d39bf50bfd9609c9169ea5"></a><!-- doxytag: member="TiXmlNode::ValueStr" ref="a6d9e505619d39bf50bfd9609c9169ea5" args="() const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">const std::string& TiXmlNode::ValueStr </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td> const<code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Return <a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41" title="The meaning of 'value' changes for the specific type of TiXmlNode.">Value()</a> as a std::string. </p>
+<p>If you only use STL, this is more efficient than calling <a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41" title="The meaning of 'value' changes for the specific type of TiXmlNode.">Value()</a>. Only available in STL mode. </p>
+
+</div>
+</div>
+<hr/><h2>Friends And Related Function Documentation</h2>
+<a class="anchor" id="a86cd49cfb17a844c0010b3136ac966c7"></a><!-- doxytag: member="TiXmlNode::operator<<" ref="a86cd49cfb17a844c0010b3136ac966c7" args="(std::ostream &out, const TiXmlNode &base)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">std::ostream& operator<< </td>
+          <td>(</td>
+          <td class="paramtype">std::ostream & </td>
+          <td class="paramname"> <em>out</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td>
+          <td class="paramname"> <em>base</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td><code> [friend]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>An output stream operator, for every class. </p>
+<p>Note that this outputs without any newlines or formatting, as opposed to <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512" title="All TinyXml classes can print themselves to a filestream or the string class (TiXmlString...">Print()</a>, which includes tabs and new lines.</p>
+<p>The operator<< and operator>> are not completely symmetric. Writing a node to a stream is very well defined. You'll get a nice stream of output, without any extra whitespace or newlines.</p>
+<p>But reading is not as well defined. (As it always is.) If you create a <a class="el" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a> (for example) and read that from an input stream, the text needs to define an element or junk will result. This is true of all input streams, but it's worth keeping in mind.</p>
+<p>A <a class="el" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a> will read nodes until it reads a root element, and all the children of that root element. </p>
+
+</div>
+</div>
+<a class="anchor" id="ab57bd426563c926844f65a78412e18b9"></a><!-- doxytag: member="TiXmlNode::operator>>" ref="ab57bd426563c926844f65a78412e18b9" args="(std::istream &in, TiXmlNode &base)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">std::istream& operator>> </td>
+          <td>(</td>
+          <td class="paramtype">std::istream & </td>
+          <td class="paramname"> <em>in</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td>
+          <td class="paramname"> <em>base</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td><code> [friend]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>An input stream operator, for every class. </p>
+<p>Tolerant of newlines and formatting, but doesn't expect them. </p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlNode.png b/Source/External/TinyXml/docs/classTiXmlNode.png
new file mode 100644
index 0000000..77ef876
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlNode.png differ
diff --git a/Source/External/TinyXml/docs/classTiXmlPrinter-members.html b/Source/External/TinyXml/docs/classTiXmlPrinter-members.html
new file mode 100644
index 0000000..2dafaa7
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlPrinter-members.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlPrinter Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a859eede9597d3e0355b77757be48735e">CStr</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#abb33ec7d4bad6aaeb57f4304394b133d">Indent</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a11f1b4804a460b175ec244eb5724d96d">LineBreak</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a213377a4070c7e625bae59716b089e5e">SetIndent</a>(const char *_indent)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a4be1e37e69e3858c59635aa947174fe6">SetLineBreak</a>(const char *_lineBreak)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#ab23a90629e374cb1cadca090468bbd19">SetStreamPrinting</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#ad01375ae9199bd2f48252eaddce3039d">Size</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a3bd4daf44309b41f5813a833caa0d1c9">Str</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#ace1b14d33eede2575c0743e2350f6a38">Visit</a>(const TiXmlDeclaration &declaration)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a711e7d65d4af9ec70977568d2451fb1c">Visit</a>(const TiXmlText &text)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a83c13d6b980064b30f989f9a35498979">Visit</a>(const TiXmlComment &comment)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#ad2dca6dd106e8982fd3c7db1f3330970">Visit</a>(const TiXmlUnknown &unknown)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a799f4f0388570cbb54c0d3c345fef7c1">VisitEnter</a>(const TiXmlDocument &doc)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a0c5e7bf8622838417a0d0bfb8f433854">VisitEnter</a>(const TiXmlElement &element, const TiXmlAttribute *firstAttribute)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a66b33edd76c538b462f789b797a4fdf2">VisitExit</a>(const TiXmlDocument &doc)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#a1853cf2f6e63ad4b4232b4835e0acaf0">VisitExit</a>(const TiXmlElement &element)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlPrinter.html b/Source/External/TinyXml/docs/classTiXmlPrinter.html
new file mode 100644
index 0000000..f499081
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlPrinter.html
@@ -0,0 +1,181 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlPrinter Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlPrinter Class Reference</h1><!-- doxytag: class="TiXmlPrinter" --><!-- doxytag: inherits="TiXmlVisitor" -->
+<p>Print to memory functionality.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlPrinter:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlPrinter.png" usemap="#TiXmlPrinter_map" alt=""/>
+  <map id="TiXmlPrinter_map" name="TiXmlPrinter_map">
+<area href="classTiXmlVisitor.html" alt="TiXmlVisitor" shape="rect" coords="0,0,81,24"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlPrinter-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a799f4f0388570cbb54c0d3c345fef7c1"></a><!-- doxytag: member="TiXmlPrinter::VisitEnter" ref="a799f4f0388570cbb54c0d3c345fef7c1" args="(const TiXmlDocument &doc)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a799f4f0388570cbb54c0d3c345fef7c1">VisitEnter</a> (const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> &doc)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a document. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a66b33edd76c538b462f789b797a4fdf2"></a><!-- doxytag: member="TiXmlPrinter::VisitExit" ref="a66b33edd76c538b462f789b797a4fdf2" args="(const TiXmlDocument &doc)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a66b33edd76c538b462f789b797a4fdf2">VisitExit</a> (const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> &doc)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a document. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0c5e7bf8622838417a0d0bfb8f433854"></a><!-- doxytag: member="TiXmlPrinter::VisitEnter" ref="a0c5e7bf8622838417a0d0bfb8f433854" args="(const TiXmlElement &element, const TiXmlAttribute *firstAttribute)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a0c5e7bf8622838417a0d0bfb8f433854">VisitEnter</a> (const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> &element, const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *firstAttribute)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an element. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1853cf2f6e63ad4b4232b4835e0acaf0"></a><!-- doxytag: member="TiXmlPrinter::VisitExit" ref="a1853cf2f6e63ad4b4232b4835e0acaf0" args="(const TiXmlElement &element)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a1853cf2f6e63ad4b4232b4835e0acaf0">VisitExit</a> (const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> &element)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an element. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ace1b14d33eede2575c0743e2350f6a38"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="ace1b14d33eede2575c0743e2350f6a38" args="(const TiXmlDeclaration &declaration)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#ace1b14d33eede2575c0743e2350f6a38">Visit</a> (const <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> &declaration)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a declaration. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a711e7d65d4af9ec70977568d2451fb1c"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="a711e7d65d4af9ec70977568d2451fb1c" args="(const TiXmlText &text)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a711e7d65d4af9ec70977568d2451fb1c">Visit</a> (const <a class="el" href="classTiXmlText.html">TiXmlText</a> &text)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a text node. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a83c13d6b980064b30f989f9a35498979"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="a83c13d6b980064b30f989f9a35498979" args="(const TiXmlComment &comment)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a83c13d6b980064b30f989f9a35498979">Visit</a> (const <a class="el" href="classTiXmlComment.html">TiXmlComment</a> &comment)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a comment node. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad2dca6dd106e8982fd3c7db1f3330970"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="ad2dca6dd106e8982fd3c7db1f3330970" args="(const TiXmlUnknown &unknown)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#ad2dca6dd106e8982fd3c7db1f3330970">Visit</a> (const <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> &unknown)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an unknown node. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a213377a4070c7e625bae59716b089e5e">SetIndent</a> (const char *_indent)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the indent characters for printing.  <a href="#a213377a4070c7e625bae59716b089e5e"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abb33ec7d4bad6aaeb57f4304394b133d"></a><!-- doxytag: member="TiXmlPrinter::Indent" ref="abb33ec7d4bad6aaeb57f4304394b133d" args="()" -->
+const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#abb33ec7d4bad6aaeb57f4304394b133d">Indent</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Query the indention string. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a4be1e37e69e3858c59635aa947174fe6">SetLineBreak</a> (const char *_lineBreak)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the line breaking string.  <a href="#a4be1e37e69e3858c59635aa947174fe6"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a11f1b4804a460b175ec244eb5724d96d"></a><!-- doxytag: member="TiXmlPrinter::LineBreak" ref="a11f1b4804a460b175ec244eb5724d96d" args="()" -->
+const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a11f1b4804a460b175ec244eb5724d96d">LineBreak</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Query the current line breaking string. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#ab23a90629e374cb1cadca090468bbd19">SetStreamPrinting</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Switch over to "stream printing" which is the most dense formatting without linebreaks.  <a href="#ab23a90629e374cb1cadca090468bbd19"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a859eede9597d3e0355b77757be48735e"></a><!-- doxytag: member="TiXmlPrinter::CStr" ref="a859eede9597d3e0355b77757be48735e" args="()" -->
+const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a859eede9597d3e0355b77757be48735e">CStr</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the result. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad01375ae9199bd2f48252eaddce3039d"></a><!-- doxytag: member="TiXmlPrinter::Size" ref="ad01375ae9199bd2f48252eaddce3039d" args="()" -->
+size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#ad01375ae9199bd2f48252eaddce3039d">Size</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the length of the result string. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3bd4daf44309b41f5813a833caa0d1c9"></a><!-- doxytag: member="TiXmlPrinter::Str" ref="a3bd4daf44309b41f5813a833caa0d1c9" args="()" -->
+const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a3bd4daf44309b41f5813a833caa0d1c9">Str</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the result. <br/></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>Print to memory functionality. </p>
+<p>The <a class="el" href="classTiXmlPrinter.html" title="Print to memory functionality.">TiXmlPrinter</a> is useful when you need to:</p>
+<ol type="1">
+<li>Print to memory (especially in non-STL mode)</li>
+<li>Control formatting (line endings, etc.)</li>
+</ol>
+<p>When constructed, the <a class="el" href="classTiXmlPrinter.html" title="Print to memory functionality.">TiXmlPrinter</a> is in its default "pretty printing" mode. Before calling Accept() you can call methods to control the printing of the XML document. After <a class="el" href="classTiXmlNode.html#acc0f88b7462c6cb73809d410a4f5bb86" title="Accept a hierchical visit the nodes in the TinyXML DOM.">TiXmlNode::Accept()</a> is called, the printed document can be accessed via the <a class="el" href="classTiXmlPrinter.html#a859eede9597d3e0355b77757be48735e" title="Return the result.">CStr()</a>, <a class="el" href="classTiXmlPrinter.html#a3bd4daf44309b41f5813a833caa0d1c9" title="Return the result.">Str()</a>, and <a class="el" href="classTiXmlPrinter.html#ad01375ae9199bd2f48252eaddce3039d" title="Return the length of the result string.">Size()</a> methods.</p>
+<p><a class="el" href="classTiXmlPrinter.html" title="Print to memory functionality.">TiXmlPrinter</a> uses the Visitor API. </p>
+<div class="fragment"><pre class="fragment">
+	TiXmlPrinter printer;
+	printer.SetIndent( "\t" );
+
+	doc.Accept( &printer );
+	fprintf( stdout, "%s", printer.CStr() );
+	</pre></div> <hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="a213377a4070c7e625bae59716b089e5e"></a><!-- doxytag: member="TiXmlPrinter::SetIndent" ref="a213377a4070c7e625bae59716b089e5e" args="(const char *_indent)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlPrinter::SetIndent </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>_indent</em></td>
+          <td> ) </td>
+          <td><code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Set the indent characters for printing. </p>
+<p>By default 4 spaces but tab () is also useful, or null/empty string for no indentation. </p>
+
+</div>
+</div>
+<a class="anchor" id="a4be1e37e69e3858c59635aa947174fe6"></a><!-- doxytag: member="TiXmlPrinter::SetLineBreak" ref="a4be1e37e69e3858c59635aa947174fe6" args="(const char *_lineBreak)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlPrinter::SetLineBreak </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>_lineBreak</em></td>
+          <td> ) </td>
+          <td><code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Set the line breaking string. </p>
+<p>By default set to newline (<br/>
+). Some operating systems prefer other characters, or can be set to the null/empty string for no indenation. </p>
+
+</div>
+</div>
+<a class="anchor" id="ab23a90629e374cb1cadca090468bbd19"></a><!-- doxytag: member="TiXmlPrinter::SetStreamPrinting" ref="ab23a90629e374cb1cadca090468bbd19" args="()" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void TiXmlPrinter::SetStreamPrinting </td>
+          <td>(</td>
+          <td class="paramname"></td>
+          <td> ) </td>
+          <td><code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Switch over to "stream printing" which is the most dense formatting without linebreaks. </p>
+<p>Common when the XML is needed for network transmission. </p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlPrinter.png b/Source/External/TinyXml/docs/classTiXmlPrinter.png
new file mode 100644
index 0000000..6a5ff8e
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlPrinter.png differ
diff --git a/Source/External/TinyXml/docs/classTiXmlText-members.html b/Source/External/TinyXml/docs/classTiXmlText-members.html
new file mode 100644
index 0000000..cb781f4
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlText-members.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlText Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlText.html">TiXmlText</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlText.html#a8483d4415ce9de6c4fa8f63d067d5de6">Accept</a>(TiXmlVisitor *content) const </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlText.html#ad1a6a6b83fa2271022dd97c072a2b586">CDATA</a>() const </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlText.html#a0c411e93a27537369479d034cc82da3b">Clone</a>() const </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [protected, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#accda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#adfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlText.html#a0cafbf6f236c7f02d12b2bffc2b7976b">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlText.html#acb17ff7c5d09b2c839393445a3de5ea9">SetCDATA</a>(bool _cdata)</td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlText.html#af659e77c6b87d684827f35a8f4895960">TiXmlText</a>(const char *initValue)</td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlText.html#a439792f6183a3d3fb6f2bc2b16fa5691">TiXmlText</a>(const std::string &initValue)</td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlText.html#a895bf34ffad17f7439ab2a52b9651648">ToText</a>() const </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlText.html#ae7c3a8fd3e4dbf6c0c4363a943d72f5b">ToText</a>()</td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlText.html b/Source/External/TinyXml/docs/classTiXmlText.html
new file mode 100644
index 0000000..657ba4f
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlText.html
@@ -0,0 +1,149 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlText Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlText Class Reference</h1><!-- doxytag: class="TiXmlText" --><!-- doxytag: inherits="TiXmlNode" -->
+<p>XML text.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlText:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlText.png" usemap="#TiXmlText_map" alt=""/>
+  <map id="TiXmlText_map" name="TiXmlText_map">
+<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,73,80"/>
+<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,73,24"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlText-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#af659e77c6b87d684827f35a8f4895960">TiXmlText</a> (const char *initValue)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor for text element.  <a href="#af659e77c6b87d684827f35a8f4895960"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a439792f6183a3d3fb6f2bc2b16fa5691"></a><!-- doxytag: member="TiXmlText::TiXmlText" ref="a439792f6183a3d3fb6f2bc2b16fa5691" args="(const std::string &initValue)" -->
+ </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#a439792f6183a3d3fb6f2bc2b16fa5691">TiXmlText</a> (const std::string &initValue)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#a0cafbf6f236c7f02d12b2bffc2b7976b">Print</a> (FILE *cfile, int depth) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.  <a href="#a0cafbf6f236c7f02d12b2bffc2b7976b"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad1a6a6b83fa2271022dd97c072a2b586"></a><!-- doxytag: member="TiXmlText::CDATA" ref="ad1a6a6b83fa2271022dd97c072a2b586" args="() const " -->
+bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#ad1a6a6b83fa2271022dd97c072a2b586">CDATA</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Queries whether this represents text using a CDATA section. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acb17ff7c5d09b2c839393445a3de5ea9"></a><!-- doxytag: member="TiXmlText::SetCDATA" ref="acb17ff7c5d09b2c839393445a3de5ea9" args="(bool _cdata)" -->
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#acb17ff7c5d09b2c839393445a3de5ea9">SetCDATA</a> (bool _cdata)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Turns on or off a CDATA representation of text. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a895bf34ffad17f7439ab2a52b9651648"></a><!-- doxytag: member="TiXmlText::ToText" ref="a895bf34ffad17f7439ab2a52b9651648" args="() const " -->
+virtual const <a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#a895bf34ffad17f7439ab2a52b9651648">ToText</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae7c3a8fd3e4dbf6c0c4363a943d72f5b"></a><!-- doxytag: member="TiXmlText::ToText" ref="ae7c3a8fd3e4dbf6c0c4363a943d72f5b" args="()" -->
+virtual <a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#ae7c3a8fd3e4dbf6c0c4363a943d72f5b">ToText</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8483d4415ce9de6c4fa8f63d067d5de6"></a><!-- doxytag: member="TiXmlText::Accept" ref="a8483d4415ce9de6c4fa8f63d067d5de6" args="(TiXmlVisitor *content) const " -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#a8483d4415ce9de6c4fa8f63d067d5de6">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *content) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br/></td></tr>
+<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0c411e93a27537369479d034cc82da3b"></a><!-- doxytag: member="TiXmlText::Clone" ref="a0c411e93a27537369479d034cc82da3b" args="() const " -->
+virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#a0c411e93a27537369479d034cc82da3b">Clone</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">[internal use] Creates a new Element and returns it. <br/></td></tr>
+<tr><td colspan="2"><h2>Friends</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab6592e32cb9132be517cc12a70564c4b"></a><!-- doxytag: member="TiXmlText::TiXmlElement" ref="ab6592e32cb9132be517cc12a70564c4b" args="" -->
+class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#ab6592e32cb9132be517cc12a70564c4b">TiXmlElement</a></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>XML text. </p>
+<p>A text node can have 2 ways to output the next. "normal" output and CDATA. It will default to the mode it was parsed from the XML file and you generally want to leave it alone, but you can change the output mode with <a class="el" href="classTiXmlText.html#acb17ff7c5d09b2c839393445a3de5ea9" title="Turns on or off a CDATA representation of text.">SetCDATA()</a> and query it with <a class="el" href="classTiXmlText.html#ad1a6a6b83fa2271022dd97c072a2b586" title="Queries whether this represents text using a CDATA section.">CDATA()</a>. </p>
+<hr/><h2>Constructor & Destructor Documentation</h2>
+<a class="anchor" id="af659e77c6b87d684827f35a8f4895960"></a><!-- doxytag: member="TiXmlText::TiXmlText" ref="af659e77c6b87d684827f35a8f4895960" args="(const char *initValue)" -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">TiXmlText::TiXmlText </td>
+          <td>(</td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"> <em>initValue</em></td>
+          <td> ) </td>
+          <td><code> [inline]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>Constructor for text element. </p>
+<p>By default, it is treated as normal, encoded text. If you want it be output as a CDATA text element, set the parameter _cdata to 'true' </p>
+
+<p>References <a class="el" href="tinyxml_8h_source.html#l00508">TiXmlNode::SetValue()</a>.</p>
+
+</div>
+</div>
+<hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="a0cafbf6f236c7f02d12b2bffc2b7976b"></a><!-- doxytag: member="TiXmlText::Print" ref="a0cafbf6f236c7f02d12b2bffc2b7976b" args="(FILE *cfile, int depth) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual void TiXmlText::Print </td>
+          <td>(</td>
+          <td class="paramtype">FILE * </td>
+          <td class="paramname"> <em>cfile</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>depth</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const<code> [virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. </p>
+<p>) Either or both cfile and str can be null.</p>
+<p>This is a formatted print, and will insert tabs and newlines.</p>
+<p>(For an unformatted stream, use the << operator.) </p>
+
+<p>Implements <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>.</p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlText.png b/Source/External/TinyXml/docs/classTiXmlText.png
new file mode 100644
index 0000000..ccd1c34
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlText.png differ
diff --git a/Source/External/TinyXml/docs/classTiXmlUnknown-members.html b/Source/External/TinyXml/docs/classTiXmlUnknown-members.html
new file mode 100644
index 0000000..6af9a49
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlUnknown-members.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlUnknown Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlUnknown.html#ad7122e5135581b3c832a1a3217760a93">Accept</a>(TiXmlVisitor *content) const </td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlUnknown.html#a0960bb7428b3f341da46244229604d73">Clone</a>() const </td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#accda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#adfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#abad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlUnknown.html#a31ba089a40fb5a1869750fce09b0bacb">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td><code> [virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#aa65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlUnknown.html#ab0313e5fe77987d746ac1a97a254419d">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlUnknown.html#a67c9fd22940e8c47f706a72cdd2e332c">ToUnknown</a>()</td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlUnknown.html b/Source/External/TinyXml/docs/classTiXmlUnknown.html
new file mode 100644
index 0000000..7e856db
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlUnknown.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlUnknown Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlUnknown Class Reference</h1><!-- doxytag: class="TiXmlUnknown" --><!-- doxytag: inherits="TiXmlNode" -->
+<p>Any tag that tinyXml doesn't recognize is saved as an unknown.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlUnknown:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlUnknown.png" usemap="#TiXmlUnknown_map" alt=""/>
+  <map id="TiXmlUnknown_map" name="TiXmlUnknown_map">
+<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,94,80"/>
+<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,94,24"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlUnknown-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0960bb7428b3f341da46244229604d73"></a><!-- doxytag: member="TiXmlUnknown::Clone" ref="a0960bb7428b3f341da46244229604d73" args="() const " -->
+virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlUnknown.html#a0960bb7428b3f341da46244229604d73">Clone</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a copy of this Unknown and returns it. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlUnknown.html#a31ba089a40fb5a1869750fce09b0bacb">Print</a> (FILE *cfile, int depth) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.  <a href="#a31ba089a40fb5a1869750fce09b0bacb"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab0313e5fe77987d746ac1a97a254419d"></a><!-- doxytag: member="TiXmlUnknown::ToUnknown" ref="ab0313e5fe77987d746ac1a97a254419d" args="() const " -->
+virtual const <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlUnknown.html#ab0313e5fe77987d746ac1a97a254419d">ToUnknown</a> () const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a67c9fd22940e8c47f706a72cdd2e332c"></a><!-- doxytag: member="TiXmlUnknown::ToUnknown" ref="a67c9fd22940e8c47f706a72cdd2e332c" args="()" -->
+virtual <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlUnknown.html#a67c9fd22940e8c47f706a72cdd2e332c">ToUnknown</a> ()</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad7122e5135581b3c832a1a3217760a93"></a><!-- doxytag: member="TiXmlUnknown::Accept" ref="ad7122e5135581b3c832a1a3217760a93" args="(TiXmlVisitor *content) const " -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlUnknown.html#ad7122e5135581b3c832a1a3217760a93">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *content) const </td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br/></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>Any tag that tinyXml doesn't recognize is saved as an unknown. </p>
+<p>It is a tag of text, but should not be modified. It will be written back to the XML, unchanged, when the file is saved.</p>
+<p>DTD tags get thrown into TiXmlUnknowns. </p>
+<hr/><h2>Member Function Documentation</h2>
+<a class="anchor" id="a31ba089a40fb5a1869750fce09b0bacb"></a><!-- doxytag: member="TiXmlUnknown::Print" ref="a31ba089a40fb5a1869750fce09b0bacb" args="(FILE *cfile, int depth) const " -->
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">virtual void TiXmlUnknown::Print </td>
+          <td>(</td>
+          <td class="paramtype">FILE * </td>
+          <td class="paramname"> <em>cfile</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"> <em>depth</em></td><td> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td><td> const<code> [virtual]</code></td>
+        </tr>
+      </table>
+</div>
+<div class="memdoc">
+
+<p>All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. </p>
+<p>) Either or both cfile and str can be null.</p>
+<p>This is a formatted print, and will insert tabs and newlines.</p>
+<p>(For an unformatted stream, use the << operator.) </p>
+
+<p>Implements <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>.</p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlUnknown.png b/Source/External/TinyXml/docs/classTiXmlUnknown.png
new file mode 100644
index 0000000..caa0c23
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlUnknown.png differ
diff --git a/Source/External/TinyXml/docs/classTiXmlVisitor-members.html b/Source/External/TinyXml/docs/classTiXmlVisitor-members.html
new file mode 100644
index 0000000..7ea5fb4
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlVisitor-members.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Member List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlVisitor Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a>, including all inherited members.<table>
+  <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#afad71c71ce6473fb9b4b64cd92de4a19">Visit</a>(const TiXmlDeclaration &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#a399b8ebca5cd14664974a32d2ce029e5">Visit</a>(const TiXmlText &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#a53a60e7a528627b31af3161972cc7fa2">Visit</a>(const TiXmlComment &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#a7e284d607d275c51dac1adb58159ce28">Visit</a>(const TiXmlUnknown &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#a07baecb52dd7d8716ae2a48ad0956ee0">VisitEnter</a>(const TiXmlDocument &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#af6c6178ffa517bbdba95d70490875fff">VisitEnter</a>(const TiXmlElement &, const TiXmlAttribute *)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#aa0ade4f27087447e93974e975c3246ad">VisitExit</a>(const TiXmlDocument &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr>
+  <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#aec2b1f8116226d52f3a1b95dafd3a32c">VisitExit</a>(const TiXmlElement &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr>
+</table></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlVisitor.html b/Source/External/TinyXml/docs/classTiXmlVisitor.html
new file mode 100644
index 0000000..c017189
--- /dev/null
+++ b/Source/External/TinyXml/docs/classTiXmlVisitor.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TiXmlVisitor Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TiXmlVisitor Class Reference</h1><!-- doxytag: class="TiXmlVisitor" -->
+<p>Implements the interface to the "Visitor pattern" (see the Accept() method.  
+<a href="#_details">More...</a></p>
+
+<p><code>#include <<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>></code></p>
+<div class="dynheader">
+Inheritance diagram for TiXmlVisitor:</div>
+<div class="dynsection">
+ <div class="center">
+  <img src="classTiXmlVisitor.png" usemap="#TiXmlVisitor_map" alt=""/>
+  <map id="TiXmlVisitor_map" name="TiXmlVisitor_map">
+<area href="classTiXmlPrinter.html" alt="TiXmlPrinter" shape="rect" coords="0,56,81,80"/>
+</map>
+ </div>
+</div>
+
+<p><a href="classTiXmlVisitor-members.html">List of all members.</a></p>
+<table border="0" cellpadding="0" cellspacing="0">
+<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a07baecb52dd7d8716ae2a48ad0956ee0"></a><!-- doxytag: member="TiXmlVisitor::VisitEnter" ref="a07baecb52dd7d8716ae2a48ad0956ee0" args="(const TiXmlDocument &)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#a07baecb52dd7d8716ae2a48ad0956ee0">VisitEnter</a> (const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> &)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a document. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa0ade4f27087447e93974e975c3246ad"></a><!-- doxytag: member="TiXmlVisitor::VisitExit" ref="aa0ade4f27087447e93974e975c3246ad" args="(const TiXmlDocument &)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#aa0ade4f27087447e93974e975c3246ad">VisitExit</a> (const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> &)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a document. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af6c6178ffa517bbdba95d70490875fff"></a><!-- doxytag: member="TiXmlVisitor::VisitEnter" ref="af6c6178ffa517bbdba95d70490875fff" args="(const TiXmlElement &, const TiXmlAttribute *)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#af6c6178ffa517bbdba95d70490875fff">VisitEnter</a> (const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> &, const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an element. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aec2b1f8116226d52f3a1b95dafd3a32c"></a><!-- doxytag: member="TiXmlVisitor::VisitExit" ref="aec2b1f8116226d52f3a1b95dafd3a32c" args="(const TiXmlElement &)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#aec2b1f8116226d52f3a1b95dafd3a32c">VisitExit</a> (const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> &)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an element. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afad71c71ce6473fb9b4b64cd92de4a19"></a><!-- doxytag: member="TiXmlVisitor::Visit" ref="afad71c71ce6473fb9b4b64cd92de4a19" args="(const TiXmlDeclaration &)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#afad71c71ce6473fb9b4b64cd92de4a19">Visit</a> (const <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> &)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a declaration. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a399b8ebca5cd14664974a32d2ce029e5"></a><!-- doxytag: member="TiXmlVisitor::Visit" ref="a399b8ebca5cd14664974a32d2ce029e5" args="(const TiXmlText &)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#a399b8ebca5cd14664974a32d2ce029e5">Visit</a> (const <a class="el" href="classTiXmlText.html">TiXmlText</a> &)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a text node. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a53a60e7a528627b31af3161972cc7fa2"></a><!-- doxytag: member="TiXmlVisitor::Visit" ref="a53a60e7a528627b31af3161972cc7fa2" args="(const TiXmlComment &)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#a53a60e7a528627b31af3161972cc7fa2">Visit</a> (const <a class="el" href="classTiXmlComment.html">TiXmlComment</a> &)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a comment node. <br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7e284d607d275c51dac1adb58159ce28"></a><!-- doxytag: member="TiXmlVisitor::Visit" ref="a7e284d607d275c51dac1adb58159ce28" args="(const TiXmlUnknown &)" -->
+virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#a7e284d607d275c51dac1adb58159ce28">Visit</a> (const <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> &)</td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an unknown node. <br/></td></tr>
+</table>
+<hr/><a name="_details"></a><h2>Detailed Description</h2>
+<p>Implements the interface to the "Visitor pattern" (see the Accept() method. </p>
+<p>) If you call the Accept() method, it requires being passed a <a class="el" href="classTiXmlVisitor.html" title="Implements the interface to the "Visitor pattern" (see the Accept() method...">TiXmlVisitor</a> class to handle callbacks. For nodes that contain other nodes (Document, Element) you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves are simply called with <a class="el" href="classTiXmlVisitor.html#afad71c71ce6473fb9b4b64cd92de4a19" title="Visit a declaration.">Visit()</a>.</p>
+<p>If you return 'true' from a Visit method, recursive parsing will continue. If you return false, <b>no children of this node or its sibilings</b> will be Visited.</p>
+<p>All flavors of Visit methods have a default implementation that returns 'true' (continue visiting). You need to only override methods that are interesting to you.</p>
+<p>Generally Accept() is called on the <a class="el" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>, although all nodes suppert Visiting.</p>
+<p>You should never change the document from a callback.</p>
+<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlNode.html#acc0f88b7462c6cb73809d410a4f5bb86" title="Accept a hierchical visit the nodes in the TinyXML DOM.">TiXmlNode::Accept()</a> </dd></dl>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/classTiXmlVisitor.png b/Source/External/TinyXml/docs/classTiXmlVisitor.png
new file mode 100644
index 0000000..b47e145
Binary files /dev/null and b/Source/External/TinyXml/docs/classTiXmlVisitor.png differ
diff --git a/Source/External/TinyXml/docs/classes.html b/Source/External/TinyXml/docs/classes.html
new file mode 100644
index 0000000..416d0d4
--- /dev/null
+++ b/Source/External/TinyXml/docs/classes.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Alphabetical List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>Class Index</h1><div class="qindex"><a class="qindex" href="#letter_T">T</a></div>
+<table align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
+<tr><td><a name="letter_T"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  T  </div></td></tr></table>
+</td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a>   </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a>   </td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a>   </td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>   </td></tr><tr><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a>   </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>   </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a>   </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a>   </td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a>   </td></tr><tr><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a>   </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a>   </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a>   </td></tr></table><div class="qindex"><a class="qindex" href="#letter_T">T</a></div>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/deprecated.html b/Source/External/TinyXml/docs/deprecated.html
new file mode 100644
index 0000000..4e5340b
--- /dev/null
+++ b/Source/External/TinyXml/docs/deprecated.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Deprecated List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
+      <li><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+
+
+<h1><a class="anchor" id="deprecated">Deprecated List </a></h1><p><a class="anchor" id="_deprecated000002"></a> </p>
+<dl>
+<dt>Member <a class="el" href="classTiXmlHandle.html#acb5fe8388a526289ea65e817a51e05e7">TiXmlHandle::Element</a> () const  </dt>
+<dd>use ToElement. Return the handle as a <a class="el" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>. This may return null. </dd>
+</dl>
+<p><a class="anchor" id="_deprecated000001"></a> </p>
+<dl>
+<dt>Member <a class="el" href="classTiXmlHandle.html#ab44b723a8dc9af72838a303c079d0376">TiXmlHandle::Node</a> () const  </dt>
+<dd>use ToNode. Return the handle as a <a class="el" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>. This may return null. </dd>
+</dl>
+<p><a class="anchor" id="_deprecated000003"></a> </p>
+<dl>
+<dt>Member <a class="el" href="classTiXmlHandle.html#a9fc739c8a18d160006f82572fc143d13">TiXmlHandle::Text</a> () const  </dt>
+<dd>use ToText() Return the handle as a <a class="el" href="classTiXmlText.html" title="XML text.">TiXmlText</a>. This may return null. </dd>
+</dl>
+<p><a class="anchor" id="_deprecated000004"></a> </p>
+<dl>
+<dt>Member <a class="el" href="classTiXmlHandle.html#a49675b74357ba2aae124657a9a1ef465">TiXmlHandle::Unknown</a> () const  </dt>
+<dd>use ToUnknown() Return the handle as a <a class="el" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn't recognize is saved as an unknown.">TiXmlUnknown</a>. This may return null. </dd>
+</dl>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/doxygen.css b/Source/External/TinyXml/docs/doxygen.css
new file mode 100644
index 0000000..609e38d
--- /dev/null
+++ b/Source/External/TinyXml/docs/doxygen.css
@@ -0,0 +1,532 @@
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+	font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+	font-size: 12px;
+}
+
+/* @group Heading Levels */
+
+h1 {
+	text-align: center;
+	font-size: 150%;
+}
+
+h2 {
+	font-size: 120%;
+}
+
+h3 {
+	font-size: 100%;
+}
+
+dt {
+	font-weight: bold;
+}
+
+div.multicol {
+	-moz-column-gap: 1em;
+	-webkit-column-gap: 1em;
+	-moz-column-count: 3;
+	-webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+	margin-top: 2px;
+}
+
+p.endli {
+	margin-bottom: 0px;
+}
+
+p.enddd {
+	margin-bottom: 4px;
+}
+
+p.endtd {
+	margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+	font-weight: bold;
+}
+
+span.legend {
+        font-size: 70%;
+        text-align: center;
+}
+
+h3.version {
+        font-size: 90%;
+        text-align: center;
+}
+
+div.qindex, div.navtab{
+	background-color: #e8eef2;
+	border: 1px solid #84b0c7;
+	text-align: center;
+	margin: 2px;
+	padding: 2px;
+}
+
+div.qindex, div.navpath {
+	width: 100%;
+	line-height: 140%;
+}
+
+div.navtab {
+	margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+	color: #153788;
+	font-weight: normal;
+	text-decoration: none;
+}
+
+.contents a:visited {
+	color: #1b77c5;
+}
+
+a:hover {
+	text-decoration: underline;
+}
+
+a.qindex {
+	font-weight: bold;
+}
+
+a.qindexHL {
+	font-weight: bold;
+	background-color: #6666cc;
+	color: #ffffff;
+	border: 1px double #9295C2;
+}
+
+.contents a.qindexHL:visited {
+        color: #ffffff;
+}
+
+a.el {
+	font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code {
+	color: #3030f0;
+}
+
+a.codeRef {
+	color: #3030f0;
+}
+
+/* @end */
+
+dl.el {
+	margin-left: -1cm;
+}
+
+.fragment {
+	font-family: monospace, fixed;
+	font-size: 105%;
+}
+
+pre.fragment {
+	border: 1px solid #CCCCCC;
+	background-color: #f5f5f5;
+	padding: 4px 6px;
+	margin: 4px 8px 4px 2px;
+	overflow: auto;
+	word-wrap: break-word;
+	font-size:  9pt;
+	line-height: 125%;
+}
+
+div.ah {
+	background-color: black;
+	font-weight: bold;
+	color: #ffffff;
+	margin-bottom: 3px;
+	margin-top: 3px
+}
+
+div.groupHeader {
+	margin-left: 16px;
+	margin-top: 12px;
+	margin-bottom: 6px;
+	font-weight: bold;
+}
+
+div.groupText {
+	margin-left: 16px;
+	font-style: italic;
+}
+
+body {
+	background: white;
+	color: black;
+	margin-right: 20px;
+	margin-left: 20px;
+}
+
+td.indexkey {
+	background-color: #e8eef2;
+	font-weight: bold;
+	border: 1px solid #CCCCCC;
+	margin: 2px 0px 2px 0;
+	padding: 2px 10px;
+}
+
+td.indexvalue {
+	background-color: #e8eef2;
+	border: 1px solid #CCCCCC;
+	padding: 2px 10px;
+	margin: 2px 0px;
+}
+
+tr.memlist {
+	background-color: #f0f0f0;
+}
+
+p.formulaDsp {
+	text-align: center;
+}
+
+img.formulaDsp {
+	
+}
+
+img.formulaInl {
+	vertical-align: middle;
+}
+
+div.center {
+	text-align: center;
+        margin-top: 0px;
+        margin-bottom: 0px;
+        padding: 0px;
+}
+
+div.center img {
+	border: 0px;
+}
+
+img.footer {
+	border: 0px;
+	vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+	color: #008000
+}
+
+span.keywordtype {
+	color: #604020
+}
+
+span.keywordflow {
+	color: #e08000
+}
+
+span.comment {
+	color: #800000
+}
+
+span.preprocessor {
+	color: #806020
+}
+
+span.stringliteral {
+	color: #002080
+}
+
+span.charliteral {
+	color: #008080
+}
+
+span.vhdldigit { 
+	color: #ff00ff 
+}
+
+span.vhdlchar { 
+	color: #000000 
+}
+
+span.vhdlkeyword { 
+	color: #700070 
+}
+
+span.vhdllogic { 
+	color: #ff0000 
+}
+
+/* @end */
+
+.search {
+	color: #003399;
+	font-weight: bold;
+}
+
+form.search {
+	margin-bottom: 0px;
+	margin-top: 0px;
+}
+
+input.search {
+	font-size: 75%;
+	color: #000080;
+	font-weight: normal;
+	background-color: #e8eef2;
+}
+
+td.tiny {
+	font-size: 75%;
+}
+
+.dirtab {
+	padding: 4px;
+	border-collapse: collapse;
+	border: 1px solid #84b0c7;
+}
+
+th.dirtab {
+	background: #e8eef2;
+	font-weight: bold;
+}
+
+hr {
+	height: 0;
+	border: none;
+	border-top: 1px solid #666;
+}
+
+/* @group Member Descriptions */
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+	background-color: #FAFAFA;
+	border: none;
+	margin: 4px;
+	padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+	padding: 0px 8px 4px 8px;
+	color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+	border-top: 1px solid #ccc;
+}
+
+.memItemLeft, .memTemplItemLeft {
+        white-space: nowrap;
+}
+
+.memTemplParams {
+	color: #606060;
+        white-space: nowrap;
+}
+
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+	font-size: 80%;
+	color: #606060;
+	font-weight: normal;
+	margin-left: 3px;
+}
+
+.memnav {
+	background-color: #e8eef2;
+	border: 1px solid #84b0c7;
+	text-align: center;
+	margin: 2px;
+	margin-right: 15px;
+	padding: 2px;
+}
+
+.memitem {
+	padding: 0;
+	margin-bottom: 10px;
+}
+
+.memname {
+	white-space: nowrap;
+	font-weight: bold;
+}
+
+.memproto, .memdoc {
+	border: 1px solid #84b0c7;	
+}
+
+.memproto {
+	padding: 0;
+	background-color: #d5e1e8;
+	font-weight: bold;
+	-webkit-border-top-left-radius: 8px;
+	-webkit-border-top-right-radius: 8px;
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+	-moz-border-radius-topleft: 8px;
+	-moz-border-radius-topright: 8px;
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+
+}
+
+.memdoc {
+	padding: 2px 5px;
+	background-color: #eef3f5;
+	border-top-width: 0;
+	-webkit-border-bottom-left-radius: 8px;
+	-webkit-border-bottom-right-radius: 8px;
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+	-moz-border-radius-bottomleft: 8px;
+	-moz-border-radius-bottomright: 8px;
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+}
+
+.paramkey {
+	text-align: right;
+}
+
+.paramtype {
+	white-space: nowrap;
+}
+
+.paramname {
+	color: #602020;
+	white-space: nowrap;
+}
+.paramname em {
+	font-style: normal;
+}
+
+/* @end */
+
+/* @group Directory (tree) */
+
+/* for the tree view */
+
+.ftvtree {
+	font-family: sans-serif;
+	margin: 0.5em;
+}
+
+/* these are for tree view when used as main index */
+
+.directory {
+	font-size: 9pt;
+	font-weight: bold;
+}
+
+.directory h3 {
+	margin: 0px;
+	margin-top: 1em;
+	font-size: 11pt;
+}
+
+/*
+The following two styles can be used to replace the root node title
+with an image of your choice.  Simply uncomment the next two styles,
+specify the name of your image and be sure to set 'height' to the
+proper pixel height of your image.
+*/
+
+/*
+.directory h3.swap {
+	height: 61px;
+	background-repeat: no-repeat;
+	background-image: url("yourimage.gif");
+}
+.directory h3.swap span {
+	display: none;
+}
+*/
+
+.directory > h3 {
+	margin-top: 0;
+}
+
+.directory p {
+	margin: 0px;
+	white-space: nowrap;
+}
+
+.directory div {
+	display: none;
+	margin: 0px;
+}
+
+.directory img {
+	vertical-align: -30%;
+}
+
+/* these are for tree view when not used as main index */
+
+.directory-alt {
+	font-size: 100%;
+	font-weight: bold;
+}
+
+.directory-alt h3 {
+	margin: 0px;
+	margin-top: 1em;
+	font-size: 11pt;
+}
+
+.directory-alt > h3 {
+	margin-top: 0;
+}
+
+.directory-alt p {
+	margin: 0px;
+	white-space: nowrap;
+}
+
+.directory-alt div {
+	display: none;
+	margin: 0px;
+}
+
+.directory-alt img {
+	vertical-align: -30%;
+}
+
+/* @end */
+
+address {
+	font-style: normal;
+	color: #333;
+}
+
+table.doxtable {
+	border-collapse:collapse;
+}
+
+table.doxtable td, table.doxtable th {
+	border: 1px solid #153788;
+	padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+	background-color: #254798;
+	color: #FFFFFF;
+	font-size: 110%;
+	padding-bottom: 4px;
+	padding-top: 5px;
+	text-align:left;
+}
+
diff --git a/Source/External/TinyXml/docs/doxygen.png b/Source/External/TinyXml/docs/doxygen.png
new file mode 100644
index 0000000..f0a274b
Binary files /dev/null and b/Source/External/TinyXml/docs/doxygen.png differ
diff --git a/Source/External/TinyXml/docs/files.html b/Source/External/TinyXml/docs/files.html
new file mode 100644
index 0000000..969508d
--- /dev/null
+++ b/Source/External/TinyXml/docs/files.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: File Index</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li><a href="annotated.html"><span>Classes</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>File List</h1>Here is a list of all documented files with brief descriptions:<table>
+  <tr><td class="indexkey"><b>tinystr.h</b> <a href="tinystr_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
+  <tr><td class="indexkey"><b>tinyxml.h</b> <a href="tinyxml_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
+</table>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions.html b/Source/External/TinyXml/docs/functions.html
new file mode 100644
index 0000000..fc1d2ba
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_a">- a -</a></h3><ul>
+<li>Accept()
+: <a class="el" href="classTiXmlNode.html#acc0f88b7462c6cb73809d410a4f5bb86">TiXmlNode</a>
+, <a class="el" href="classTiXmlElement.html#a71a81b2afb0d42be1543d1c404dee6f5">TiXmlElement</a>
+, <a class="el" href="classTiXmlText.html#a8483d4415ce9de6c4fa8f63d067d5de6">TiXmlText</a>
+, <a class="el" href="classTiXmlDeclaration.html#a22315a535983b86535cdba3458669e3e">TiXmlDeclaration</a>
+, <a class="el" href="classTiXmlDocument.html#aa545aae325d9752ad64120bc4ecf939a">TiXmlDocument</a>
+, <a class="el" href="classTiXmlUnknown.html#ad7122e5135581b3c832a1a3217760a93">TiXmlUnknown</a>
+, <a class="el" href="classTiXmlComment.html#af3ac1b99fbbe9ea4fb6e14146156e43e">TiXmlComment</a>
+</li>
+<li>Attribute()
+: <a class="el" href="classTiXmlElement.html#aeaff99d4f0ea5b34f7aee202aad457ba">TiXmlElement</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x63.html b/Source/External/TinyXml/docs/functions_0x63.html
new file mode 100644
index 0000000..ebafb93
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x63.html
@@ -0,0 +1,98 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li class="current"><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_c">- c -</a></h3><ul>
+<li>CDATA()
+: <a class="el" href="classTiXmlText.html#ad1a6a6b83fa2271022dd97c072a2b586">TiXmlText</a>
+</li>
+<li>Child()
+: <a class="el" href="classTiXmlHandle.html#a072492b4be1acdb0db2d03cd8f71ccc4">TiXmlHandle</a>
+</li>
+<li>ChildElement()
+: <a class="el" href="classTiXmlHandle.html#a979a3f850984a176ee884e394c7eed2d">TiXmlHandle</a>
+</li>
+<li>Clear()
+: <a class="el" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b">TiXmlNode</a>
+</li>
+<li>ClearError()
+: <a class="el" href="classTiXmlDocument.html#ac66b8c28db86363315712a3574e87c35">TiXmlDocument</a>
+</li>
+<li>Clone()
+: <a class="el" href="classTiXmlComment.html#a0d6662bdc52488b9e12b3c7a0453d028">TiXmlComment</a>
+, <a class="el" href="classTiXmlElement.html#aa464535ea1994db337cb6a8ce4b588b5">TiXmlElement</a>
+, <a class="el" href="classTiXmlUnknown.html#a0960bb7428b3f341da46244229604d73">TiXmlUnknown</a>
+, <a class="el" href="classTiXmlNode.html#a4508cc3a2d7a98e96a54cc09c37a78a4">TiXmlNode</a>
+, <a class="el" href="classTiXmlDeclaration.html#a7cf459186040141cda7a180a6585ce2e">TiXmlDeclaration</a>
+, <a class="el" href="classTiXmlDocument.html#a4968661cab4a1f44a23329c6f8db1907">TiXmlDocument</a>
+, <a class="el" href="classTiXmlText.html#a0c411e93a27537369479d034cc82da3b">TiXmlText</a>
+</li>
+<li>Column()
+: <a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">TiXmlBase</a>
+</li>
+<li>CStr()
+: <a class="el" href="classTiXmlPrinter.html#a859eede9597d3e0355b77757be48735e">TiXmlPrinter</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x64.html b/Source/External/TinyXml/docs/functions_0x64.html
new file mode 100644
index 0000000..2d4695a
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x64.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li class="current"><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_d">- d -</a></h3><ul>
+<li>DoubleValue()
+: <a class="el" href="classTiXmlAttribute.html#a2880ddef53fc7522c99535273954d230">TiXmlAttribute</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x65.html b/Source/External/TinyXml/docs/functions_0x65.html
new file mode 100644
index 0000000..a61ddc5
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x65.html
@@ -0,0 +1,92 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li class="current"><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_e">- e -</a></h3><ul>
+<li>Element()
+: <a class="el" href="classTiXmlHandle.html#acb5fe8388a526289ea65e817a51e05e7">TiXmlHandle</a>
+</li>
+<li>EncodeString()
+: <a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">TiXmlBase</a>
+</li>
+<li>Encoding()
+: <a class="el" href="classTiXmlDeclaration.html#a5d974231f9e9a2f0542f15f3a46cdb76">TiXmlDeclaration</a>
+</li>
+<li>Error()
+: <a class="el" href="classTiXmlDocument.html#a6dfc01a6e5d58e56acd537dfd3bdeb29">TiXmlDocument</a>
+</li>
+<li>ErrorCol()
+: <a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649">TiXmlDocument</a>
+</li>
+<li>ErrorDesc()
+: <a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e">TiXmlDocument</a>
+</li>
+<li>ErrorId()
+: <a class="el" href="classTiXmlDocument.html#af96fc2f3f9ec6422782bfe916c9e778f">TiXmlDocument</a>
+</li>
+<li>ErrorRow()
+: <a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e">TiXmlDocument</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x66.html b/Source/External/TinyXml/docs/functions_0x66.html
new file mode 100644
index 0000000..d0a0eab
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x66.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li class="current"><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_f">- f -</a></h3><ul>
+<li>FirstAttribute()
+: <a class="el" href="classTiXmlElement.html#a516054c9073647d6cb29b6abe9fa0592">TiXmlElement</a>
+</li>
+<li>FirstChild()
+: <a class="el" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">TiXmlNode</a>
+, <a class="el" href="classTiXmlHandle.html#a8c61f64ae9365d89c264f289085541f8">TiXmlHandle</a>
+, <a class="el" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">TiXmlNode</a>
+, <a class="el" href="classTiXmlHandle.html#acdb1faaf88a700b40ca2c8d9aee21139">TiXmlHandle</a>
+</li>
+<li>FirstChildElement()
+: <a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">TiXmlNode</a>
+, <a class="el" href="classTiXmlHandle.html#a24d1112e995e937e4dddb202d4113d4a">TiXmlHandle</a>
+, <a class="el" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">TiXmlNode</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x67.html b/Source/External/TinyXml/docs/functions_0x67.html
new file mode 100644
index 0000000..be5aa34
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x67.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li class="current"><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_g">- g -</a></h3><ul>
+<li>GetDocument()
+: <a class="el" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3">TiXmlNode</a>
+</li>
+<li>GetText()
+: <a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87">TiXmlElement</a>
+</li>
+<li>GetUserData()
+: <a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">TiXmlBase</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x69.html b/Source/External/TinyXml/docs/functions_0x69.html
new file mode 100644
index 0000000..f2df3f1
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x69.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li class="current"><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_i">- i -</a></h3><ul>
+<li>Indent()
+: <a class="el" href="classTiXmlPrinter.html#abb33ec7d4bad6aaeb57f4304394b133d">TiXmlPrinter</a>
+</li>
+<li>InsertAfterChild()
+: <a class="el" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5">TiXmlNode</a>
+</li>
+<li>InsertBeforeChild()
+: <a class="el" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7">TiXmlNode</a>
+</li>
+<li>InsertEndChild()
+: <a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba">TiXmlNode</a>
+</li>
+<li>IntValue()
+: <a class="el" href="classTiXmlAttribute.html#aa1a20ad59dc7e89a0ab265396360d50f">TiXmlAttribute</a>
+</li>
+<li>IsWhiteSpaceCondensed()
+: <a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">TiXmlBase</a>
+</li>
+<li>IterateChildren()
+: <a class="el" href="classTiXmlNode.html#adfaef35a076b9343adc1420757376c39">TiXmlNode</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x6c.html b/Source/External/TinyXml/docs/functions_0x6c.html
new file mode 100644
index 0000000..3ccd546
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x6c.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li class="current"><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_l">- l -</a></h3><ul>
+<li>LastAttribute()
+: <a class="el" href="classTiXmlElement.html#a86191b49f9177be132b85b14655f1381">TiXmlElement</a>
+</li>
+<li>LastChild()
+: <a class="el" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">TiXmlNode</a>
+</li>
+<li>LineBreak()
+: <a class="el" href="classTiXmlPrinter.html#a11f1b4804a460b175ec244eb5724d96d">TiXmlPrinter</a>
+</li>
+<li>LinkEndChild()
+: <a class="el" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6">TiXmlNode</a>
+</li>
+<li>LoadFile()
+: <a class="el" href="classTiXmlDocument.html#a41f6fe7200864d1dca663d230caf8db6">TiXmlDocument</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x6e.html b/Source/External/TinyXml/docs/functions_0x6e.html
new file mode 100644
index 0000000..a35fb93
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x6e.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li class="current"><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_n">- n -</a></h3><ul>
+<li>Name()
+: <a class="el" href="classTiXmlAttribute.html#a298a57287d305904ba6bd96ae6f78d3d">TiXmlAttribute</a>
+</li>
+<li>Next()
+: <a class="el" href="classTiXmlAttribute.html#a1c78e92e223a40843f644ba48ef69f67">TiXmlAttribute</a>
+</li>
+<li>NextSibling()
+: <a class="el" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">TiXmlNode</a>
+</li>
+<li>NextSiblingElement()
+: <a class="el" href="classTiXmlNode.html#a071ba77fd7ab79402fa84b7e9b8607b3">TiXmlNode</a>
+</li>
+<li>NoChildren()
+: <a class="el" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">TiXmlNode</a>
+</li>
+<li>Node()
+: <a class="el" href="classTiXmlHandle.html#ab44b723a8dc9af72838a303c079d0376">TiXmlHandle</a>
+</li>
+<li>NodeType
+: <a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">TiXmlNode</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x6f.html b/Source/External/TinyXml/docs/functions_0x6f.html
new file mode 100644
index 0000000..65f75a2
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x6f.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li class="current"><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_o">- o -</a></h3><ul>
+<li>operator<<
+: <a class="el" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7">TiXmlNode</a>
+</li>
+<li>operator>>
+: <a class="el" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9">TiXmlNode</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x70.html b/Source/External/TinyXml/docs/functions_0x70.html
new file mode 100644
index 0000000..92b4fc6
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x70.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li class="current"><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_p">- p -</a></h3><ul>
+<li>Parent()
+: <a class="el" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">TiXmlNode</a>
+</li>
+<li>Parse()
+: <a class="el" href="classTiXmlDocument.html#a17ebabe36926ef398e78dec0d0ad0378">TiXmlDocument</a>
+</li>
+<li>Previous()
+: <a class="el" href="classTiXmlAttribute.html#a6ebbfe333fe76cd834bd6cbcca3130cf">TiXmlAttribute</a>
+</li>
+<li>PreviousSibling()
+: <a class="el" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">TiXmlNode</a>
+</li>
+<li>Print()
+: <a class="el" href="classTiXmlElement.html#afbf52736e70fc91ec9d760721d6f4fd2">TiXmlElement</a>
+, <a class="el" href="classTiXmlAttribute.html#acc04956c1d5c4c31fe74f7a7528d109a">TiXmlAttribute</a>
+, <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>
+, <a class="el" href="classTiXmlText.html#a0cafbf6f236c7f02d12b2bffc2b7976b">TiXmlText</a>
+, <a class="el" href="classTiXmlDocument.html#af08389ec70ee9b2de7f800e206a18510">TiXmlDocument</a>
+, <a class="el" href="classTiXmlUnknown.html#a31ba089a40fb5a1869750fce09b0bacb">TiXmlUnknown</a>
+, <a class="el" href="classTiXmlDocument.html#a8701fda1fa31b25abbc9c0df42da10e8">TiXmlDocument</a>
+, <a class="el" href="classTiXmlComment.html#a6b316527aaa8da0370cd68c22a5a0f5f">TiXmlComment</a>
+, <a class="el" href="classTiXmlDeclaration.html#abf6303db4bd05b5be554036817ff1cb4">TiXmlDeclaration</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x71.html b/Source/External/TinyXml/docs/functions_0x71.html
new file mode 100644
index 0000000..1697cf9
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x71.html
@@ -0,0 +1,95 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li class="current"><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_q">- q -</a></h3><ul>
+<li>QueryBoolAttribute()
+: <a class="el" href="classTiXmlElement.html#af4a1d3f88c28eb0f3115dc39ebd83fff">TiXmlElement</a>
+</li>
+<li>QueryDoubleAttribute()
+: <a class="el" href="classTiXmlElement.html#a898d7730ecc341f0bffc7a9dadbf1ce7">TiXmlElement</a>
+</li>
+<li>QueryDoubleValue()
+: <a class="el" href="classTiXmlAttribute.html#ac87b2a8489906a5d7aa2875f20be3513">TiXmlAttribute</a>
+</li>
+<li>QueryFloatAttribute()
+: <a class="el" href="classTiXmlElement.html#aa04d3af11601ef5a5f88295203a843be">TiXmlElement</a>
+</li>
+<li>QueryIntAttribute()
+: <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9">TiXmlElement</a>
+</li>
+<li>QueryIntValue()
+: <a class="el" href="classTiXmlAttribute.html#ad6c93088ee21af41a107931223339344">TiXmlAttribute</a>
+</li>
+<li>QueryStringAttribute()
+: <a class="el" href="classTiXmlElement.html#a14321ac360efe906ed449d9db3fd9961">TiXmlElement</a>
+</li>
+<li>QueryUnsignedAttribute()
+: <a class="el" href="classTiXmlElement.html#ae48df644f890ab86fa19839ac401f00d">TiXmlElement</a>
+</li>
+<li>QueryValueAttribute()
+: <a class="el" href="classTiXmlElement.html#ae3b9a03b0a56663a40801c7256683576">TiXmlElement</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x72.html b/Source/External/TinyXml/docs/functions_0x72.html
new file mode 100644
index 0000000..33840be
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x72.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li class="current"><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_r">- r -</a></h3><ul>
+<li>RemoveAttribute()
+: <a class="el" href="classTiXmlElement.html#a56979767deca794376b1dfa69a525b2a">TiXmlElement</a>
+</li>
+<li>RemoveChild()
+: <a class="el" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf">TiXmlNode</a>
+</li>
+<li>ReplaceChild()
+: <a class="el" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd">TiXmlNode</a>
+</li>
+<li>RootElement()
+: <a class="el" href="classTiXmlDocument.html#ad09d17927f908f40efb406af2fb873be">TiXmlDocument</a>
+</li>
+<li>Row()
+: <a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">TiXmlBase</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x73.html b/Source/External/TinyXml/docs/functions_0x73.html
new file mode 100644
index 0000000..171b2d4
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x73.html
@@ -0,0 +1,121 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li class="current"><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_s">- s -</a></h3><ul>
+<li>SaveFile()
+: <a class="el" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93">TiXmlDocument</a>
+</li>
+<li>SetAttribute()
+: <a class="el" href="classTiXmlElement.html#ace6f4be75e373726d4774073d666d1a7">TiXmlElement</a>
+</li>
+<li>SetCDATA()
+: <a class="el" href="classTiXmlText.html#acb17ff7c5d09b2c839393445a3de5ea9">TiXmlText</a>
+</li>
+<li>SetCondenseWhiteSpace()
+: <a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">TiXmlBase</a>
+</li>
+<li>SetDoubleAttribute()
+: <a class="el" href="classTiXmlElement.html#a0d1dd975d75496778177e35abfe0ec0b">TiXmlElement</a>
+</li>
+<li>SetDoubleValue()
+: <a class="el" href="classTiXmlAttribute.html#a0316da31373496c4368ad549bf711394">TiXmlAttribute</a>
+</li>
+<li>SetIndent()
+: <a class="el" href="classTiXmlPrinter.html#a213377a4070c7e625bae59716b089e5e">TiXmlPrinter</a>
+</li>
+<li>SetIntValue()
+: <a class="el" href="classTiXmlAttribute.html#a7e065df640116a62ea4f4b7da5449cc8">TiXmlAttribute</a>
+</li>
+<li>SetLineBreak()
+: <a class="el" href="classTiXmlPrinter.html#a4be1e37e69e3858c59635aa947174fe6">TiXmlPrinter</a>
+</li>
+<li>SetName()
+: <a class="el" href="classTiXmlAttribute.html#ab7fa3d21ff8d7c5764cf9af15b667a99">TiXmlAttribute</a>
+</li>
+<li>SetStreamPrinting()
+: <a class="el" href="classTiXmlPrinter.html#ab23a90629e374cb1cadca090468bbd19">TiXmlPrinter</a>
+</li>
+<li>SetTabSize()
+: <a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e">TiXmlDocument</a>
+</li>
+<li>SetUserData()
+: <a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">TiXmlBase</a>
+</li>
+<li>SetValue()
+: <a class="el" href="classTiXmlAttribute.html#a2dae44178f668b3cb48101be4f2236a0">TiXmlAttribute</a>
+, <a class="el" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">TiXmlNode</a>
+, <a class="el" href="classTiXmlAttribute.html#ab43f67a0cc3ec1d80e62606500f0925f">TiXmlAttribute</a>
+</li>
+<li>Size()
+: <a class="el" href="classTiXmlPrinter.html#ad01375ae9199bd2f48252eaddce3039d">TiXmlPrinter</a>
+</li>
+<li>Standalone()
+: <a class="el" href="classTiXmlDeclaration.html#a9ff06afc033d7ef730ec7c6825b97ad9">TiXmlDeclaration</a>
+</li>
+<li>Str()
+: <a class="el" href="classTiXmlPrinter.html#a3bd4daf44309b41f5813a833caa0d1c9">TiXmlPrinter</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x74.html b/Source/External/TinyXml/docs/functions_0x74.html
new file mode 100644
index 0000000..a84435f
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x74.html
@@ -0,0 +1,127 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li class="current"><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_t">- t -</a></h3><ul>
+<li>Text()
+: <a class="el" href="classTiXmlHandle.html#a9fc739c8a18d160006f82572fc143d13">TiXmlHandle</a>
+</li>
+<li>TiXmlAttribute()
+: <a class="el" href="classTiXmlAttribute.html#a9cfa3c8179873fd485d83003b114f8e1">TiXmlAttribute</a>
+</li>
+<li>TiXmlComment()
+: <a class="el" href="classTiXmlComment.html#aaa3252031d3e8bd3a2bf51a1c61201b7">TiXmlComment</a>
+</li>
+<li>TiXmlDeclaration()
+: <a class="el" href="classTiXmlDeclaration.html#acd5556007c3c72209465081de39d9836">TiXmlDeclaration</a>
+</li>
+<li>TiXmlDocument()
+: <a class="el" href="classTiXmlDocument.html#a9f5e84335708fde98400230f9f12659c">TiXmlDocument</a>
+</li>
+<li>TiXmlElement()
+: <a class="el" href="classTiXmlElement.html#a01bc3ab372d35da08efcbbe65ad90c60">TiXmlElement</a>
+</li>
+<li>TiXmlHandle()
+: <a class="el" href="classTiXmlHandle.html#a236d7855e1e56ccc7b980630c48c7fd7">TiXmlHandle</a>
+</li>
+<li>TiXmlText()
+: <a class="el" href="classTiXmlText.html#af659e77c6b87d684827f35a8f4895960">TiXmlText</a>
+</li>
+<li>ToComment()
+: <a class="el" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574">TiXmlNode</a>
+, <a class="el" href="classTiXmlComment.html#a00fb4215c20a2399ea05ac9b9e7e68a0">TiXmlComment</a>
+</li>
+<li>ToDeclaration()
+: <a class="el" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72">TiXmlNode</a>
+, <a class="el" href="classTiXmlDeclaration.html#a1e085d3fefd1dbf5ccdbff729931a967">TiXmlDeclaration</a>
+</li>
+<li>ToDocument()
+: <a class="el" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08">TiXmlNode</a>
+, <a class="el" href="classTiXmlDocument.html#a1dc977bde3e4fe85a8eb9d88a35ef5a4">TiXmlDocument</a>
+</li>
+<li>ToElement()
+: <a class="el" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c">TiXmlNode</a>
+, <a class="el" href="classTiXmlElement.html#ac5b8d0e25fa23fd9acbb6d146082901c">TiXmlElement</a>
+, <a class="el" href="classTiXmlHandle.html#abc6e7ed383a5fe1e52b0c0004b457b9e">TiXmlHandle</a>
+</li>
+<li>ToNode()
+: <a class="el" href="classTiXmlHandle.html#af678e5088e83be67baf76f699756f2c3">TiXmlHandle</a>
+</li>
+<li>ToText()
+: <a class="el" href="classTiXmlText.html#ae7c3a8fd3e4dbf6c0c4363a943d72f5b">TiXmlText</a>
+, <a class="el" href="classTiXmlHandle.html#a4ac53a652296203a5b5e13854d923586">TiXmlHandle</a>
+, <a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03">TiXmlNode</a>
+, <a class="el" href="classTiXmlText.html#a895bf34ffad17f7439ab2a52b9651648">TiXmlText</a>
+</li>
+<li>ToUnknown()
+: <a class="el" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2">TiXmlNode</a>
+, <a class="el" href="classTiXmlUnknown.html#ab0313e5fe77987d746ac1a97a254419d">TiXmlUnknown</a>
+, <a class="el" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d">TiXmlNode</a>
+, <a class="el" href="classTiXmlHandle.html#a1381c17507a130767b1e23afc93b3674">TiXmlHandle</a>
+</li>
+<li>Type()
+: <a class="el" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">TiXmlNode</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x75.html b/Source/External/TinyXml/docs/functions_0x75.html
new file mode 100644
index 0000000..b790f21
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x75.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li class="current"><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_u">- u -</a></h3><ul>
+<li>Unknown()
+: <a class="el" href="classTiXmlHandle.html#a49675b74357ba2aae124657a9a1ef465">TiXmlHandle</a>
+</li>
+<li>userData
+: <a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">TiXmlBase</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_0x76.html b/Source/External/TinyXml/docs/functions_0x76.html
new file mode 100644
index 0000000..7e8a475
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_0x76.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
+      <li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
+      <li class="current"><a href="functions_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+Here is a list of all documented class members with links to the class documentation for each member:
+
+<h3><a class="anchor" id="index_v">- v -</a></h3><ul>
+<li>Value()
+: <a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">TiXmlNode</a>
+, <a class="el" href="classTiXmlAttribute.html#a0f874490eac8ca00ee0070765d0e97e3">TiXmlAttribute</a>
+</li>
+<li>ValueStr()
+: <a class="el" href="classTiXmlAttribute.html#a87705c3ccf9ee9417beb4f7cbacd4d33">TiXmlAttribute</a>
+, <a class="el" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">TiXmlNode</a>
+</li>
+<li>Version()
+: <a class="el" href="classTiXmlDeclaration.html#a02ee557b1a4545c3219ed377c103ec76">TiXmlDeclaration</a>
+</li>
+<li>Visit()
+: <a class="el" href="classTiXmlVisitor.html#a53a60e7a528627b31af3161972cc7fa2">TiXmlVisitor</a>
+, <a class="el" href="classTiXmlPrinter.html#ace1b14d33eede2575c0743e2350f6a38">TiXmlPrinter</a>
+, <a class="el" href="classTiXmlVisitor.html#afad71c71ce6473fb9b4b64cd92de4a19">TiXmlVisitor</a>
+, <a class="el" href="classTiXmlPrinter.html#a83c13d6b980064b30f989f9a35498979">TiXmlPrinter</a>
+, <a class="el" href="classTiXmlVisitor.html#a399b8ebca5cd14664974a32d2ce029e5">TiXmlVisitor</a>
+</li>
+<li>VisitEnter()
+: <a class="el" href="classTiXmlVisitor.html#a07baecb52dd7d8716ae2a48ad0956ee0">TiXmlVisitor</a>
+, <a class="el" href="classTiXmlPrinter.html#a0c5e7bf8622838417a0d0bfb8f433854">TiXmlPrinter</a>
+, <a class="el" href="classTiXmlVisitor.html#af6c6178ffa517bbdba95d70490875fff">TiXmlVisitor</a>
+</li>
+<li>VisitExit()
+: <a class="el" href="classTiXmlPrinter.html#a1853cf2f6e63ad4b4232b4835e0acaf0">TiXmlPrinter</a>
+, <a class="el" href="classTiXmlVisitor.html#aa0ade4f27087447e93974e975c3246ad">TiXmlVisitor</a>
+, <a class="el" href="classTiXmlPrinter.html#a66b33edd76c538b462f789b797a4fdf2">TiXmlPrinter</a>
+, <a class="el" href="classTiXmlVisitor.html#aec2b1f8116226d52f3a1b95dafd3a32c">TiXmlVisitor</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_enum.html b/Source/External/TinyXml/docs/functions_enum.html
new file mode 100644
index 0000000..8b7537b
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_enum.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Enumerations</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li class="current"><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ <ul>
+<li>NodeType
+: <a class="el" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">TiXmlNode</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func.html b/Source/External/TinyXml/docs/functions_func.html
new file mode 100644
index 0000000..c3fd13c
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_a">- a -</a></h3><ul>
+<li>Accept()
+: <a class="el" href="classTiXmlNode.html#acc0f88b7462c6cb73809d410a4f5bb86">TiXmlNode</a>
+, <a class="el" href="classTiXmlElement.html#a71a81b2afb0d42be1543d1c404dee6f5">TiXmlElement</a>
+, <a class="el" href="classTiXmlText.html#a8483d4415ce9de6c4fa8f63d067d5de6">TiXmlText</a>
+, <a class="el" href="classTiXmlDeclaration.html#a22315a535983b86535cdba3458669e3e">TiXmlDeclaration</a>
+, <a class="el" href="classTiXmlDocument.html#aa545aae325d9752ad64120bc4ecf939a">TiXmlDocument</a>
+, <a class="el" href="classTiXmlUnknown.html#ad7122e5135581b3c832a1a3217760a93">TiXmlUnknown</a>
+, <a class="el" href="classTiXmlComment.html#af3ac1b99fbbe9ea4fb6e14146156e43e">TiXmlComment</a>
+</li>
+<li>Attribute()
+: <a class="el" href="classTiXmlElement.html#aeaff99d4f0ea5b34f7aee202aad457ba">TiXmlElement</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x63.html b/Source/External/TinyXml/docs/functions_func_0x63.html
new file mode 100644
index 0000000..224bf20
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x63.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li class="current"><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_c">- c -</a></h3><ul>
+<li>CDATA()
+: <a class="el" href="classTiXmlText.html#ad1a6a6b83fa2271022dd97c072a2b586">TiXmlText</a>
+</li>
+<li>Child()
+: <a class="el" href="classTiXmlHandle.html#a072492b4be1acdb0db2d03cd8f71ccc4">TiXmlHandle</a>
+</li>
+<li>ChildElement()
+: <a class="el" href="classTiXmlHandle.html#a979a3f850984a176ee884e394c7eed2d">TiXmlHandle</a>
+</li>
+<li>Clear()
+: <a class="el" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b">TiXmlNode</a>
+</li>
+<li>ClearError()
+: <a class="el" href="classTiXmlDocument.html#ac66b8c28db86363315712a3574e87c35">TiXmlDocument</a>
+</li>
+<li>Clone()
+: <a class="el" href="classTiXmlComment.html#a0d6662bdc52488b9e12b3c7a0453d028">TiXmlComment</a>
+, <a class="el" href="classTiXmlElement.html#aa464535ea1994db337cb6a8ce4b588b5">TiXmlElement</a>
+, <a class="el" href="classTiXmlUnknown.html#a0960bb7428b3f341da46244229604d73">TiXmlUnknown</a>
+, <a class="el" href="classTiXmlNode.html#a4508cc3a2d7a98e96a54cc09c37a78a4">TiXmlNode</a>
+, <a class="el" href="classTiXmlDeclaration.html#a7cf459186040141cda7a180a6585ce2e">TiXmlDeclaration</a>
+, <a class="el" href="classTiXmlDocument.html#a4968661cab4a1f44a23329c6f8db1907">TiXmlDocument</a>
+, <a class="el" href="classTiXmlText.html#a0c411e93a27537369479d034cc82da3b">TiXmlText</a>
+</li>
+<li>Column()
+: <a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">TiXmlBase</a>
+</li>
+<li>CStr()
+: <a class="el" href="classTiXmlPrinter.html#a859eede9597d3e0355b77757be48735e">TiXmlPrinter</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x64.html b/Source/External/TinyXml/docs/functions_func_0x64.html
new file mode 100644
index 0000000..c5c83c2
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x64.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li class="current"><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_d">- d -</a></h3><ul>
+<li>DoubleValue()
+: <a class="el" href="classTiXmlAttribute.html#a2880ddef53fc7522c99535273954d230">TiXmlAttribute</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x65.html b/Source/External/TinyXml/docs/functions_func_0x65.html
new file mode 100644
index 0000000..5762bde
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x65.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li class="current"><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_e">- e -</a></h3><ul>
+<li>Element()
+: <a class="el" href="classTiXmlHandle.html#acb5fe8388a526289ea65e817a51e05e7">TiXmlHandle</a>
+</li>
+<li>EncodeString()
+: <a class="el" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948">TiXmlBase</a>
+</li>
+<li>Encoding()
+: <a class="el" href="classTiXmlDeclaration.html#a5d974231f9e9a2f0542f15f3a46cdb76">TiXmlDeclaration</a>
+</li>
+<li>Error()
+: <a class="el" href="classTiXmlDocument.html#a6dfc01a6e5d58e56acd537dfd3bdeb29">TiXmlDocument</a>
+</li>
+<li>ErrorCol()
+: <a class="el" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649">TiXmlDocument</a>
+</li>
+<li>ErrorDesc()
+: <a class="el" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e">TiXmlDocument</a>
+</li>
+<li>ErrorId()
+: <a class="el" href="classTiXmlDocument.html#af96fc2f3f9ec6422782bfe916c9e778f">TiXmlDocument</a>
+</li>
+<li>ErrorRow()
+: <a class="el" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e">TiXmlDocument</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x66.html b/Source/External/TinyXml/docs/functions_func_0x66.html
new file mode 100644
index 0000000..8db1603
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x66.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li class="current"><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_f">- f -</a></h3><ul>
+<li>FirstAttribute()
+: <a class="el" href="classTiXmlElement.html#a516054c9073647d6cb29b6abe9fa0592">TiXmlElement</a>
+</li>
+<li>FirstChild()
+: <a class="el" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">TiXmlNode</a>
+, <a class="el" href="classTiXmlHandle.html#a8c61f64ae9365d89c264f289085541f8">TiXmlHandle</a>
+, <a class="el" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">TiXmlNode</a>
+, <a class="el" href="classTiXmlHandle.html#acdb1faaf88a700b40ca2c8d9aee21139">TiXmlHandle</a>
+</li>
+<li>FirstChildElement()
+: <a class="el" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba">TiXmlNode</a>
+, <a class="el" href="classTiXmlHandle.html#a24d1112e995e937e4dddb202d4113d4a">TiXmlHandle</a>
+, <a class="el" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">TiXmlNode</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x67.html b/Source/External/TinyXml/docs/functions_func_0x67.html
new file mode 100644
index 0000000..e81d1b1
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x67.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li class="current"><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_g">- g -</a></h3><ul>
+<li>GetDocument()
+: <a class="el" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3">TiXmlNode</a>
+</li>
+<li>GetText()
+: <a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87">TiXmlElement</a>
+</li>
+<li>GetUserData()
+: <a class="el" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">TiXmlBase</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x69.html b/Source/External/TinyXml/docs/functions_func_0x69.html
new file mode 100644
index 0000000..27f2cdb
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x69.html
@@ -0,0 +1,88 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li class="current"><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_i">- i -</a></h3><ul>
+<li>Indent()
+: <a class="el" href="classTiXmlPrinter.html#abb33ec7d4bad6aaeb57f4304394b133d">TiXmlPrinter</a>
+</li>
+<li>InsertAfterChild()
+: <a class="el" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5">TiXmlNode</a>
+</li>
+<li>InsertBeforeChild()
+: <a class="el" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7">TiXmlNode</a>
+</li>
+<li>InsertEndChild()
+: <a class="el" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba">TiXmlNode</a>
+</li>
+<li>IntValue()
+: <a class="el" href="classTiXmlAttribute.html#aa1a20ad59dc7e89a0ab265396360d50f">TiXmlAttribute</a>
+</li>
+<li>IsWhiteSpaceCondensed()
+: <a class="el" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">TiXmlBase</a>
+</li>
+<li>IterateChildren()
+: <a class="el" href="classTiXmlNode.html#adfaef35a076b9343adc1420757376c39">TiXmlNode</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x6c.html b/Source/External/TinyXml/docs/functions_func_0x6c.html
new file mode 100644
index 0000000..c3023ae
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x6c.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li class="current"><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_l">- l -</a></h3><ul>
+<li>LastAttribute()
+: <a class="el" href="classTiXmlElement.html#a86191b49f9177be132b85b14655f1381">TiXmlElement</a>
+</li>
+<li>LastChild()
+: <a class="el" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">TiXmlNode</a>
+</li>
+<li>LineBreak()
+: <a class="el" href="classTiXmlPrinter.html#a11f1b4804a460b175ec244eb5724d96d">TiXmlPrinter</a>
+</li>
+<li>LinkEndChild()
+: <a class="el" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6">TiXmlNode</a>
+</li>
+<li>LoadFile()
+: <a class="el" href="classTiXmlDocument.html#a41f6fe7200864d1dca663d230caf8db6">TiXmlDocument</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x6e.html b/Source/External/TinyXml/docs/functions_func_0x6e.html
new file mode 100644
index 0000000..750c240
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x6e.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li class="current"><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_n">- n -</a></h3><ul>
+<li>Name()
+: <a class="el" href="classTiXmlAttribute.html#a298a57287d305904ba6bd96ae6f78d3d">TiXmlAttribute</a>
+</li>
+<li>Next()
+: <a class="el" href="classTiXmlAttribute.html#a1c78e92e223a40843f644ba48ef69f67">TiXmlAttribute</a>
+</li>
+<li>NextSibling()
+: <a class="el" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">TiXmlNode</a>
+</li>
+<li>NextSiblingElement()
+: <a class="el" href="classTiXmlNode.html#a071ba77fd7ab79402fa84b7e9b8607b3">TiXmlNode</a>
+</li>
+<li>NoChildren()
+: <a class="el" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">TiXmlNode</a>
+</li>
+<li>Node()
+: <a class="el" href="classTiXmlHandle.html#ab44b723a8dc9af72838a303c079d0376">TiXmlHandle</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x70.html b/Source/External/TinyXml/docs/functions_func_0x70.html
new file mode 100644
index 0000000..990d49f
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x70.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li class="current"><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_p">- p -</a></h3><ul>
+<li>Parent()
+: <a class="el" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">TiXmlNode</a>
+</li>
+<li>Parse()
+: <a class="el" href="classTiXmlDocument.html#a17ebabe36926ef398e78dec0d0ad0378">TiXmlDocument</a>
+</li>
+<li>Previous()
+: <a class="el" href="classTiXmlAttribute.html#a6ebbfe333fe76cd834bd6cbcca3130cf">TiXmlAttribute</a>
+</li>
+<li>PreviousSibling()
+: <a class="el" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">TiXmlNode</a>
+</li>
+<li>Print()
+: <a class="el" href="classTiXmlElement.html#afbf52736e70fc91ec9d760721d6f4fd2">TiXmlElement</a>
+, <a class="el" href="classTiXmlAttribute.html#acc04956c1d5c4c31fe74f7a7528d109a">TiXmlAttribute</a>
+, <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>
+, <a class="el" href="classTiXmlText.html#a0cafbf6f236c7f02d12b2bffc2b7976b">TiXmlText</a>
+, <a class="el" href="classTiXmlDocument.html#af08389ec70ee9b2de7f800e206a18510">TiXmlDocument</a>
+, <a class="el" href="classTiXmlUnknown.html#a31ba089a40fb5a1869750fce09b0bacb">TiXmlUnknown</a>
+, <a class="el" href="classTiXmlDocument.html#a8701fda1fa31b25abbc9c0df42da10e8">TiXmlDocument</a>
+, <a class="el" href="classTiXmlComment.html#a6b316527aaa8da0370cd68c22a5a0f5f">TiXmlComment</a>
+, <a class="el" href="classTiXmlDeclaration.html#abf6303db4bd05b5be554036817ff1cb4">TiXmlDeclaration</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x71.html b/Source/External/TinyXml/docs/functions_func_0x71.html
new file mode 100644
index 0000000..e9cbe4e
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x71.html
@@ -0,0 +1,94 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li class="current"><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_q">- q -</a></h3><ul>
+<li>QueryBoolAttribute()
+: <a class="el" href="classTiXmlElement.html#af4a1d3f88c28eb0f3115dc39ebd83fff">TiXmlElement</a>
+</li>
+<li>QueryDoubleAttribute()
+: <a class="el" href="classTiXmlElement.html#a898d7730ecc341f0bffc7a9dadbf1ce7">TiXmlElement</a>
+</li>
+<li>QueryDoubleValue()
+: <a class="el" href="classTiXmlAttribute.html#ac87b2a8489906a5d7aa2875f20be3513">TiXmlAttribute</a>
+</li>
+<li>QueryFloatAttribute()
+: <a class="el" href="classTiXmlElement.html#aa04d3af11601ef5a5f88295203a843be">TiXmlElement</a>
+</li>
+<li>QueryIntAttribute()
+: <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9">TiXmlElement</a>
+</li>
+<li>QueryIntValue()
+: <a class="el" href="classTiXmlAttribute.html#ad6c93088ee21af41a107931223339344">TiXmlAttribute</a>
+</li>
+<li>QueryStringAttribute()
+: <a class="el" href="classTiXmlElement.html#a14321ac360efe906ed449d9db3fd9961">TiXmlElement</a>
+</li>
+<li>QueryUnsignedAttribute()
+: <a class="el" href="classTiXmlElement.html#ae48df644f890ab86fa19839ac401f00d">TiXmlElement</a>
+</li>
+<li>QueryValueAttribute()
+: <a class="el" href="classTiXmlElement.html#ae3b9a03b0a56663a40801c7256683576">TiXmlElement</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x72.html b/Source/External/TinyXml/docs/functions_func_0x72.html
new file mode 100644
index 0000000..8c76d08
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x72.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li class="current"><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_r">- r -</a></h3><ul>
+<li>RemoveAttribute()
+: <a class="el" href="classTiXmlElement.html#a56979767deca794376b1dfa69a525b2a">TiXmlElement</a>
+</li>
+<li>RemoveChild()
+: <a class="el" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf">TiXmlNode</a>
+</li>
+<li>ReplaceChild()
+: <a class="el" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd">TiXmlNode</a>
+</li>
+<li>RootElement()
+: <a class="el" href="classTiXmlDocument.html#ad09d17927f908f40efb406af2fb873be">TiXmlDocument</a>
+</li>
+<li>Row()
+: <a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">TiXmlBase</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x73.html b/Source/External/TinyXml/docs/functions_func_0x73.html
new file mode 100644
index 0000000..568c3e4
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x73.html
@@ -0,0 +1,120 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li class="current"><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_s">- s -</a></h3><ul>
+<li>SaveFile()
+: <a class="el" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93">TiXmlDocument</a>
+</li>
+<li>SetAttribute()
+: <a class="el" href="classTiXmlElement.html#ace6f4be75e373726d4774073d666d1a7">TiXmlElement</a>
+</li>
+<li>SetCDATA()
+: <a class="el" href="classTiXmlText.html#acb17ff7c5d09b2c839393445a3de5ea9">TiXmlText</a>
+</li>
+<li>SetCondenseWhiteSpace()
+: <a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">TiXmlBase</a>
+</li>
+<li>SetDoubleAttribute()
+: <a class="el" href="classTiXmlElement.html#a0d1dd975d75496778177e35abfe0ec0b">TiXmlElement</a>
+</li>
+<li>SetDoubleValue()
+: <a class="el" href="classTiXmlAttribute.html#a0316da31373496c4368ad549bf711394">TiXmlAttribute</a>
+</li>
+<li>SetIndent()
+: <a class="el" href="classTiXmlPrinter.html#a213377a4070c7e625bae59716b089e5e">TiXmlPrinter</a>
+</li>
+<li>SetIntValue()
+: <a class="el" href="classTiXmlAttribute.html#a7e065df640116a62ea4f4b7da5449cc8">TiXmlAttribute</a>
+</li>
+<li>SetLineBreak()
+: <a class="el" href="classTiXmlPrinter.html#a4be1e37e69e3858c59635aa947174fe6">TiXmlPrinter</a>
+</li>
+<li>SetName()
+: <a class="el" href="classTiXmlAttribute.html#ab7fa3d21ff8d7c5764cf9af15b667a99">TiXmlAttribute</a>
+</li>
+<li>SetStreamPrinting()
+: <a class="el" href="classTiXmlPrinter.html#ab23a90629e374cb1cadca090468bbd19">TiXmlPrinter</a>
+</li>
+<li>SetTabSize()
+: <a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e">TiXmlDocument</a>
+</li>
+<li>SetUserData()
+: <a class="el" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">TiXmlBase</a>
+</li>
+<li>SetValue()
+: <a class="el" href="classTiXmlAttribute.html#a2dae44178f668b3cb48101be4f2236a0">TiXmlAttribute</a>
+, <a class="el" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">TiXmlNode</a>
+, <a class="el" href="classTiXmlAttribute.html#ab43f67a0cc3ec1d80e62606500f0925f">TiXmlAttribute</a>
+</li>
+<li>Size()
+: <a class="el" href="classTiXmlPrinter.html#ad01375ae9199bd2f48252eaddce3039d">TiXmlPrinter</a>
+</li>
+<li>Standalone()
+: <a class="el" href="classTiXmlDeclaration.html#a9ff06afc033d7ef730ec7c6825b97ad9">TiXmlDeclaration</a>
+</li>
+<li>Str()
+: <a class="el" href="classTiXmlPrinter.html#a3bd4daf44309b41f5813a833caa0d1c9">TiXmlPrinter</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x74.html b/Source/External/TinyXml/docs/functions_func_0x74.html
new file mode 100644
index 0000000..928c974
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x74.html
@@ -0,0 +1,126 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li class="current"><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_t">- t -</a></h3><ul>
+<li>Text()
+: <a class="el" href="classTiXmlHandle.html#a9fc739c8a18d160006f82572fc143d13">TiXmlHandle</a>
+</li>
+<li>TiXmlAttribute()
+: <a class="el" href="classTiXmlAttribute.html#a9cfa3c8179873fd485d83003b114f8e1">TiXmlAttribute</a>
+</li>
+<li>TiXmlComment()
+: <a class="el" href="classTiXmlComment.html#aaa3252031d3e8bd3a2bf51a1c61201b7">TiXmlComment</a>
+</li>
+<li>TiXmlDeclaration()
+: <a class="el" href="classTiXmlDeclaration.html#acd5556007c3c72209465081de39d9836">TiXmlDeclaration</a>
+</li>
+<li>TiXmlDocument()
+: <a class="el" href="classTiXmlDocument.html#a9f5e84335708fde98400230f9f12659c">TiXmlDocument</a>
+</li>
+<li>TiXmlElement()
+: <a class="el" href="classTiXmlElement.html#a01bc3ab372d35da08efcbbe65ad90c60">TiXmlElement</a>
+</li>
+<li>TiXmlHandle()
+: <a class="el" href="classTiXmlHandle.html#a236d7855e1e56ccc7b980630c48c7fd7">TiXmlHandle</a>
+</li>
+<li>TiXmlText()
+: <a class="el" href="classTiXmlText.html#af659e77c6b87d684827f35a8f4895960">TiXmlText</a>
+</li>
+<li>ToComment()
+: <a class="el" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574">TiXmlNode</a>
+, <a class="el" href="classTiXmlComment.html#a00fb4215c20a2399ea05ac9b9e7e68a0">TiXmlComment</a>
+</li>
+<li>ToDeclaration()
+: <a class="el" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72">TiXmlNode</a>
+, <a class="el" href="classTiXmlDeclaration.html#a1e085d3fefd1dbf5ccdbff729931a967">TiXmlDeclaration</a>
+</li>
+<li>ToDocument()
+: <a class="el" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08">TiXmlNode</a>
+, <a class="el" href="classTiXmlDocument.html#a1dc977bde3e4fe85a8eb9d88a35ef5a4">TiXmlDocument</a>
+</li>
+<li>ToElement()
+: <a class="el" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c">TiXmlNode</a>
+, <a class="el" href="classTiXmlElement.html#ac5b8d0e25fa23fd9acbb6d146082901c">TiXmlElement</a>
+, <a class="el" href="classTiXmlHandle.html#abc6e7ed383a5fe1e52b0c0004b457b9e">TiXmlHandle</a>
+</li>
+<li>ToNode()
+: <a class="el" href="classTiXmlHandle.html#af678e5088e83be67baf76f699756f2c3">TiXmlHandle</a>
+</li>
+<li>ToText()
+: <a class="el" href="classTiXmlText.html#ae7c3a8fd3e4dbf6c0c4363a943d72f5b">TiXmlText</a>
+, <a class="el" href="classTiXmlHandle.html#a4ac53a652296203a5b5e13854d923586">TiXmlHandle</a>
+, <a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03">TiXmlNode</a>
+, <a class="el" href="classTiXmlText.html#a895bf34ffad17f7439ab2a52b9651648">TiXmlText</a>
+</li>
+<li>ToUnknown()
+: <a class="el" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2">TiXmlNode</a>
+, <a class="el" href="classTiXmlUnknown.html#ab0313e5fe77987d746ac1a97a254419d">TiXmlUnknown</a>
+, <a class="el" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d">TiXmlNode</a>
+, <a class="el" href="classTiXmlHandle.html#a1381c17507a130767b1e23afc93b3674">TiXmlHandle</a>
+</li>
+<li>Type()
+: <a class="el" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">TiXmlNode</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x75.html b/Source/External/TinyXml/docs/functions_func_0x75.html
new file mode 100644
index 0000000..dbbb483
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x75.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li class="current"><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_u">- u -</a></h3><ul>
+<li>Unknown()
+: <a class="el" href="classTiXmlHandle.html#a49675b74357ba2aae124657a9a1ef465">TiXmlHandle</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_func_0x76.html b/Source/External/TinyXml/docs/functions_func_0x76.html
new file mode 100644
index 0000000..9840e77
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_func_0x76.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions_func.html#index_a"><span>a</span></a></li>
+      <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li>
+      <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li>
+      <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li>
+      <li><a href="functions_func_0x66.html#index_f"><span>f</span></a></li>
+      <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li>
+      <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li>
+      <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li>
+      <li><a href="functions_func_0x6e.html#index_n"><span>n</span></a></li>
+      <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li>
+      <li><a href="functions_func_0x71.html#index_q"><span>q</span></a></li>
+      <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li>
+      <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li>
+      <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li>
+      <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li>
+      <li class="current"><a href="functions_func_0x76.html#index_v"><span>v</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ 
+
+<h3><a class="anchor" id="index_v">- v -</a></h3><ul>
+<li>Value()
+: <a class="el" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">TiXmlNode</a>
+, <a class="el" href="classTiXmlAttribute.html#a0f874490eac8ca00ee0070765d0e97e3">TiXmlAttribute</a>
+</li>
+<li>ValueStr()
+: <a class="el" href="classTiXmlAttribute.html#a87705c3ccf9ee9417beb4f7cbacd4d33">TiXmlAttribute</a>
+, <a class="el" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">TiXmlNode</a>
+</li>
+<li>Version()
+: <a class="el" href="classTiXmlDeclaration.html#a02ee557b1a4545c3219ed377c103ec76">TiXmlDeclaration</a>
+</li>
+<li>Visit()
+: <a class="el" href="classTiXmlVisitor.html#a53a60e7a528627b31af3161972cc7fa2">TiXmlVisitor</a>
+, <a class="el" href="classTiXmlPrinter.html#ace1b14d33eede2575c0743e2350f6a38">TiXmlPrinter</a>
+, <a class="el" href="classTiXmlVisitor.html#afad71c71ce6473fb9b4b64cd92de4a19">TiXmlVisitor</a>
+, <a class="el" href="classTiXmlPrinter.html#a83c13d6b980064b30f989f9a35498979">TiXmlPrinter</a>
+, <a class="el" href="classTiXmlVisitor.html#a399b8ebca5cd14664974a32d2ce029e5">TiXmlVisitor</a>
+</li>
+<li>VisitEnter()
+: <a class="el" href="classTiXmlVisitor.html#a07baecb52dd7d8716ae2a48ad0956ee0">TiXmlVisitor</a>
+, <a class="el" href="classTiXmlPrinter.html#a0c5e7bf8622838417a0d0bfb8f433854">TiXmlPrinter</a>
+, <a class="el" href="classTiXmlVisitor.html#af6c6178ffa517bbdba95d70490875fff">TiXmlVisitor</a>
+</li>
+<li>VisitExit()
+: <a class="el" href="classTiXmlPrinter.html#a1853cf2f6e63ad4b4232b4835e0acaf0">TiXmlPrinter</a>
+, <a class="el" href="classTiXmlVisitor.html#aa0ade4f27087447e93974e975c3246ad">TiXmlVisitor</a>
+, <a class="el" href="classTiXmlPrinter.html#a66b33edd76c538b462f789b797a4fdf2">TiXmlPrinter</a>
+, <a class="el" href="classTiXmlVisitor.html#aec2b1f8116226d52f3a1b95dafd3a32c">TiXmlVisitor</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_rela.html b/Source/External/TinyXml/docs/functions_rela.html
new file mode 100644
index 0000000..9d134e7
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_rela.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Related Functions</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li class="current"><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ <ul>
+<li>operator<<
+: <a class="el" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7">TiXmlNode</a>
+</li>
+<li>operator>>
+: <a class="el" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9">TiXmlNode</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/functions_vars.html b/Source/External/TinyXml/docs/functions_vars.html
new file mode 100644
index 0000000..80bb681
--- /dev/null
+++ b/Source/External/TinyXml/docs/functions_vars.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Class Members - Variables</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li class="current"><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="functions.html"><span>All</span></a></li>
+      <li><a href="functions_func.html"><span>Functions</span></a></li>
+      <li class="current"><a href="functions_vars.html"><span>Variables</span></a></li>
+      <li><a href="functions_enum.html"><span>Enumerations</span></a></li>
+      <li><a href="functions_rela.html"><span>Related Functions</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+ <ul>
+<li>userData
+: <a class="el" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">TiXmlBase</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/hierarchy.html b/Source/External/TinyXml/docs/hierarchy.html
new file mode 100644
index 0000000..0b2099d
--- /dev/null
+++ b/Source/External/TinyXml/docs/hierarchy.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Hierarchical Index</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="annotated.html"><span>Class List</span></a></li>
+      <li class="current"><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
+      <li><a href="functions.html"><span>Class Members</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>Class Hierarchy</h1>This inheritance list is sorted roughly, but not completely, alphabetically:<ul>
+<li><a class="el" href="classTiXmlBase.html">TiXmlBase</a><ul>
+<li><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></li>
+<li><a class="el" href="classTiXmlNode.html">TiXmlNode</a><ul>
+<li><a class="el" href="classTiXmlComment.html">TiXmlComment</a></li>
+<li><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></li>
+<li><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></li>
+<li><a class="el" href="classTiXmlElement.html">TiXmlElement</a></li>
+<li><a class="el" href="classTiXmlText.html">TiXmlText</a></li>
+<li><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></li>
+<li><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a><ul>
+<li><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/index.html b/Source/External/TinyXml/docs/index.html
new file mode 100644
index 0000000..aaa966c
--- /dev/null
+++ b/Source/External/TinyXml/docs/index.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Main Page</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li class="current"><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>TinyXml Documentation</h1><h3 class="version">2.6.2 </h3><h1>TinyXML </h1>
+<p>TinyXML is a simple, small, C++ XML parser that can be easily integrated into other programs.</p>
+<h2>What it does. </h2>
+<p>In brief, TinyXML parses an XML document, and builds from that a Document Object Model (DOM) that can be read, modified, and saved.</p>
+<p>XML stands for "eXtensible Markup Language." It allows you to create your own document markups. Where HTML does a very good job of marking documents for browsers, XML allows you to define any kind of document markup, for example a document that describes a "to do" list for an organizer application. XML is a very structured and convenient format. All those random file formats created to store application data can all be replaced with XML. One parser for everything.</p>
+<p>The best place for the complete, correct, and quite frankly hard to read spec is at <a href="http://www.w3.org/TR/2004/REC-xml-20040204/">http://www.w3.org/TR/2004/REC-xml-20040204/</a>. An intro to XML (that I really like) can be found at <a href="http://skew.org/xml/tutorial/">http://skew.org/xml/tutorial</a>.</p>
+<p>There are different ways to access and interact with XML data. TinyXML uses a Document Object Model (DOM), meaning the XML data is parsed into a C++ objects that can be browsed and manipulated, and then written to disk or another output stream. You can also construct an XML document from scratch with C++ objects and write this to disk or another output stream.</p>
+<p>TinyXML is designed to be easy and fast to learn. It is two headers and four cpp files. Simply add these to your project and off you go. There is an example file - xmltest.cpp - to get you started.</p>
+<p>TinyXML is released under the ZLib license, so you can use it in open source or commercial code. The details of the license are at the top of every source file.</p>
+<p>TinyXML attempts to be a flexible parser, but with truly correct and compliant XML output. TinyXML should compile on any reasonably C++ compliant system. It does not rely on exceptions or RTTI. It can be compiled with or without STL support. TinyXML fully supports the UTF-8 encoding, and the first 64k character entities.</p>
+<h2>What it doesn't do. </h2>
+<p>TinyXML doesn't parse or use DTDs (Document Type Definitions) or XSLs (eXtensible Stylesheet Language.) There are other parsers out there (check out www.sourceforge.org, search for XML) that are much more fully featured. But they are also much bigger, take longer to set up in your project, have a higher learning curve, and often have a more restrictive license. If you are working with browsers or have more complete XML needs, TinyXML is not the parser for you.</p>
+<p>The following DTD syntax will not parse at this time in TinyXML:</p>
+<div class="fragment"><pre class="fragment">
+	<!DOCTYPE Archiv [
+	 <!ELEMENT Comment (#PCDATA)>
+	]>
+</pre></div><p>because TinyXML sees this as a !DOCTYPE node with an illegally embedded !ELEMENT node. This may be addressed in the future.</p>
+<h2>Tutorials. </h2>
+<p>For the impatient, here is a tutorial to get you going. A great way to get started, but it is worth your time to read this (very short) manual completely.</p>
+<ul>
+<li><a class="el" href="tutorial0.html">TinyXML Tutorial</a></li>
+</ul>
+<h2>Code Status. </h2>
+<p>TinyXML is mature, tested code. It is very stable. If you find bugs, please file a bug report on the sourceforge web site (www.sourceforge.net/projects/tinyxml). We'll get them straightened out as soon as possible.</p>
+<p>There are some areas of improvement; please check sourceforge if you are interested in working on TinyXML.</p>
+<h2>Related Projects </h2>
+<p>TinyXML projects you may find useful! (Descriptions provided by the projects.)</p>
+<ul>
+<li>
+<b>TinyXPath</b> (<a href="http://tinyxpath.sourceforge.net">http://tinyxpath.sourceforge.net</a>). TinyXPath is a small footprint XPath syntax decoder, written in C++. </li>
+<li>
+<b>TinyXML++</b> (<a href="http://code.google.com/p/ticpp/">http://code.google.com/p/ticpp/</a>). TinyXML++ is a completely new interface to TinyXML that uses MANY of the C++ strengths. Templates, exceptions, and much better error handling. </li>
+</ul>
+<h2>Features </h2>
+<h3>Using STL </h3>
+<p>TinyXML can be compiled to use or not use STL. When using STL, TinyXML uses the std::string class, and fully supports std::istream, std::ostream, operator<<, and operator>>. Many API methods have both 'const char*' and 'const std::string&' forms.</p>
+<p>When STL support is compiled out, no STL files are included whatsoever. All the string classes are implemented by TinyXML itself. API methods all use the 'const char*' form for input.</p>
+<p>Use the compile time define:</p>
+<p>TIXML_USE_STL</p>
+<p>to compile one version or the other. This can be passed by the compiler, or set as the first line of "tinyxml.h".</p>
+<p>Note: If compiling the test code in Linux, setting the environment variable TINYXML_USE_STL=YES/NO will control STL compilation. In the Windows project file, STL and non STL targets are provided. In your project, It's probably easiest to add the line "#define TIXML_USE_STL" as the first line of <a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>.</p>
+<h3>UTF-8 </h3>
+<p>TinyXML supports UTF-8 allowing to manipulate XML files in any language. TinyXML also supports "legacy mode" - the encoding used before UTF-8 support and probably best described as "extended ascii".</p>
+<p>Normally, TinyXML will try to detect the correct encoding and use it. However, by setting the value of TIXML_DEFAULT_ENCODING in the header file, TinyXML can be forced to always use one encoding.</p>
+<p>TinyXML will assume Legacy Mode until one of the following occurs: </p>
+<ol>
+<li>
+If the non-standard but common "UTF-8 lead bytes" (0xef 0xbb 0xbf) begin the file or data stream, TinyXML will read it as UTF-8.  </li>
+<li>
+If the declaration tag is read, and it has an encoding="UTF-8", then TinyXML will read it as UTF-8.  </li>
+<li>
+If the declaration tag is read, and it has no encoding specified, then TinyXML will read it as UTF-8.  </li>
+<li>
+If the declaration tag is read, and it has an encoding="something else", then TinyXML will read it as Legacy Mode. In legacy mode, TinyXML will work as it did before. It's not clear what that mode does exactly, but old content should keep working. </li>
+<li>
+Until one of the above criteria is met, TinyXML runs in Legacy Mode. </li>
+</ol>
+<p>What happens if the encoding is incorrectly set or detected? TinyXML will try to read and pass through text seen as improperly encoded. You may get some strange results or mangled characters. You may want to force TinyXML to the correct mode.</p>
+<p>You may force TinyXML to Legacy Mode by using LoadFile( TIXML_ENCODING_LEGACY ) or LoadFile( filename, TIXML_ENCODING_LEGACY ). You may force it to use legacy mode all the time by setting TIXML_DEFAULT_ENCODING = TIXML_ENCODING_LEGACY. Likewise, you may force it to TIXML_ENCODING_UTF8 with the same technique.</p>
+<p>For English users, using English XML, UTF-8 is the same as low-ASCII. You don't need to be aware of UTF-8 or change your code in any way. You can think of UTF-8 as a "superset" of ASCII.</p>
+<p>UTF-8 is not a double byte format - but it is a standard encoding of Unicode! TinyXML does not use or directly support wchar, TCHAR, or Microsoft's _UNICODE at this time. It is common to see the term "Unicode" improperly refer to UTF-16, a wide byte encoding of unicode. This is a source of confusion.</p>
+<p>For "high-ascii" languages - everything not English, pretty much - TinyXML can handle all languages, at the same time, as long as the XML is encoded in UTF-8. That can be a little tricky, older programs and operating systems tend to use the "default" or "traditional" code page. Many apps (and almost all modern ones) can output UTF-8, but older or stubborn (or just broken) ones still output text in the default code page.</p>
+<p>For example, Japanese systems traditionally use SHIFT-JIS encoding. Text encoded as SHIFT-JIS can not be read by TinyXML. A good text editor can import SHIFT-JIS and then save as UTF-8.</p>
+<p>The <a href="http://skew.org/xml/tutorial/">Skew.org link</a> does a great job covering the encoding issue.</p>
+<p>The test file "utf8test.xml" is an XML containing English, Spanish, Russian, and Simplified Chinese. (Hopefully they are translated correctly). The file "utf8test.gif" is a screen capture of the XML file, rendered in IE. Note that if you don't have the correct fonts (Simplified Chinese or Russian) on your system, you won't see output that matches the GIF file even if you can parse it correctly. Also note that (at least on my Windows machine) console output is in a Western code page, so that Print() or printf() cannot correctly display the file. This is not a bug in TinyXML - just an OS issue. No data is lost or destroyed by TinyXML. The console just doesn't render UTF-8.</p>
+<h3>Entities </h3>
+<p>TinyXML recognizes the pre-defined "character entities", meaning special characters. Namely:</p>
+<div class="fragment"><pre class="fragment">
+	&amp;	&
+	&lt;	<
+	&gt;	>
+	&quot;	"
+	&apos;	'
+</pre></div><p>These are recognized when the XML document is read, and translated to there UTF-8 equivalents. For instance, text with the XML of:</p>
+<div class="fragment"><pre class="fragment">
+	Far &amp; Away
+</pre></div><p>will have the Value() of "Far & Away" when queried from the <a class="el" href="classTiXmlText.html" title="XML text.">TiXmlText</a> object, and will be written back to the XML stream/file as an ampersand. Older versions of TinyXML "preserved" character entities, but the newer versions will translate them into characters.</p>
+<p>Additionally, any character can be specified by its Unicode code point: The syntax "&#xA0;" or "&#160;" are both to the non-breaking space characher.</p>
+<h3>Printing </h3>
+<p>TinyXML can print output in several different ways that all have strengths and limitations.</p>
+<ul>
+<li>Print( FILE* ). Output to a std-C stream, which includes all C files as well as stdout.<ul>
+<li>"Pretty prints", but you don't have control over printing options.</li>
+<li>The output is streamed directly to the FILE object, so there is no memory overhead in the TinyXML code.</li>
+<li>used by Print() and SaveFile()</li>
+</ul>
+</li>
+</ul>
+<ul>
+<li>operator<<. Output to a c++ stream.<ul>
+<li>Integrates with standart C++ iostreams.</li>
+<li>Outputs in "network printing" mode without line breaks. Good for network transmission and moving XML between C++ objects, but hard for a human to read.</li>
+</ul>
+</li>
+</ul>
+<ul>
+<li><a class="el" href="classTiXmlPrinter.html" title="Print to memory functionality.">TiXmlPrinter</a>. Output to a std::string or memory buffer.<ul>
+<li>API is less concise</li>
+<li>Future printing options will be put here.</li>
+<li>Printing may change slightly in future versions as it is refined and expanded.</li>
+</ul>
+</li>
+</ul>
+<h3>Streams </h3>
+<p>With TIXML_USE_STL on TinyXML supports C++ streams (operator <<,>>) streams as well as C (FILE*) streams. There are some differences that you may need to be aware of.</p>
+<p>C style output:</p>
+<ul>
+<li>based on FILE*</li>
+<li>the Print() and SaveFile() methods</li>
+</ul>
+<p>Generates formatted output, with plenty of white space, intended to be as human-readable as possible. They are very fast, and tolerant of ill formed XML documents. For example, an XML document that contains 2 root elements and 2 declarations, will still print.</p>
+<p>C style input:</p>
+<ul>
+<li>based on FILE*</li>
+<li>the Parse() and LoadFile() methods</li>
+</ul>
+<p>A fast, tolerant read. Use whenever you don't need the C++ streams.</p>
+<p>C++ style output:</p>
+<ul>
+<li>based on std::ostream</li>
+<li>operator<<</li>
+</ul>
+<p>Generates condensed output, intended for network transmission rather than readability. Depending on your system's implementation of the ostream class, these may be somewhat slower. (Or may not.) Not tolerant of ill formed XML: a document should contain the correct one root element. Additional root level elements will not be streamed out.</p>
+<p>C++ style input:</p>
+<ul>
+<li>based on std::istream</li>
+<li>operator>></li>
+</ul>
+<p>Reads XML from a stream, making it useful for network transmission. The tricky part is knowing when the XML document is complete, since there will almost certainly be other data in the stream. TinyXML will assume the XML data is complete after it reads the root element. Put another way, documents that are ill-constructed with more than one root element will not read correctly. Also note that operator>> is somewhat slower than Parse, due to both implementation of the STL and limitations of TinyXML.</p>
+<h3>White space </h3>
+<p>The world simply does not agree on whether white space should be kept, or condensed. For example, pretend the '_' is a space, and look at "Hello____world". HTML, and at least some XML parsers, will interpret this as "Hello_world". They condense white space. Some XML parsers do not, and will leave it as "Hello____world". (Remember to keep pretending the _ is a space.) Others suggest that __Hello___world__ should become Hello___world.</p>
+<p>It's an issue that hasn't been resolved to my satisfaction. TinyXML supports the first 2 approaches. Call <a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1" title="The world does not agree on whether white space should be kept or not.">TiXmlBase::SetCondenseWhiteSpace( bool )</a> to set the desired behavior. The default is to condense white space.</p>
+<p>If you change the default, you should call <a class="el" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1" title="The world does not agree on whether white space should be kept or not.">TiXmlBase::SetCondenseWhiteSpace( bool )</a> before making any calls to Parse XML data, and I don't recommend changing it after it has been set.</p>
+<h3>Handles </h3>
+<p>Where browsing an XML document in a robust way, it is important to check for null returns from method calls. An error safe implementation can generate a lot of code like:</p>
+<div class="fragment"><pre class="fragment">
+TiXmlElement* root = document.FirstChildElement( "Document" );
+if ( root )
+{
+	TiXmlElement* element = root->FirstChildElement( "Element" );
+	if ( element )
+	{
+		TiXmlElement* child = element->FirstChildElement( "Child" );
+		if ( child )
+		{
+			TiXmlElement* child2 = child->NextSiblingElement( "Child" );
+			if ( child2 )
+			{
+				// Finally do something useful.
+</pre></div><p>Handles have been introduced to clean this up. Using the <a class="el" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> class, the previous code reduces to:</p>
+<div class="fragment"><pre class="fragment">
+TiXmlHandle docHandle( &document );
+TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement();
+if ( child2 )
+{
+	// do something useful
+</pre></div><p>Which is much easier to deal with. See <a class="el" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> for more information.</p>
+<h3>Row and Column tracking </h3>
+<p>Being able to track nodes and attributes back to their origin location in source files can be very important for some applications. Additionally, knowing where parsing errors occured in the original source can be very time saving.</p>
+<p>TinyXML can tracks the row and column origin of all nodes and attributes in a text file. The <a class="el" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853" title="Return the position, in the original source file, of this node or attribute.">TiXmlBase::Row()</a> and <a class="el" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003" title="See Row().">TiXmlBase::Column()</a> methods return the origin of the node in the source text. The correct tabs can be configured in <a class="el" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e" title="SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to...">TiXmlDocument::SetTabSize()</a>.</p>
+<h2>Using and Installing </h2>
+<p>To Compile and Run xmltest:</p>
+<p>A Linux Makefile and a Windows Visual C++ .dsw file is provided. Simply compile and run. It will write the file demotest.xml to your disk and generate output on the screen. It also tests walking the DOM by printing out the number of nodes found using different techniques.</p>
+<p>The Linux makefile is very generic and runs on many systems - it is currently tested on mingw and MacOSX. You do not need to run 'make depend'. The dependecies have been hard coded.</p>
+<h3>Windows project file for VC6</h3>
+<ul>
+<li>
+tinyxml: tinyxml library, non-STL  </li>
+<li>
+tinyxmlSTL: tinyxml library, STL  </li>
+<li>
+tinyXmlTest: test app, non-STL  </li>
+<li>
+tinyXmlTestSTL: test app, STL  </li>
+</ul>
+<h3>Makefile</h3>
+<p>At the top of the makefile you can set:</p>
+<p>PROFILE, DEBUG, and TINYXML_USE_STL. Details (such that they are) are in the makefile.</p>
+<p>In the tinyxml directory, type "make clean" then "make". The executable file 'xmltest' will be created.</p>
+<h3>To Use in an Application:</h3>
+<p>Add tinyxml.cpp, <a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>, tinyxmlerror.cpp, tinyxmlparser.cpp, tinystr.cpp, and <a class="el" href="tinystr_8h_source.html">tinystr.h</a> to your project or make file. That's it! It should compile on any reasonably compliant C++ system. You do not need to enable exceptions or RTTI for TinyXML.</p>
+<h2>How TinyXML works. </h2>
+<p>An example is probably the best way to go. Take: </p>
+<div class="fragment"><pre class="fragment">
+	<?xml version="1.0" standalone=no>
+	<!-- Our to do list data -->
+	<ToDo>
+		<Item priority="1"> Go to the <bold>Toy store!</bold></Item>
+		<Item priority="2"> Do bills</Item>
+	</ToDo>
+</pre></div><p>Its not much of a To Do list, but it will do. To read this file (say "demo.xml") you would create a document, and parse it in: </p>
+<div class="fragment"><pre class="fragment">
+	TiXmlDocument doc( "demo.xml" );
+	doc.LoadFile();
+</pre></div><p>And its ready to go. Now lets look at some lines and how they relate to the DOM.</p>
+<div class="fragment"><pre class="fragment">
+<?xml version="1.0" standalone=no>
+</pre></div><p>The first line is a declaration, and gets turned into the <a class="el" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a> class. It will be the first child of the document node.</p>
+<p>This is the only directive/special tag parsed by TinyXML. Generally directive tags are stored in <a class="el" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn't recognize is saved as an unknown.">TiXmlUnknown</a> so the commands wont be lost when it is saved back to disk.</p>
+<div class="fragment"><pre class="fragment">
+<!-- Our to do list data -->
+</pre></div><p>A comment. Will become a <a class="el" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a> object.</p>
+<div class="fragment"><pre class="fragment">
+<ToDo>
+</pre></div><p>The "ToDo" tag defines a <a class="el" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a> object. This one does not have any attributes, but does contain 2 other elements.</p>
+<div class="fragment"><pre class="fragment">
+<Item priority="1"> 
+</pre></div><p>Creates another <a class="el" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a> which is a child of the "ToDo" element. This element has 1 attribute, with the name "priority" and the value "1".</p>
+<div class="fragment"><pre class="fragment">
+Go to the
+</pre></div><p>A <a class="el" href="classTiXmlText.html" title="XML text.">TiXmlText</a>. This is a leaf node and cannot contain other nodes. It is a child of the "Item" <a class="el" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>.</p>
+<div class="fragment"><pre class="fragment">
+<bold>
+</pre></div><p>Another <a class="el" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>, this one a child of the "Item" element.</p>
+<p>Etc.</p>
+<p>Looking at the entire object tree, you end up with: </p>
+<div class="fragment"><pre class="fragment">
+TiXmlDocument					"demo.xml"
+	TiXmlDeclaration			"version='1.0'" "standalone=no"
+	TiXmlComment				" Our to do list data"
+	TiXmlElement				"ToDo"
+		TiXmlElement			"Item" Attribtutes: priority = 1
+			TiXmlText			"Go to the "
+			TiXmlElement		"bold"
+				TiXmlText		"Toy store!"
+		TiXmlElement			"Item" Attributes: priority=2
+			TiXmlText			"Do bills"
+</pre></div><h2>Documentation </h2>
+<p>The documentation is build with Doxygen, using the 'dox' configuration file.</p>
+<h2>License </h2>
+<p>TinyXML is released under the zlib license:</p>
+<p>This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.</p>
+<p>Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:</p>
+<p>1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.</p>
+<p>2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.</p>
+<p>3. This notice may not be removed or altered from any source distribution.</p>
+<h2>References </h2>
+<p>The World Wide Web Consortium is the definitive standard body for XML, and their web pages contain huge amounts of information.</p>
+<p>The definitive spec: <a href="http://www.w3.org/TR/2004/REC-xml-20040204/">http://www.w3.org/TR/2004/REC-xml-20040204/</a></p>
+<p>I also recommend "XML Pocket Reference" by Robert Eckstein and published by OReilly...the book that got the whole thing started.</p>
+<h2>Contributors, Contacts, and a Brief History </h2>
+<p>Thanks very much to everyone who sends suggestions, bugs, ideas, and encouragement. It all helps, and makes this project fun. A special thanks to the contributors on the web pages that keep it lively.</p>
+<p>So many people have sent in bugs and ideas, that rather than list here we try to give credit due in the "changes.txt" file.</p>
+<p>TinyXML was originally written by Lee Thomason. (Often the "I" still in the documentation.) Lee reviews changes and releases new versions, with the help of Yves Berquin, Andrew Ellerton, and the tinyXml community.</p>
+<p>We appreciate your suggestions, and would love to know if you use TinyXML. Hopefully you will enjoy it and find it useful. Please post questions, comments, file bugs, or contact us at:</p>
+<p>www.sourceforge.net/projects/tinyxml</p>
+<p>Lee Thomason, Yves Berquin, Andrew Ellerton </p>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/pages.html b/Source/External/TinyXml/docs/pages.html
new file mode 100644
index 0000000..f03b9f0
--- /dev/null
+++ b/Source/External/TinyXml/docs/pages.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: Page Index</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
+      <li><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div>
+<div class="contents">
+<h1>Related Pages</h1>Here is a list of all related documentation pages:<ul>
+<li><a class="el" href="deprecated.html">Deprecated List</a>
+</li>
+</ul>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/tab_b.gif b/Source/External/TinyXml/docs/tab_b.gif
new file mode 100644
index 0000000..0d62348
Binary files /dev/null and b/Source/External/TinyXml/docs/tab_b.gif differ
diff --git a/Source/External/TinyXml/docs/tab_l.gif b/Source/External/TinyXml/docs/tab_l.gif
new file mode 100644
index 0000000..9b1e633
Binary files /dev/null and b/Source/External/TinyXml/docs/tab_l.gif differ
diff --git a/Source/External/TinyXml/docs/tab_r.gif b/Source/External/TinyXml/docs/tab_r.gif
new file mode 100644
index 0000000..ce9dd9f
Binary files /dev/null and b/Source/External/TinyXml/docs/tab_r.gif differ
diff --git a/Source/External/TinyXml/docs/tabs.css b/Source/External/TinyXml/docs/tabs.css
new file mode 100644
index 0000000..6a26826
--- /dev/null
+++ b/Source/External/TinyXml/docs/tabs.css
@@ -0,0 +1,105 @@
+/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */
+
+DIV.tabs
+{
+   float            : left;
+   width            : 100%;
+   background       : url("tab_b.gif") repeat-x bottom;
+   margin-bottom    : 4px;
+}
+
+DIV.tabs UL
+{
+   margin           : 0px;
+   padding-left     : 10px;
+   list-style       : none;
+}
+
+DIV.tabs LI, DIV.tabs FORM
+{
+   display          : inline;
+   margin           : 0px;
+   padding          : 0px;
+}
+
+DIV.tabs FORM
+{
+   float            : right;
+}
+
+DIV.tabs A
+{
+   float            : left;
+   background       : url("tab_r.gif") no-repeat right top;
+   border-bottom    : 1px solid #84B0C7;
+   font-size        : 80%;
+   font-weight      : bold;
+   text-decoration  : none;
+}
+
+DIV.tabs A:hover
+{
+   background-position: 100% -150px;
+}
+
+DIV.tabs A:link, DIV.tabs A:visited,
+DIV.tabs A:active, DIV.tabs A:hover
+{
+       color: #1A419D;
+}
+
+DIV.tabs SPAN
+{
+   float            : left;
+   display          : block;
+   background       : url("tab_l.gif") no-repeat left top;
+   padding          : 5px 9px;
+   white-space      : nowrap;
+}
+
+DIV.tabs #MSearchBox
+{
+   float            : right;
+   display          : inline;
+   font-size        : 1em;
+}
+
+DIV.tabs TD
+{
+   font-size        : 80%;
+   font-weight      : bold;
+   text-decoration  : none;
+}
+
+
+
+/* Commented Backslash Hack hides rule from IE5-Mac \*/
+DIV.tabs SPAN {float : none;}
+/* End IE5-Mac hack */
+
+DIV.tabs A:hover SPAN
+{
+   background-position: 0% -150px;
+}
+
+DIV.tabs LI.current A
+{
+   background-position: 100% -150px;
+   border-width     : 0px;
+}
+
+DIV.tabs LI.current SPAN
+{
+   background-position: 0% -150px;
+   padding-bottom   : 6px;
+}
+
+DIV.navpath
+{
+   background       : none;
+   border           : none;
+   border-bottom    : 1px solid #84B0C7;
+   text-align       : center;
+   margin           : 2px;
+   padding          : 2px;
+}
diff --git a/Source/External/TinyXml/docs/tinystr_8h_source.html b/Source/External/TinyXml/docs/tinystr_8h_source.html
new file mode 100644
index 0000000..71b0e66
--- /dev/null
+++ b/Source/External/TinyXml/docs/tinystr_8h_source.html
@@ -0,0 +1,335 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: tinystr.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li><a href="annotated.html"><span>Classes</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<h1>tinystr.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment">www.sourceforge.net/projects/tinyxml</span>
+<a name="l00003"></a>00003 <span class="comment"></span>
+<a name="l00004"></a>00004 <span class="comment">This software is provided 'as-is', without any express or implied</span>
+<a name="l00005"></a>00005 <span class="comment">warranty. In no event will the authors be held liable for any</span>
+<a name="l00006"></a>00006 <span class="comment">damages arising from the use of this software.</span>
+<a name="l00007"></a>00007 <span class="comment"></span>
+<a name="l00008"></a>00008 <span class="comment">Permission is granted to anyone to use this software for any</span>
+<a name="l00009"></a>00009 <span class="comment">purpose, including commercial applications, and to alter it and</span>
+<a name="l00010"></a>00010 <span class="comment">redistribute it freely, subject to the following restrictions:</span>
+<a name="l00011"></a>00011 <span class="comment"></span>
+<a name="l00012"></a>00012 <span class="comment">1. The origin of this software must not be misrepresented; you must</span>
+<a name="l00013"></a>00013 <span class="comment">not claim that you wrote the original software. If you use this</span>
+<a name="l00014"></a>00014 <span class="comment">software in a product, an acknowledgment in the product documentation</span>
+<a name="l00015"></a>00015 <span class="comment">would be appreciated but is not required.</span>
+<a name="l00016"></a>00016 <span class="comment"></span>
+<a name="l00017"></a>00017 <span class="comment">2. Altered source versions must be plainly marked as such, and</span>
+<a name="l00018"></a>00018 <span class="comment">must not be misrepresented as being the original software.</span>
+<a name="l00019"></a>00019 <span class="comment"></span>
+<a name="l00020"></a>00020 <span class="comment">3. This notice may not be removed or altered from any source</span>
+<a name="l00021"></a>00021 <span class="comment">distribution.</span>
+<a name="l00022"></a>00022 <span class="comment">*/</span>
+<a name="l00023"></a>00023 
+<a name="l00024"></a>00024 
+<a name="l00025"></a>00025 <span class="preprocessor">#ifndef TIXML_USE_STL</span>
+<a name="l00026"></a>00026 <span class="preprocessor"></span>
+<a name="l00027"></a>00027 <span class="preprocessor">#ifndef TIXML_STRING_INCLUDED</span>
+<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define TIXML_STRING_INCLUDED</span>
+<a name="l00029"></a>00029 <span class="preprocessor"></span>
+<a name="l00030"></a>00030 <span class="preprocessor">#include <assert.h></span>
+<a name="l00031"></a>00031 <span class="preprocessor">#include <string.h></span>
+<a name="l00032"></a>00032 
+<a name="l00033"></a>00033 <span class="comment">/*  The support for explicit isn't that universal, and it isn't really</span>
+<a name="l00034"></a>00034 <span class="comment">    required - it is used to check that the TiXmlString class isn't incorrectly</span>
+<a name="l00035"></a>00035 <span class="comment">    used. Be nice to old compilers and macro it here:</span>
+<a name="l00036"></a>00036 <span class="comment">*/</span>
+<a name="l00037"></a>00037 <span class="preprocessor">#if defined(_MSC_VER) && (_MSC_VER >= 1200 )</span>
+<a name="l00038"></a>00038 <span class="preprocessor"></span>    <span class="comment">// Microsoft visual studio, version 6 and higher.</span>
+<a name="l00039"></a>00039 <span class="preprocessor">    #define TIXML_EXPLICIT explicit</span>
+<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__GNUC__) && (__GNUC__ >= 3 )</span>
+<a name="l00041"></a>00041 <span class="preprocessor"></span>    <span class="comment">// GCC version 3 and higher.s</span>
+<a name="l00042"></a>00042 <span class="preprocessor">    #define TIXML_EXPLICIT explicit</span>
+<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#else</span>
+<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">    #define TIXML_EXPLICIT</span>
+<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+<a name="l00046"></a>00046 <span class="preprocessor"></span>
+<a name="l00047"></a>00047 
+<a name="l00048"></a>00048 <span class="comment">/*</span>
+<a name="l00049"></a>00049 <span class="comment">   TiXmlString is an emulation of a subset of the std::string template.</span>
+<a name="l00050"></a>00050 <span class="comment">   Its purpose is to allow compiling TinyXML on compilers with no or poor STL support.</span>
+<a name="l00051"></a>00051 <span class="comment">   Only the member functions relevant to the TinyXML project have been implemented.</span>
+<a name="l00052"></a>00052 <span class="comment">   The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase</span>
+<a name="l00053"></a>00053 <span class="comment">   a string and there's no more room, we allocate a buffer twice as big as we need.</span>
+<a name="l00054"></a>00054 <span class="comment">*/</span>
+<a name="l00055"></a>00055 <span class="keyword">class </span>TiXmlString
+<a name="l00056"></a>00056 {
+<a name="l00057"></a>00057   <span class="keyword">public</span> :
+<a name="l00058"></a>00058     <span class="comment">// The size type used</span>
+<a name="l00059"></a>00059     <span class="keyword">typedef</span> <span class="keywordtype">size_t</span> size_type;
+<a name="l00060"></a>00060 
+<a name="l00061"></a>00061     <span class="comment">// Error value for find primitive</span>
+<a name="l00062"></a>00062     <span class="keyword">static</span> <span class="keyword">const</span> size_type npos; <span class="comment">// = -1;</span>
+<a name="l00063"></a>00063 
+<a name="l00064"></a>00064 
+<a name="l00065"></a>00065     <span class="comment">// TiXmlString empty constructor</span>
+<a name="l00066"></a>00066     TiXmlString () : rep_(&nullrep_)
+<a name="l00067"></a>00067     {
+<a name="l00068"></a>00068     }
+<a name="l00069"></a>00069 
+<a name="l00070"></a>00070     <span class="comment">// TiXmlString copy constructor</span>
+<a name="l00071"></a>00071     TiXmlString ( <span class="keyword">const</span> TiXmlString & copy) : rep_(0)
+<a name="l00072"></a>00072     {
+<a name="l00073"></a>00073         init(copy.length());
+<a name="l00074"></a>00074         memcpy(start(), copy.data(), length());
+<a name="l00075"></a>00075     }
+<a name="l00076"></a>00076 
+<a name="l00077"></a>00077     <span class="comment">// TiXmlString constructor, based on a string</span>
+<a name="l00078"></a>00078     TIXML_EXPLICIT TiXmlString ( <span class="keyword">const</span> <span class="keywordtype">char</span> * copy) : rep_(0)
+<a name="l00079"></a>00079     {
+<a name="l00080"></a>00080         init( static_cast<size_type>( strlen(copy) ));
+<a name="l00081"></a>00081         memcpy(start(), copy, length());
+<a name="l00082"></a>00082     }
+<a name="l00083"></a>00083 
+<a name="l00084"></a>00084     <span class="comment">// TiXmlString constructor, based on a string</span>
+<a name="l00085"></a>00085     TIXML_EXPLICIT TiXmlString ( <span class="keyword">const</span> <span class="keywordtype">char</span> * str, size_type len) : rep_(0)
+<a name="l00086"></a>00086     {
+<a name="l00087"></a>00087         init(len);
+<a name="l00088"></a>00088         memcpy(start(), str, len);
+<a name="l00089"></a>00089     }
+<a name="l00090"></a>00090 
+<a name="l00091"></a>00091     <span class="comment">// TiXmlString destructor</span>
+<a name="l00092"></a>00092     ~TiXmlString ()
+<a name="l00093"></a>00093     {
+<a name="l00094"></a>00094         quit();
+<a name="l00095"></a>00095     }
+<a name="l00096"></a>00096 
+<a name="l00097"></a>00097     TiXmlString& operator = (<span class="keyword">const</span> <span class="keywordtype">char</span> * copy)
+<a name="l00098"></a>00098     {
+<a name="l00099"></a>00099         <span class="keywordflow">return</span> assign( copy, (size_type)strlen(copy));
+<a name="l00100"></a>00100     }
+<a name="l00101"></a>00101 
+<a name="l00102"></a>00102     TiXmlString& operator = (<span class="keyword">const</span> TiXmlString & copy)
+<a name="l00103"></a>00103     {
+<a name="l00104"></a>00104         <span class="keywordflow">return</span> assign(copy.start(), copy.length());
+<a name="l00105"></a>00105     }
+<a name="l00106"></a>00106 
+<a name="l00107"></a>00107 
+<a name="l00108"></a>00108     <span class="comment">// += operator. Maps to append</span>
+<a name="l00109"></a>00109     TiXmlString& operator += (<span class="keyword">const</span> <span class="keywordtype">char</span> * suffix)
+<a name="l00110"></a>00110     {
+<a name="l00111"></a>00111         <span class="keywordflow">return</span> append(suffix, static_cast<size_type>( strlen(suffix) ));
+<a name="l00112"></a>00112     }
+<a name="l00113"></a>00113 
+<a name="l00114"></a>00114     <span class="comment">// += operator. Maps to append</span>
+<a name="l00115"></a>00115     TiXmlString& operator += (<span class="keywordtype">char</span> single)
+<a name="l00116"></a>00116     {
+<a name="l00117"></a>00117         <span class="keywordflow">return</span> append(&single, 1);
+<a name="l00118"></a>00118     }
+<a name="l00119"></a>00119 
+<a name="l00120"></a>00120     <span class="comment">// += operator. Maps to append</span>
+<a name="l00121"></a>00121     TiXmlString& operator += (<span class="keyword">const</span> TiXmlString & suffix)
+<a name="l00122"></a>00122     {
+<a name="l00123"></a>00123         <span class="keywordflow">return</span> append(suffix.data(), suffix.length());
+<a name="l00124"></a>00124     }
+<a name="l00125"></a>00125 
+<a name="l00126"></a>00126 
+<a name="l00127"></a>00127     <span class="comment">// Convert a TiXmlString into a null-terminated char *</span>
+<a name="l00128"></a>00128     <span class="keyword">const</span> <span class="keywordtype">char</span> * c_str ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->str; }
+<a name="l00129"></a>00129 
+<a name="l00130"></a>00130     <span class="comment">// Convert a TiXmlString into a char * (need not be null terminated).</span>
+<a name="l00131"></a>00131     <span class="keyword">const</span> <span class="keywordtype">char</span> * data ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->str; }
+<a name="l00132"></a>00132 
+<a name="l00133"></a>00133     <span class="comment">// Return the length of a TiXmlString</span>
+<a name="l00134"></a>00134     size_type length ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->size; }
+<a name="l00135"></a>00135 
+<a name="l00136"></a>00136     <span class="comment">// Alias for length()</span>
+<a name="l00137"></a>00137     size_type size ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->size; }
+<a name="l00138"></a>00138 
+<a name="l00139"></a>00139     <span class="comment">// Checks if a TiXmlString is empty</span>
+<a name="l00140"></a>00140     <span class="keywordtype">bool</span> empty ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->size == 0; }
+<a name="l00141"></a>00141 
+<a name="l00142"></a>00142     <span class="comment">// Return capacity of string</span>
+<a name="l00143"></a>00143     size_type capacity ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->capacity; }
+<a name="l00144"></a>00144 
+<a name="l00145"></a>00145 
+<a name="l00146"></a>00146     <span class="comment">// single char extraction</span>
+<a name="l00147"></a>00147     <span class="keyword">const</span> <span class="keywordtype">char</span>& at (size_type index)<span class="keyword"> const</span>
+<a name="l00148"></a>00148 <span class="keyword">    </span>{
+<a name="l00149"></a>00149         assert( index < length() );
+<a name="l00150"></a>00150         <span class="keywordflow">return</span> rep_->str[ index ];
+<a name="l00151"></a>00151     }
+<a name="l00152"></a>00152 
+<a name="l00153"></a>00153     <span class="comment">// [] operator</span>
+<a name="l00154"></a>00154     <span class="keywordtype">char</span>& operator [] (size_type index)<span class="keyword"> const</span>
+<a name="l00155"></a>00155 <span class="keyword">    </span>{
+<a name="l00156"></a>00156         assert( index < length() );
+<a name="l00157"></a>00157         <span class="keywordflow">return</span> rep_->str[ index ];
+<a name="l00158"></a>00158     }
+<a name="l00159"></a>00159 
+<a name="l00160"></a>00160     <span class="comment">// find a char in a string. Return TiXmlString::npos if not found</span>
+<a name="l00161"></a>00161     size_type find (<span class="keywordtype">char</span> lookup)<span class="keyword"> const</span>
+<a name="l00162"></a>00162 <span class="keyword">    </span>{
+<a name="l00163"></a>00163         <span class="keywordflow">return</span> find(lookup, 0);
+<a name="l00164"></a>00164     }
+<a name="l00165"></a>00165 
+<a name="l00166"></a>00166     <span class="comment">// find a char in a string from an offset. Return TiXmlString::npos if not found</span>
+<a name="l00167"></a>00167     size_type find (<span class="keywordtype">char</span> tofind, size_type offset)<span class="keyword"> const</span>
+<a name="l00168"></a>00168 <span class="keyword">    </span>{
+<a name="l00169"></a>00169         <span class="keywordflow">if</span> (offset >= length()) <span class="keywordflow">return</span> npos;
+<a name="l00170"></a>00170 
+<a name="l00171"></a>00171         <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">char</span>* p = c_str() + offset; *p != <span class="charliteral">'\0'</span>; ++p)
+<a name="l00172"></a>00172         {
+<a name="l00173"></a>00173            <span class="keywordflow">if</span> (*p == tofind) <span class="keywordflow">return</span> <span class="keyword">static_cast<</span> size_type <span class="keyword">></span>( p - c_str() );
+<a name="l00174"></a>00174         }
+<a name="l00175"></a>00175         <span class="keywordflow">return</span> npos;
+<a name="l00176"></a>00176     }
+<a name="l00177"></a>00177 
+<a name="l00178"></a>00178     <span class="keywordtype">void</span> clear ()
+<a name="l00179"></a>00179     {
+<a name="l00180"></a>00180         <span class="comment">//Lee:</span>
+<a name="l00181"></a>00181         <span class="comment">//The original was just too strange, though correct:</span>
+<a name="l00182"></a>00182         <span class="comment">//  TiXmlString().swap(*this);</span>
+<a name="l00183"></a>00183         <span class="comment">//Instead use the quit & re-init:</span>
+<a name="l00184"></a>00184         quit();
+<a name="l00185"></a>00185         init(0,0);
+<a name="l00186"></a>00186     }
+<a name="l00187"></a>00187 
+<a name="l00188"></a>00188     <span class="comment">/*  Function to reserve a big amount of data when we know we'll need it. Be aware that this</span>
+<a name="l00189"></a>00189 <span class="comment">        function DOES NOT clear the content of the TiXmlString if any exists.</span>
+<a name="l00190"></a>00190 <span class="comment">    */</span>
+<a name="l00191"></a>00191     <span class="keywordtype">void</span> reserve (size_type cap);
+<a name="l00192"></a>00192 
+<a name="l00193"></a>00193     TiXmlString& assign (<span class="keyword">const</span> <span class="keywordtype">char</span>* str, size_type len);
+<a name="l00194"></a>00194 
+<a name="l00195"></a>00195     TiXmlString& append (<span class="keyword">const</span> <span class="keywordtype">char</span>* str, size_type len);
+<a name="l00196"></a>00196 
+<a name="l00197"></a>00197     <span class="keywordtype">void</span> swap (TiXmlString& other)
+<a name="l00198"></a>00198     {
+<a name="l00199"></a>00199         Rep* r = rep_;
+<a name="l00200"></a>00200         rep_ = other.rep_;
+<a name="l00201"></a>00201         other.rep_ = r;
+<a name="l00202"></a>00202     }
+<a name="l00203"></a>00203 
+<a name="l00204"></a>00204   <span class="keyword">private</span>:
+<a name="l00205"></a>00205 
+<a name="l00206"></a>00206     <span class="keywordtype">void</span> init(size_type sz) { init(sz, sz); }
+<a name="l00207"></a>00207     <span class="keywordtype">void</span> set_size(size_type sz) { rep_->str[ rep_->size = sz ] = <span class="charliteral">'\0'</span>; }
+<a name="l00208"></a>00208     <span class="keywordtype">char</span>* start()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->str; }
+<a name="l00209"></a>00209     <span class="keywordtype">char</span>* finish()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->str + rep_->size; }
+<a name="l00210"></a>00210 
+<a name="l00211"></a>00211     <span class="keyword">struct </span>Rep
+<a name="l00212"></a>00212     {
+<a name="l00213"></a>00213         size_type size, capacity;
+<a name="l00214"></a>00214         <span class="keywordtype">char</span> str[1];
+<a name="l00215"></a>00215     };
+<a name="l00216"></a>00216 
+<a name="l00217"></a>00217     <span class="keywordtype">void</span> init(size_type sz, size_type cap)
+<a name="l00218"></a>00218     {
+<a name="l00219"></a>00219         <span class="keywordflow">if</span> (cap)
+<a name="l00220"></a>00220         {
+<a name="l00221"></a>00221             <span class="comment">// Lee: the original form:</span>
+<a name="l00222"></a>00222             <span class="comment">//  rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap));</span>
+<a name="l00223"></a>00223             <span class="comment">// doesn't work in some cases of new being overloaded. Switching</span>
+<a name="l00224"></a>00224             <span class="comment">// to the normal allocation, although use an 'int' for systems</span>
+<a name="l00225"></a>00225             <span class="comment">// that are overly picky about structure alignment.</span>
+<a name="l00226"></a>00226             <span class="keyword">const</span> size_type bytesNeeded = <span class="keyword">sizeof</span>(Rep) + cap;
+<a name="l00227"></a>00227             <span class="keyword">const</span> size_type intsNeeded = ( bytesNeeded + <span class="keyword">sizeof</span>(int) - 1 ) / <span class="keyword">sizeof</span>( int ); 
+<a name="l00228"></a>00228             rep_ = <span class="keyword">reinterpret_cast<</span>Rep*<span class="keyword">></span>( <span class="keyword">new</span> <span class="keywordtype">int</span>[ intsNeeded ] );
+<a name="l00229"></a>00229 
+<a name="l00230"></a>00230             rep_->str[ rep_->size = sz ] = <span class="charliteral">'\0'</span>;
+<a name="l00231"></a>00231             rep_->capacity = cap;
+<a name="l00232"></a>00232         }
+<a name="l00233"></a>00233         <span class="keywordflow">else</span>
+<a name="l00234"></a>00234         {
+<a name="l00235"></a>00235             rep_ = &nullrep_;
+<a name="l00236"></a>00236         }
+<a name="l00237"></a>00237     }
+<a name="l00238"></a>00238 
+<a name="l00239"></a>00239     <span class="keywordtype">void</span> quit()
+<a name="l00240"></a>00240     {
+<a name="l00241"></a>00241         <span class="keywordflow">if</span> (rep_ != &nullrep_)
+<a name="l00242"></a>00242         {
+<a name="l00243"></a>00243             <span class="comment">// The rep_ is really an array of ints. (see the allocator, above).</span>
+<a name="l00244"></a>00244             <span class="comment">// Cast it back before delete, so the compiler won't incorrectly call destructors.</span>
+<a name="l00245"></a>00245             <span class="keyword">delete</span> [] ( <span class="keyword">reinterpret_cast<</span><span class="keywordtype">int</span>*<span class="keyword">></span>( rep_ ) );
+<a name="l00246"></a>00246         }
+<a name="l00247"></a>00247     }
+<a name="l00248"></a>00248 
+<a name="l00249"></a>00249     Rep * rep_;
+<a name="l00250"></a>00250     <span class="keyword">static</span> Rep nullrep_;
+<a name="l00251"></a>00251 
+<a name="l00252"></a>00252 } ;
+<a name="l00253"></a>00253 
+<a name="l00254"></a>00254 
+<a name="l00255"></a>00255 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator == (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b)
+<a name="l00256"></a>00256 {
+<a name="l00257"></a>00257     <span class="keywordflow">return</span>    ( a.length() == b.length() )              <span class="comment">// optimization on some platforms</span>
+<a name="l00258"></a>00258            && ( strcmp(a.c_str(), b.c_str()) == 0 );    <span class="comment">// actual compare</span>
+<a name="l00259"></a>00259 }
+<a name="l00260"></a>00260 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator < (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b)
+<a name="l00261"></a>00261 {
+<a name="l00262"></a>00262     <span class="keywordflow">return</span> strcmp(a.c_str(), b.c_str()) < 0;
+<a name="l00263"></a>00263 }
+<a name="l00264"></a>00264 
+<a name="l00265"></a>00265 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator != (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> !(a == b); }
+<a name="l00266"></a>00266 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator >  (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> b < a; }
+<a name="l00267"></a>00267 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator <= (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> !(b < a); }
+<a name="l00268"></a>00268 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator >= (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> !(a < b); }
+<a name="l00269"></a>00269 
+<a name="l00270"></a>00270 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator == (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> <span class="keywordtype">char</span>* b) { <span class="keywordflow">return</span> strcmp(a.c_str(), b) == 0; }
+<a name="l00271"></a>00271 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator == (<span class="keyword">const</span> <span class="keywordtype">char</span>* a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> b == a; }
+<a name="l00272"></a>00272 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator != (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> <span class="keywordtype">char</span>* b) { <span class="keywordflow">return</span> !(a == b); }
+<a name="l00273"></a>00273 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator != (<span class="keyword">const</span> <span class="keywordtype">char</span>* a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> !(b == a); }
+<a name="l00274"></a>00274 
+<a name="l00275"></a>00275 TiXmlString operator + (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b);
+<a name="l00276"></a>00276 TiXmlString operator + (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> <span class="keywordtype">char</span>* b);
+<a name="l00277"></a>00277 TiXmlString operator + (<span class="keyword">const</span> <span class="keywordtype">char</span>* a, <span class="keyword">const</span> TiXmlString & b);
+<a name="l00278"></a>00278 
+<a name="l00279"></a>00279 
+<a name="l00280"></a>00280 <span class="comment">/*</span>
+<a name="l00281"></a>00281 <span class="comment">   TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString.</span>
+<a name="l00282"></a>00282 <span class="comment">   Only the operators that we need for TinyXML have been developped.</span>
+<a name="l00283"></a>00283 <span class="comment">*/</span>
+<a name="l00284"></a>00284 <span class="keyword">class </span>TiXmlOutStream : <span class="keyword">public</span> TiXmlString
+<a name="l00285"></a>00285 {
+<a name="l00286"></a>00286 <span class="keyword">public</span> :
+<a name="l00287"></a>00287 
+<a name="l00288"></a>00288     <span class="comment">// TiXmlOutStream << operator.</span>
+<a name="l00289"></a>00289     TiXmlOutStream & operator << (<span class="keyword">const</span> TiXmlString & in)
+<a name="l00290"></a>00290     {
+<a name="l00291"></a>00291         *<span class="keyword">this</span> += in;
+<a name="l00292"></a>00292         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
+<a name="l00293"></a>00293     }
+<a name="l00294"></a>00294 
+<a name="l00295"></a>00295     <span class="comment">// TiXmlOutStream << operator.</span>
+<a name="l00296"></a>00296     TiXmlOutStream & operator << (<span class="keyword">const</span> <span class="keywordtype">char</span> * in)
+<a name="l00297"></a>00297     {
+<a name="l00298"></a>00298         *<span class="keyword">this</span> += in;
+<a name="l00299"></a>00299         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
+<a name="l00300"></a>00300     }
+<a name="l00301"></a>00301 
+<a name="l00302"></a>00302 } ;
+<a name="l00303"></a>00303 
+<a name="l00304"></a>00304 <span class="preprocessor">#endif  // TIXML_STRING_INCLUDED</span>
+<a name="l00305"></a>00305 <span class="preprocessor"></span><span class="preprocessor">#endif  // TIXML_USE_STL</span>
+</pre></div></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/tinyxml_8h_source.html b/Source/External/TinyXml/docs/tinyxml_8h_source.html
new file mode 100644
index 0000000..05df047
--- /dev/null
+++ b/Source/External/TinyXml/docs/tinyxml_8h_source.html
@@ -0,0 +1,1206 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: tinyxml.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="pages.html"><span>Related Pages</span></a></li>
+      <li><a href="annotated.html"><span>Classes</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="tabs">
+    <ul>
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<h1>tinyxml.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
+<a name="l00002"></a>00002 <span class="comment">www.sourceforge.net/projects/tinyxml</span>
+<a name="l00003"></a>00003 <span class="comment">Original code by Lee Thomason (www.grinninglizard.com)</span>
+<a name="l00004"></a>00004 <span class="comment"></span>
+<a name="l00005"></a>00005 <span class="comment">This software is provided 'as-is', without any express or implied</span>
+<a name="l00006"></a>00006 <span class="comment">warranty. In no event will the authors be held liable for any</span>
+<a name="l00007"></a>00007 <span class="comment">damages arising from the use of this software.</span>
+<a name="l00008"></a>00008 <span class="comment"></span>
+<a name="l00009"></a>00009 <span class="comment">Permission is granted to anyone to use this software for any</span>
+<a name="l00010"></a>00010 <span class="comment">purpose, including commercial applications, and to alter it and</span>
+<a name="l00011"></a>00011 <span class="comment">redistribute it freely, subject to the following restrictions:</span>
+<a name="l00012"></a>00012 <span class="comment"></span>
+<a name="l00013"></a>00013 <span class="comment">1. The origin of this software must not be misrepresented; you must</span>
+<a name="l00014"></a>00014 <span class="comment">not claim that you wrote the original software. If you use this</span>
+<a name="l00015"></a>00015 <span class="comment">software in a product, an acknowledgment in the product documentation</span>
+<a name="l00016"></a>00016 <span class="comment">would be appreciated but is not required.</span>
+<a name="l00017"></a>00017 <span class="comment"></span>
+<a name="l00018"></a>00018 <span class="comment">2. Altered source versions must be plainly marked as such, and</span>
+<a name="l00019"></a>00019 <span class="comment">must not be misrepresented as being the original software.</span>
+<a name="l00020"></a>00020 <span class="comment"></span>
+<a name="l00021"></a>00021 <span class="comment">3. This notice may not be removed or altered from any source</span>
+<a name="l00022"></a>00022 <span class="comment">distribution.</span>
+<a name="l00023"></a>00023 <span class="comment">*/</span>
+<a name="l00024"></a>00024 
+<a name="l00025"></a>00025 
+<a name="l00026"></a>00026 <span class="preprocessor">#ifndef TINYXML_INCLUDED</span>
+<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define TINYXML_INCLUDED</span>
+<a name="l00028"></a>00028 <span class="preprocessor"></span>
+<a name="l00029"></a>00029 <span class="preprocessor">#ifdef _MSC_VER</span>
+<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( push )</span>
+<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4530 )</span>
+<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4786 )</span>
+<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+<a name="l00034"></a>00034 <span class="preprocessor"></span>
+<a name="l00035"></a>00035 <span class="preprocessor">#include <ctype.h></span>
+<a name="l00036"></a>00036 <span class="preprocessor">#include <stdio.h></span>
+<a name="l00037"></a>00037 <span class="preprocessor">#include <stdlib.h></span>
+<a name="l00038"></a>00038 <span class="preprocessor">#include <string.h></span>
+<a name="l00039"></a>00039 <span class="preprocessor">#include <assert.h></span>
+<a name="l00040"></a>00040 
+<a name="l00041"></a>00041 <span class="comment">// Help out windows:</span>
+<a name="l00042"></a>00042 <span class="preprocessor">#if defined( _DEBUG ) && !defined( DEBUG )</span>
+<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define DEBUG</span>
+<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+<a name="l00045"></a>00045 <span class="preprocessor"></span>
+<a name="l00046"></a>00046 <span class="preprocessor">#ifdef TIXML_USE_STL</span>
+<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">    #include <string></span>
+<a name="l00048"></a>00048 <span class="preprocessor">    #include <iostream></span>
+<a name="l00049"></a>00049 <span class="preprocessor">    #include <sstream></span>
+<a name="l00050"></a>00050 <span class="preprocessor">    #define TIXML_STRING        std::string</span>
+<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#else</span>
+<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">    #include "tinystr.h"</span>
+<a name="l00053"></a>00053 <span class="preprocessor">    #define TIXML_STRING        TiXmlString</span>
+<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+<a name="l00055"></a>00055 <span class="preprocessor"></span>
+<a name="l00056"></a>00056 <span class="comment">// Deprecated library function hell. Compilers want to use the</span>
+<a name="l00057"></a>00057 <span class="comment">// new safe versions. This probably doesn't fully address the problem,</span>
+<a name="l00058"></a>00058 <span class="comment">// but it gets closer. There are too many compilers for me to fully</span>
+<a name="l00059"></a>00059 <span class="comment">// test. If you get compilation troubles, undefine TIXML_SAFE</span>
+<a name="l00060"></a>00060 <span class="preprocessor">#define TIXML_SAFE</span>
+<a name="l00061"></a>00061 <span class="preprocessor"></span>
+<a name="l00062"></a>00062 <span class="preprocessor">#ifdef TIXML_SAFE</span>
+<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">    #if defined(_MSC_VER) && (_MSC_VER >= 1400 )</span>
+<a name="l00064"></a>00064 <span class="preprocessor"></span>        <span class="comment">// Microsoft visual studio, version 2005 and higher.</span>
+<a name="l00065"></a>00065 <span class="preprocessor">        #define TIXML_SNPRINTF _snprintf_s</span>
+<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">        #define TIXML_SSCANF   sscanf_s</span>
+<a name="l00067"></a>00067 <span class="preprocessor"></span><span class="preprocessor">    #elif defined(_MSC_VER) && (_MSC_VER >= 1200 )</span>
+<a name="l00068"></a>00068 <span class="preprocessor"></span>        <span class="comment">// Microsoft visual studio, version 6 and higher.</span>
+<a name="l00069"></a>00069         <span class="comment">//#pragma message( "Using _sn* functions." )</span>
+<a name="l00070"></a>00070 <span class="preprocessor">        #define TIXML_SNPRINTF _snprintf</span>
+<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">        #define TIXML_SSCANF   sscanf</span>
+<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">    #elif defined(__GNUC__) && (__GNUC__ >= 3 )</span>
+<a name="l00073"></a>00073 <span class="preprocessor"></span>        <span class="comment">// GCC version 3 and higher.s</span>
+<a name="l00074"></a>00074         <span class="comment">//#warning( "Using sn* functions." )</span>
+<a name="l00075"></a>00075 <span class="preprocessor">        #define TIXML_SNPRINTF snprintf</span>
+<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">        #define TIXML_SSCANF   sscanf</span>
+<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">    #else</span>
+<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">        #define TIXML_SNPRINTF snprintf</span>
+<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">        #define TIXML_SSCANF   sscanf</span>
+<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">    #endif</span>
+<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">#endif  </span>
+<a name="l00082"></a>00082 <span class="preprocessor"></span>
+<a name="l00083"></a>00083 <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>;
+<a name="l00084"></a>00084 <span class="keyword">class </span><a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>;
+<a name="l00085"></a>00085 <span class="keyword">class </span><a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>;
+<a name="l00086"></a>00086 <span class="keyword">class </span><a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>;
+<a name="l00087"></a>00087 <span class="keyword">class </span><a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>;
+<a name="l00088"></a>00088 <span class="keyword">class </span><a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>;
+<a name="l00089"></a>00089 <span class="keyword">class </span><a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>;
+<a name="l00090"></a>00090 <span class="keyword">class </span>TiXmlParsingData;
+<a name="l00091"></a>00091 
+<a name="l00092"></a>00092 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_MAJOR_VERSION = 2;
+<a name="l00093"></a>00093 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_MINOR_VERSION = 6;
+<a name="l00094"></a>00094 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_PATCH_VERSION = 2;
+<a name="l00095"></a>00095 
+<a name="l00096"></a>00096 <span class="comment">/*  Internal structure for tracking location of items </span>
+<a name="l00097"></a>00097 <span class="comment">    in the XML file.</span>
+<a name="l00098"></a>00098 <span class="comment">*/</span>
+<a name="l00099"></a>00099 <span class="keyword">struct </span>TiXmlCursor
+<a name="l00100"></a>00100 {
+<a name="l00101"></a>00101     TiXmlCursor()       { Clear(); }
+<a name="l00102"></a>00102     <span class="keywordtype">void</span> Clear()        { row = col = -1; }
+<a name="l00103"></a>00103 
+<a name="l00104"></a>00104     <span class="keywordtype">int</span> row;    <span class="comment">// 0 based.</span>
+<a name="l00105"></a>00105     <span class="keywordtype">int</span> col;    <span class="comment">// 0 based.</span>
+<a name="l00106"></a>00106 };
+<a name="l00107"></a>00107 
+<a name="l00108"></a>00108 
+<a name="l00128"></a><a class="code" href="classTiXmlVisitor.html">00128</a> <span class="keyword">class </span><a class="code" href="classTiXmlVisitor.html" title="Implements the interface to the &quot;Visitor pattern&quot; (see the Accept() method...">TiXmlVisitor</a>
+<a name="l00129"></a>00129 {
+<a name="l00130"></a>00130 <span class="keyword">public</span>:
+<a name="l00131"></a>00131     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlVisitor.html" title="Implements the interface to the &quot;Visitor pattern&quot; (see the Accept() method...">TiXmlVisitor</a>() {}
+<a name="l00132"></a>00132 
+<a name="l00134"></a><a class="code" href="classTiXmlVisitor.html#a07baecb52dd7d8716ae2a48ad0956ee0">00134</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#a07baecb52dd7d8716ae2a48ad0956ee0" title="Visit a document.">VisitEnter</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>& <span class="comment">/*doc*/</span> )         { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
+<a name="l00136"></a><a class="code" href="classTiXmlVisitor.html#aa0ade4f27087447e93974e975c3246ad">00136</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#aa0ade4f27087447e93974e975c3246ad" title="Visit a document.">VisitExit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>& <span class="comment">/*doc*/</span> )          { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
+<a name="l00137"></a>00137 
+<a name="l00139"></a><a class="code" href="classTiXmlVisitor.html#af6c6178ffa517bbdba95d70490875fff">00139</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#af6c6178ffa517bbdba95d70490875fff" title="Visit an element.">VisitEnter</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>& <span class="comment">/*element*/</span>, <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <span class="comment">/*firstAttribute*/</span> )    { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
+<a name="l00141"></a><a class="code" href="classTiXmlVisitor.html#aec2b1f8116226d52f3a1b95dafd3a32c">00141</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#aec2b1f8116226d52f3a1b95dafd3a32c" title="Visit an element.">VisitExit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>& <span class="comment">/*element*/</span> )       { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
+<a name="l00142"></a>00142 
+<a name="l00144"></a><a class="code" href="classTiXmlVisitor.html#afad71c71ce6473fb9b4b64cd92de4a19">00144</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#afad71c71ce6473fb9b4b64cd92de4a19" title="Visit a declaration.">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>& <span class="comment">/*declaration*/</span> )   { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
+<a name="l00146"></a><a class="code" href="classTiXmlVisitor.html#a399b8ebca5cd14664974a32d2ce029e5">00146</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#a399b8ebca5cd14664974a32d2ce029e5" title="Visit a text node.">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>& <span class="comment">/*text*/</span> )                 { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
+<a name="l00148"></a><a class="code" href="classTiXmlVisitor.html#a53a60e7a528627b31af3161972cc7fa2">00148</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#a53a60e7a528627b31af3161972cc7fa2" title="Visit a comment node.">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>& <span class="comment">/*comment*/</span> )           { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
+<a name="l00150"></a><a class="code" href="classTiXmlVisitor.html#a7e284d607d275c51dac1adb58159ce28">00150</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#a7e284d607d275c51dac1adb58159ce28" title="Visit an unknown node.">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>& <span class="comment">/*unknown*/</span> )           { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
+<a name="l00151"></a>00151 };
+<a name="l00152"></a>00152 
+<a name="l00153"></a>00153 <span class="comment">// Only used by Attribute::Query functions</span>
+<a name="l00154"></a>00154 <span class="keyword">enum</span> 
+<a name="l00155"></a>00155 { 
+<a name="l00156"></a>00156     TIXML_SUCCESS,
+<a name="l00157"></a>00157     TIXML_NO_ATTRIBUTE,
+<a name="l00158"></a>00158     TIXML_WRONG_TYPE
+<a name="l00159"></a>00159 };
+<a name="l00160"></a>00160 
+<a name="l00161"></a>00161 
+<a name="l00162"></a>00162 <span class="comment">// Used by the parsing routines.</span>
+<a name="l00163"></a>00163 <span class="keyword">enum</span> TiXmlEncoding
+<a name="l00164"></a>00164 {
+<a name="l00165"></a>00165     TIXML_ENCODING_UNKNOWN,
+<a name="l00166"></a>00166     TIXML_ENCODING_UTF8,
+<a name="l00167"></a>00167     TIXML_ENCODING_LEGACY
+<a name="l00168"></a>00168 };
+<a name="l00169"></a>00169 
+<a name="l00170"></a>00170 <span class="keyword">const</span> TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN;
+<a name="l00171"></a>00171 
+<a name="l00194"></a><a class="code" href="classTiXmlBase.html">00194</a> <span class="keyword">class </span><a class="code" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a>
+<a name="l00195"></a>00195 {
+<a name="l00196"></a>00196     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>;
+<a name="l00197"></a>00197     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>;
+<a name="l00198"></a>00198     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>;
+<a name="l00199"></a>00199 
+<a name="l00200"></a>00200 <span class="keyword">public</span>:
+<a name="l00201"></a>00201     <a class="code" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a>() :   <a class="code" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c" title="Field containing a generic user pointer.">userData</a>(0)     {}
+<a name="l00202"></a>00202     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a>()            {}
+<a name="l00203"></a>00203 
+<a name="l00213"></a>00213     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512" title="All TinyXml classes can print themselves to a filestream or the string class (TiXmlString...">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span> = 0;
+<a name="l00214"></a>00214 
+<a name="l00221"></a><a class="code" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1">00221</a>     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlBase.html#a0f799ec645bfb8d8a969e83478f379c1" title="The world does not agree on whether white space should be kept or not.">SetCondenseWhiteSpace</a>( <span class="keywordtype">bool</span> condense )      { condenseWhiteSpace = condense; }
+<a name="l00222"></a>00222 
+<a name="l00224"></a><a class="code" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438">00224</a>     <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlBase.html#ad4b1472531c647a25b1840a87ae42438" title="Return the current white space setting.">IsWhiteSpaceCondensed</a>()                     { <span class="keywordflow">return</span> condenseWhiteSpace; }
+<a name="l00225"></a>00225 
+<a name="l00244"></a><a class="code" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853">00244</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlBase.html#a024bceb070188df92c2a8d8852dd0853" title="Return the position, in the original source file, of this node or attribute.">Row</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> location.row + 1; }
+<a name="l00245"></a><a class="code" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003">00245</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlBase.html#ab54bfb9b70fe6dd276e7b279cab7f003" title="See Row().">Column</a>()<span class="keyword"> const      </span>{ <span class="keywordflow">return</span> location.col + 1; }    
+<a name="l00246"></a>00246 
+<a name="l00247"></a><a class="code" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d">00247</a>     <span class="keywordtype">void</span>  <a class="code" href="classTiXmlBase.html#ac6b3e0f790930d4970ec30764e937b5d" title="Set a pointer to arbitrary user data.">SetUserData</a>( <span class="keywordtype">void</span>* user )         { <a class="code" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c" title="Field containing a generic user pointer.">userData</a> = user; }    
+<a name="l00248"></a><a class="code" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17">00248</a>     <span class="keywordtype">void</span>* <a class="code" href="classTiXmlBase.html#a6559a530ca6763fc301a14d77ed28c17" title="Get a pointer to arbitrary user data.">GetUserData</a>()                     { <span class="keywordflow">return</span> <a class="code" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c" title="Field containing a generic user pointer.">userData</a>; }    
+<a name="l00249"></a><a class="code" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4">00249</a>     <span class="keyword">const</span> <span class="keywordtype">void</span>* <a class="code" href="classTiXmlBase.html#ad0120210e4680ef2088601753ce0ede4" title="Get a pointer to arbitrary user data.">GetUserData</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c" title="Field containing a generic user pointer.">userData</a>; }    
+<a name="l00250"></a>00250 
+<a name="l00251"></a>00251     <span class="comment">// Table that returs, for a given lead byte, the total number of bytes</span>
+<a name="l00252"></a>00252     <span class="comment">// in the UTF-8 sequence.</span>
+<a name="l00253"></a>00253     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> utf8ByteTable[256];
+<a name="l00254"></a>00254 
+<a name="l00255"></a>00255     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlDocument.html#a17ebabe36926ef398e78dec0d0ad0378" title="Parse the given null terminated block of xml data.">Parse</a>(  <span class="keyword">const</span> <span class="keywordtype">char</span>* p, 
+<a name="l00256"></a>00256                                 TiXmlParsingData* data, 
+<a name="l00257"></a>00257                                 TiXmlEncoding encoding <span class="comment">/*= TIXML_ENCODING_UNKNOWN */</span> ) = 0;
+<a name="l00258"></a>00258 
+<a name="l00262"></a>00262     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlBase.html#a6bd8c315c1acb09e34107b8736505948" title="Expands entities in a string.">EncodeString</a>( <span class="keyword">const</span> TIXML_STRING& str, TIXML_STRING* out );
+<a name="l00263"></a>00263 
+<a name="l00264"></a>00264     <span class="keyword">enum</span>
+<a name="l00265"></a>00265     {
+<a name="l00266"></a>00266         TIXML_NO_ERROR = 0,
+<a name="l00267"></a>00267         TIXML_ERROR,
+<a name="l00268"></a>00268         TIXML_ERROR_OPENING_FILE,
+<a name="l00269"></a>00269         TIXML_ERROR_PARSING_ELEMENT,
+<a name="l00270"></a>00270         TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME,
+<a name="l00271"></a>00271         TIXML_ERROR_READING_ELEMENT_VALUE,
+<a name="l00272"></a>00272         TIXML_ERROR_READING_ATTRIBUTES,
+<a name="l00273"></a>00273         TIXML_ERROR_PARSING_EMPTY,
+<a name="l00274"></a>00274         TIXML_ERROR_READING_END_TAG,
+<a name="l00275"></a>00275         TIXML_ERROR_PARSING_UNKNOWN,
+<a name="l00276"></a>00276         TIXML_ERROR_PARSING_COMMENT,
+<a name="l00277"></a>00277         TIXML_ERROR_PARSING_DECLARATION,
+<a name="l00278"></a>00278         TIXML_ERROR_DOCUMENT_EMPTY,
+<a name="l00279"></a>00279         TIXML_ERROR_EMBEDDED_NULL,
+<a name="l00280"></a>00280         TIXML_ERROR_PARSING_CDATA,
+<a name="l00281"></a>00281         TIXML_ERROR_DOCUMENT_TOP_ONLY,
+<a name="l00282"></a>00282 
+<a name="l00283"></a>00283         TIXML_ERROR_STRING_COUNT
+<a name="l00284"></a>00284     };
+<a name="l00285"></a>00285 
+<a name="l00286"></a>00286 <span class="keyword">protected</span>:
+<a name="l00287"></a>00287 
+<a name="l00288"></a>00288     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* SkipWhiteSpace( <span class="keyword">const</span> <span class="keywordtype">char</span>*, TiXmlEncoding encoding );
+<a name="l00289"></a>00289 
+<a name="l00290"></a>00290     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> IsWhiteSpace( <span class="keywordtype">char</span> c )       
+<a name="l00291"></a>00291     { 
+<a name="l00292"></a>00292         <span class="keywordflow">return</span> ( isspace( (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>) c ) || c == <span class="charliteral">'\n'</span> || c == <span class="charliteral">'\r'</span> ); 
+<a name="l00293"></a>00293     }
+<a name="l00294"></a>00294     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> IsWhiteSpace( <span class="keywordtype">int</span> c )
+<a name="l00295"></a>00295     {
+<a name="l00296"></a>00296         <span class="keywordflow">if</span> ( c < 256 )
+<a name="l00297"></a>00297             <span class="keywordflow">return</span> IsWhiteSpace( (<span class="keywordtype">char</span>) c );
+<a name="l00298"></a>00298         <span class="keywordflow">return</span> <span class="keyword">false</span>;   <span class="comment">// Again, only truly correct for English/Latin...but usually works.</span>
+<a name="l00299"></a>00299     }
+<a name="l00300"></a>00300 
+<a name="l00301"></a>00301 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00302"></a>00302 <span class="preprocessor"></span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> StreamWhiteSpace( std::istream * in, TIXML_STRING * tag );
+<a name="l00303"></a>00303     <span class="keyword">static</span> <span class="keywordtype">bool</span> StreamTo( std::istream * in, <span class="keywordtype">int</span> character, TIXML_STRING * tag );
+<a name="l00304"></a>00304 <span class="preprocessor">    #endif</span>
+<a name="l00305"></a>00305 <span class="preprocessor"></span>
+<a name="l00306"></a>00306     <span class="comment">/*  Reads an XML name into the string provided. Returns</span>
+<a name="l00307"></a>00307 <span class="comment">        a pointer just past the last character of the name,</span>
+<a name="l00308"></a>00308 <span class="comment">        or 0 if the function has an error.</span>
+<a name="l00309"></a>00309 <span class="comment">    */</span>
+<a name="l00310"></a>00310     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* ReadName( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TIXML_STRING* name, TiXmlEncoding encoding );
+<a name="l00311"></a>00311 
+<a name="l00312"></a>00312     <span class="comment">/*  Reads text. Returns a pointer past the given end tag.</span>
+<a name="l00313"></a>00313 <span class="comment">        Wickedly complex options, but it keeps the (sensitive) code in one place.</span>
+<a name="l00314"></a>00314 <span class="comment">    */</span>
+<a name="l00315"></a>00315     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* ReadText(    <span class="keyword">const</span> <span class="keywordtype">char</span>* in,             <span class="comment">// where to start</span>
+<a name="l00316"></a>00316                                     TIXML_STRING* text,         <span class="comment">// the string read</span>
+<a name="l00317"></a>00317                                     <span class="keywordtype">bool</span> ignoreWhiteSpace,      <span class="comment">// whether to keep the white space</span>
+<a name="l00318"></a>00318                                     <span class="keyword">const</span> <span class="keywordtype">char</span>* endTag,         <span class="comment">// what ends this text</span>
+<a name="l00319"></a>00319                                     <span class="keywordtype">bool</span> ignoreCase,            <span class="comment">// whether to ignore case in the end tag</span>
+<a name="l00320"></a>00320                                     TiXmlEncoding encoding );   <span class="comment">// the current encoding</span>
+<a name="l00321"></a>00321 
+<a name="l00322"></a>00322     <span class="comment">// If an entity has been found, transform it into a character.</span>
+<a name="l00323"></a>00323     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GetEntity( <span class="keyword">const</span> <span class="keywordtype">char</span>* in, <span class="keywordtype">char</span>* value, <span class="keywordtype">int</span>* length, TiXmlEncoding encoding );
+<a name="l00324"></a>00324 
+<a name="l00325"></a>00325     <span class="comment">// Get a character, while interpreting entities.</span>
+<a name="l00326"></a>00326     <span class="comment">// The length can be from 0 to 4 bytes.</span>
+<a name="l00327"></a>00327     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GetChar( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, <span class="keywordtype">char</span>* _value, <span class="keywordtype">int</span>* length, TiXmlEncoding encoding )
+<a name="l00328"></a>00328     {
+<a name="l00329"></a>00329         assert( p );
+<a name="l00330"></a>00330         <span class="keywordflow">if</span> ( encoding == TIXML_ENCODING_UTF8 )
+<a name="l00331"></a>00331         {
+<a name="l00332"></a>00332             *length = utf8ByteTable[ *((<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)p) ];
+<a name="l00333"></a>00333             assert( *length >= 0 && *length < 5 );
+<a name="l00334"></a>00334         }
+<a name="l00335"></a>00335         <span class="keywordflow">else</span>
+<a name="l00336"></a>00336         {
+<a name="l00337"></a>00337             *length = 1;
+<a name="l00338"></a>00338         }
+<a name="l00339"></a>00339 
+<a name="l00340"></a>00340         <span class="keywordflow">if</span> ( *length == 1 )
+<a name="l00341"></a>00341         {
+<a name="l00342"></a>00342             <span class="keywordflow">if</span> ( *p == <span class="charliteral">'&'</span> )
+<a name="l00343"></a>00343                 <span class="keywordflow">return</span> GetEntity( p, _value, length, encoding );
+<a name="l00344"></a>00344             *_value = *p;
+<a name="l00345"></a>00345             <span class="keywordflow">return</span> p+1;
+<a name="l00346"></a>00346         }
+<a name="l00347"></a>00347         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( *length )
+<a name="l00348"></a>00348         {
+<a name="l00349"></a>00349             <span class="comment">//strncpy( _value, p, *length );    // lots of compilers don't like this function (unsafe),</span>
+<a name="l00350"></a>00350                                                 <span class="comment">// and the null terminator isn't needed</span>
+<a name="l00351"></a>00351             <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; p[i] && i<*length; ++i ) {
+<a name="l00352"></a>00352                 _value[i] = p[i];
+<a name="l00353"></a>00353             }
+<a name="l00354"></a>00354             <span class="keywordflow">return</span> p + (*length);
+<a name="l00355"></a>00355         }
+<a name="l00356"></a>00356         <span class="keywordflow">else</span>
+<a name="l00357"></a>00357         {
+<a name="l00358"></a>00358             <span class="comment">// Not valid text.</span>
+<a name="l00359"></a>00359             <span class="keywordflow">return</span> 0;
+<a name="l00360"></a>00360         }
+<a name="l00361"></a>00361     }
+<a name="l00362"></a>00362 
+<a name="l00363"></a>00363     <span class="comment">// Return true if the next characters in the stream are any of the endTag sequences.</span>
+<a name="l00364"></a>00364     <span class="comment">// Ignore case only works for english, and should only be relied on when comparing</span>
+<a name="l00365"></a>00365     <span class="comment">// to English words: StringEqual( p, "version", true ) is fine.</span>
+<a name="l00366"></a>00366     <span class="keyword">static</span> <span class="keywordtype">bool</span> StringEqual(    <span class="keyword">const</span> <span class="keywordtype">char</span>* p,
+<a name="l00367"></a>00367                                 <span class="keyword">const</span> <span class="keywordtype">char</span>* endTag,
+<a name="l00368"></a>00368                                 <span class="keywordtype">bool</span> ignoreCase,
+<a name="l00369"></a>00369                                 TiXmlEncoding encoding );
+<a name="l00370"></a>00370 
+<a name="l00371"></a>00371     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* errorString[ TIXML_ERROR_STRING_COUNT ];
+<a name="l00372"></a>00372 
+<a name="l00373"></a>00373     TiXmlCursor location;
+<a name="l00374"></a>00374 
+<a name="l00376"></a><a class="code" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c">00376</a>     <span class="keywordtype">void</span>*           <a class="code" href="classTiXmlBase.html#ab242c01590191f644569fa89a080d97c" title="Field containing a generic user pointer.">userData</a>;
+<a name="l00377"></a>00377     
+<a name="l00378"></a>00378     <span class="comment">// None of these methods are reliable for any language except English.</span>
+<a name="l00379"></a>00379     <span class="comment">// Good for approximation, not great for accuracy.</span>
+<a name="l00380"></a>00380     <span class="keyword">static</span> <span class="keywordtype">int</span> IsAlpha( <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> anyByte, TiXmlEncoding encoding );
+<a name="l00381"></a>00381     <span class="keyword">static</span> <span class="keywordtype">int</span> IsAlphaNum( <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> anyByte, TiXmlEncoding encoding );
+<a name="l00382"></a>00382     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">int</span> ToLower( <span class="keywordtype">int</span> v, TiXmlEncoding encoding )
+<a name="l00383"></a>00383     {
+<a name="l00384"></a>00384         <span class="keywordflow">if</span> ( encoding == TIXML_ENCODING_UTF8 )
+<a name="l00385"></a>00385         {
+<a name="l00386"></a>00386             <span class="keywordflow">if</span> ( v < 128 ) <span class="keywordflow">return</span> tolower( v );
+<a name="l00387"></a>00387             <span class="keywordflow">return</span> v;
+<a name="l00388"></a>00388         }
+<a name="l00389"></a>00389         <span class="keywordflow">else</span>
+<a name="l00390"></a>00390         {
+<a name="l00391"></a>00391             <span class="keywordflow">return</span> tolower( v );
+<a name="l00392"></a>00392         }
+<a name="l00393"></a>00393     }
+<a name="l00394"></a>00394     <span class="keyword">static</span> <span class="keywordtype">void</span> ConvertUTF32ToUTF8( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> input, <span class="keywordtype">char</span>* output, <span class="keywordtype">int</span>* length );
+<a name="l00395"></a>00395 
+<a name="l00396"></a>00396 <span class="keyword">private</span>:
+<a name="l00397"></a>00397     <a class="code" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a>& );              <span class="comment">// not implemented.</span>
+<a name="l00398"></a>00398     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a>& base );    <span class="comment">// not allowed.</span>
+<a name="l00399"></a>00399 
+<a name="l00400"></a>00400     <span class="keyword">struct </span>Entity
+<a name="l00401"></a>00401     {
+<a name="l00402"></a>00402         <span class="keyword">const</span> <span class="keywordtype">char</span>*     str;
+<a name="l00403"></a>00403         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    strLength;
+<a name="l00404"></a>00404         <span class="keywordtype">char</span>            chr;
+<a name="l00405"></a>00405     };
+<a name="l00406"></a>00406     <span class="keyword">enum</span>
+<a name="l00407"></a>00407     {
+<a name="l00408"></a>00408         NUM_ENTITY = 5,
+<a name="l00409"></a>00409         MAX_ENTITY_LENGTH = 6
+<a name="l00410"></a>00410 
+<a name="l00411"></a>00411     };
+<a name="l00412"></a>00412     <span class="keyword">static</span> Entity entity[ NUM_ENTITY ];
+<a name="l00413"></a>00413     <span class="keyword">static</span> <span class="keywordtype">bool</span> condenseWhiteSpace;
+<a name="l00414"></a>00414 };
+<a name="l00415"></a>00415 
+<a name="l00416"></a>00416 
+<a name="l00423"></a><a class="code" href="classTiXmlNode.html">00423</a> <span class="keyword">class </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a>
+<a name="l00424"></a>00424 {
+<a name="l00425"></a>00425     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>;
+<a name="l00426"></a>00426     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>;
+<a name="l00427"></a>00427 
+<a name="l00428"></a>00428 <span class="keyword">public</span>:
+<a name="l00429"></a>00429 <span class="preprocessor">    #ifdef TIXML_USE_STL    </span>
+<a name="l00430"></a>00430 <span class="preprocessor"></span>
+<a name="l00434"></a>00434         <span class="keyword">friend</span> std::istream& <a class="code" href="classTiXmlNode.html#ab57bd426563c926844f65a78412e18b9" title="An input stream operator, for every class.">operator >> </a>(std::istream& in, <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>& base);
+<a name="l00435"></a>00435 
+<a name="l00452"></a>00452         <span class="keyword">friend</span> std::ostream& <a class="code" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7" title="An output stream operator, for every class.">operator<< </a>(std::ostream& out, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>& base);
+<a name="l00453"></a>00453 
+<a name="l00455"></a>00455         <span class="keyword">friend</span> std::string& <a class="code" href="classTiXmlNode.html#a86cd49cfb17a844c0010b3136ac966c7" title="An output stream operator, for every class.">operator<< </a>(std::string& out, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>& base );
+<a name="l00456"></a>00456 
+<a name="l00457"></a>00457 <span class="preprocessor">    #endif</span>
+<a name="l00458"></a>00458 <span class="preprocessor"></span>
+<a name="l00462"></a><a class="code" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2">00462</a>     <span class="keyword">enum</span> <a class="code" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2" title="The types of XML nodes supported by TinyXml.">NodeType</a>
+<a name="l00463"></a>00463     {
+<a name="l00464"></a>00464         TINYXML_DOCUMENT,
+<a name="l00465"></a>00465         TINYXML_ELEMENT,
+<a name="l00466"></a>00466         TINYXML_COMMENT,
+<a name="l00467"></a>00467         TINYXML_UNKNOWN,
+<a name="l00468"></a>00468         TINYXML_TEXT,
+<a name="l00469"></a>00469         TINYXML_DECLARATION,
+<a name="l00470"></a>00470         TINYXML_TYPECOUNT
+<a name="l00471"></a>00471     };
+<a name="l00472"></a>00472 
+<a name="l00473"></a>00473     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>();
+<a name="l00474"></a>00474 
+<a name="l00487"></a><a class="code" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41">00487</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlNode.html#a77943eb90d12c2892b1337a9f5918b41" title="The meaning of &#39;value&#39; changes for the specific type of TiXmlNode.">Value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value.c_str (); }
+<a name="l00488"></a>00488 
+<a name="l00489"></a>00489 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00490"></a>00490 <span class="preprocessor"></span>
+<a name="l00494"></a><a class="code" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5">00494</a>     <span class="keyword">const</span> std::string& <a class="code" href="classTiXmlNode.html#a6d9e505619d39bf50bfd9609c9169ea5" title="Return Value() as a std::string.">ValueStr</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value; }
+<a name="l00495"></a>00495 <span class="preprocessor">    #endif</span>
+<a name="l00496"></a>00496 <span class="preprocessor"></span>
+<a name="l00497"></a>00497     <span class="keyword">const</span> TIXML_STRING& ValueTStr()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value; }
+<a name="l00498"></a>00498 
+<a name="l00508"></a><a class="code" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90">00508</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90" title="Changes the value of the node.">SetValue</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * _value) { value = _value;}
+<a name="l00509"></a>00509 
+<a name="l00510"></a>00510 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00512"></a><a class="code" href="classTiXmlNode.html#a2598d5f448042c1abbeae4503dd45ff2">00512</a> <span class="preprocessor">    void SetValue( const std::string& _value )  { value = _value; }</span>
+<a name="l00513"></a>00513 <span class="preprocessor"></span><span class="preprocessor">    #endif</span>
+<a name="l00514"></a>00514 <span class="preprocessor"></span>
+<a name="l00516"></a>00516     <span class="keywordtype">void</span> <a class="code" href="classTiXmlNode.html#a708e7f953df61d4d2d12f73171550a4b" title="Delete all the children of this node. Does not affect &#39;this&#39;.">Clear</a>();
+<a name="l00517"></a>00517 
+<a name="l00519"></a><a class="code" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e">00519</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e" title="One step up the DOM.">Parent</a>()                         { <span class="keywordflow">return</span> parent; }
+<a name="l00520"></a>00520     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#ab643043132ffd794f8602685d34a982e" title="One step up the DOM.">Parent</a>()<span class="keyword"> const             </span>{ <span class="keywordflow">return</span> parent; }
+<a name="l00521"></a>00521 
+<a name="l00522"></a><a class="code" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0">00522</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0" title="The first child of this node. Will be null if there are no children.">FirstChild</a>()<span class="keyword">   const       </span>{ <span class="keywordflow">return</span> firstChild; }  
+<a name="l00523"></a>00523     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0" title="The first child of this node. Will be null if there are no children.">FirstChild</a>()                     { <span class="keywordflow">return</span> firstChild; }
+<a name="l00524"></a>00524     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a44c8eee26bbe2d1b2762038df9dde2f0" title="The first child of this node. Will be null if there are no children.">FirstChild</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>;            
+<a name="l00525"></a>00525 
+<a name="l00526"></a><a class="code" href="classTiXmlNode.html#abc8bf32be6419ec453a731868de19554">00526</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#abc8bf32be6419ec453a731868de19554" title="The first child of this node with the matching &#39;value&#39;. Will be null if none...">FirstChild</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _value ) {
+<a name="l00527"></a>00527         <span class="comment">// Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe)</span>
+<a name="l00528"></a>00528         <span class="comment">// call the method, cast the return back to non-const.</span>
+<a name="l00529"></a>00529         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span> ((<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->FirstChild( _value ));
+<a name="l00530"></a>00530     }
+<a name="l00531"></a>00531     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* LastChild()<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> lastChild; }       
+<a name="l00532"></a><a class="code" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031">00532</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a6432d2b2495f6caf9cb4278df706a031" title="The last child of this node. Will be null if there are no children.">LastChild</a>()  { <span class="keywordflow">return</span> lastChild; }
+<a name="l00533"></a>00533     
+<a name="l00534"></a>00534     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* LastChild( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>;         
+<a name="l00535"></a><a class="code" href="classTiXmlNode.html#abad5bf1059c48127b958711ef89e8e5d">00535</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#abad5bf1059c48127b958711ef89e8e5d" title="The last child of this node matching &#39;value&#39;. Will be null if there are no...">LastChild</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _value ) {
+<a name="l00536"></a>00536         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span> ((<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->LastChild( _value ));
+<a name="l00537"></a>00537     }
+<a name="l00538"></a>00538 
+<a name="l00539"></a>00539 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00540"></a><a class="code" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6">00540</a> <span class="preprocessor"></span>    <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6" title="STL std::string form.">FirstChild</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const  </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a07f6200a5956c723c5b52d70f29c46f6" title="STL std::string form.">FirstChild</a> (_value.c_str ());    }   
+<a name="l00541"></a><a class="code" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6">00541</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6" title="STL std::string form.">FirstChild</a>( <span class="keyword">const</span> std::string& _value )              {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a10d2669ccb5e29e02fcb0e4408685ef6" title="STL std::string form.">FirstChild</a> (_value.c_str ());    }   
+<a name="l00542"></a><a class="code" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63">00542</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63" title="STL std::string form.">LastChild</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const   </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a256d0cdbfcfeccae83f3a1c9747a8b63" title="STL std::string form.">LastChild</a> (_value.c_str ()); }   
+<a name="l00543"></a><a class="code" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3">00543</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3" title="STL std::string form.">LastChild</a>( <span class="keyword">const</span> std::string& _value )               {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a69772c9202f70553f940b15c06b07be3" title="STL std::string form.">LastChild</a> (_value.c_str ()); }   
+<a name="l00544"></a>00544 <span class="preprocessor">    #endif</span>
+<a name="l00545"></a>00545 <span class="preprocessor"></span>
+<a name="l00562"></a>00562     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6" title="An alternate way to walk the children of a node.">IterateChildren</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* previous ) <span class="keyword">const</span>;
+<a name="l00563"></a>00563     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6" title="An alternate way to walk the children of a node.">IterateChildren</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* previous ) {
+<a name="l00564"></a>00564         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->IterateChildren( previous ) );
+<a name="l00565"></a>00565     }
+<a name="l00566"></a>00566 
+<a name="l00568"></a>00568     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6" title="An alternate way to walk the children of a node.">IterateChildren</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* previous ) <span class="keyword">const</span>;
+<a name="l00569"></a>00569     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a8621196ba3705fa226bef4a761cc51b6" title="An alternate way to walk the children of a node.">IterateChildren</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _value, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* previous ) {
+<a name="l00570"></a>00570         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->IterateChildren( _value, previous ) );
+<a name="l00571"></a>00571     }
+<a name="l00572"></a>00572 
+<a name="l00573"></a>00573 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00574"></a><a class="code" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df">00574</a> <span class="preprocessor"></span>    <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df" title="STL std::string form.">IterateChildren</a>( <span class="keyword">const</span> std::string& _value, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* previous )<span class="keyword"> const  </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a1cbaaf8e82c09ad763d52616d75724df" title="STL std::string form.">IterateChildren</a> (_value.c_str (), previous); }   
+<a name="l00575"></a><a class="code" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c">00575</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c" title="STL std::string form.">IterateChildren</a>( <span class="keyword">const</span> std::string& _value, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* previous ) {    <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a16e9ad53e2f5445b14bf325c90aa862c" title="STL std::string form.">IterateChildren</a> (_value.c_str (), previous); }   
+<a name="l00576"></a>00576 <span class="preprocessor">    #endif</span>
+<a name="l00577"></a>00577 <span class="preprocessor"></span>
+<a name="l00581"></a>00581     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#ad7d4630e1a2a916edda16be22448a8ba" title="Add a new node related to this.">InsertEndChild</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>& addThis );
+<a name="l00582"></a>00582 
+<a name="l00583"></a>00583 
+<a name="l00593"></a>00593     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a5d29442ae46de6d0168429156197bfc6" title="Add a new node related to this.">LinkEndChild</a>( <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* addThis );
+<a name="l00594"></a>00594 
+<a name="l00598"></a>00598     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a0c146fa2fff0157b681594102f48cbc7" title="Add a new node related to this.">InsertBeforeChild</a>( <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* beforeThis, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>& addThis );
+<a name="l00599"></a>00599 
+<a name="l00603"></a>00603     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#ad9b75e54ec19301c8b4d5ff583d0b3d5" title="Add a new node related to this.">InsertAfterChild</a>(  <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* afterThis, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>& addThis );
+<a name="l00604"></a>00604 
+<a name="l00608"></a>00608     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a0c49e739a17b9938050c22cd89617fbd" title="Replace a child of this node.">ReplaceChild</a>( <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* replaceThis, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>& withThis );
+<a name="l00609"></a>00609 
+<a name="l00611"></a>00611     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlNode.html#ae19d8510efc90596552f4feeac9a8fbf" title="Delete a child of this node.">RemoveChild</a>( <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* removeThis );
+<a name="l00612"></a>00612 
+<a name="l00614"></a><a class="code" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10">00614</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10" title="Navigate to a sibling node.">PreviousSibling</a>()<span class="keyword"> const            </span>{ <span class="keywordflow">return</span> prev; }
+<a name="l00615"></a>00615     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10" title="Navigate to a sibling node.">PreviousSibling</a>()                        { <span class="keywordflow">return</span> prev; }
+<a name="l00616"></a>00616 
+<a name="l00618"></a>00618     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10" title="Navigate to a sibling node.">PreviousSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * ) <span class="keyword">const</span>;
+<a name="l00619"></a>00619     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#ac2cd892768726270e511b2ab32de4d10" title="Navigate to a sibling node.">PreviousSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> *_prev ) {
+<a name="l00620"></a>00620         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->PreviousSibling( _prev ) );
+<a name="l00621"></a>00621     }
+<a name="l00622"></a>00622 
+<a name="l00623"></a>00623 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00624"></a><a class="code" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab">00624</a> <span class="preprocessor"></span>    <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab" title="STL std::string form.">PreviousSibling</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a658276f57d35d5d4256d1dc1a2c398ab" title="STL std::string form.">PreviousSibling</a> (_value.c_str ());   }   
+<a name="l00625"></a><a class="code" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912">00625</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912" title="STL std::string form.">PreviousSibling</a>( <span class="keyword">const</span> std::string& _value )             {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#acc8a0434c7f401d4a3b6dee77c1a5912" title="STL std::string form.">PreviousSibling</a> (_value.c_str ());   }   
+<a name="l00626"></a><a class="code" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9">00626</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9" title="STL std::string form.">NextSibling</a>( <span class="keyword">const</span> std::string& _value)<span class="keyword"> const      </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a1b94d2f7fa7ab25a5a8e8d4340c449c9" title="STL std::string form.">NextSibling</a> (_value.c_str ());   }   
+<a name="l00627"></a><a class="code" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea">00627</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea" title="STL std::string form.">NextSibling</a>( <span class="keyword">const</span> std::string& _value)                  {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a1757c1f4d01e8c9596ffdbd561c76aea" title="STL std::string form.">NextSibling</a> (_value.c_str ());   }   
+<a name="l00628"></a>00628 <span class="preprocessor">    #endif</span>
+<a name="l00629"></a>00629 <span class="preprocessor"></span>
+<a name="l00631"></a><a class="code" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e">00631</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e" title="Navigate to a sibling node.">NextSibling</a>()<span class="keyword"> const                </span>{ <span class="keywordflow">return</span> next; }
+<a name="l00632"></a>00632     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e" title="Navigate to a sibling node.">NextSibling</a>()                            { <span class="keywordflow">return</span> next; }
+<a name="l00633"></a>00633 
+<a name="l00635"></a>00635     <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e" title="Navigate to a sibling node.">NextSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * ) <span class="keyword">const</span>;
+<a name="l00636"></a>00636     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#af854baeba384f5fe9859f5aee03b548e" title="Navigate to a sibling node.">NextSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _next ) {
+<a name="l00637"></a>00637         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->NextSibling( _next ) );
+<a name="l00638"></a>00638     }
+<a name="l00639"></a>00639 
+<a name="l00644"></a>00644     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1" title="Convenience function to get through elements.">NextSiblingElement</a>() <span class="keyword">const</span>;
+<a name="l00645"></a>00645     <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1" title="Convenience function to get through elements.">NextSiblingElement</a>() {
+<a name="l00646"></a>00646         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->NextSiblingElement() );
+<a name="l00647"></a>00647     }
+<a name="l00648"></a>00648 
+<a name="l00653"></a>00653     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1" title="Convenience function to get through elements.">NextSiblingElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * ) <span class="keyword">const</span>;
+<a name="l00654"></a>00654     <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a73acf929d49d10bd0e5fb3d31b0372d1" title="Convenience function to get through elements.">NextSiblingElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> *_next ) {
+<a name="l00655"></a>00655         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->NextSiblingElement( _next ) );
+<a name="l00656"></a>00656     }
+<a name="l00657"></a>00657 
+<a name="l00658"></a>00658 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00659"></a><a class="code" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463">00659</a> <span class="preprocessor"></span>    <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463" title="STL std::string form.">NextSiblingElement</a>( <span class="keyword">const</span> std::string& _value)<span class="keyword"> const    </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a7572d0af9d1e696ee3f05d8bb5ebb463" title="STL std::string form.">NextSiblingElement</a> (_value.c_str ());    }   
+<a name="l00660"></a><a class="code" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081">00660</a>     <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081" title="STL std::string form.">NextSiblingElement</a>( <span class="keyword">const</span> std::string& _value)                {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a506958e34406729a4e4c5326ea39d081" title="STL std::string form.">NextSiblingElement</a> (_value.c_str ());    }   
+<a name="l00661"></a>00661 <span class="preprocessor">    #endif</span>
+<a name="l00662"></a>00662 <span class="preprocessor"></span>
+<a name="l00664"></a>00664     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba" title="Convenience function to get through elements.">FirstChildElement</a>() <span class="keyword">const</span>;
+<a name="l00665"></a>00665     <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba" title="Convenience function to get through elements.">FirstChildElement</a>() {
+<a name="l00666"></a>00666         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->FirstChildElement() );
+<a name="l00667"></a>00667     }
+<a name="l00668"></a>00668 
+<a name="l00670"></a>00670     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba" title="Convenience function to get through elements.">FirstChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _value ) <span class="keyword">const</span>;
+<a name="l00671"></a>00671     <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba" title="Convenience function to get through elements.">FirstChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _value ) {
+<a name="l00672"></a>00672         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->FirstChildElement( _value ) );
+<a name="l00673"></a>00673     }
+<a name="l00674"></a>00674 
+<a name="l00675"></a>00675 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00676"></a><a class="code" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7">00676</a> <span class="preprocessor"></span>    <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7" title="STL std::string form.">FirstChildElement</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const    </span>{   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a327ad4bbd90073c5dfc931b07314f5f7" title="STL std::string form.">FirstChildElement</a> (_value.c_str ()); }   
+<a name="l00677"></a><a class="code" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45">00677</a>     <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45" title="STL std::string form.">FirstChildElement</a>( <span class="keyword">const</span> std::string& _value )                {   <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#a7f1d7291880534c1e5cdeb392d8c1f45" title="STL std::string form.">FirstChildElement</a> (_value.c_str ()); }   
+<a name="l00678"></a>00678 <span class="preprocessor">    #endif</span>
+<a name="l00679"></a>00679 <span class="preprocessor"></span>
+<a name="l00684"></a><a class="code" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e">00684</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlNode.html#a57b99d5c97d67a42b9752f5210a1ba5e" title="Query the type (as an enumerated value, above) of this node.">Type</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span> type; }
+<a name="l00685"></a>00685 
+<a name="l00689"></a>00689     <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>* <a class="code" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3" title="Return a pointer to the Document this node lives in.">GetDocument</a>() <span class="keyword">const</span>;
+<a name="l00690"></a>00690     <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>* <a class="code" href="classTiXmlNode.html#a80e397fa973cf5323e33b07154b024f3" title="Return a pointer to the Document this node lives in.">GetDocument</a>() {
+<a name="l00691"></a>00691         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->GetDocument() );
+<a name="l00692"></a>00692     }
+<a name="l00693"></a>00693 
+<a name="l00695"></a><a class="code" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3">00695</a>     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlNode.html#aeed21ad30630ef6e7faf096127edc9f3" title="Returns true if this node has no children.">NoChildren</a>()<span class="keyword"> const                     </span>{ <span class="keywordflow">return</span> !firstChild; }
+<a name="l00696"></a>00696 
+<a name="l00697"></a><a class="code" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08">00697</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>*    <a class="code" href="classTiXmlNode.html#a8a4cda4b15c29f64cff419309aebed08" title="Cast to a more defined type. Will return null if not of the requested type.">ToDocument</a>()<span class="keyword">    const </span>{ <span class="keywordflow">return</span> 0; } 
+<a name="l00698"></a><a class="code" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c">00698</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>*     <a class="code" href="classTiXmlNode.html#a72abed96dc9667ab9e0a2a275301bb1c" title="Cast to a more defined type. Will return null if not of the requested type.">ToElement</a>()<span class="keyword">     const </span>{ <span class="keywordflow">return</span> 0; } 
+<a name="l00699"></a><a class="code" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574">00699</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>*     <a class="code" href="classTiXmlNode.html#aa0a5086f9eaee910bbfdc7f975e26574" title="Cast to a more defined type. Will return null if not of the requested type.">ToComment</a>()<span class="keyword">     const </span>{ <span class="keywordflow">return</span> 0; } 
+<a name="l00700"></a><a class="code" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2">00700</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>*     <a class="code" href="classTiXmlNode.html#afd7205cf31d7a376929f8a36930627a2" title="Cast to a more defined type. Will return null if not of the requested type.">ToUnknown</a>()<span class="keyword">     const </span>{ <span class="keywordflow">return</span> 0; } 
+<a name="l00701"></a><a class="code" href="classTiXmlNode.html#a95a46a52c525992d6b4ee08beb14cd69">00701</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>*        <a class="code" href="classTiXmlNode.html#a95a46a52c525992d6b4ee08beb14cd69" title="Cast to a more defined type. Will return null if not of the requested type.">ToText</a>()<span class="keyword">        const </span>{ <span class="keywordflow">return</span> 0; } 
+<a name="l00702"></a><a class="code" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72">00702</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>* <a class="code" href="classTiXmlNode.html#a9f43e6984fc7d4afd6eb32714c6b7b72" title="Cast to a more defined type. Will return null if not of the requested type.">ToDeclaration</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; } 
+<a name="l00703"></a>00703 
+<a name="l00704"></a><a class="code" href="classTiXmlNode.html#a6a4c8ac28ee7a745d059db6691e03bae">00704</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>*          <a class="code" href="classTiXmlNode.html#a6a4c8ac28ee7a745d059db6691e03bae" title="Cast to a more defined type. Will return null if not of the requested type.">ToDocument</a>()    { <span class="keywordflow">return</span> 0; } 
+<a name="l00705"></a><a class="code" href="classTiXmlNode.html#aa65d000223187d22a4dcebd7479e9ebc">00705</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>*           <a class="code" href="classTiXmlNode.html#aa65d000223187d22a4dcebd7479e9ebc" title="Cast to a more defined type. Will return null if not of the requested type.">ToElement</a>()     { <span class="keywordflow">return</span> 0; } 
+<a name="l00706"></a><a class="code" href="classTiXmlNode.html#a383e06a0787f7063953934867990f849">00706</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>*           <a class="code" href="classTiXmlNode.html#a383e06a0787f7063953934867990f849" title="Cast to a more defined type. Will return null if not of the requested type.">ToComment</a>()     { <span class="keywordflow">return</span> 0; } 
+<a name="l00707"></a><a class="code" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d">00707</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>*           <a class="code" href="classTiXmlNode.html#a06de5af852668c7e4af0d09c205f0b0d" title="Cast to a more defined type. Will return null if not of the requested type.">ToUnknown</a>()     { <span class="keywordflow">return</span> 0; } 
+<a name="l00708"></a><a class="code" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03">00708</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>*              <a class="code" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03" title="Cast to a more defined type. Will return null if not of the requested type.">ToText</a>()        { <span class="keywordflow">return</span> 0; } 
+<a name="l00709"></a><a class="code" href="classTiXmlNode.html#a4027136ca820ff4a636b607231b6a6df">00709</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>*       <a class="code" href="classTiXmlNode.html#a4027136ca820ff4a636b607231b6a6df" title="Cast to a more defined type. Will return null if not of the requested type.">ToDeclaration</a>() { <span class="keywordflow">return</span> 0; } 
+<a name="l00710"></a>00710 
+<a name="l00714"></a>00714     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#a4508cc3a2d7a98e96a54cc09c37a78a4" title="Create an exact duplicate of this node and return it.">Clone</a>() <span class="keyword">const</span> = 0;
+<a name="l00715"></a>00715 
+<a name="l00738"></a>00738     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlNode.html#acc0f88b7462c6cb73809d410a4f5bb86" title="Accept a hierchical visit the nodes in the TinyXML DOM.">Accept</a>( <a class="code" href="classTiXmlVisitor.html" title="Implements the interface to the &quot;Visitor pattern&quot; (see the Accept() method...">TiXmlVisitor</a>* visitor ) <span class="keyword">const</span> = 0;
+<a name="l00739"></a>00739 
+<a name="l00740"></a>00740 <span class="keyword">protected</span>:
+<a name="l00741"></a>00741     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2" title="The types of XML nodes supported by TinyXml.">NodeType</a> _type );
+<a name="l00742"></a>00742 
+<a name="l00743"></a>00743     <span class="comment">// Copy to the allocated object. Shared functionality between Clone, Copy constructor,</span>
+<a name="l00744"></a>00744     <span class="comment">// and the assignment operator.</span>
+<a name="l00745"></a>00745     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* target ) <span class="keyword">const</span>;
+<a name="l00746"></a>00746 
+<a name="l00747"></a>00747 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00748"></a>00748 <span class="preprocessor"></span>        <span class="comment">// The real work of the input operator.</span>
+<a name="l00749"></a>00749     <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream* in, TIXML_STRING* tag ) = 0;
+<a name="l00750"></a>00750 <span class="preprocessor">    #endif</span>
+<a name="l00751"></a>00751 <span class="preprocessor"></span>
+<a name="l00752"></a>00752     <span class="comment">// Figure out what is at *p, and parse it. Returns null if it is not an xml node.</span>
+<a name="l00753"></a>00753     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* Identify( <span class="keyword">const</span> <span class="keywordtype">char</span>* start, TiXmlEncoding encoding );
+<a name="l00754"></a>00754 
+<a name="l00755"></a>00755     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>*      parent;
+<a name="l00756"></a>00756     <a class="code" href="classTiXmlNode.html#a836eded4920ab9e9ef28496f48cd95a2" title="The types of XML nodes supported by TinyXml.">NodeType</a>        type;
+<a name="l00757"></a>00757 
+<a name="l00758"></a>00758     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>*      firstChild;
+<a name="l00759"></a>00759     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>*      lastChild;
+<a name="l00760"></a>00760 
+<a name="l00761"></a>00761     TIXML_STRING    value;
+<a name="l00762"></a>00762 
+<a name="l00763"></a>00763     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>*      prev;
+<a name="l00764"></a>00764     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>*      next;
+<a name="l00765"></a>00765 
+<a name="l00766"></a>00766 <span class="keyword">private</span>:
+<a name="l00767"></a>00767     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>& );              <span class="comment">// not implemented.</span>
+<a name="l00768"></a>00768     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>& base );    <span class="comment">// not allowed.</span>
+<a name="l00769"></a>00769 };
+<a name="l00770"></a>00770 
+<a name="l00771"></a>00771 
+<a name="l00779"></a><a class="code" href="classTiXmlAttribute.html">00779</a> <span class="keyword">class </span><a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a>
+<a name="l00780"></a>00780 {
+<a name="l00781"></a>00781     <span class="keyword">friend</span> <span class="keyword">class </span>TiXmlAttributeSet;
+<a name="l00782"></a>00782 
+<a name="l00783"></a>00783 <span class="keyword">public</span>:
+<a name="l00785"></a><a class="code" href="classTiXmlAttribute.html#a9cfa3c8179873fd485d83003b114f8e1">00785</a>     <a class="code" href="classTiXmlAttribute.html#a9cfa3c8179873fd485d83003b114f8e1" title="Construct an empty attribute.">TiXmlAttribute</a>() : <a class="code" href="classTiXmlBase.html" title="TiXmlBase is a base class for every class in TinyXml.">TiXmlBase</a>()
+<a name="l00786"></a>00786     {
+<a name="l00787"></a>00787         document = 0;
+<a name="l00788"></a>00788         prev = next = 0;
+<a name="l00789"></a>00789     }
+<a name="l00790"></a>00790 
+<a name="l00791"></a>00791 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00793"></a><a class="code" href="classTiXmlAttribute.html#a052213522caac3979960e0714063861d">00793</a> <span class="preprocessor">    TiXmlAttribute( const std::string& _name, const std::string& _value )</span>
+<a name="l00794"></a>00794 <span class="preprocessor"></span>    {
+<a name="l00795"></a>00795         name = _name;
+<a name="l00796"></a>00796         value = _value;
+<a name="l00797"></a>00797         document = 0;
+<a name="l00798"></a>00798         prev = next = 0;
+<a name="l00799"></a>00799     }
+<a name="l00800"></a>00800 <span class="preprocessor">    #endif</span>
+<a name="l00801"></a>00801 <span class="preprocessor"></span>
+<a name="l00803"></a><a class="code" href="classTiXmlAttribute.html#a759d0b76fb8fcf765ecab243bc14f05e">00803</a>     <a class="code" href="classTiXmlAttribute.html#a9cfa3c8179873fd485d83003b114f8e1" title="Construct an empty attribute.">TiXmlAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _name, <span class="keyword">const</span> <span class="keywordtype">char</span> * _value )
+<a name="l00804"></a>00804     {
+<a name="l00805"></a>00805         name = _name;
+<a name="l00806"></a>00806         value = _value;
+<a name="l00807"></a>00807         document = 0;
+<a name="l00808"></a>00808         prev = next = 0;
+<a name="l00809"></a>00809     }
+<a name="l00810"></a>00810 
+<a name="l00811"></a><a class="code" href="classTiXmlAttribute.html#a298a57287d305904ba6bd96ae6f78d3d">00811</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>*     <a class="code" href="classTiXmlAttribute.html#a298a57287d305904ba6bd96ae6f78d3d" title="Return the name of this attribute.">Name</a>()<span class="keyword">  const       </span>{ <span class="keywordflow">return</span> name.c_str(); }        
+<a name="l00812"></a><a class="code" href="classTiXmlAttribute.html#a0f874490eac8ca00ee0070765d0e97e3">00812</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>*     <a class="code" href="classTiXmlAttribute.html#a0f874490eac8ca00ee0070765d0e97e3" title="Return the value of this attribute.">Value</a>()<span class="keyword"> const       </span>{ <span class="keywordflow">return</span> value.c_str(); }       
+<a name="l00813"></a>00813 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00814"></a><a class="code" href="classTiXmlAttribute.html#a87705c3ccf9ee9417beb4f7cbacd4d33">00814</a> <span class="preprocessor"></span>    <span class="keyword">const</span> std::string& <a class="code" href="classTiXmlAttribute.html#a87705c3ccf9ee9417beb4f7cbacd4d33" title="Return the value of this attribute.">ValueStr</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value; }               
+<a name="l00815"></a>00815 <span class="preprocessor">    #endif</span>
+<a name="l00816"></a>00816 <span class="preprocessor"></span>    <span class="keywordtype">int</span>             <a class="code" href="classTiXmlAttribute.html#aa1a20ad59dc7e89a0ab265396360d50f" title="Return the value of this attribute, converted to an integer.">IntValue</a>() <span class="keyword">const</span>;                                   
+<a name="l00817"></a>00817     <span class="keywordtype">double</span>          <a class="code" href="classTiXmlAttribute.html#a2880ddef53fc7522c99535273954d230" title="Return the value of this attribute, converted to a double.">DoubleValue</a>() <span class="keyword">const</span>;                                
+<a name="l00818"></a>00818 
+<a name="l00819"></a>00819     <span class="comment">// Get the tinyxml string representation</span>
+<a name="l00820"></a>00820     <span class="keyword">const</span> TIXML_STRING& NameTStr()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> name; }
+<a name="l00821"></a>00821 
+<a name="l00831"></a>00831     <span class="keywordtype">int</span> <a class="code" href="classTiXmlAttribute.html#ad6c93088ee21af41a107931223339344" title="QueryIntValue examines the value string.">QueryIntValue</a>( <span class="keywordtype">int</span>* _value ) <span class="keyword">const</span>;
+<a name="l00833"></a>00833     <span class="keywordtype">int</span> <a class="code" href="classTiXmlAttribute.html#ac87b2a8489906a5d7aa2875f20be3513" title="QueryDoubleValue examines the value string. See QueryIntValue().">QueryDoubleValue</a>( <span class="keywordtype">double</span>* _value ) <span class="keyword">const</span>;
+<a name="l00834"></a>00834 
+<a name="l00835"></a><a class="code" href="classTiXmlAttribute.html#ab7fa3d21ff8d7c5764cf9af15b667a99">00835</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#ab7fa3d21ff8d7c5764cf9af15b667a99" title="Set the name of this attribute.">SetName</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _name )   { name = _name; }               
+<a name="l00836"></a><a class="code" href="classTiXmlAttribute.html#a2dae44178f668b3cb48101be4f2236a0">00836</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#a2dae44178f668b3cb48101be4f2236a0" title="Set the value.">SetValue</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _value ) { value = _value; }             
+<a name="l00837"></a>00837 
+<a name="l00838"></a>00838     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#a7e065df640116a62ea4f4b7da5449cc8" title="Set the value from an integer.">SetIntValue</a>( <span class="keywordtype">int</span> _value );                                     
+<a name="l00839"></a>00839     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#a0316da31373496c4368ad549bf711394" title="Set the value from a double.">SetDoubleValue</a>( <span class="keywordtype">double</span> _value );                               
+<a name="l00840"></a>00840 
+<a name="l00841"></a>00841 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00843"></a><a class="code" href="classTiXmlAttribute.html#ab296ff0c9a8c701055cd257a8a976e57">00843</a> <span class="preprocessor">    void SetName( const std::string& _name )    { name = _name; }   </span>
+<a name="l00845"></a><a class="code" href="classTiXmlAttribute.html#ab43f67a0cc3ec1d80e62606500f0925f">00845</a> <span class="preprocessor">    void SetValue( const std::string& _value )  { value = _value; }</span>
+<a name="l00846"></a>00846 <span class="preprocessor"></span><span class="preprocessor">    #endif</span>
+<a name="l00847"></a>00847 <span class="preprocessor"></span>
+<a name="l00849"></a>00849     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#a1c78e92e223a40843f644ba48ef69f67" title="Get the next sibling attribute in the DOM. Returns null at end.">Next</a>() <span class="keyword">const</span>;
+<a name="l00850"></a>00850     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#a1c78e92e223a40843f644ba48ef69f67" title="Get the next sibling attribute in the DOM. Returns null at end.">Next</a>() {
+<a name="l00851"></a>00851         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->Next() ); 
+<a name="l00852"></a>00852     }
+<a name="l00853"></a>00853 
+<a name="l00855"></a>00855     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#a6ebbfe333fe76cd834bd6cbcca3130cf" title="Get the previous sibling attribute in the DOM. Returns null at beginning.">Previous</a>() <span class="keyword">const</span>;
+<a name="l00856"></a>00856     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#a6ebbfe333fe76cd834bd6cbcca3130cf" title="Get the previous sibling attribute in the DOM. Returns null at beginning.">Previous</a>() {
+<a name="l00857"></a>00857         <span class="keywordflow">return</span> <span class="keyword">const_cast<</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <span class="keyword">></span>( (<span class="keyword">const_cast<</span> <span class="keyword">const </span><a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <span class="keyword">></span>(<span class="keyword">this</span>))->Previous() ); 
+<a name="l00858"></a>00858     }
+<a name="l00859"></a>00859 
+<a name="l00860"></a>00860     <span class="keywordtype">bool</span> operator==( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>& rhs )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rhs.name == name; }
+<a name="l00861"></a>00861     <span class="keywordtype">bool</span> operator<( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>& rhs )<span class="keyword">  const </span>{ <span class="keywordflow">return</span> name < rhs.name; }
+<a name="l00862"></a>00862     <span class="keywordtype">bool</span> operator>( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>& rhs )<span class="keyword">  const </span>{ <span class="keywordflow">return</span> name > rhs.name; }
+<a name="l00863"></a>00863 
+<a name="l00864"></a>00864     <span class="comment">/*  Attribute parsing starts: first letter of the name</span>
+<a name="l00865"></a>00865 <span class="comment">                         returns: the next char after the value end quote</span>
+<a name="l00866"></a>00866 <span class="comment">    */</span>
+<a name="l00867"></a>00867     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+<a name="l00868"></a>00868 
+<a name="l00869"></a>00869     <span class="comment">// Prints this Attribute to a FILE stream.</span>
+<a name="l00870"></a><a class="code" href="classTiXmlAttribute.html#acc04956c1d5c4c31fe74f7a7528d109a">00870</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#acc04956c1d5c4c31fe74f7a7528d109a" title="All TinyXml classes can print themselves to a filestream or the string class (TiXmlString...">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth )<span class="keyword"> const </span>{
+<a name="l00871"></a>00871         <a class="code" href="classTiXmlAttribute.html#acc04956c1d5c4c31fe74f7a7528d109a" title="All TinyXml classes can print themselves to a filestream or the string class (TiXmlString...">Print</a>( cfile, depth, 0 );
+<a name="l00872"></a>00872     }
+<a name="l00873"></a>00873     <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#acc04956c1d5c4c31fe74f7a7528d109a" title="All TinyXml classes can print themselves to a filestream or the string class (TiXmlString...">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth, TIXML_STRING* str ) <span class="keyword">const</span>;
+<a name="l00874"></a>00874 
+<a name="l00875"></a>00875     <span class="comment">// [internal use]</span>
+<a name="l00876"></a>00876     <span class="comment">// Set the document pointer so the attribute can report errors.</span>
+<a name="l00877"></a>00877     <span class="keywordtype">void</span> SetDocument( <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>* doc )  { document = doc; }
+<a name="l00878"></a>00878 
+<a name="l00879"></a>00879 <span class="keyword">private</span>:
+<a name="l00880"></a>00880     <a class="code" href="classTiXmlAttribute.html#a9cfa3c8179873fd485d83003b114f8e1" title="Construct an empty attribute.">TiXmlAttribute</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>& );                <span class="comment">// not implemented.</span>
+<a name="l00881"></a>00881     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>& base );   <span class="comment">// not allowed.</span>
+<a name="l00882"></a>00882 
+<a name="l00883"></a>00883     <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>*  document;   <span class="comment">// A pointer back to a document, for error reporting.</span>
+<a name="l00884"></a>00884     TIXML_STRING name;
+<a name="l00885"></a>00885     TIXML_STRING value;
+<a name="l00886"></a>00886     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* prev;
+<a name="l00887"></a>00887     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* next;
+<a name="l00888"></a>00888 };
+<a name="l00889"></a>00889 
+<a name="l00890"></a>00890 
+<a name="l00891"></a>00891 <span class="comment">/*  A class used to manage a group of attributes.</span>
+<a name="l00892"></a>00892 <span class="comment">    It is only used internally, both by the ELEMENT and the DECLARATION.</span>
+<a name="l00893"></a>00893 <span class="comment">    </span>
+<a name="l00894"></a>00894 <span class="comment">    The set can be changed transparent to the Element and Declaration</span>
+<a name="l00895"></a>00895 <span class="comment">    classes that use it, but NOT transparent to the Attribute</span>
+<a name="l00896"></a>00896 <span class="comment">    which has to implement a next() and previous() method. Which makes</span>
+<a name="l00897"></a>00897 <span class="comment">    it a bit problematic and prevents the use of STL.</span>
+<a name="l00898"></a>00898 <span class="comment"></span>
+<a name="l00899"></a>00899 <span class="comment">    This version is implemented with circular lists because:</span>
+<a name="l00900"></a>00900 <span class="comment">        - I like circular lists</span>
+<a name="l00901"></a>00901 <span class="comment">        - it demonstrates some independence from the (typical) doubly linked list.</span>
+<a name="l00902"></a>00902 <span class="comment">*/</span>
+<a name="l00903"></a>00903 <span class="keyword">class </span>TiXmlAttributeSet
+<a name="l00904"></a>00904 {
+<a name="l00905"></a>00905 <span class="keyword">public</span>:
+<a name="l00906"></a>00906     TiXmlAttributeSet();
+<a name="l00907"></a>00907     ~TiXmlAttributeSet();
+<a name="l00908"></a>00908 
+<a name="l00909"></a>00909     <span class="keywordtype">void</span> Add( <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* attribute );
+<a name="l00910"></a>00910     <span class="keywordtype">void</span> Remove( <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* attribute );
+<a name="l00911"></a>00911 
+<a name="l00912"></a>00912     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* First()<span class="keyword">   const   </span>{ <span class="keywordflow">return</span> ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
+<a name="l00913"></a>00913     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* First()                 { <span class="keywordflow">return</span> ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
+<a name="l00914"></a>00914     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* Last()<span class="keyword"> const      </span>{ <span class="keywordflow">return</span> ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
+<a name="l00915"></a>00915     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* Last()                  { <span class="keywordflow">return</span> ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
+<a name="l00916"></a>00916 
+<a name="l00917"></a>00917     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* Find( <span class="keyword">const</span> <span class="keywordtype">char</span>* _name ) <span class="keyword">const</span>;
+<a name="l00918"></a>00918     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* FindOrCreate( <span class="keyword">const</span> <span class="keywordtype">char</span>* _name );
+<a name="l00919"></a>00919 
+<a name="l00920"></a>00920 <span class="preprocessor">#   ifdef TIXML_USE_STL</span>
+<a name="l00921"></a>00921 <span class="preprocessor"></span>    <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* Find( <span class="keyword">const</span> std::string& _name ) <span class="keyword">const</span>;
+<a name="l00922"></a>00922     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* FindOrCreate( <span class="keyword">const</span> std::string& _name );
+<a name="l00923"></a>00923 <span class="preprocessor">#   endif</span>
+<a name="l00924"></a>00924 <span class="preprocessor"></span>
+<a name="l00925"></a>00925 
+<a name="l00926"></a>00926 <span class="keyword">private</span>:
+<a name="l00927"></a>00927     <span class="comment">//*ME:  Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element),</span>
+<a name="l00928"></a>00928     <span class="comment">//*ME:  this class must be also use a hidden/disabled copy-constructor !!!</span>
+<a name="l00929"></a>00929     TiXmlAttributeSet( <span class="keyword">const</span> TiXmlAttributeSet& );  <span class="comment">// not allowed</span>
+<a name="l00930"></a>00930     <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> TiXmlAttributeSet& ); <span class="comment">// not allowed (as TiXmlAttribute)</span>
+<a name="l00931"></a>00931 
+<a name="l00932"></a>00932     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a> sentinel;
+<a name="l00933"></a>00933 };
+<a name="l00934"></a>00934 
+<a name="l00935"></a>00935 
+<a name="l00940"></a><a class="code" href="classTiXmlElement.html">00940</a> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>
+<a name="l00941"></a>00941 {
+<a name="l00942"></a>00942 <span class="keyword">public</span>:
+<a name="l00944"></a>00944     <a class="code" href="classTiXmlElement.html#a01bc3ab372d35da08efcbbe65ad90c60" title="Construct an element.">TiXmlElement</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> * in_value);
+<a name="l00945"></a>00945 
+<a name="l00946"></a>00946 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l00948"></a>00948 <span class="preprocessor">    TiXmlElement( const std::string& _value );</span>
+<a name="l00949"></a>00949 <span class="preprocessor"></span><span class="preprocessor">    #endif</span>
+<a name="l00950"></a>00950 <span class="preprocessor"></span>
+<a name="l00951"></a>00951     <a class="code" href="classTiXmlElement.html#a01bc3ab372d35da08efcbbe65ad90c60" title="Construct an element.">TiXmlElement</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>& );
+<a name="l00952"></a>00952 
+<a name="l00953"></a>00953     <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>& operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>& base );
+<a name="l00954"></a>00954 
+<a name="l00955"></a>00955     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>();
+<a name="l00956"></a>00956 
+<a name="l00960"></a>00960     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name ) <span class="keyword">const</span>;
+<a name="l00961"></a>00961 
+<a name="l00968"></a>00968     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">int</span>* i ) <span class="keyword">const</span>;
+<a name="l00969"></a>00969 
+<a name="l00976"></a>00976     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">double</span>* d ) <span class="keyword">const</span>;
+<a name="l00977"></a>00977 
+<a name="l00985"></a>00985     <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">int</span>* _value ) <span class="keyword">const</span>;
+<a name="l00987"></a>00987     <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#ae48df644f890ab86fa19839ac401f00d" title="QueryUnsignedAttribute examines the attribute - see QueryIntAttribute().">QueryUnsignedAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">unsigned</span>* _value ) <span class="keyword">const</span>;
+<a name="l00992"></a>00992     <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#af4a1d3f88c28eb0f3115dc39ebd83fff" title="QueryBoolAttribute examines the attribute - see QueryIntAttribute().">QueryBoolAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">bool</span>* _value ) <span class="keyword">const</span>;
+<a name="l00994"></a>00994     <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#a898d7730ecc341f0bffc7a9dadbf1ce7" title="QueryDoubleAttribute examines the attribute - see QueryIntAttribute().">QueryDoubleAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">double</span>* _value ) <span class="keyword">const</span>;
+<a name="l00996"></a><a class="code" href="classTiXmlElement.html#aa04d3af11601ef5a5f88295203a843be">00996</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#aa04d3af11601ef5a5f88295203a843be" title="QueryFloatAttribute examines the attribute - see QueryIntAttribute().">QueryFloatAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">float</span>* _value )<span class="keyword"> const </span>{
+<a name="l00997"></a>00997         <span class="keywordtype">double</span> d;
+<a name="l00998"></a>00998         <span class="keywordtype">int</span> result = <a class="code" href="classTiXmlElement.html#a898d7730ecc341f0bffc7a9dadbf1ce7" title="QueryDoubleAttribute examines the attribute - see QueryIntAttribute().">QueryDoubleAttribute</a>( name, &d );
+<a name="l00999"></a>00999         <span class="keywordflow">if</span> ( result == TIXML_SUCCESS ) {
+<a name="l01000"></a>01000             *_value = (float)d;
+<a name="l01001"></a>01001         }
+<a name="l01002"></a>01002         <span class="keywordflow">return</span> result;
+<a name="l01003"></a>01003     }
+<a name="l01004"></a>01004 
+<a name="l01005"></a>01005 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01007"></a><a class="code" href="classTiXmlElement.html#a14321ac360efe906ed449d9db3fd9961">01007</a> <span class="preprocessor">    int QueryStringAttribute( const char* name, std::string* _value ) const {</span>
+<a name="l01008"></a>01008 <span class="preprocessor"></span>        <span class="keyword">const</span> <span class="keywordtype">char</span>* cstr = <a class="code" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute</a>( name );
+<a name="l01009"></a>01009         <span class="keywordflow">if</span> ( cstr ) {
+<a name="l01010"></a>01010             *_value = std::string( cstr );
+<a name="l01011"></a>01011             <span class="keywordflow">return</span> TIXML_SUCCESS;
+<a name="l01012"></a>01012         }
+<a name="l01013"></a>01013         <span class="keywordflow">return</span> TIXML_NO_ATTRIBUTE;
+<a name="l01014"></a>01014     }
+<a name="l01015"></a>01015 
+<a name="l01024"></a><a class="code" href="classTiXmlElement.html#ae3b9a03b0a56663a40801c7256683576">01024</a>     <span class="keyword">template</span>< <span class="keyword">typename</span> T > <span class="keywordtype">int</span> QueryValueAttribute( <span class="keyword">const</span> std::string& name, T* outValue )<span class="keyword"> const</span>
+<a name="l01025"></a>01025 <span class="keyword">    </span>{
+<a name="l01026"></a>01026         <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* node = attributeSet.Find( name );
+<a name="l01027"></a>01027         <span class="keywordflow">if</span> ( !node )
+<a name="l01028"></a>01028             <span class="keywordflow">return</span> TIXML_NO_ATTRIBUTE;
+<a name="l01029"></a>01029 
+<a name="l01030"></a>01030         std::stringstream sstream( node-><a class="code" href="classTiXmlAttribute.html#a87705c3ccf9ee9417beb4f7cbacd4d33" title="Return the value of this attribute.">ValueStr</a>() );
+<a name="l01031"></a>01031         sstream >> *outValue;
+<a name="l01032"></a>01032         <span class="keywordflow">if</span> ( !sstream.fail() )
+<a name="l01033"></a>01033             <span class="keywordflow">return</span> TIXML_SUCCESS;
+<a name="l01034"></a>01034         <span class="keywordflow">return</span> TIXML_WRONG_TYPE;
+<a name="l01035"></a>01035     }
+<a name="l01036"></a>01036 
+<a name="l01037"></a>01037     <span class="keywordtype">int</span> QueryValueAttribute( <span class="keyword">const</span> std::string& name, std::string* outValue )<span class="keyword"> const</span>
+<a name="l01038"></a>01038 <span class="keyword">    </span>{
+<a name="l01039"></a>01039         <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* node = attributeSet.Find( name );
+<a name="l01040"></a>01040         <span class="keywordflow">if</span> ( !node )
+<a name="l01041"></a>01041             <span class="keywordflow">return</span> TIXML_NO_ATTRIBUTE;
+<a name="l01042"></a>01042         *outValue = node-><a class="code" href="classTiXmlAttribute.html#a87705c3ccf9ee9417beb4f7cbacd4d33" title="Return the value of this attribute.">ValueStr</a>();
+<a name="l01043"></a>01043         <span class="keywordflow">return</span> TIXML_SUCCESS;
+<a name="l01044"></a>01044     }
+<a name="l01045"></a>01045 <span class="preprocessor">    #endif</span>
+<a name="l01046"></a>01046 <span class="preprocessor"></span>
+<a name="l01050"></a>01050     <span class="keywordtype">void</span> SetAttribute( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keyword">const</span> <span class="keywordtype">char</span> * _value );
+<a name="l01051"></a>01051 
+<a name="l01052"></a>01052 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01053"></a>01053 <span class="preprocessor"></span>    <span class="keyword">const</span> std::string* Attribute( <span class="keyword">const</span> std::string& name ) <span class="keyword">const</span>;
+<a name="l01054"></a>01054     <span class="keyword">const</span> std::string* Attribute( <span class="keyword">const</span> std::string& name, <span class="keywordtype">int</span>* i ) <span class="keyword">const</span>;
+<a name="l01055"></a>01055     <span class="keyword">const</span> std::string* Attribute( <span class="keyword">const</span> std::string& name, <span class="keywordtype">double</span>* d ) <span class="keyword">const</span>;
+<a name="l01056"></a>01056     <span class="keywordtype">int</span> QueryIntAttribute( <span class="keyword">const</span> std::string& name, <span class="keywordtype">int</span>* _value ) <span class="keyword">const</span>;
+<a name="l01057"></a>01057     <span class="keywordtype">int</span> QueryDoubleAttribute( <span class="keyword">const</span> std::string& name, <span class="keywordtype">double</span>* _value ) <span class="keyword">const</span>;
+<a name="l01058"></a>01058 
+<a name="l01060"></a>01060     <span class="keywordtype">void</span> SetAttribute( <span class="keyword">const</span> std::string& name, <span class="keyword">const</span> std::string& _value );
+<a name="l01062"></a>01062     <span class="keywordtype">void</span> SetAttribute( <span class="keyword">const</span> std::string& name, <span class="keywordtype">int</span> _value );
+<a name="l01064"></a>01064     <span class="keywordtype">void</span> SetDoubleAttribute( <span class="keyword">const</span> std::string& name, <span class="keywordtype">double</span> value );
+<a name="l01065"></a>01065 <span class="preprocessor">    #endif</span>
+<a name="l01066"></a>01066 <span class="preprocessor"></span>
+<a name="l01070"></a>01070     <span class="keywordtype">void</span> SetAttribute( <span class="keyword">const</span> <span class="keywordtype">char</span> * name, <span class="keywordtype">int</span> value );
+<a name="l01071"></a>01071 
+<a name="l01075"></a>01075     <span class="keywordtype">void</span> SetDoubleAttribute( <span class="keyword">const</span> <span class="keywordtype">char</span> * name, <span class="keywordtype">double</span> value );
+<a name="l01076"></a>01076 
+<a name="l01079"></a>01079     <span class="keywordtype">void</span> RemoveAttribute( <span class="keyword">const</span> <span class="keywordtype">char</span> * name );
+<a name="l01080"></a>01080 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01081"></a><a class="code" href="classTiXmlElement.html#a1afa6aea716511326a608e4c05df4f3a">01081</a> <span class="preprocessor"></span>    <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#a1afa6aea716511326a608e4c05df4f3a" title="STL std::string form.">RemoveAttribute</a>( <span class="keyword">const</span> std::string& name ) {   <a class="code" href="classTiXmlElement.html#a1afa6aea716511326a608e4c05df4f3a" title="STL std::string form.">RemoveAttribute</a> (name.c_str ());    }   
+<a name="l01082"></a>01082 <span class="preprocessor">    #endif</span>
+<a name="l01083"></a>01083 <span class="preprocessor"></span>
+<a name="l01084"></a><a class="code" href="classTiXmlElement.html#a516054c9073647d6cb29b6abe9fa0592">01084</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <a class="code" href="classTiXmlElement.html#a516054c9073647d6cb29b6abe9fa0592" title="Access the first attribute in this element.">FirstAttribute</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span> attributeSet.First(); }        
+<a name="l01085"></a>01085     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* FirstAttribute()                { <span class="keywordflow">return</span> attributeSet.First(); }
+<a name="l01086"></a><a class="code" href="classTiXmlElement.html#a86191b49f9177be132b85b14655f1381">01086</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* <a class="code" href="classTiXmlElement.html#a86191b49f9177be132b85b14655f1381" title="Access the last attribute in this element.">LastAttribute</a>()<span class="keyword">   const   </span>{ <span class="keywordflow">return</span> attributeSet.Last(); }     
+<a name="l01087"></a>01087     <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* LastAttribute()                 { <span class="keywordflow">return</span> attributeSet.Last(); }
+<a name="l01088"></a>01088 
+<a name="l01121"></a>01121     <span class="keyword">const</span> <span class="keywordtype">char</span>* GetText() <span class="keyword">const</span>;
+<a name="l01122"></a>01122 
+<a name="l01124"></a>01124     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* Clone() <span class="keyword">const</span>;
+<a name="l01125"></a>01125     <span class="comment">// Print the Element to a FILE stream.</span>
+<a name="l01126"></a>01126     <span class="keyword">virtual</span> <span class="keywordtype">void</span> Print( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>;
+<a name="l01127"></a>01127 
+<a name="l01128"></a>01128     <span class="comment">/*  Attribtue parsing starts: next char past '<'</span>
+<a name="l01129"></a>01129 <span class="comment">                         returns: next char past '>'</span>
+<a name="l01130"></a>01130 <span class="comment">    */</span>
+<a name="l01131"></a>01131     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+<a name="l01132"></a>01132 
+<a name="l01133"></a><a class="code" href="classTiXmlElement.html#ac5b8d0e25fa23fd9acbb6d146082901c">01133</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>*     <a class="code" href="classTiXmlElement.html#ac5b8d0e25fa23fd9acbb6d146082901c" title="Cast to a more defined type. Will return null not of the requested type.">ToElement</a>()<span class="keyword">     const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01134"></a><a class="code" href="classTiXmlElement.html#a9def86337ea7a755eb41cac980f60c7a">01134</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>*           <a class="code" href="classTiXmlElement.html#a9def86337ea7a755eb41cac980f60c7a" title="Cast to a more defined type. Will return null not of the requested type.">ToElement</a>()           { <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01135"></a>01135 
+<a name="l01138"></a>01138     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Accept( <a class="code" href="classTiXmlVisitor.html" title="Implements the interface to the &quot;Visitor pattern&quot; (see the Accept() method...">TiXmlVisitor</a>* visitor ) <span class="keyword">const</span>;
+<a name="l01139"></a>01139 
+<a name="l01140"></a>01140 <span class="keyword">protected</span>:
+<a name="l01141"></a>01141 
+<a name="l01142"></a>01142     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* target ) <span class="keyword">const</span>;
+<a name="l01143"></a>01143     <span class="keywordtype">void</span> ClearThis();   <span class="comment">// like clear, but initializes 'this' object as well</span>
+<a name="l01144"></a>01144 
+<a name="l01145"></a>01145     <span class="comment">// Used to be public [internal use]</span>
+<a name="l01146"></a>01146 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01147"></a>01147 <span class="preprocessor"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag );
+<a name="l01148"></a>01148 <span class="preprocessor">    #endif</span>
+<a name="l01149"></a>01149 <span class="preprocessor"></span>    <span class="comment">/*  [internal use]</span>
+<a name="l01150"></a>01150 <span class="comment">        Reads the "value" of the element -- another element, or text.</span>
+<a name="l01151"></a>01151 <span class="comment">        This should terminate with the current end tag.</span>
+<a name="l01152"></a>01152 <span class="comment">    */</span>
+<a name="l01153"></a>01153     <span class="keyword">const</span> <span class="keywordtype">char</span>* ReadValue( <span class="keyword">const</span> <span class="keywordtype">char</span>* in, TiXmlParsingData* prevData, TiXmlEncoding encoding );
+<a name="l01154"></a>01154 
+<a name="l01155"></a>01155 <span class="keyword">private</span>:
+<a name="l01156"></a>01156     TiXmlAttributeSet attributeSet;
+<a name="l01157"></a>01157 };
+<a name="l01158"></a>01158 
+<a name="l01159"></a>01159 
+<a name="l01162"></a><a class="code" href="classTiXmlComment.html">01162</a> <span class="keyword">class </span><a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>
+<a name="l01163"></a>01163 {
+<a name="l01164"></a>01164 <span class="keyword">public</span>:
+<a name="l01166"></a><a class="code" href="classTiXmlComment.html#aaa3252031d3e8bd3a2bf51a1c61201b7">01166</a>     <a class="code" href="classTiXmlComment.html#aaa3252031d3e8bd3a2bf51a1c61201b7" title="Constructs an empty comment.">TiXmlComment</a>() : <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>::TINYXML_COMMENT ) {}
+<a name="l01168"></a><a class="code" href="classTiXmlComment.html#a37e7802ef17bc03ebe5ae79bf0713d47">01168</a>     <a class="code" href="classTiXmlComment.html#a37e7802ef17bc03ebe5ae79bf0713d47" title="Construct a comment from text.">TiXmlComment</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _value ) : <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>::TINYXML_COMMENT ) {
+<a name="l01169"></a>01169         <a class="code" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90" title="Changes the value of the node.">SetValue</a>( _value );
+<a name="l01170"></a>01170     }
+<a name="l01171"></a>01171     <a class="code" href="classTiXmlComment.html#aaa3252031d3e8bd3a2bf51a1c61201b7" title="Constructs an empty comment.">TiXmlComment</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>& );
+<a name="l01172"></a>01172     <a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>& operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>& base );
+<a name="l01173"></a>01173 
+<a name="l01174"></a>01174     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>() {}
+<a name="l01175"></a>01175 
+<a name="l01177"></a>01177     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlComment.html#a0d6662bdc52488b9e12b3c7a0453d028" title="Returns a copy of this Comment.">Clone</a>() <span class="keyword">const</span>;
+<a name="l01178"></a>01178     <span class="comment">// Write this Comment to a FILE stream.</span>
+<a name="l01179"></a>01179     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlComment.html#a6b316527aaa8da0370cd68c22a5a0f5f" title="All TinyXml classes can print themselves to a filestream or the string class (TiXmlString...">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>;
+<a name="l01180"></a>01180 
+<a name="l01181"></a>01181     <span class="comment">/*  Attribtue parsing starts: at the ! of the !--</span>
+<a name="l01182"></a>01182 <span class="comment">                         returns: next char past '>'</span>
+<a name="l01183"></a>01183 <span class="comment">    */</span>
+<a name="l01184"></a>01184     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+<a name="l01185"></a>01185 
+<a name="l01186"></a><a class="code" href="classTiXmlComment.html#a00fb4215c20a2399ea05ac9b9e7e68a0">01186</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>*  <a class="code" href="classTiXmlComment.html#a00fb4215c20a2399ea05ac9b9e7e68a0" title="Cast to a more defined type. Will return null not of the requested type.">ToComment</a>()<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01187"></a><a class="code" href="classTiXmlComment.html#acc7c7e07e13c23f17797d642981511df">01187</a>     <span class="keyword">virtual</span>       <a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>*  <a class="code" href="classTiXmlComment.html#acc7c7e07e13c23f17797d642981511df" title="Cast to a more defined type. Will return null not of the requested type.">ToComment</a>()        { <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01188"></a>01188 
+<a name="l01191"></a>01191     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlComment.html#af3ac1b99fbbe9ea4fb6e14146156e43e" title="Walk the XML tree visiting this node and all of its children.">Accept</a>( <a class="code" href="classTiXmlVisitor.html" title="Implements the interface to the &quot;Visitor pattern&quot; (see the Accept() method...">TiXmlVisitor</a>* visitor ) <span class="keyword">const</span>;
+<a name="l01192"></a>01192 
+<a name="l01193"></a>01193 <span class="keyword">protected</span>:
+<a name="l01194"></a>01194     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>* target ) <span class="keyword">const</span>;
+<a name="l01195"></a>01195 
+<a name="l01196"></a>01196     <span class="comment">// used to be public</span>
+<a name="l01197"></a>01197 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01198"></a>01198 <span class="preprocessor"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag );
+<a name="l01199"></a>01199 <span class="preprocessor">    #endif</span>
+<a name="l01200"></a>01200 <span class="preprocessor"></span><span class="comment">//  virtual void StreamOut( TIXML_OSTREAM * out ) const;</span>
+<a name="l01201"></a>01201 
+<a name="l01202"></a>01202 <span class="keyword">private</span>:
+<a name="l01203"></a>01203 
+<a name="l01204"></a>01204 };
+<a name="l01205"></a>01205 
+<a name="l01206"></a>01206 
+<a name="l01212"></a><a class="code" href="classTiXmlText.html">01212</a> <span class="keyword">class </span><a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>
+<a name="l01213"></a>01213 {
+<a name="l01214"></a>01214     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>;
+<a name="l01215"></a>01215 <span class="keyword">public</span>:
+<a name="l01220"></a><a class="code" href="classTiXmlText.html#af659e77c6b87d684827f35a8f4895960">01220</a>     <a class="code" href="classTiXmlText.html#af659e77c6b87d684827f35a8f4895960" title="Constructor for text element.">TiXmlText</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> * initValue ) : <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a> (<a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>::TINYXML_TEXT)
+<a name="l01221"></a>01221     {
+<a name="l01222"></a>01222         <a class="code" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90" title="Changes the value of the node.">SetValue</a>( initValue );
+<a name="l01223"></a>01223         cdata = <span class="keyword">false</span>;
+<a name="l01224"></a>01224     }
+<a name="l01225"></a>01225     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>() {}
+<a name="l01226"></a>01226 
+<a name="l01227"></a>01227 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01229"></a><a class="code" href="classTiXmlText.html#a439792f6183a3d3fb6f2bc2b16fa5691">01229</a> <span class="preprocessor">    TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TINYXML_TEXT)</span>
+<a name="l01230"></a>01230 <span class="preprocessor"></span>    {
+<a name="l01231"></a>01231         <a class="code" href="classTiXmlNode.html#a2a38329ca5d3f28f98ce932b8299ae90" title="Changes the value of the node.">SetValue</a>( initValue );
+<a name="l01232"></a>01232         cdata = <span class="keyword">false</span>;
+<a name="l01233"></a>01233     }
+<a name="l01234"></a>01234 <span class="preprocessor">    #endif</span>
+<a name="l01235"></a>01235 <span class="preprocessor"></span>
+<a name="l01236"></a>01236     <a class="code" href="classTiXmlText.html#af659e77c6b87d684827f35a8f4895960" title="Constructor for text element.">TiXmlText</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>& copy ) : <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>::TINYXML_TEXT )   { copy.CopyTo( <span class="keyword">this</span> ); }
+<a name="l01237"></a>01237     <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>& operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>& base )                               { base.CopyTo( <span class="keyword">this</span> ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
+<a name="l01238"></a>01238 
+<a name="l01239"></a>01239     <span class="comment">// Write this text object to a FILE stream.</span>
+<a name="l01240"></a>01240     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlText.html#a0cafbf6f236c7f02d12b2bffc2b7976b" title="All TinyXml classes can print themselves to a filestream or the string class (TiXmlString...">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>;
+<a name="l01241"></a>01241 
+<a name="l01243"></a><a class="code" href="classTiXmlText.html#ad1a6a6b83fa2271022dd97c072a2b586">01243</a>     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlText.html#ad1a6a6b83fa2271022dd97c072a2b586" title="Queries whether this represents text using a CDATA section.">CDATA</a>()<span class="keyword"> const              </span>{ <span class="keywordflow">return</span> cdata; }
+<a name="l01245"></a><a class="code" href="classTiXmlText.html#acb17ff7c5d09b2c839393445a3de5ea9">01245</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlText.html#acb17ff7c5d09b2c839393445a3de5ea9" title="Turns on or off a CDATA representation of text.">SetCDATA</a>( <span class="keywordtype">bool</span> _cdata )    { cdata = _cdata; }
+<a name="l01246"></a>01246 
+<a name="l01247"></a>01247     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+<a name="l01248"></a>01248 
+<a name="l01249"></a><a class="code" href="classTiXmlText.html#a895bf34ffad17f7439ab2a52b9651648">01249</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>* <a class="code" href="classTiXmlText.html#a895bf34ffad17f7439ab2a52b9651648" title="Cast to a more defined type. Will return null not of the requested type.">ToText</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01250"></a><a class="code" href="classTiXmlText.html#ae7c3a8fd3e4dbf6c0c4363a943d72f5b">01250</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>*       <a class="code" href="classTiXmlText.html#ae7c3a8fd3e4dbf6c0c4363a943d72f5b" title="Cast to a more defined type. Will return null not of the requested type.">ToText</a>()       { <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01251"></a>01251 
+<a name="l01254"></a>01254     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlText.html#a8483d4415ce9de6c4fa8f63d067d5de6" title="Walk the XML tree visiting this node and all of its children.">Accept</a>( <a class="code" href="classTiXmlVisitor.html" title="Implements the interface to the &quot;Visitor pattern&quot; (see the Accept() method...">TiXmlVisitor</a>* content ) <span class="keyword">const</span>;
+<a name="l01255"></a>01255 
+<a name="l01256"></a>01256 <span class="keyword">protected</span> :
+<a name="l01258"></a>01258     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlText.html#a0c411e93a27537369479d034cc82da3b" title="[internal use] Creates a new Element and returns it.">Clone</a>() <span class="keyword">const</span>;
+<a name="l01259"></a>01259     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>* target ) <span class="keyword">const</span>;
+<a name="l01260"></a>01260 
+<a name="l01261"></a>01261     <span class="keywordtype">bool</span> Blank() <span class="keyword">const</span>; <span class="comment">// returns true if all white space and new lines</span>
+<a name="l01262"></a>01262     <span class="comment">// [internal use]</span>
+<a name="l01263"></a>01263 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01264"></a>01264 <span class="preprocessor"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag );
+<a name="l01265"></a>01265 <span class="preprocessor">    #endif</span>
+<a name="l01266"></a>01266 <span class="preprocessor"></span>
+<a name="l01267"></a>01267 <span class="keyword">private</span>:
+<a name="l01268"></a>01268     <span class="keywordtype">bool</span> cdata;         <span class="comment">// true if this should be input and output as a CDATA style text element</span>
+<a name="l01269"></a>01269 };
+<a name="l01270"></a>01270 
+<a name="l01271"></a>01271 
+<a name="l01285"></a><a class="code" href="classTiXmlDeclaration.html">01285</a> <span class="keyword">class </span><a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>
+<a name="l01286"></a>01286 {
+<a name="l01287"></a>01287 <span class="keyword">public</span>:
+<a name="l01289"></a><a class="code" href="classTiXmlDeclaration.html#aa0484d059bea0ea1acb47c9094382d79">01289</a>     <a class="code" href="classTiXmlDeclaration.html#aa0484d059bea0ea1acb47c9094382d79" title="Construct an empty declaration.">TiXmlDeclaration</a>()   : <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>::TINYXML_DECLARATION ) {}
+<a name="l01290"></a>01290 
+<a name="l01291"></a>01291 <span class="preprocessor">#ifdef TIXML_USE_STL</span>
+<a name="l01293"></a>01293 <span class="preprocessor">    TiXmlDeclaration(   const std::string& _version,</span>
+<a name="l01294"></a>01294 <span class="preprocessor"></span>                        <span class="keyword">const</span> std::string& _encoding,
+<a name="l01295"></a>01295                         <span class="keyword">const</span> std::string& _standalone );
+<a name="l01296"></a>01296 <span class="preprocessor">#endif</span>
+<a name="l01297"></a>01297 <span class="preprocessor"></span>
+<a name="l01299"></a>01299     <a class="code" href="classTiXmlDeclaration.html#aa0484d059bea0ea1acb47c9094382d79" title="Construct an empty declaration.">TiXmlDeclaration</a>(   <span class="keyword">const</span> <span class="keywordtype">char</span>* _version,
+<a name="l01300"></a>01300                         <span class="keyword">const</span> <span class="keywordtype">char</span>* _encoding,
+<a name="l01301"></a>01301                         <span class="keyword">const</span> <span class="keywordtype">char</span>* _standalone );
+<a name="l01302"></a>01302 
+<a name="l01303"></a>01303     <a class="code" href="classTiXmlDeclaration.html#aa0484d059bea0ea1acb47c9094382d79" title="Construct an empty declaration.">TiXmlDeclaration</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>& copy );
+<a name="l01304"></a>01304     <a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>& operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>& copy );
+<a name="l01305"></a>01305 
+<a name="l01306"></a>01306     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>() {}
+<a name="l01307"></a>01307 
+<a name="l01309"></a><a class="code" href="classTiXmlDeclaration.html#a02ee557b1a4545c3219ed377c103ec76">01309</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlDeclaration.html#a02ee557b1a4545c3219ed377c103ec76" title="Version. Will return an empty string if none was found.">Version</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> version.c_str (); }
+<a name="l01311"></a><a class="code" href="classTiXmlDeclaration.html#a5d974231f9e9a2f0542f15f3a46cdb76">01311</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlDeclaration.html#a5d974231f9e9a2f0542f15f3a46cdb76" title="Encoding. Will return an empty string if none was found.">Encoding</a>()<span class="keyword"> const        </span>{ <span class="keywordflow">return</span> encoding.c_str (); }
+<a name="l01313"></a><a class="code" href="classTiXmlDeclaration.html#a9ff06afc033d7ef730ec7c6825b97ad9">01313</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlDeclaration.html#a9ff06afc033d7ef730ec7c6825b97ad9" title="Is this a standalone document?">Standalone</a>()<span class="keyword"> const      </span>{ <span class="keywordflow">return</span> standalone.c_str (); }
+<a name="l01314"></a>01314 
+<a name="l01316"></a>01316     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlDeclaration.html#a7cf459186040141cda7a180a6585ce2e" title="Creates a copy of this Declaration and returns it.">Clone</a>() <span class="keyword">const</span>;
+<a name="l01317"></a>01317     <span class="comment">// Print this declaration to a FILE stream.</span>
+<a name="l01318"></a>01318     <span class="keyword">virtual</span> <span class="keywordtype">void</span> Print( FILE* cfile, <span class="keywordtype">int</span> depth, TIXML_STRING* str ) <span class="keyword">const</span>;
+<a name="l01319"></a><a class="code" href="classTiXmlDeclaration.html#abf6303db4bd05b5be554036817ff1cb4">01319</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlDeclaration.html#abf6303db4bd05b5be554036817ff1cb4" title="All TinyXml classes can print themselves to a filestream or the string class (TiXmlString...">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth )<span class="keyword"> const </span>{
+<a name="l01320"></a>01320         Print( cfile, depth, 0 );
+<a name="l01321"></a>01321     }
+<a name="l01322"></a>01322 
+<a name="l01323"></a>01323     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+<a name="l01324"></a>01324 
+<a name="l01325"></a><a class="code" href="classTiXmlDeclaration.html#a1e085d3fefd1dbf5ccdbff729931a967">01325</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>* <a class="code" href="classTiXmlDeclaration.html#a1e085d3fefd1dbf5ccdbff729931a967" title="Cast to a more defined type. Will return null not of the requested type.">ToDeclaration</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01326"></a><a class="code" href="classTiXmlDeclaration.html#a6bd3d1daddcaeb9543c24bfd090969ce">01326</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>*       <a class="code" href="classTiXmlDeclaration.html#a6bd3d1daddcaeb9543c24bfd090969ce" title="Cast to a more defined type. Will return null not of the requested type.">ToDeclaration</a>()       { <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01327"></a>01327 
+<a name="l01330"></a>01330     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDeclaration.html#a22315a535983b86535cdba3458669e3e" title="Walk the XML tree visiting this node and all of its children.">Accept</a>( <a class="code" href="classTiXmlVisitor.html" title="Implements the interface to the &quot;Visitor pattern&quot; (see the Accept() method...">TiXmlVisitor</a>* visitor ) <span class="keyword">const</span>;
+<a name="l01331"></a>01331 
+<a name="l01332"></a>01332 <span class="keyword">protected</span>:
+<a name="l01333"></a>01333     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>* target ) <span class="keyword">const</span>;
+<a name="l01334"></a>01334     <span class="comment">// used to be public</span>
+<a name="l01335"></a>01335 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01336"></a>01336 <span class="preprocessor"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag );
+<a name="l01337"></a>01337 <span class="preprocessor">    #endif</span>
+<a name="l01338"></a>01338 <span class="preprocessor"></span>
+<a name="l01339"></a>01339 <span class="keyword">private</span>:
+<a name="l01340"></a>01340 
+<a name="l01341"></a>01341     TIXML_STRING version;
+<a name="l01342"></a>01342     TIXML_STRING encoding;
+<a name="l01343"></a>01343     TIXML_STRING standalone;
+<a name="l01344"></a>01344 };
+<a name="l01345"></a>01345 
+<a name="l01346"></a>01346 
+<a name="l01354"></a><a class="code" href="classTiXmlUnknown.html">01354</a> <span class="keyword">class </span><a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>
+<a name="l01355"></a>01355 {
+<a name="l01356"></a>01356 <span class="keyword">public</span>:
+<a name="l01357"></a>01357     <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>() : <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>( TiXmlNode::TINYXML_UNKNOWN )    {}
+<a name="l01358"></a>01358     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>() {}
+<a name="l01359"></a>01359 
+<a name="l01360"></a>01360     <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>& copy ) : <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>( TiXmlNode::TINYXML_UNKNOWN )      { copy.CopyTo( <span class="keyword">this</span> ); }
+<a name="l01361"></a>01361     <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>& operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>& copy )                                     { copy.CopyTo( <span class="keyword">this</span> ); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
+<a name="l01362"></a>01362 
+<a name="l01364"></a>01364     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlUnknown.html#a0960bb7428b3f341da46244229604d73" title="Creates a copy of this Unknown and returns it.">Clone</a>() <span class="keyword">const</span>;
+<a name="l01365"></a>01365     <span class="comment">// Print this Unknown to a FILE stream.</span>
+<a name="l01366"></a>01366     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlUnknown.html#a31ba089a40fb5a1869750fce09b0bacb" title="All TinyXml classes can print themselves to a filestream or the string class (TiXmlString...">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>;
+<a name="l01367"></a>01367 
+<a name="l01368"></a>01368     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+<a name="l01369"></a>01369 
+<a name="l01370"></a><a class="code" href="classTiXmlUnknown.html#ab0313e5fe77987d746ac1a97a254419d">01370</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>*     <a class="code" href="classTiXmlUnknown.html#ab0313e5fe77987d746ac1a97a254419d" title="Cast to a more defined type. Will return null not of the requested type.">ToUnknown</a>()<span class="keyword">     const   </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01371"></a><a class="code" href="classTiXmlUnknown.html#a67c9fd22940e8c47f706a72cdd2e332c">01371</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>*           <a class="code" href="classTiXmlUnknown.html#a67c9fd22940e8c47f706a72cdd2e332c" title="Cast to a more defined type. Will return null not of the requested type.">ToUnknown</a>()             { <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01372"></a>01372 
+<a name="l01375"></a>01375     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlUnknown.html#ad7122e5135581b3c832a1a3217760a93" title="Walk the XML tree visiting this node and all of its children.">Accept</a>( <a class="code" href="classTiXmlVisitor.html" title="Implements the interface to the &quot;Visitor pattern&quot; (see the Accept() method...">TiXmlVisitor</a>* content ) <span class="keyword">const</span>;
+<a name="l01376"></a>01376 
+<a name="l01377"></a>01377 <span class="keyword">protected</span>:
+<a name="l01378"></a>01378     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>* target ) <span class="keyword">const</span>;
+<a name="l01379"></a>01379 
+<a name="l01380"></a>01380 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01381"></a>01381 <span class="preprocessor"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag );
+<a name="l01382"></a>01382 <span class="preprocessor">    #endif</span>
+<a name="l01383"></a>01383 <span class="preprocessor"></span>
+<a name="l01384"></a>01384 <span class="keyword">private</span>:
+<a name="l01385"></a>01385 
+<a name="l01386"></a>01386 };
+<a name="l01387"></a>01387 
+<a name="l01388"></a>01388 
+<a name="l01393"></a><a class="code" href="classTiXmlDocument.html">01393</a> <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>
+<a name="l01394"></a>01394 {
+<a name="l01395"></a>01395 <span class="keyword">public</span>:
+<a name="l01397"></a>01397     <a class="code" href="classTiXmlDocument.html#a9f5e84335708fde98400230f9f12659c" title="Create an empty document, that has no name.">TiXmlDocument</a>();
+<a name="l01399"></a>01399     <a class="code" href="classTiXmlDocument.html#a9f5e84335708fde98400230f9f12659c" title="Create an empty document, that has no name.">TiXmlDocument</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * documentName );
+<a name="l01400"></a>01400 
+<a name="l01401"></a>01401 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01403"></a>01403 <span class="preprocessor">    TiXmlDocument( const std::string& documentName );</span>
+<a name="l01404"></a>01404 <span class="preprocessor"></span><span class="preprocessor">    #endif</span>
+<a name="l01405"></a>01405 <span class="preprocessor"></span>
+<a name="l01406"></a>01406     <a class="code" href="classTiXmlDocument.html#a9f5e84335708fde98400230f9f12659c" title="Create an empty document, that has no name.">TiXmlDocument</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>& copy );
+<a name="l01407"></a>01407     <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>& operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>& copy );
+<a name="l01408"></a>01408 
+<a name="l01409"></a>01409     <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>() {}
+<a name="l01410"></a>01410 
+<a name="l01415"></a>01415     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f" title="Load a file using the current document value.">LoadFile</a>( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+<a name="l01417"></a>01417     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93" title="Save a file using the current document value. Returns true if successful.">SaveFile</a>() <span class="keyword">const</span>;
+<a name="l01419"></a>01419     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f" title="Load a file using the current document value.">LoadFile</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+<a name="l01421"></a>01421     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93" title="Save a file using the current document value. Returns true if successful.">SaveFile</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * filename ) <span class="keyword">const</span>;
+<a name="l01427"></a>01427     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f" title="Load a file using the current document value.">LoadFile</a>( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+<a name="l01429"></a>01429     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93" title="Save a file using the current document value. Returns true if successful.">SaveFile</a>( FILE* ) <span class="keyword">const</span>;
+<a name="l01430"></a>01430 
+<a name="l01431"></a>01431 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01432"></a><a class="code" href="classTiXmlDocument.html#a18ae6ed34fed7991ebc220862dfac884">01432</a> <span class="preprocessor"></span>    <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f" title="Load a file using the current document value.">LoadFile</a>( <span class="keyword">const</span> std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING )           
+<a name="l01433"></a>01433     {
+<a name="l01434"></a>01434         <span class="keywordflow">return</span> <a class="code" href="classTiXmlDocument.html#a4c852a889c02cf251117fd1d9fe1845f" title="Load a file using the current document value.">LoadFile</a>( filename.c_str(), encoding );
+<a name="l01435"></a>01435     }
+<a name="l01436"></a><a class="code" href="classTiXmlDocument.html#a3d4fae0463f3f03679ba0b7cf6f2df52">01436</a>     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93" title="Save a file using the current document value. Returns true if successful.">SaveFile</a>( <span class="keyword">const</span> std::string& filename ) <span class="keyword">const</span>      
+<a name="l01437"></a>01437     {
+<a name="l01438"></a>01438         <span class="keywordflow">return</span> <a class="code" href="classTiXmlDocument.html#a21c0aeb0d0a720169ad4ac89523ebe93" title="Save a file using the current document value. Returns true if successful.">SaveFile</a>( filename.c_str() );
+<a name="l01439"></a>01439     }
+<a name="l01440"></a>01440 <span class="preprocessor">    #endif</span>
+<a name="l01441"></a>01441 <span class="preprocessor"></span>
+<a name="l01446"></a>01446     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlDocument.html#a17ebabe36926ef398e78dec0d0ad0378" title="Parse the given null terminated block of xml data.">Parse</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+<a name="l01447"></a>01447 
+<a name="l01452"></a><a class="code" href="classTiXmlDocument.html#ad09d17927f908f40efb406af2fb873be">01452</a>     <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlDocument.html#ad09d17927f908f40efb406af2fb873be" title="Get the root element -- the only top level element -- of the document.">RootElement</a>()<span class="keyword"> const     </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba" title="Convenience function to get through elements.">FirstChildElement</a>(); }
+<a name="l01453"></a>01453     <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlDocument.html#ad09d17927f908f40efb406af2fb873be" title="Get the root element -- the only top level element -- of the document.">RootElement</a>()                 { <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#af4fb652f6bd79ae0d5ce7d0f7d3c0fba" title="Convenience function to get through elements.">FirstChildElement</a>(); }
+<a name="l01454"></a>01454 
+<a name="l01460"></a><a class="code" href="classTiXmlDocument.html#a6dfc01a6e5d58e56acd537dfd3bdeb29">01460</a>     <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a6dfc01a6e5d58e56acd537dfd3bdeb29" title="If an error occurs, Error will be set to true.">Error</a>()<span class="keyword"> const                      </span>{ <span class="keywordflow">return</span> error; }
+<a name="l01461"></a>01461 
+<a name="l01463"></a><a class="code" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e">01463</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="classTiXmlDocument.html#a9d0f689f6e09ea494ea547be8d79c25e" title="Contains a textual (english) description of the error if one occurs.">ErrorDesc</a>()<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> errorDesc.c_str (); }
+<a name="l01464"></a>01464 
+<a name="l01468"></a><a class="code" href="classTiXmlDocument.html#af96fc2f3f9ec6422782bfe916c9e778f">01468</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlDocument.html#af96fc2f3f9ec6422782bfe916c9e778f" title="Generally, you probably want the error string ( ErrorDesc() ).">ErrorId</a>()<span class="keyword">   const               </span>{ <span class="keywordflow">return</span> errorId; }
+<a name="l01469"></a>01469 
+<a name="l01477"></a><a class="code" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e">01477</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlDocument.html#af30efc75e804aa2e92fb8be3a8cb676e" title="Returns the location (if known) of the error.">ErrorRow</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span> errorLocation.row+1; }
+<a name="l01478"></a><a class="code" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649">01478</a>     <span class="keywordtype">int</span> <a class="code" href="classTiXmlDocument.html#aa90bc630ee5203c6109ca5fad3323649" title="The column where the error occured. See ErrorRow().">ErrorCol</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span> errorLocation.col+1; } 
+<a name="l01479"></a>01479 
+<a name="l01504"></a><a class="code" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e">01504</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#a51dac56316f89b35bdb7d0d433ba988e" title="SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to...">SetTabSize</a>( <span class="keywordtype">int</span> _tabsize )     { tabsize = _tabsize; }
+<a name="l01505"></a>01505 
+<a name="l01506"></a>01506     <span class="keywordtype">int</span> TabSize()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> tabsize; }
+<a name="l01507"></a>01507 
+<a name="l01511"></a><a class="code" href="classTiXmlDocument.html#ac66b8c28db86363315712a3574e87c35">01511</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#ac66b8c28db86363315712a3574e87c35" title="If you have handled the error, it can be reset with this call.">ClearError</a>()                       {   error = <span class="keyword">false</span>; 
+<a name="l01512"></a>01512                                                 errorId = 0; 
+<a name="l01513"></a>01513                                                 errorDesc = <span class="stringliteral">""</span>; 
+<a name="l01514"></a>01514                                                 errorLocation.row = errorLocation.col = 0; 
+<a name="l01515"></a>01515                                                 <span class="comment">//errorLocation.last = 0; </span>
+<a name="l01516"></a>01516                                             }
+<a name="l01517"></a>01517 
+<a name="l01519"></a><a class="code" href="classTiXmlDocument.html#af08389ec70ee9b2de7f800e206a18510">01519</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#af08389ec70ee9b2de7f800e206a18510" title="Write the document to standard out using formatted printing (&quot;pretty print&quot;)...">Print</a>()<span class="keyword"> const                      </span>{ <a class="code" href="classTiXmlDocument.html#af08389ec70ee9b2de7f800e206a18510" title="Write the document to standard out using formatted printing (&quot;pretty print&quot;)...">Print</a>( stdout, 0 ); }
+<a name="l01520"></a>01520 
+<a name="l01521"></a>01521     <span class="comment">/* Write the document to a string using formatted printing ("pretty print"). This</span>
+<a name="l01522"></a>01522 <span class="comment">        will allocate a character array (new char[]) and return it as a pointer. The</span>
+<a name="l01523"></a>01523 <span class="comment">        calling code pust call delete[] on the return char* to avoid a memory leak.</span>
+<a name="l01524"></a>01524 <span class="comment">    */</span>
+<a name="l01525"></a>01525     <span class="comment">//char* PrintToMemory() const; </span>
+<a name="l01526"></a>01526 
+<a name="l01528"></a>01528     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#af08389ec70ee9b2de7f800e206a18510" title="Write the document to standard out using formatted printing (&quot;pretty print&quot;)...">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth = 0 ) <span class="keyword">const</span>;
+<a name="l01529"></a>01529     <span class="comment">// [internal use]</span>
+<a name="l01530"></a>01530     <span class="keywordtype">void</span> SetError( <span class="keywordtype">int</span> err, <span class="keyword">const</span> <span class="keywordtype">char</span>* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding );
+<a name="l01531"></a>01531 
+<a name="l01532"></a><a class="code" href="classTiXmlDocument.html#a1dc977bde3e4fe85a8eb9d88a35ef5a4">01532</a>     <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>*    <a class="code" href="classTiXmlDocument.html#a1dc977bde3e4fe85a8eb9d88a35ef5a4" title="Cast to a more defined type. Will return null not of the requested type.">ToDocument</a>()<span class="keyword">    const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01533"></a><a class="code" href="classTiXmlDocument.html#a1025d942a1f328fd742d545e37efdd42">01533</a>     <span class="keyword">virtual</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>*          <a class="code" href="classTiXmlDocument.html#a1025d942a1f328fd742d545e37efdd42" title="Cast to a more defined type. Will return null not of the requested type.">ToDocument</a>()          { <span class="keywordflow">return</span> <span class="keyword">this</span>; } 
+<a name="l01534"></a>01534 
+<a name="l01537"></a>01537     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#aa545aae325d9752ad64120bc4ecf939a" title="Walk the XML tree visiting this node and all of its children.">Accept</a>( <a class="code" href="classTiXmlVisitor.html" title="Implements the interface to the &quot;Visitor pattern&quot; (see the Accept() method...">TiXmlVisitor</a>* content ) <span class="keyword">const</span>;
+<a name="l01538"></a>01538 
+<a name="l01539"></a>01539 <span class="keyword">protected</span> :
+<a name="l01540"></a>01540     <span class="comment">// [internal use]</span>
+<a name="l01541"></a>01541     <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlDocument.html#a4968661cab4a1f44a23329c6f8db1907" title="Create an exact duplicate of this node and return it.">Clone</a>() <span class="keyword">const</span>;
+<a name="l01542"></a>01542 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01543"></a>01543 <span class="preprocessor"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag );
+<a name="l01544"></a>01544 <span class="preprocessor">    #endif</span>
+<a name="l01545"></a>01545 <span class="preprocessor"></span>
+<a name="l01546"></a>01546 <span class="keyword">private</span>:
+<a name="l01547"></a>01547     <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>* target ) <span class="keyword">const</span>;
+<a name="l01548"></a>01548 
+<a name="l01549"></a>01549     <span class="keywordtype">bool</span> error;
+<a name="l01550"></a>01550     <span class="keywordtype">int</span>  errorId;
+<a name="l01551"></a>01551     TIXML_STRING errorDesc;
+<a name="l01552"></a>01552     <span class="keywordtype">int</span> tabsize;
+<a name="l01553"></a>01553     TiXmlCursor errorLocation;
+<a name="l01554"></a>01554     <span class="keywordtype">bool</span> useMicrosoftBOM;       <span class="comment">// the UTF-8 BOM were found when read. Note this, and try to write.</span>
+<a name="l01555"></a>01555 };
+<a name="l01556"></a>01556 
+<a name="l01557"></a>01557 
+<a name="l01638"></a><a class="code" href="classTiXmlHandle.html">01638</a> <span class="keyword">class </span><a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a>
+<a name="l01639"></a>01639 {
+<a name="l01640"></a>01640 <span class="keyword">public</span>:
+<a name="l01642"></a><a class="code" href="classTiXmlHandle.html#aba18fd7bdefb942ecdea4bf4b8e29ec8">01642</a>     <a class="code" href="classTiXmlHandle.html#aba18fd7bdefb942ecdea4bf4b8e29ec8" title="Create a handle from any node (at any depth of the tree.) This can be a null pointer...">TiXmlHandle</a>( <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* _node )                 { this->node = _node; }
+<a name="l01644"></a><a class="code" href="classTiXmlHandle.html#a236d7855e1e56ccc7b980630c48c7fd7">01644</a>     <a class="code" href="classTiXmlHandle.html#a236d7855e1e56ccc7b980630c48c7fd7" title="Copy constructor.">TiXmlHandle</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a>& ref )           { this->node = ref.node; }
+<a name="l01645"></a>01645     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a>& ref ) { <span class="keywordflow">if</span> ( &ref != <span class="keyword">this</span> ) this->node = ref.node; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
+<a name="l01646"></a>01646 
+<a name="l01648"></a>01648     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#acdb1faaf88a700b40ca2c8d9aee21139" title="Return a handle to the first child node.">FirstChild</a>() <span class="keyword">const</span>;
+<a name="l01650"></a>01650     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#acdb1faaf88a700b40ca2c8d9aee21139" title="Return a handle to the first child node.">FirstChild</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>;
+<a name="l01652"></a>01652     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a24d1112e995e937e4dddb202d4113d4a" title="Return a handle to the first child element.">FirstChildElement</a>() <span class="keyword">const</span>;
+<a name="l01654"></a>01654     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a24d1112e995e937e4dddb202d4113d4a" title="Return a handle to the first child element.">FirstChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>;
+<a name="l01655"></a>01655 
+<a name="l01659"></a>01659     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a072492b4be1acdb0db2d03cd8f71ccc4" title="Return a handle to the &quot;index&quot; child with the given name.">Child</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* value, <span class="keywordtype">int</span> index ) <span class="keyword">const</span>;
+<a name="l01663"></a>01663     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a072492b4be1acdb0db2d03cd8f71ccc4" title="Return a handle to the &quot;index&quot; child with the given name.">Child</a>( <span class="keywordtype">int</span> index ) <span class="keyword">const</span>;
+<a name="l01668"></a>01668     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a979a3f850984a176ee884e394c7eed2d" title="Return a handle to the &quot;index&quot; child element with the given name.">ChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* value, <span class="keywordtype">int</span> index ) <span class="keyword">const</span>;
+<a name="l01673"></a>01673     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a979a3f850984a176ee884e394c7eed2d" title="Return a handle to the &quot;index&quot; child element with the given name.">ChildElement</a>( <span class="keywordtype">int</span> index ) <span class="keyword">const</span>;
+<a name="l01674"></a>01674 
+<a name="l01675"></a>01675 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01676"></a>01676 <span class="preprocessor"></span>    <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#acdb1faaf88a700b40ca2c8d9aee21139" title="Return a handle to the first child node.">FirstChild</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const               </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#acdb1faaf88a700b40ca2c8d9aee21139" title="Return a handle to the first child node.">FirstChild</a>( _value.c_str() ); }
+<a name="l01677"></a>01677     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a24d1112e995e937e4dddb202d4113d4a" title="Return a handle to the first child element.">FirstChildElement</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const        </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#a24d1112e995e937e4dddb202d4113d4a" title="Return a handle to the first child element.">FirstChildElement</a>( _value.c_str() ); }
+<a name="l01678"></a>01678 
+<a name="l01679"></a>01679     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a072492b4be1acdb0db2d03cd8f71ccc4" title="Return a handle to the &quot;index&quot; child with the given name.">Child</a>( <span class="keyword">const</span> std::string& _value, <span class="keywordtype">int</span> index )<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#a072492b4be1acdb0db2d03cd8f71ccc4" title="Return a handle to the &quot;index&quot; child with the given name.">Child</a>( _value.c_str(), index ); }
+<a name="l01680"></a>01680     <a class="code" href="classTiXmlHandle.html" title="A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly...">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#a979a3f850984a176ee884e394c7eed2d" title="Return a handle to the &quot;index&quot; child element with the given name.">ChildElement</a>( <span class="keyword">const</span> std::string& _value, <span class="keywordtype">int</span> index )<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#a979a3f850984a176ee884e394c7eed2d" title="Return a handle to the &quot;index&quot; child element with the given name.">ChildElement</a>( _value.c_str(), index ); }
+<a name="l01681"></a>01681 <span class="preprocessor">    #endif</span>
+<a name="l01682"></a>01682 <span class="preprocessor"></span>
+<a name="l01685"></a><a class="code" href="classTiXmlHandle.html#af678e5088e83be67baf76f699756f2c3">01685</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlHandle.html#af678e5088e83be67baf76f699756f2c3" title="Return the handle as a TiXmlNode.">ToNode</a>()<span class="keyword"> const           </span>{ <span class="keywordflow">return</span> node; } 
+<a name="l01688"></a><a class="code" href="classTiXmlHandle.html#abc6e7ed383a5fe1e52b0c0004b457b9e">01688</a>     <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlHandle.html#abc6e7ed383a5fe1e52b0c0004b457b9e" title="Return the handle as a TiXmlElement.">ToElement</a>()<span class="keyword"> const     </span>{ <span class="keywordflow">return</span> ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); }
+<a name="l01691"></a><a class="code" href="classTiXmlHandle.html#a4ac53a652296203a5b5e13854d923586">01691</a>     <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>* <a class="code" href="classTiXmlHandle.html#a4ac53a652296203a5b5e13854d923586" title="Return the handle as a TiXmlText.">ToText</a>()<span class="keyword"> const           </span>{ <span class="keywordflow">return</span> ( ( node && node->ToText() ) ? node->ToText() : 0 ); }
+<a name="l01694"></a><a class="code" href="classTiXmlHandle.html#a1381c17507a130767b1e23afc93b3674">01694</a>     <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>* <a class="code" href="classTiXmlHandle.html#a1381c17507a130767b1e23afc93b3674" title="Return the handle as a TiXmlUnknown.">ToUnknown</a>()<span class="keyword"> const     </span>{ <span class="keywordflow">return</span> ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); }
+<a name="l01695"></a>01695 
+<a name="l01699"></a><a class="code" href="classTiXmlHandle.html#ab44b723a8dc9af72838a303c079d0376">01699</a>     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* <a class="code" href="classTiXmlHandle.html#ab44b723a8dc9af72838a303c079d0376">Node</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#af678e5088e83be67baf76f699756f2c3" title="Return the handle as a TiXmlNode.">ToNode</a>(); } 
+<a name="l01703"></a><a class="code" href="classTiXmlHandle.html#acb5fe8388a526289ea65e817a51e05e7">01703</a>     <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>* <a class="code" href="classTiXmlHandle.html#acb5fe8388a526289ea65e817a51e05e7">Element</a>()<span class="keyword"> const   </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#abc6e7ed383a5fe1e52b0c0004b457b9e" title="Return the handle as a TiXmlElement.">ToElement</a>(); }
+<a name="l01707"></a><a class="code" href="classTiXmlHandle.html#a9fc739c8a18d160006f82572fc143d13">01707</a>     <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>* <a class="code" href="classTiXmlHandle.html#a9fc739c8a18d160006f82572fc143d13">Text</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#a4ac53a652296203a5b5e13854d923586" title="Return the handle as a TiXmlText.">ToText</a>(); }
+<a name="l01711"></a><a class="code" href="classTiXmlHandle.html#a49675b74357ba2aae124657a9a1ef465">01711</a>     <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>* <a class="code" href="classTiXmlHandle.html#a49675b74357ba2aae124657a9a1ef465">Unknown</a>()<span class="keyword"> const   </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#a1381c17507a130767b1e23afc93b3674" title="Return the handle as a TiXmlUnknown.">ToUnknown</a>(); }
+<a name="l01712"></a>01712 
+<a name="l01713"></a>01713 <span class="keyword">private</span>:
+<a name="l01714"></a>01714     <a class="code" href="classTiXmlNode.html" title="The parent class for everything in the Document Object Model.">TiXmlNode</a>* node;
+<a name="l01715"></a>01715 };
+<a name="l01716"></a>01716 
+<a name="l01717"></a>01717 
+<a name="l01737"></a><a class="code" href="classTiXmlPrinter.html">01737</a> <span class="keyword">class </span><a class="code" href="classTiXmlPrinter.html" title="Print to memory functionality.">TiXmlPrinter</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlVisitor.html" title="Implements the interface to the &quot;Visitor pattern&quot; (see the Accept() method...">TiXmlVisitor</a>
+<a name="l01738"></a>01738 {
+<a name="l01739"></a>01739 <span class="keyword">public</span>:
+<a name="l01740"></a>01740     <a class="code" href="classTiXmlPrinter.html" title="Print to memory functionality.">TiXmlPrinter</a>() : depth( 0 ), simpleTextPrint( <span class="keyword">false</span> ),
+<a name="l01741"></a>01741                      buffer(), indent( <span class="stringliteral">"    "</span> ), lineBreak( <span class="stringliteral">"\n"</span> ) {}
+<a name="l01742"></a>01742 
+<a name="l01743"></a>01743     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#a799f4f0388570cbb54c0d3c345fef7c1" title="Visit a document.">VisitEnter</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>& doc );
+<a name="l01744"></a>01744     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#a66b33edd76c538b462f789b797a4fdf2" title="Visit a document.">VisitExit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html" title="Always the top level node.">TiXmlDocument</a>& doc );
+<a name="l01745"></a>01745 
+<a name="l01746"></a>01746     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#a799f4f0388570cbb54c0d3c345fef7c1" title="Visit a document.">VisitEnter</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>& element, <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a>* firstAttribute );
+<a name="l01747"></a>01747     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#a66b33edd76c538b462f789b797a4fdf2" title="Visit a document.">VisitExit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html" title="The element is a container class.">TiXmlElement</a>& element );
+<a name="l01748"></a>01748 
+<a name="l01749"></a>01749     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#ace1b14d33eede2575c0743e2350f6a38" title="Visit a declaration.">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html" title="In correct XML the declaration is the first entry in the file.">TiXmlDeclaration</a>& declaration );
+<a name="l01750"></a>01750     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#ace1b14d33eede2575c0743e2350f6a38" title="Visit a declaration.">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlText.html" title="XML text.">TiXmlText</a>& text );
+<a name="l01751"></a>01751     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#ace1b14d33eede2575c0743e2350f6a38" title="Visit a declaration.">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html" title="An XML comment.">TiXmlComment</a>& comment );
+<a name="l01752"></a>01752     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#ace1b14d33eede2575c0743e2350f6a38" title="Visit a declaration.">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html" title="Any tag that tinyXml doesn&#39;t recognize is saved as an unknown.">TiXmlUnknown</a>& unknown );
+<a name="l01753"></a>01753 
+<a name="l01757"></a><a class="code" href="classTiXmlPrinter.html#a213377a4070c7e625bae59716b089e5e">01757</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlPrinter.html#a213377a4070c7e625bae59716b089e5e" title="Set the indent characters for printing.">SetIndent</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _indent )           { indent = _indent ? _indent : <span class="stringliteral">""</span> ; }
+<a name="l01759"></a><a class="code" href="classTiXmlPrinter.html#abb33ec7d4bad6aaeb57f4304394b133d">01759</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlPrinter.html#abb33ec7d4bad6aaeb57f4304394b133d" title="Query the indention string.">Indent</a>()                            { <span class="keywordflow">return</span> indent.c_str(); }
+<a name="l01764"></a><a class="code" href="classTiXmlPrinter.html#a4be1e37e69e3858c59635aa947174fe6">01764</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlPrinter.html#a4be1e37e69e3858c59635aa947174fe6" title="Set the line breaking string.">SetLineBreak</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _lineBreak )     { lineBreak = _lineBreak ? _lineBreak : <span class="stringliteral">""</span>; }
+<a name="l01766"></a><a class="code" href="classTiXmlPrinter.html#a11f1b4804a460b175ec244eb5724d96d">01766</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlPrinter.html#a11f1b4804a460b175ec244eb5724d96d" title="Query the current line breaking string.">LineBreak</a>()                         { <span class="keywordflow">return</span> lineBreak.c_str(); }
+<a name="l01767"></a>01767 
+<a name="l01771"></a><a class="code" href="classTiXmlPrinter.html#ab23a90629e374cb1cadca090468bbd19">01771</a>     <span class="keywordtype">void</span> <a class="code" href="classTiXmlPrinter.html#ab23a90629e374cb1cadca090468bbd19" title="Switch over to &quot;stream printing&quot; which is the most dense formatting without...">SetStreamPrinting</a>()                        { indent = <span class="stringliteral">""</span>;
+<a name="l01772"></a>01772                                                       lineBreak = <span class="stringliteral">""</span>;
+<a name="l01773"></a>01773                                                     }   
+<a name="l01775"></a><a class="code" href="classTiXmlPrinter.html#a859eede9597d3e0355b77757be48735e">01775</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlPrinter.html#a859eede9597d3e0355b77757be48735e" title="Return the result.">CStr</a>()                              { <span class="keywordflow">return</span> buffer.c_str(); }
+<a name="l01777"></a><a class="code" href="classTiXmlPrinter.html#ad01375ae9199bd2f48252eaddce3039d">01777</a>     <span class="keywordtype">size_t</span> <a class="code" href="classTiXmlPrinter.html#ad01375ae9199bd2f48252eaddce3039d" title="Return the length of the result string.">Size</a>()                                   { <span class="keywordflow">return</span> buffer.size(); }
+<a name="l01778"></a>01778 
+<a name="l01779"></a>01779 <span class="preprocessor">    #ifdef TIXML_USE_STL</span>
+<a name="l01781"></a><a class="code" href="classTiXmlPrinter.html#a3bd4daf44309b41f5813a833caa0d1c9">01781</a> <span class="preprocessor">    const std::string& Str()                        { return buffer; }</span>
+<a name="l01782"></a>01782 <span class="preprocessor"></span><span class="preprocessor">    #endif</span>
+<a name="l01783"></a>01783 <span class="preprocessor"></span>
+<a name="l01784"></a>01784 <span class="keyword">private</span>:
+<a name="l01785"></a>01785     <span class="keywordtype">void</span> DoIndent() {
+<a name="l01786"></a>01786         <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; i<depth; ++i )
+<a name="l01787"></a>01787             buffer += indent;
+<a name="l01788"></a>01788     }
+<a name="l01789"></a>01789     <span class="keywordtype">void</span> DoLineBreak() {
+<a name="l01790"></a>01790         buffer += lineBreak;
+<a name="l01791"></a>01791     }
+<a name="l01792"></a>01792 
+<a name="l01793"></a>01793     <span class="keywordtype">int</span> depth;
+<a name="l01794"></a>01794     <span class="keywordtype">bool</span> simpleTextPrint;
+<a name="l01795"></a>01795     TIXML_STRING buffer;
+<a name="l01796"></a>01796     TIXML_STRING indent;
+<a name="l01797"></a>01797     TIXML_STRING lineBreak;
+<a name="l01798"></a>01798 };
+<a name="l01799"></a>01799 
+<a name="l01800"></a>01800 
+<a name="l01801"></a>01801 <span class="preprocessor">#ifdef _MSC_VER</span>
+<a name="l01802"></a>01802 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( pop )</span>
+<a name="l01803"></a>01803 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
+<a name="l01804"></a>01804 <span class="preprocessor"></span>
+<a name="l01805"></a>01805 <span class="preprocessor">#endif</span>
+</pre></div></div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/docs/tutorial0.html b/Source/External/TinyXml/docs/tutorial0.html
new file mode 100644
index 0000000..d480780
--- /dev/null
+++ b/Source/External/TinyXml/docs/tutorial0.html
@@ -0,0 +1,720 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>TinyXml: TinyXML Tutorial</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<!-- Generated by Doxygen 1.6.2 -->
+<div class="navigation" id="top">
+  <div class="tabs">
+    <ul>
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
+      <li><a href="annotated.html"><span>Classes</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div class="navpath"><a class="el" href="index.html">index</a>
+  </div>
+</div>
+<div class="contents">
+
+
+<h1><a class="anchor" id="tutorial0">TinyXML Tutorial </a></h1><h1>What is this? </h1>
+<p>This tutorial has a few tips and suggestions on how to use TinyXML effectively.</p>
+<p>I've also tried to include some C++ tips like how to convert strings to integers and vice versa. This isn't anything to do with TinyXML itself, but it may helpful for your project so I've put it in anyway.</p>
+<p>If you don't know basic C++ concepts this tutorial won't be useful. Likewise if you don't know what a DOM is, look elsewhere first.</p>
+<h1>Before we start </h1>
+<p>Some example XML datasets/files will be used.</p>
+<p>example1.xml:</p>
+<div class="fragment"><pre class="fragment">
+<?xml version="1.0" ?>
+<Hello>World</Hello>
+</pre></div><p>example2.xml:</p>
+<div class="fragment"><pre class="fragment">
+<?xml version="1.0" ?>
+<poetry>
+	<verse>
+		Alas
+		  Great World
+			Alas (again)
+	</verse>
+</poetry>
+</pre></div><p>example3.xml:</p>
+<div class="fragment"><pre class="fragment">
+<?xml version="1.0" ?>
+<shapes>
+	<circle name="int-based" x="20" y="30" r="50" />
+	<point name="float-based" x="3.5" y="52.1" />
+</shapes>
+</pre></div><p>example4.xml</p>
+<div class="fragment"><pre class="fragment">
+<?xml version="1.0" ?>
+<MyApp>
+    <!-- Settings for MyApp -->
+    <Messages>
+        <Welcome>Welcome to MyApp</Welcome>
+        <Farewell>Thank you for using MyApp</Farewell>
+    </Messages>
+    <Windows>
+        <Window name="MainFrame" x="5" y="15" w="400" h="250" />
+    </Windows>
+    <Connection ip="192.168.0.1" timeout="123.456000" />
+</MyApp>
+</pre></div><h1>Getting Started </h1>
+<h2>Load XML from a file </h2>
+<p>The simplest way to load a file into a TinyXML DOM is:</p>
+<div class="fragment"><pre class="fragment">
+TiXmlDocument doc( "demo.xml" );
+doc.LoadFile();
+</pre></div><p>A more real-world usage is shown below. This will load the file and display the contents to STDOUT:</p>
+<div class="fragment"><pre class="fragment">
+// load the named file and dump its structure to STDOUT
+void dump_to_stdout(const char* pFilename)
+{
+	TiXmlDocument doc(pFilename);
+	bool loadOkay = doc.LoadFile();
+	if (loadOkay)
+	{
+		printf("\n%s:\n", pFilename);
+		dump_to_stdout( &doc ); // defined later in the tutorial
+	}
+	else
+	{
+		printf("Failed to load file \"%s\"\n", pFilename);
+	}
+}
+</pre></div><p>A simple demonstration of this function is to use a main like this:</p>
+<div class="fragment"><pre class="fragment">
+int main(void)
+{
+	dump_to_stdout("example1.xml");
+	return 0;
+}
+</pre></div><p>Recall that Example 1 XML is:</p>
+<div class="fragment"><pre class="fragment">
+<?xml version="1.0" ?>
+<Hello>World</Hello>
+</pre></div><p>Running the program with this XML will display this in the console/DOS window:</p>
+<div class="fragment"><pre class="fragment">
+DOCUMENT
++ DECLARATION
++ ELEMENT Hello
+  + TEXT[World]
+</pre></div><p>The ``dump_to_stdout`` function is defined later in this tutorial and is useful if you want to understand recursive traversal of a DOM.</p>
+<h2>Building Documents Programatically </h2>
+<p>This is how to build Example 1 pragmatically:</p>
+<div class="fragment"><pre class="fragment">
+void build_simple_doc( )
+{
+	// Make xml: <?xml ..><Hello>World</Hello>
+	TiXmlDocument doc;
+	TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" );
+	TiXmlElement * element = new TiXmlElement( "Hello" );
+	TiXmlText * text = new TiXmlText( "World" );
+	element->LinkEndChild( text );
+	doc.LinkEndChild( decl );
+	doc.LinkEndChild( element );
+	doc.SaveFile( "madeByHand.xml" );
+}
+</pre></div><p>This can be loaded and displayed on the console with:</p>
+<div class="fragment"><pre class="fragment">
+dump_to_stdout("madeByHand.xml"); // this func defined later in the tutorial
+</pre></div><p>and you'll see it is identical to Example 1:</p>
+<div class="fragment"><pre class="fragment">
+madeByHand.xml:
+Document
++ Declaration
++ Element [Hello]
+  + Text: [World]
+</pre></div><p>This code produces exactly the same XML DOM but it shows a different ordering to node creation and linking:</p>
+<div class="fragment"><pre class="fragment">
+void write_simple_doc2( )
+{
+	// same as write_simple_doc1 but add each node
+	// as early as possible into the tree.
+
+	TiXmlDocument doc;
+	TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" );
+	doc.LinkEndChild( decl );
+	
+	TiXmlElement * element = new TiXmlElement( "Hello" );
+	doc.LinkEndChild( element );
+	
+	TiXmlText * text = new TiXmlText( "World" );
+	element->LinkEndChild( text );
+	
+	doc.SaveFile( "madeByHand2.xml" );
+}
+</pre></div><p>Both of these produce the same XML, namely:</p>
+<div class="fragment"><pre class="fragment">
+<?xml version="1.0" ?>
+<Hello>World</Hello>
+</pre></div><p>Or in structure form:</p>
+<div class="fragment"><pre class="fragment">
+DOCUMENT
++ DECLARATION
++ ELEMENT Hello
+  + TEXT[World]
+</pre></div><h2>Attributes </h2>
+<p>Given an existing node, settings attributes is easy:</p>
+<div class="fragment"><pre class="fragment">
+window = new TiXmlElement( "Demo" );  
+window->SetAttribute("name", "Circle");
+window->SetAttribute("x", 5);
+window->SetAttribute("y", 15);
+window->SetDoubleAttribute("radius", 3.14159);
+</pre></div><p>You can it also work with the <a class="el" href="classTiXmlAttribute.html" title="An attribute is a name-value pair.">TiXmlAttribute</a> objects if you want.</p>
+<p>The following code shows one way (not the only way) to get all attributes of an element, print the name and string value, and if the value can be converted to an integer or double, print that value too:</p>
+<div class="fragment"><pre class="fragment">
+// print all attributes of pElement.
+// returns the number of attributes printed
+int dump_attribs_to_stdout(TiXmlElement* pElement, unsigned int indent)
+{
+	if ( !pElement ) return 0;
+
+	TiXmlAttribute* pAttrib=pElement->FirstAttribute();
+	int i=0;
+	int ival;
+	double dval;
+	const char* pIndent=getIndent(indent);
+	printf("\n");
+	while (pAttrib)
+	{
+		printf( "%s%s: value=[%s]", pIndent, pAttrib->Name(), pAttrib->Value());
+
+		if (pAttrib->QueryIntValue(&ival)==TIXML_SUCCESS)    printf( " int=%d", ival);
+		if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval);
+		printf( "\n" );
+		i++;
+		pAttrib=pAttrib->Next();
+	}
+	return i;
+}
+</pre></div><h2>Writing a document to a file </h2>
+<p>Writing a pre-built DOM to a file is trivial:</p>
+<div class="fragment"><pre class="fragment">
+doc.SaveFile( saveFilename );  
+</pre></div><p>Recall, for example, example 4:</p>
+<div class="fragment"><pre class="fragment">
+<?xml version="1.0" ?>
+<MyApp>
+    <!-- Settings for MyApp -->
+    <Messages>
+        <Welcome>Welcome to MyApp</Welcome>
+        <Farewell>Thank you for using MyApp</Farewell>
+    </Messages>
+    <Windows>
+        <Window name="MainFrame" x="5" y="15" w="400" h="250" />
+    </Windows>
+    <Connection ip="192.168.0.1" timeout="123.456000" />
+</MyApp>
+</pre></div><p>The following function builds this DOM and writes the file "appsettings.xml":</p>
+<div class="fragment"><pre class="fragment">
+void write_app_settings_doc( )  
+{  
+	TiXmlDocument doc;  
+	TiXmlElement* msg;
+ 	TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );  
+	doc.LinkEndChild( decl );  
+ 
+	TiXmlElement * root = new TiXmlElement( "MyApp" );  
+	doc.LinkEndChild( root );  
+
+	TiXmlComment * comment = new TiXmlComment();
+	comment->SetValue(" Settings for MyApp " );  
+	root->LinkEndChild( comment );  
+ 
+	TiXmlElement * msgs = new TiXmlElement( "Messages" );  
+	root->LinkEndChild( msgs );  
+ 
+	msg = new TiXmlElement( "Welcome" );  
+	msg->LinkEndChild( new TiXmlText( "Welcome to MyApp" ));  
+	msgs->LinkEndChild( msg );  
+ 
+	msg = new TiXmlElement( "Farewell" );  
+	msg->LinkEndChild( new TiXmlText( "Thank you for using MyApp" ));  
+	msgs->LinkEndChild( msg );  
+ 
+	TiXmlElement * windows = new TiXmlElement( "Windows" );  
+	root->LinkEndChild( windows );  
+
+	TiXmlElement * window;
+	window = new TiXmlElement( "Window" );  
+	windows->LinkEndChild( window );  
+	window->SetAttribute("name", "MainFrame");
+	window->SetAttribute("x", 5);
+	window->SetAttribute("y", 15);
+	window->SetAttribute("w", 400);
+	window->SetAttribute("h", 250);
+
+	TiXmlElement * cxn = new TiXmlElement( "Connection" );  
+	root->LinkEndChild( cxn );  
+	cxn->SetAttribute("ip", "192.168.0.1");
+	cxn->SetDoubleAttribute("timeout", 123.456); // floating point attrib
+	
+	dump_to_stdout( &doc );
+	doc.SaveFile( "appsettings.xml" );  
+} 
+</pre></div><p>The dump_to_stdout function will show this structure:</p>
+<div class="fragment"><pre class="fragment">
+Document
++ Declaration
++ Element [MyApp]
+ (No attributes)
+  + Comment: [ Settings for MyApp ]
+  + Element [Messages]
+ (No attributes)
+    + Element [Welcome]
+ (No attributes)
+      + Text: [Welcome to MyApp]
+    + Element [Farewell]
+ (No attributes)
+      + Text: [Thank you for using MyApp]
+  + Element [Windows]
+ (No attributes)
+    + Element [Window]
+      + name: value=[MainFrame]
+      + x: value=[5] int=5 d=5.0
+      + y: value=[15] int=15 d=15.0
+      + w: value=[400] int=400 d=400.0
+      + h: value=[250] int=250 d=250.0
+      5 attributes
+  + Element [Connection]
+    + ip: value=[192.168.0.1] int=192 d=192.2
+    + timeout: value=[123.456000] int=123 d=123.5
+    2 attributes
+</pre></div><p>I was surprised that TinyXml, by default, writes the XML in what other APIs call a "pretty" format - it modifies the whitespace of text of elements that contain other nodes so that writing the tree includes an indication of nesting level.</p>
+<p>I haven't looked yet to see if there is a way to turn off indenting when writing a file - its bound to be easy.</p>
+<p>[Lee: It's easy in STL mode, just use cout << myDoc. Non-STL mode is always in "pretty" format. Adding a switch would be a nice feature and has been requested.]</p>
+<h1>XML to/from C++ objects </h1>
+<h2>Intro </h2>
+<p>This example assumes you're loading and saving your app settings in an XML file, e.g. something like example4.xml.</p>
+<p>There are a number of ways to do this. For example, look into the TinyBind project at <a href="http://sourceforge.net/projects/tinybind">http://sourceforge.net/projects/tinybind</a></p>
+<p>This section shows a plain-old approach to loading and saving a basic object structure using XML.</p>
+<h2>Set up your object classes </h2>
+<p>Start off with some basic classes like these:</p>
+<div class="fragment"><pre class="fragment">
+#include <string>
+#include <map>
+using namespace std;
+
+typedef std::map<std::string,std::string> MessageMap;
+
+// a basic window abstraction - demo purposes only
+class WindowSettings
+{
+public:
+	int x,y,w,h;
+	string name;
+
+	WindowSettings()
+		: x(0), y(0), w(100), h(100), name("Untitled")
+	{
+	}
+
+	WindowSettings(int x, int y, int w, int h, const string& name)
+	{
+		this->x=x;
+		this->y=y;
+		this->w=w;
+		this->h=h;
+		this->name=name;
+	}
+};
+
+class ConnectionSettings
+{
+public:
+	string ip;
+	double timeout;
+};
+
+class AppSettings
+{
+public:
+	string m_name;
+	MessageMap m_messages;
+	list<WindowSettings> m_windows;
+	ConnectionSettings m_connection;
+
+	AppSettings() {}
+
+	void save(const char* pFilename);
+	void load(const char* pFilename);
+	
+	// just to show how to do it
+	void setDemoValues()
+	{
+		m_name="MyApp";
+		m_messages.clear();
+		m_messages["Welcome"]="Welcome to "+m_name;
+		m_messages["Farewell"]="Thank you for using "+m_name;
+		m_windows.clear();
+		m_windows.push_back(WindowSettings(15,15,400,250,"Main"));
+		m_connection.ip="Unknown";
+		m_connection.timeout=123.456;
+	}
+};
+</pre></div><p>This is a basic main() that shows how to create a default settings object tree, save it and load it again:</p>
+<div class="fragment"><pre class="fragment">
+int main(void)
+{
+	AppSettings settings;
+	
+	settings.save("appsettings2.xml");
+	settings.load("appsettings2.xml");
+	return 0;
+}
+</pre></div><p>The following main() shows creation, modification, saving and then loading of a settings structure:</p>
+<div class="fragment"><pre class="fragment">
+int main(void)
+{
+	// block: customise and save settings
+	{
+		AppSettings settings;
+		settings.m_name="HitchHikerApp";
+		settings.m_messages["Welcome"]="Don't Panic";
+		settings.m_messages["Farewell"]="Thanks for all the fish";
+		settings.m_windows.push_back(WindowSettings(15,25,300,250,"BookFrame"));
+		settings.m_connection.ip="192.168.0.77";
+		settings.m_connection.timeout=42.0;
+
+		settings.save("appsettings2.xml");
+	}
+	
+	// block: load settings
+	{
+		AppSettings settings;
+		settings.load("appsettings2.xml");
+		printf("%s: %s\n", settings.m_name.c_str(), 
+			settings.m_messages["Welcome"].c_str());
+		WindowSettings & w=settings.m_windows.front();
+		printf("%s: Show window '%s' at %d,%d (%d x %d)\n", 
+			settings.m_name.c_str(), w.name.c_str(), w.x, w.y, w.w, w.h);
+		printf("%s: %s\n", settings.m_name.c_str(), settings.m_messages["Farewell"].c_str());
+	}
+	return 0;
+}
+</pre></div><p>When the save() and load() are completed (see below), running this main() displays on the console:</p>
+<div class="fragment"><pre class="fragment">
+HitchHikerApp: Don't Panic
+HitchHikerApp: Show window 'BookFrame' at 15,25 (300 x 100)
+HitchHikerApp: Thanks for all the fish
+</pre></div><h2>Encode C++ state as XML </h2>
+<p>There are lots of different ways to approach saving this to a file. Here's one:</p>
+<div class="fragment"><pre class="fragment">
+void AppSettings::save(const char* pFilename)
+{
+	TiXmlDocument doc;  
+	TiXmlElement* msg;
+	TiXmlComment * comment;
+	string s;
+ 	TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );  
+	doc.LinkEndChild( decl ); 
+ 
+	TiXmlElement * root = new TiXmlElement(m_name.c_str());  
+	doc.LinkEndChild( root );  
+
+	comment = new TiXmlComment();
+	s=" Settings for "+m_name+" ";
+	comment->SetValue(s.c_str());  
+	root->LinkEndChild( comment );  
+
+	// block: messages
+	{
+		MessageMap::iterator iter;
+
+		TiXmlElement * msgs = new TiXmlElement( "Messages" );  
+		root->LinkEndChild( msgs );  
+ 
+		for (iter=m_messages.begin(); iter != m_messages.end(); iter++)
+		{
+			const string & key=(*iter).first;
+			const string & value=(*iter).second;
+			msg = new TiXmlElement(key.c_str());  
+			msg->LinkEndChild( new TiXmlText(value.c_str()));  
+			msgs->LinkEndChild( msg );  
+		}
+	}
+
+	// block: windows
+	{
+		TiXmlElement * windowsNode = new TiXmlElement( "Windows" );  
+		root->LinkEndChild( windowsNode );  
+
+		list<WindowSettings>::iterator iter;
+
+		for (iter=m_windows.begin(); iter != m_windows.end(); iter++)
+		{
+			const WindowSettings& w=*iter;
+
+			TiXmlElement * window;
+			window = new TiXmlElement( "Window" );  
+			windowsNode->LinkEndChild( window );  
+			window->SetAttribute("name", w.name.c_str());
+			window->SetAttribute("x", w.x);
+			window->SetAttribute("y", w.y);
+			window->SetAttribute("w", w.w);
+			window->SetAttribute("h", w.h);
+		}
+	}
+
+	// block: connection
+	{
+		TiXmlElement * cxn = new TiXmlElement( "Connection" );  
+		root->LinkEndChild( cxn );  
+		cxn->SetAttribute("ip", m_connection.ip.c_str());
+		cxn->SetDoubleAttribute("timeout", m_connection.timeout); 
+	}
+
+	doc.SaveFile(pFilename);  
+}
+</pre></div><p>Running this with the modified main produces this file:</p>
+<div class="fragment"><pre class="fragment">
+<?xml version="1.0" ?>
+<HitchHikerApp>
+    <!-- Settings for HitchHikerApp -->
+    <Messages>
+        <Farewell>Thanks for all the fish</Farewell>
+        <Welcome>Don&apos;t Panic</Welcome>
+    </Messages>
+    <Windows>
+        <Window name="BookFrame" x="15" y="25" w="300" h="250" />
+    </Windows>
+    <Connection ip="192.168.0.77" timeout="42.000000" />
+</HitchHikerApp>
+</pre></div><h2>Decoding state from XML </h2>
+<p>As with encoding objects, there are a number of approaches to decoding XML into your own C++ object structure. The following approach uses TiXmlHandles.</p>
+<div class="fragment"><pre class="fragment">
+void AppSettings::load(const char* pFilename)
+{
+	TiXmlDocument doc(pFilename);
+	if (!doc.LoadFile()) return;
+
+	TiXmlHandle hDoc(&doc);
+	TiXmlElement* pElem;
+	TiXmlHandle hRoot(0);
+
+	// block: name
+	{
+		pElem=hDoc.FirstChildElement().Element();
+		// should always have a valid root but handle gracefully if it does
+		if (!pElem) return;
+		m_name=pElem->Value();
+
+		// save this for later
+		hRoot=TiXmlHandle(pElem);
+	}
+
+	// block: string table
+	{
+		m_messages.clear(); // trash existing table
+
+		pElem=hRoot.FirstChild( "Messages" ).FirstChild().Element();
+		for( pElem; pElem; pElem=pElem->NextSiblingElement())
+		{
+			const char *pKey=pElem->Value();
+			const char *pText=pElem->GetText();
+			if (pKey && pText) 
+			{
+				m_messages[pKey]=pText;
+			}
+		}
+	}
+
+	// block: windows
+	{
+		m_windows.clear(); // trash existing list
+
+		TiXmlElement* pWindowNode=hRoot.FirstChild( "Windows" ).FirstChild().Element();
+		for( pWindowNode; pWindowNode; pWindowNode=pWindowNode->NextSiblingElement())
+		{
+			WindowSettings w;
+			const char *pName=pWindowNode->Attribute("name");
+			if (pName) w.name=pName;
+			
+			pWindowNode->QueryIntAttribute("x", &w.x); // If this fails, original value is left as-is
+			pWindowNode->QueryIntAttribute("y", &w.y);
+			pWindowNode->QueryIntAttribute("w", &w.w);
+			pWindowNode->QueryIntAttribute("hh", &w.h);
+
+			m_windows.push_back(w);
+		}
+	}
+
+	// block: connection
+	{
+		pElem=hRoot.FirstChild("Connection").Element();
+		if (pElem)
+		{
+			m_connection.ip=pElem->Attribute("ip");
+			pElem->QueryDoubleAttribute("timeout",&m_connection.timeout);
+		}
+	}
+}
+</pre></div><h1>Full listing for dump_to_stdout </h1>
+<p>Below is a copy-and-paste demo program for loading arbitrary XML files and dumping the structure to STDOUT using the recursive traversal listed above.</p>
+<div class="fragment"><pre class="fragment">
+// tutorial demo program
+#include "stdafx.h"
+#include "tinyxml.h"
+
+// ----------------------------------------------------------------------
+// STDOUT dump and indenting utility functions
+// ----------------------------------------------------------------------
+const unsigned int NUM_INDENTS_PER_SPACE=2;
+
+const char * getIndent( unsigned int numIndents )
+{
+	static const char * pINDENT="                                      + ";
+	static const unsigned int LENGTH=strlen( pINDENT );
+	unsigned int n=numIndents*NUM_INDENTS_PER_SPACE;
+	if ( n > LENGTH ) n = LENGTH;
+
+	return &pINDENT[ LENGTH-n ];
+}
+
+// same as getIndent but no "+" at the end
+const char * getIndentAlt( unsigned int numIndents )
+{
+	static const char * pINDENT="                                        ";
+	static const unsigned int LENGTH=strlen( pINDENT );
+	unsigned int n=numIndents*NUM_INDENTS_PER_SPACE;
+	if ( n > LENGTH ) n = LENGTH;
+
+	return &pINDENT[ LENGTH-n ];
+}
+
+int dump_attribs_to_stdout(TiXmlElement* pElement, unsigned int indent)
+{
+	if ( !pElement ) return 0;
+
+	TiXmlAttribute* pAttrib=pElement->FirstAttribute();
+	int i=0;
+	int ival;
+	double dval;
+	const char* pIndent=getIndent(indent);
+	printf("\n");
+	while (pAttrib)
+	{
+		printf( "%s%s: value=[%s]", pIndent, pAttrib->Name(), pAttrib->Value());
+
+		if (pAttrib->QueryIntValue(&ival)==TIXML_SUCCESS)    printf( " int=%d", ival);
+		if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval);
+		printf( "\n" );
+		i++;
+		pAttrib=pAttrib->Next();
+	}
+	return i;	
+}
+
+void dump_to_stdout( TiXmlNode* pParent, unsigned int indent = 0 )
+{
+	if ( !pParent ) return;
+
+	TiXmlNode* pChild;
+	TiXmlText* pText;
+	int t = pParent->Type();
+	printf( "%s", getIndent(indent));
+	int num;
+
+	switch ( t )
+	{
+	case TiXmlNode::TINYXML_DOCUMENT:
+		printf( "Document" );
+		break;
+
+	case TiXmlNode::TINYXML_ELEMENT:
+		printf( "Element [%s]", pParent->Value() );
+		num=dump_attribs_to_stdout(pParent->ToElement(), indent+1);
+		switch(num)
+		{
+			case 0:  printf( " (No attributes)"); break;
+			case 1:  printf( "%s1 attribute", getIndentAlt(indent)); break;
+			default: printf( "%s%d attributes", getIndentAlt(indent), num); break;
+		}
+		break;
+
+	case TiXmlNode::TINYXML_COMMENT:
+		printf( "Comment: [%s]", pParent->Value());
+		break;
+
+	case TiXmlNode::TINYXML_UNKNOWN:
+		printf( "Unknown" );
+		break;
+
+	case TiXmlNode::TINYXML_TEXT:
+		pText = pParent->ToText();
+		printf( "Text: [%s]", pText->Value() );
+		break;
+
+	case TiXmlNode::TINYXML_DECLARATION:
+		printf( "Declaration" );
+		break;
+	default:
+		break;
+	}
+	printf( "\n" );
+	for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling()) 
+	{
+		dump_to_stdout( pChild, indent+1 );
+	}
+}
+
+// load the named file and dump its structure to STDOUT
+void dump_to_stdout(const char* pFilename)
+{
+	TiXmlDocument doc(pFilename);
+	bool loadOkay = doc.LoadFile();
+	if (loadOkay)
+	{
+		printf("\n%s:\n", pFilename);
+		dump_to_stdout( &doc ); // defined later in the tutorial
+	}
+	else
+	{
+		printf("Failed to load file \"%s\"\n", pFilename);
+	}
+}
+
+// ----------------------------------------------------------------------
+// main() for printing files named on the command line
+// ----------------------------------------------------------------------
+int main(int argc, char* argv[])
+{
+	for (int i=1; i<argc; i++)
+	{
+		dump_to_stdout(argv[i]);
+	}
+	return 0;
+}
+</pre></div><p>Run this from the command line or a DOS window, e.g.:</p>
+<div class="fragment"><pre class="fragment">
+C:\dev\tinyxml> Debug\tinyxml_1.exe example1.xml
+
+example1.xml:
+Document
++ Declaration
++ Element [Hello]
+ (No attributes)
+  + Text: [World]
+</pre></div><p><em> Authors and Changes </p>
+<ul>
+<li>
+Written by Ellers, April, May, June 2005  </li>
+<li>
+Minor edits and integration into doc system, Lee Thomason September 2005  </li>
+<li>
+Updated by Ellers, October 2005  </li>
+</ul>
+<p></em> </p>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated by 
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
+</body>
+</html>
diff --git a/Source/External/TinyXml/readme.txt b/Source/External/TinyXml/readme.txt
new file mode 100644
index 0000000..8c2c6bb
--- /dev/null
+++ b/Source/External/TinyXml/readme.txt
@@ -0,0 +1,530 @@
+/** @mainpage
+
+<h1> TinyXML </h1>
+
+TinyXML is a simple, small, C++ XML parser that can be easily 
+integrated into other programs.
+
+<h2> What it does. </h2>
+	
+In brief, TinyXML parses an XML document, and builds from that a 
+Document Object Model (DOM) that can be read, modified, and saved.
+
+XML stands for "eXtensible Markup Language." It allows you to create 
+your own document markups. Where HTML does a very good job of marking 
+documents for browsers, XML allows you to define any kind of document 
+markup, for example a document that describes a "to do" list for an 
+organizer application. XML is a very structured and convenient format.
+All those random file formats created to store application data can 
+all be replaced with XML. One parser for everything.
+
+The best place for the complete, correct, and quite frankly hard to
+read spec is at <a href="http://www.w3.org/TR/2004/REC-xml-20040204/">
+http://www.w3.org/TR/2004/REC-xml-20040204/</a>. An intro to XML
+(that I really like) can be found at 
+<a href="http://skew.org/xml/tutorial/">http://skew.org/xml/tutorial</a>.
+
+There are different ways to access and interact with XML data.
+TinyXML uses a Document Object Model (DOM), meaning the XML data is parsed
+into a C++ objects that can be browsed and manipulated, and then 
+written to disk or another output stream. You can also construct an XML document 
+from scratch with C++ objects and write this to disk or another output
+stream.
+
+TinyXML is designed to be easy and fast to learn. It is two headers 
+and four cpp files. Simply add these to your project and off you go. 
+There is an example file - xmltest.cpp - to get you started. 
+
+TinyXML is released under the ZLib license, 
+so you can use it in open source or commercial code. The details
+of the license are at the top of every source file.
+
+TinyXML attempts to be a flexible parser, but with truly correct and
+compliant XML output. TinyXML should compile on any reasonably C++
+compliant system. It does not rely on exceptions or RTTI. It can be 
+compiled with or without STL support. TinyXML fully supports
+the UTF-8 encoding, and the first 64k character entities.
+
+
+<h2> What it doesn't do. </h2>
+
+TinyXML doesn't parse or use DTDs (Document Type Definitions) or XSLs
+(eXtensible Stylesheet Language.) There are other parsers out there 
+(check out www.sourceforge.org, search for XML) that are much more fully
+featured. But they are also much bigger, take longer to set up in
+your project, have a higher learning curve, and often have a more
+restrictive license. If you are working with browsers or have more
+complete XML needs, TinyXML is not the parser for you.
+
+The following DTD syntax will not parse at this time in TinyXML:
+
+ at verbatim
+	<!DOCTYPE Archiv [
+	 <!ELEMENT Comment (#PCDATA)>
+	]>
+ at endverbatim
+
+because TinyXML sees this as a !DOCTYPE node with an illegally 
+embedded !ELEMENT node. This may be addressed in the future.
+
+<h2> Tutorials. </h2>
+
+For the impatient, here is a tutorial to get you going. A great way to get started, 
+but it is worth your time to read this (very short) manual completely.
+
+- @subpage tutorial0
+
+<h2> Code Status.  </h2>
+
+TinyXML is mature, tested code. It is very stable. If you find
+bugs, please file a bug report on the sourceforge web site
+(www.sourceforge.net/projects/tinyxml). We'll get them straightened 
+out as soon as possible.
+
+There are some areas of improvement; please check sourceforge if you are
+interested in working on TinyXML.
+
+<h2> Related Projects </h2>
+
+TinyXML projects you may find useful! (Descriptions provided by the projects.)
+
+<ul>
+<li> <b>TinyXPath</b> (http://tinyxpath.sourceforge.net). TinyXPath is a small footprint 
+     XPath syntax decoder, written in C++.</li>
+<li> <b>TinyXML++</b> (http://code.google.com/p/ticpp/). TinyXML++ is a completely new 
+     interface to TinyXML that uses MANY of the C++ strengths. Templates, 
+	 exceptions, and much better error handling.</li>
+</ul>
+
+<h2> Features </h2>
+
+<h3> Using STL </h3>
+
+TinyXML can be compiled to use or not use STL. When using STL, TinyXML
+uses the std::string class, and fully supports std::istream, std::ostream,
+operator<<, and operator>>. Many API methods have both 'const char*' and
+'const std::string&' forms.
+
+When STL support is compiled out, no STL files are included whatsoever. All
+the string classes are implemented by TinyXML itself. API methods
+all use the 'const char*' form for input.
+
+Use the compile time #define:
+
+	TIXML_USE_STL
+
+to compile one version or the other. This can be passed by the compiler,
+or set as the first line of "tinyxml.h".
+
+Note: If compiling the test code in Linux, setting the environment
+variable TINYXML_USE_STL=YES/NO will control STL compilation. In the
+Windows project file, STL and non STL targets are provided. In your project,
+It's probably easiest to add the line "#define TIXML_USE_STL" as the first
+line of tinyxml.h.
+
+<h3> UTF-8 </h3>
+
+TinyXML supports UTF-8 allowing to manipulate XML files in any language. TinyXML
+also supports "legacy mode" - the encoding used before UTF-8 support and
+probably best described as "extended ascii".
+
+Normally, TinyXML will try to detect the correct encoding and use it. However,
+by setting the value of TIXML_DEFAULT_ENCODING in the header file, TinyXML
+can be forced to always use one encoding.
+
+TinyXML will assume Legacy Mode until one of the following occurs:
+<ol>
+	<li> If the non-standard but common "UTF-8 lead bytes" (0xef 0xbb 0xbf)
+		 begin the file or data stream, TinyXML will read it as UTF-8. </li>
+	<li> If the declaration tag is read, and it has an encoding="UTF-8", then
+		 TinyXML will read it as UTF-8. </li>
+	<li> If the declaration tag is read, and it has no encoding specified, then TinyXML will 
+		 read it as UTF-8. </li>
+	<li> If the declaration tag is read, and it has an encoding="something else", then TinyXML 
+		 will read it as Legacy Mode. In legacy mode, TinyXML will work as it did before. It's 
+		 not clear what that mode does exactly, but old content should keep working.</li>
+	<li> Until one of the above criteria is met, TinyXML runs in Legacy Mode.</li>
+</ol>
+
+What happens if the encoding is incorrectly set or detected? TinyXML will try
+to read and pass through text seen as improperly encoded. You may get some strange results or 
+mangled characters. You may want to force TinyXML to the correct mode.
+
+You may force TinyXML to Legacy Mode by using LoadFile( TIXML_ENCODING_LEGACY ) or
+LoadFile( filename, TIXML_ENCODING_LEGACY ). You may force it to use legacy mode all
+the time by setting TIXML_DEFAULT_ENCODING = TIXML_ENCODING_LEGACY. Likewise, you may 
+force it to TIXML_ENCODING_UTF8 with the same technique.
+
+For English users, using English XML, UTF-8 is the same as low-ASCII. You
+don't need to be aware of UTF-8 or change your code in any way. You can think
+of UTF-8 as a "superset" of ASCII.
+
+UTF-8 is not a double byte format - but it is a standard encoding of Unicode!
+TinyXML does not use or directly support wchar, TCHAR, or Microsoft's _UNICODE at this time. 
+It is common to see the term "Unicode" improperly refer to UTF-16, a wide byte encoding
+of unicode. This is a source of confusion.
+
+For "high-ascii" languages - everything not English, pretty much - TinyXML can
+handle all languages, at the same time, as long as the XML is encoded
+in UTF-8. That can be a little tricky, older programs and operating systems
+tend to use the "default" or "traditional" code page. Many apps (and almost all
+modern ones) can output UTF-8, but older or stubborn (or just broken) ones
+still output text in the default code page. 
+
+For example, Japanese systems traditionally use SHIFT-JIS encoding. 
+Text encoded as SHIFT-JIS can not be read by TinyXML. 
+A good text editor can import SHIFT-JIS and then save as UTF-8.
+
+The <a href="http://skew.org/xml/tutorial/">Skew.org link</a> does a great
+job covering the encoding issue.
+
+The test file "utf8test.xml" is an XML containing English, Spanish, Russian,
+and Simplified Chinese. (Hopefully they are translated correctly). The file
+"utf8test.gif" is a screen capture of the XML file, rendered in IE. Note that
+if you don't have the correct fonts (Simplified Chinese or Russian) on your
+system, you won't see output that matches the GIF file even if you can parse
+it correctly. Also note that (at least on my Windows machine) console output
+is in a Western code page, so that Print() or printf() cannot correctly display
+the file. This is not a bug in TinyXML - just an OS issue. No data is lost or 
+destroyed by TinyXML. The console just doesn't render UTF-8.
+
+
+<h3> Entities </h3>
+TinyXML recognizes the pre-defined "character entities", meaning special
+characters. Namely:
+
+ at verbatim
+	&	&
+	<	<
+	>	>
+	"	"
+	'	'
+ at endverbatim
+
+These are recognized when the XML document is read, and translated to there
+UTF-8 equivalents. For instance, text with the XML of:
+
+ at verbatim
+	Far & Away
+ at endverbatim
+
+will have the Value() of "Far & Away" when queried from the TiXmlText object,
+and will be written back to the XML stream/file as an ampersand. Older versions
+of TinyXML "preserved" character entities, but the newer versions will translate
+them into characters.
+
+Additionally, any character can be specified by its Unicode code point:
+The syntax "&#xA0;" or " " are both to the non-breaking space characher.
+
+<h3> Printing </h3>
+TinyXML can print output in several different ways that all have strengths and limitations.
+
+- Print( FILE* ). Output to a std-C stream, which includes all C files as well as stdout.
+	- "Pretty prints", but you don't have control over printing options.
+	- The output is streamed directly to the FILE object, so there is no memory overhead
+	  in the TinyXML code.
+	- used by Print() and SaveFile()
+
+- operator<<. Output to a c++ stream.
+	- Integrates with standart C++ iostreams.
+	- Outputs in "network printing" mode without line breaks. Good for network transmission
+	  and moving XML between C++ objects, but hard for a human to read.
+
+- TiXmlPrinter. Output to a std::string or memory buffer.
+	- API is less concise
+	- Future printing options will be put here.
+	- Printing may change slightly in future versions as it is refined and expanded.
+
+<h3> Streams </h3>
+With TIXML_USE_STL on TinyXML supports C++ streams (operator <<,>>) streams as well
+as C (FILE*) streams. There are some differences that you may need to be aware of.
+
+C style output:
+	- based on FILE*
+	- the Print() and SaveFile() methods
+
+	Generates formatted output, with plenty of white space, intended to be as 
+	human-readable as possible. They are very fast, and tolerant of ill formed 
+	XML documents. For example, an XML document that contains 2 root elements 
+	and 2 declarations, will still print.
+
+C style input:
+	- based on FILE*
+	- the Parse() and LoadFile() methods
+
+	A fast, tolerant read. Use whenever you don't need the C++ streams.
+
+C++ style output:
+	- based on std::ostream
+	- operator<<
+
+	Generates condensed output, intended for network transmission rather than
+	readability. Depending on your system's implementation of the ostream class,
+	these may be somewhat slower. (Or may not.) Not tolerant of ill formed XML:
+	a document should contain the correct one root element. Additional root level
+	elements will not be streamed out.
+
+C++ style input:
+	- based on std::istream
+	- operator>>
+
+	Reads XML from a stream, making it useful for network transmission. The tricky
+	part is knowing when the XML document is complete, since there will almost
+	certainly be other data in the stream. TinyXML will assume the XML data is
+	complete after it reads the root element. Put another way, documents that
+	are ill-constructed with more than one root element will not read correctly.
+	Also note that operator>> is somewhat slower than Parse, due to both 
+	implementation of the STL and limitations of TinyXML.
+
+<h3> White space </h3>
+The world simply does not agree on whether white space should be kept, or condensed.
+For example, pretend the '_' is a space, and look at "Hello____world". HTML, and 
+at least some XML parsers, will interpret this as "Hello_world". They condense white
+space. Some XML parsers do not, and will leave it as "Hello____world". (Remember
+to keep pretending the _ is a space.) Others suggest that __Hello___world__ should become
+Hello___world.
+
+It's an issue that hasn't been resolved to my satisfaction. TinyXML supports the
+first 2 approaches. Call TiXmlBase::SetCondenseWhiteSpace( bool ) to set the desired behavior.
+The default is to condense white space.
+
+If you change the default, you should call TiXmlBase::SetCondenseWhiteSpace( bool )
+before making any calls to Parse XML data, and I don't recommend changing it after
+it has been set.
+
+
+<h3> Handles </h3>
+
+Where browsing an XML document in a robust way, it is important to check
+for null returns from method calls. An error safe implementation can
+generate a lot of code like:
+
+ at verbatim
+TiXmlElement* root = document.FirstChildElement( "Document" );
+if ( root )
+{
+	TiXmlElement* element = root->FirstChildElement( "Element" );
+	if ( element )
+	{
+		TiXmlElement* child = element->FirstChildElement( "Child" );
+		if ( child )
+		{
+			TiXmlElement* child2 = child->NextSiblingElement( "Child" );
+			if ( child2 )
+			{
+				// Finally do something useful.
+ at endverbatim
+
+Handles have been introduced to clean this up. Using the TiXmlHandle class,
+the previous code reduces to:
+
+ at verbatim
+TiXmlHandle docHandle( &document );
+TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement();
+if ( child2 )
+{
+	// do something useful
+ at endverbatim
+
+Which is much easier to deal with. See TiXmlHandle for more information.
+
+
+<h3> Row and Column tracking </h3>
+Being able to track nodes and attributes back to their origin location
+in source files can be very important for some applications. Additionally,
+knowing where parsing errors occured in the original source can be very
+time saving.
+
+TinyXML can tracks the row and column origin of all nodes and attributes
+in a text file. The TiXmlBase::Row() and TiXmlBase::Column() methods return
+the origin of the node in the source text. The correct tabs can be 
+configured in TiXmlDocument::SetTabSize().
+
+
+<h2> Using and Installing </h2>
+
+To Compile and Run xmltest:
+
+A Linux Makefile and a Windows Visual C++ .dsw file is provided. 
+Simply compile and run. It will write the file demotest.xml to your 
+disk and generate output on the screen. It also tests walking the
+DOM by printing out the number of nodes found using different 
+techniques.
+
+The Linux makefile is very generic and runs on many systems - it 
+is currently tested on mingw and
+MacOSX. You do not need to run 'make depend'. The dependecies have been
+hard coded.
+
+<h3>Windows project file for VC6</h3>
+<ul>
+<li>tinyxml:		tinyxml library, non-STL </li>
+<li>tinyxmlSTL:		tinyxml library, STL </li>
+<li>tinyXmlTest:	test app, non-STL </li>
+<li>tinyXmlTestSTL: test app, STL </li>
+</ul>
+
+<h3>Makefile</h3>
+At the top of the makefile you can set:
+
+PROFILE, DEBUG, and TINYXML_USE_STL. Details (such that they are) are in
+the makefile.
+
+In the tinyxml directory, type "make clean" then "make". The executable
+file 'xmltest' will be created.
+
+
+
+<h3>To Use in an Application:</h3>
+
+Add tinyxml.cpp, tinyxml.h, tinyxmlerror.cpp, tinyxmlparser.cpp, tinystr.cpp, and tinystr.h to your
+project or make file. That's it! It should compile on any reasonably
+compliant C++ system. You do not need to enable exceptions or
+RTTI for TinyXML.
+
+
+<h2> How TinyXML works.  </h2>
+
+An example is probably the best way to go. Take:
+ at verbatim
+	<?xml version="1.0" standalone=no>
+	<!-- Our to do list data -->
+	<ToDo>
+		<Item priority="1"> Go to the <bold>Toy store!</bold></Item>
+		<Item priority="2"> Do bills</Item>
+	</ToDo>
+ at endverbatim
+
+Its not much of a To Do list, but it will do. To read this file 
+(say "demo.xml") you would create a document, and parse it in:
+ at verbatim
+	TiXmlDocument doc( "demo.xml" );
+	doc.LoadFile();
+ at endverbatim
+
+And its ready to go. Now lets look at some lines and how they 
+relate to the DOM.
+
+ at verbatim
+<?xml version="1.0" standalone=no>
+ at endverbatim
+
+	The first line is a declaration, and gets turned into the
+	TiXmlDeclaration class. It will be the first child of the
+	document node.
+	
+	This is the only directive/special tag parsed by TinyXML.
+	Generally directive tags are stored in TiXmlUnknown so the 
+	commands wont be lost when it is saved back to disk.
+
+ at verbatim
+<!-- Our to do list data -->
+ at endverbatim
+
+	A comment. Will become a TiXmlComment object.
+
+ at verbatim
+<ToDo>
+ at endverbatim
+
+	The "ToDo" tag defines a TiXmlElement object. This one does not have 
+	any attributes, but does contain 2 other elements.
+
+ at verbatim
+<Item priority="1"> 
+ at endverbatim
+
+	Creates another TiXmlElement which is a child of the "ToDo" element. 
+	This element has 1 attribute, with the name "priority" and the value 
+	"1".
+
+ at verbatim
+Go to the
+ at endverbatim 
+
+	A TiXmlText. This is a leaf node and cannot contain other nodes. 
+	It is a child of the "Item" TiXmlElement.
+
+ at verbatim
+<bold>
+ at endverbatim
+
+	
+	Another TiXmlElement, this one a child of the "Item" element.
+
+Etc.
+
+Looking at the entire object tree, you end up with:
+ at verbatim
+TiXmlDocument					"demo.xml"
+	TiXmlDeclaration			"version='1.0'" "standalone=no"
+	TiXmlComment				" Our to do list data"
+	TiXmlElement				"ToDo"
+		TiXmlElement			"Item" Attribtutes: priority = 1
+			TiXmlText			"Go to the "
+			TiXmlElement		"bold"
+				TiXmlText		"Toy store!"
+		TiXmlElement			"Item" Attributes: priority=2
+			TiXmlText			"Do bills"
+ at endverbatim
+
+<h2> Documentation </h2>
+
+The documentation is build with Doxygen, using the 'dox' 
+configuration file.
+
+<h2> License </h2>
+
+TinyXML is released under the zlib license:
+
+This software is provided 'as-is', without any express or implied 
+warranty. In no event will the authors be held liable for any 
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any 
+purpose, including commercial applications, and to alter it and 
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must 
+not claim that you wrote the original software. If you use this 
+software in a product, an acknowledgment in the product documentation 
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and 
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source 
+distribution.
+
+<h2> References  </h2>
+
+The World Wide Web Consortium is the definitive standard body for 
+XML, and their web pages contain huge amounts of information. 
+
+The definitive spec: <a href="http://www.w3.org/TR/2004/REC-xml-20040204/">
+http://www.w3.org/TR/2004/REC-xml-20040204/</a>
+
+I also recommend "XML Pocket Reference" by Robert Eckstein and published by 
+OReilly...the book that got the whole thing started.
+
+<h2> Contributors, Contacts, and a Brief History </h2>
+
+Thanks very much to everyone who sends suggestions, bugs, ideas, and 
+encouragement. It all helps, and makes this project fun. A special thanks
+to the contributors on the web pages that keep it lively.
+
+So many people have sent in bugs and ideas, that rather than list here 
+we try to give credit due in the "changes.txt" file.
+
+TinyXML was originally written by Lee Thomason. (Often the "I" still
+in the documentation.) Lee reviews changes and releases new versions,
+with the help of Yves Berquin, Andrew Ellerton, and the tinyXml community.
+
+We appreciate your suggestions, and would love to know if you 
+use TinyXML. Hopefully you will enjoy it and find it useful. 
+Please post questions, comments, file bugs, or contact us at:
+
+www.sourceforge.net/projects/tinyxml
+
+Lee Thomason, Yves Berquin, Andrew Ellerton
+*/
diff --git a/Source/External/TinyXml/tinystr.cpp b/Source/External/TinyXml/tinystr.cpp
index 35522bd..590df2d 100644
--- a/Source/External/TinyXml/tinystr.cpp
+++ b/Source/External/TinyXml/tinystr.cpp
@@ -1,6 +1,5 @@
 /*
 www.sourceforge.net/projects/tinyxml
-Original file by Yves Berquin.
 
 This software is provided 'as-is', without any express or implied
 warranty. In no event will the authors be held liable for any
@@ -22,10 +21,6 @@ must not be misrepresented as being the original software.
 distribution.
 */
 
-/*
- * THIS FILE WAS ALTERED BY Tyge L�vset, 7. April 2005.
- */
-
 
 #ifndef TIXML_USE_STL
 
diff --git a/Source/External/TinyXml/tinystr.h b/Source/External/TinyXml/tinystr.h
index 1e968f2..3ff0908 100644
--- a/Source/External/TinyXml/tinystr.h
+++ b/Source/External/TinyXml/tinystr.h
@@ -1,6 +1,5 @@
 /*
 www.sourceforge.net/projects/tinyxml
-Original file by Yves Berquin.
 
 This software is provided 'as-is', without any express or implied
 warranty. In no event will the authors be held liable for any
@@ -22,17 +21,6 @@ must not be misrepresented as being the original software.
 distribution.
 */
 
-/*
- * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005.
- *
- * - completely rewritten. compact, clean, and fast implementation.
- * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems)
- * - fixed reserve() to work as per specification.
- * - fixed buggy compares operator==(), operator<(), and operator>()
- * - fixed operator+=() to take a const ref argument, following spec.
- * - added "copy" constructor with length, and most compare operators.
- * - added swap(), clear(), size(), capacity(), operator+().
- */
 
 #ifndef TIXML_USE_STL
 
@@ -107,13 +95,11 @@ class TiXmlString
 		quit();
 	}
 
-	// = operator
 	TiXmlString& operator = (const char * copy)
 	{
 		return assign( copy, (size_type)strlen(copy));
 	}
 
-	// = operator
 	TiXmlString& operator = (const TiXmlString & copy)
 	{
 		return assign(copy.start(), copy.length());
diff --git a/Source/External/TinyXml/tinyxml.cpp b/Source/External/TinyXml/tinyxml.cpp
index 9214ee8..df75e72 100644
--- a/Source/External/TinyXml/tinyxml.cpp
+++ b/Source/External/TinyXml/tinyxml.cpp
@@ -1,6 +1,6 @@
 /*
 www.sourceforge.net/projects/tinyxml
-Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
+Original code by Lee Thomason (www.grinninglizard.com)
 
 This software is provided 'as-is', without any express or implied
 warranty. In no event will the authors be held liable for any
@@ -191,7 +191,8 @@ TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node )
 	if ( node->Type() == TiXmlNode::TINYXML_DOCUMENT )
 	{
 		delete node;
-		if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
+		if ( GetDocument() ) 
+			GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
 		return 0;
 	}
 
@@ -214,7 +215,8 @@ TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis )
 {
 	if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT )
 	{
-		if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
+		if ( GetDocument() ) 
+			GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
 		return 0;
 	}
 	TiXmlNode* node = addThis.Clone();
@@ -232,7 +234,8 @@ TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode&
 	}
 	if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT )
 	{
-		if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
+		if ( GetDocument() ) 
+			GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
 		return 0;
 	}
 
@@ -264,7 +267,8 @@ TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& a
 	}
 	if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT )
 	{
-		if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
+		if ( GetDocument() ) 
+			GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
 		return 0;
 	}
 
@@ -544,10 +548,11 @@ TiXmlElement::TiXmlElement( const TiXmlElement& copy)
 }
 
 
-void TiXmlElement::operator=( const TiXmlElement& base )
+TiXmlElement& TiXmlElement::operator=( const TiXmlElement& base )
 {
 	ClearThis();
 	base.CopyTo( this );
+	return *this;
 }
 
 
@@ -662,6 +667,45 @@ int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const
 }
 
 
+int TiXmlElement::QueryUnsignedAttribute( const char* name, unsigned* value ) const
+{
+	const TiXmlAttribute* node = attributeSet.Find( name );
+	if ( !node )
+		return TIXML_NO_ATTRIBUTE;
+
+	int ival = 0;
+	int result = node->QueryIntValue( &ival );
+	*value = (unsigned)ival;
+	return result;
+}
+
+
+int TiXmlElement::QueryBoolAttribute( const char* name, bool* bval ) const
+{
+	const TiXmlAttribute* node = attributeSet.Find( name );
+	if ( !node )
+		return TIXML_NO_ATTRIBUTE;
+	
+	int result = TIXML_WRONG_TYPE;
+	if (    StringEqual( node->Value(), "true", true, TIXML_ENCODING_UNKNOWN ) 
+		 || StringEqual( node->Value(), "yes", true, TIXML_ENCODING_UNKNOWN ) 
+		 || StringEqual( node->Value(), "1", true, TIXML_ENCODING_UNKNOWN ) ) 
+	{
+		*bval = true;
+		result = TIXML_SUCCESS;
+	}
+	else if (    StringEqual( node->Value(), "false", true, TIXML_ENCODING_UNKNOWN ) 
+			  || StringEqual( node->Value(), "no", true, TIXML_ENCODING_UNKNOWN ) 
+			  || StringEqual( node->Value(), "0", true, TIXML_ENCODING_UNKNOWN ) ) 
+	{
+		*bval = false;
+		result = TIXML_SUCCESS;
+	}
+	return result;
+}
+
+
+
 #ifdef TIXML_USE_STL
 int TiXmlElement::QueryIntAttribute( const std::string& name, int* ival ) const
 {
@@ -899,10 +943,11 @@ TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode
 }
 
 
-void TiXmlDocument::operator=( const TiXmlDocument& copy )
+TiXmlDocument& TiXmlDocument::operator=( const TiXmlDocument& copy )
 {
 	Clear();
 	copy.CopyTo( this );
+	return *this;
 }
 
 
@@ -1171,7 +1216,7 @@ void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) cons
 
 	if (value.find ('\"') == TIXML_STRING::npos) {
 		if ( cfile ) {
-		fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() );
+			fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() );
 		}
 		if ( str ) {
 			(*str) += n; (*str) += "=\""; (*str) += v; (*str) += "\"";
@@ -1179,7 +1224,7 @@ void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) cons
 	}
 	else {
 		if ( cfile ) {
-		fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() );
+			fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() );
 		}
 		if ( str ) {
 			(*str) += n; (*str) += "='"; (*str) += v; (*str) += "'";
@@ -1241,10 +1286,11 @@ TiXmlComment::TiXmlComment( const TiXmlComment& copy ) : TiXmlNode( TiXmlNode::T
 }
 
 
-void TiXmlComment::operator=( const TiXmlComment& base )
+TiXmlComment& TiXmlComment::operator=( const TiXmlComment& base )
 {
 	Clear();
 	base.CopyTo( this );
+	return *this;
 }
 
 
@@ -1361,10 +1407,11 @@ TiXmlDeclaration::TiXmlDeclaration( const TiXmlDeclaration& copy )
 }
 
 
-void TiXmlDeclaration::operator=( const TiXmlDeclaration& copy )
+TiXmlDeclaration& TiXmlDeclaration::operator=( const TiXmlDeclaration& copy )
 {
 	Clear();
 	copy.CopyTo( this );
+	return *this;
 }
 
 
diff --git a/Source/External/TinyXml/tinyxml.h b/Source/External/TinyXml/tinyxml.h
index 3d2d0d5..d051548 100644
--- a/Source/External/TinyXml/tinyxml.h
+++ b/Source/External/TinyXml/tinyxml.h
@@ -1,6 +1,6 @@
 /*
 www.sourceforge.net/projects/tinyxml
-Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
+Original code by Lee Thomason (www.grinninglizard.com)
 
 This software is provided 'as-is', without any express or implied
 warranty. In no event will the authors be held liable for any
@@ -91,7 +91,7 @@ class TiXmlParsingData;
 
 const int TIXML_MAJOR_VERSION = 2;
 const int TIXML_MINOR_VERSION = 6;
-const int TIXML_PATCH_VERSION = 1;
+const int TIXML_PATCH_VERSION = 2;
 
 /*	Internal structure for tracking location of items 
 	in the XML file.
@@ -146,7 +146,7 @@ public:
 	virtual bool Visit( const TiXmlText& /*text*/ )					{ return true; }
 	/// Visit a comment node
 	virtual bool Visit( const TiXmlComment& /*comment*/ )			{ return true; }
-	/// Visit an unknow node
+	/// Visit an unknown node
 	virtual bool Visit( const TiXmlUnknown& /*unknown*/ )			{ return true; }
 };
 
@@ -678,8 +678,8 @@ public:
 	#endif
 
 	/** Query the type (as an enumerated value, above) of this node.
-		The possible types are: DOCUMENT, ELEMENT, COMMENT,
-								UNKNOWN, TEXT, and DECLARATION.
+		The possible types are: TINYXML_DOCUMENT, TINYXML_ELEMENT, TINYXML_COMMENT,
+								TINYXML_UNKNOWN, TINYXML_TEXT, and TINYXML_DECLARATION.
 	*/
 	int Type() const	{ return type; }
 
@@ -950,7 +950,7 @@ public:
 
 	TiXmlElement( const TiXmlElement& );
 
-	void operator=( const TiXmlElement& base );
+	TiXmlElement& operator=( const TiXmlElement& base );
 
 	virtual ~TiXmlElement();
 
@@ -983,6 +983,13 @@ public:
 		does not exist, then TIXML_NO_ATTRIBUTE is returned.
 	*/	
 	int QueryIntAttribute( const char* name, int* _value ) const;
+	/// QueryUnsignedAttribute examines the attribute - see QueryIntAttribute().
+	int QueryUnsignedAttribute( const char* name, unsigned* _value ) const;
+	/** QueryBoolAttribute examines the attribute - see QueryIntAttribute(). 
+		Note that '1', 'true', or 'yes' are considered true, while '0', 'false'
+		and 'no' are considered false.
+	*/
+	int QueryBoolAttribute( const char* name, bool* _value ) const;
 	/// QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
 	int QueryDoubleAttribute( const char* name, double* _value ) const;
 	/// QueryFloatAttribute examines the attribute - see QueryIntAttribute().
@@ -1162,7 +1169,7 @@ public:
 		SetValue( _value );
 	}
 	TiXmlComment( const TiXmlComment& );
-	void operator=( const TiXmlComment& base );
+	TiXmlComment& operator=( const TiXmlComment& base );
 
 	virtual ~TiXmlComment()	{}
 
@@ -1176,8 +1183,8 @@ public:
 	*/
 	virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
 
-	virtual const TiXmlComment*  ToComment() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
-	virtual TiXmlComment*  ToComment() { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual const TiXmlComment*  ToComment() const	{ return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual		  TiXmlComment*  ToComment()		{ return this; } ///< Cast to a more defined type. Will return null not of the requested type.
 
 	/** Walk the XML tree visiting this node and all of its children. 
 	*/
@@ -1227,7 +1234,7 @@ public:
 	#endif
 
 	TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TINYXML_TEXT )	{ copy.CopyTo( this ); }
-	void operator=( const TiXmlText& base )							 	{ base.CopyTo( this ); }
+	TiXmlText& operator=( const TiXmlText& base )							 	{ base.CopyTo( this ); return *this; }
 
 	// Write this text object to a FILE stream.
 	virtual void Print( FILE* cfile, int depth ) const;
@@ -1294,7 +1301,7 @@ public:
 						const char* _standalone );
 
 	TiXmlDeclaration( const TiXmlDeclaration& copy );
-	void operator=( const TiXmlDeclaration& copy );
+	TiXmlDeclaration& operator=( const TiXmlDeclaration& copy );
 
 	virtual ~TiXmlDeclaration()	{}
 
@@ -1351,7 +1358,7 @@ public:
 	virtual ~TiXmlUnknown() {}
 
 	TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::TINYXML_UNKNOWN )		{ copy.CopyTo( this ); }
-	void operator=( const TiXmlUnknown& copy )										{ copy.CopyTo( this ); }
+	TiXmlUnknown& operator=( const TiXmlUnknown& copy )										{ copy.CopyTo( this ); return *this; }
 
 	/// Creates a copy of this Unknown and returns it.
 	virtual TiXmlNode* Clone() const;
@@ -1360,8 +1367,8 @@ public:
 
 	virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
 
-	virtual const TiXmlUnknown*     ToUnknown()     const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
-	virtual TiXmlUnknown*           ToUnknown()	    { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual const TiXmlUnknown*     ToUnknown()     const	{ return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual TiXmlUnknown*           ToUnknown()				{ return this; } ///< Cast to a more defined type. Will return null not of the requested type.
 
 	/** Walk the XML tree visiting this node and all of its children. 
 	*/
@@ -1397,7 +1404,7 @@ public:
 	#endif
 
 	TiXmlDocument( const TiXmlDocument& copy );
-	void operator=( const TiXmlDocument& copy );
+	TiXmlDocument& operator=( const TiXmlDocument& copy );
 
 	virtual ~TiXmlDocument() {}
 
@@ -1635,7 +1642,7 @@ public:
 	TiXmlHandle( TiXmlNode* _node )					{ this->node = _node; }
 	/// Copy constructor
 	TiXmlHandle( const TiXmlHandle& ref )			{ this->node = ref.node; }
-	TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; }
+	TiXmlHandle operator=( const TiXmlHandle& ref ) { if ( &ref != this ) this->node = ref.node; return *this; }
 
 	/// Return a handle to the first child node.
 	TiXmlHandle FirstChild() const;
@@ -1796,4 +1803,3 @@ private:
 #endif
 
 #endif
-
diff --git a/Source/External/TinyXml/tinyxmlerror.cpp b/Source/External/TinyXml/tinyxmlerror.cpp
index 877b5bf..0b273e6 100644
--- a/Source/External/TinyXml/tinyxmlerror.cpp
+++ b/Source/External/TinyXml/tinyxmlerror.cpp
@@ -31,7 +31,7 @@ distribution.
 // It also cleans up the code a bit.
 //
 
-const char* TiXmlBase::errorString[TiXmlBase::TIXML_ERROR_STRING_COUNT] =
+const char* TiXmlBase::errorString[ TiXmlBase::TIXML_ERROR_STRING_COUNT ] =
 {
 	"No error",
 	"Error",
diff --git a/Source/External/TinyXml/tinyxmlparser.cpp b/Source/External/TinyXml/tinyxmlparser.cpp
index 8639a0e..e763833 100644
--- a/Source/External/TinyXml/tinyxmlparser.cpp
+++ b/Source/External/TinyXml/tinyxmlparser.cpp
@@ -1,6 +1,6 @@
 /*
 www.sourceforge.net/projects/tinyxml
-Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com)
+Original code by Lee Thomason (www.grinninglizard.com)
 
 This software is provided 'as-is', without any express or implied 
 warranty. In no event will the authors be held liable for any 
@@ -40,7 +40,7 @@ distribution.
 // Note tha "PutString" hardcodes the same list. This
 // is less flexible than it appears. Changing the entries
 // or order will break putstring.	
-TiXmlBase::Entity TiXmlBase::entity[ TiXmlBase::NUM_ENTITY ] =
+TiXmlBase::Entity TiXmlBase::entity[ TiXmlBase::NUM_ENTITY ] = 
 {
 	{ "&",  5, '&' },
 	{ "<",   4, '<' },
@@ -174,7 +174,7 @@ class TiXmlParsingData
   public:
 	void Stamp( const char* now, TiXmlEncoding encoding );
 
-	const TiXmlCursor& Cursor()	{ return cursor; }
+	const TiXmlCursor& Cursor() const	{ return cursor; }
 
   private:
 	// Only used by the document!
@@ -631,9 +631,9 @@ const char* TiXmlBase::ReadText(	const char* p,
 			}
 		}
 	}
-	if ( p && *p ) 
+	if ( p && *p )
 		p += strlen( endTag );
-	return p;
+	return ( p && *p ) ? p : 0;
 }
 
 #ifdef TIXML_USE_STL
@@ -1298,9 +1298,10 @@ const char* TiXmlUnknown::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
 
 	if ( !p )
 	{
-		if ( document )	document->SetError( TIXML_ERROR_PARSING_UNKNOWN, 0, 0, encoding );
+		if ( document )	
+			document->SetError( TIXML_ERROR_PARSING_UNKNOWN, 0, 0, encoding );
 	}
-	if ( *p == '>' )
+	if ( p && *p == '>' )
 		return p+1;
 	return p;
 }
@@ -1350,7 +1351,8 @@ const char* TiXmlComment::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc
 
 	if ( !StringEqual( p, startTag, false, encoding ) )
 	{
-		document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding );
+		if ( document )
+			document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding );
 		return 0;
 	}
 	p += strlen( startTag );
@@ -1512,7 +1514,8 @@ const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncodi
 
 		if ( !StringEqual( p, startTag, false, encoding ) )
 		{
-			document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding );
+			if ( document )
+				document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding );
 			return 0;
 		}
 		p += strlen( startTag );
@@ -1536,7 +1539,7 @@ const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncodi
 
 		const char* end = "<";
 		p = ReadText( p, &value, ignoreWhite, end, false, encoding );
-		if ( p )
+		if ( p && *p )
 			return p-1;	// don't truncate the '<'
 		return 0;
 	}
diff --git a/Source/Modules/Common/DataRecords.cpp b/Source/Modules/Common/DataRecords.cpp
index 5b7f86d..37e8dcd 100644
--- a/Source/Modules/Common/DataRecords.cpp
+++ b/Source/Modules/Common/DataRecords.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -26,17 +26,19 @@
 const RecordingHeader DEFAULT_RECORDING_HEADER = 
 {
 	{'N','I','1','0'}, //Magic
-	{1, 0, 0, 6}, //Version 
+	{1, 0, 1, 0}, //Version
 	0, //Global max timestamp
 	0 //Max node id
 };
 
 const XnUInt32 Record::MAGIC = 0x0052494E; //It reads "NIR\0"
 
-Record::Record(XnUInt8* pData, XnUInt32 nMaxSize) : 
+Record::Record(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) : 
 	m_pData(pData),
 	m_nMaxSize(nMaxSize),
-	m_nReadOffset(0)
+	m_nReadOffset(0),
+	m_bUseOld32Header(bUseOld32Header),
+	HEADER_SIZE(bUseOld32Header ? HEADER_SIZE_old32 : HEADER_SIZE_current)
 {
 	XN_ASSERT(m_pData != NULL);
 	XN_ASSERT(m_nMaxSize >= HEADER_SIZE);
@@ -48,14 +50,16 @@ Record::Record(XnUInt8* pData, XnUInt32 nMaxSize) :
 Record::Record(const Record &other) :
 	m_pData(other.m_pData),
 	m_nMaxSize(other.m_nMaxSize),
-	m_nReadOffset(other.m_nReadOffset)
+	m_nReadOffset(other.m_nReadOffset),
+	m_bUseOld32Header(other.m_bUseOld32Header),
+	HEADER_SIZE(other.HEADER_SIZE)
 {
 	//We don't set the header info here, cuz it was already set by the other record
 }
 
-XnUInt32 Record::GetType() const
+RecordType Record::GetType() const
 {
-	return m_pHeader->m_nRecordType;
+	return (RecordType)m_pHeader->m_nRecordType;
 }
 
 XnUInt32 Record::GetNodeID() const
@@ -73,9 +77,12 @@ XnUInt32 Record::GetPayloadSize() const
 	return m_pHeader->m_nPayloadSize;
 }
 
-XnUInt32 Record::GetUndoRecordPos() const
+XnUInt64 Record::GetUndoRecordPos() const
 {
-	return m_pHeader->m_nUndoRecordPos;
+	if (m_bUseOld32Header)
+		return ((Header_old32 *)m_pHeader)->m_nUndoRecordPos;
+	else
+		return m_pHeader->m_nUndoRecordPos;
 }
 
 void Record::SetNodeID(XnUInt32 nNodeID)
@@ -88,7 +95,7 @@ void Record::SetPayloadSize(XnUInt32 nPayloadSize)
 	m_pHeader->m_nPayloadSize = nPayloadSize;
 }
 
-void Record::SetUndoRecordPos(XnUInt32 nUndoRecordPos)
+void Record::SetUndoRecordPos(XnUInt64 nUndoRecordPos)
 {
 	m_pHeader->m_nUndoRecordPos = nUndoRecordPos;
 }
@@ -258,8 +265,8 @@ XnStatus Record::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt32& nCharsWritt
 /****************************/
 /* NodeAdded_1_0_0_4_Record */
 /****************************/
-NodeAdded_1_0_0_4_Record::NodeAdded_1_0_0_4_Record(XnUInt8* pData, XnUInt32 nMaxSize) :
-	Record(pData, nMaxSize), m_strNodeName(NULL), m_type(XnProductionNodeType(0))
+NodeAdded_1_0_0_4_Record::NodeAdded_1_0_0_4_Record(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) :
+	Record(pData, nMaxSize, bUseOld32Header), m_strNodeName(NULL), m_type(XnProductionNodeType(0))
 {
 	xnOSMemSet(&m_compression, 0, sizeof(m_compression));
 }
@@ -369,8 +376,8 @@ XnStatus NodeAdded_1_0_0_4_Record::AsString(XnChar* strDest, XnUInt32 nSize, XnU
 /****************************/
 /* NodeAdded_1_0_0_5_Record */
 /****************************/
-NodeAdded_1_0_0_5_Record::NodeAdded_1_0_0_5_Record(XnUInt8* pData, XnUInt32 nMaxSize) :
-	NodeAdded_1_0_0_4_Record(pData, nMaxSize), m_nNumberOfFrames(0), m_nMinTimestamp(0), m_nMaxTimestamp(0)
+NodeAdded_1_0_0_5_Record::NodeAdded_1_0_0_5_Record(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) :
+	NodeAdded_1_0_0_4_Record(pData, nMaxSize, bUseOld32Header), m_nNumberOfFrames(0), m_nMinTimestamp(0), m_nMaxTimestamp(0)
 {
 }
 
@@ -479,8 +486,8 @@ XnStatus NodeAdded_1_0_0_5_Record::AsString(XnChar* strDest, XnUInt32 nSize, XnU
 /****************************/
 /* NodeAddedRecord          */
 /****************************/
-NodeAddedRecord::NodeAddedRecord(XnUInt8* pData, XnUInt32 nMaxSize) :
-	NodeAdded_1_0_0_5_Record(pData, nMaxSize), m_nSeekTablePosition(0)
+NodeAddedRecord::NodeAddedRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) :
+	NodeAdded_1_0_0_5_Record(pData, nMaxSize, bUseOld32Header), m_nSeekTablePosition(0)
 {
 }
 
@@ -489,12 +496,12 @@ NodeAddedRecord::NodeAddedRecord(const Record& record) :
 {
 }
 
-void NodeAddedRecord::SetSeekTablePosition(XnUInt32 nPos)
+void NodeAddedRecord::SetSeekTablePosition(XnUInt64 nPos)
 {
 	m_nSeekTablePosition = nPos;
 }
 
-XnUInt32 NodeAddedRecord::GetSeekTablePosition()
+XnUInt64 NodeAddedRecord::GetSeekTablePosition()
 {
 	return m_nSeekTablePosition;
 }
@@ -518,7 +525,10 @@ XnStatus NodeAddedRecord::Decode()
 	XN_IS_STATUS_OK(nRetVal);
 	nRetVal = NodeAdded_1_0_0_5_Record::DecodeImpl();
 	XN_IS_STATUS_OK(nRetVal);
-	nRetVal = Read(&m_nSeekTablePosition, sizeof(m_nSeekTablePosition));
+	if (m_bUseOld32Header)
+		nRetVal = Read(&m_nSeekTablePosition, sizeof(XnUInt32));
+	else
+		nRetVal = Read(&m_nSeekTablePosition, sizeof(m_nSeekTablePosition));
 	XN_IS_STATUS_OK(nRetVal);
 	return XN_STATUS_OK;
 }
@@ -540,8 +550,8 @@ XnStatus NodeAddedRecord::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt32& nC
 /*********************/
 /* NodeRemovedRecord */
 /*********************/
-NodeRemovedRecord::NodeRemovedRecord(XnUInt8* pData, XnUInt32 nMaxSize) :
-	Record(pData, nMaxSize)
+NodeRemovedRecord::NodeRemovedRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) :
+	Record(pData, nMaxSize, bUseOld32Header)
 {
 }
 
@@ -571,9 +581,9 @@ XnStatus NodeRemovedRecord::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt32&
 /*********************/
 /* GeneralPropRecord */
 /*********************/
-GeneralPropRecord::GeneralPropRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnUInt32 nPropRecordType /*= RECORD_GENERAL_PROPERTY*/) : 
+GeneralPropRecord::GeneralPropRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header, XnUInt32 nPropRecordType /*= RECORD_GENERAL_PROPERTY*/) : 
 	m_nPropRecordType(nPropRecordType),
-	Record(pData, nMaxSize), 
+	Record(pData, nMaxSize, bUseOld32Header), 
 	m_strPropName(NULL),
 	m_nPropDataSize(0),
 	m_pPropData(NULL)
@@ -645,7 +655,7 @@ XnStatus GeneralPropRecord::Decode()
 	//The property data is not copied but just pointed to
 	XnUInt8* pData = const_cast<XnUInt8*>(GetReadPos());
 
-#if (XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_ARC)
+#if (XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_ARC || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
 	// under ARM we have some alignment issues. Move this buffer so it will be aligned.
 	XnUInt32 nAlignFix = XN_DEFAULT_MEM_ALIGN - ((XnUInt32)pData % XN_DEFAULT_MEM_ALIGN);
 	if (nAlignFix != 0)
@@ -678,8 +688,8 @@ XnStatus GeneralPropRecord::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt32&
 /*****************/
 /* IntPropRecord */
 /*****************/
-IntPropRecord::IntPropRecord(XnUInt8* pData, XnUInt32 nMaxSize) :
-	GeneralPropRecord(pData, nMaxSize, RECORD_INT_PROPERTY),
+IntPropRecord::IntPropRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) :
+	GeneralPropRecord(pData, nMaxSize, bUseOld32Header, RECORD_INT_PROPERTY),
 	m_nValue(0)
 {
 }
@@ -717,8 +727,8 @@ XnStatus IntPropRecord::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt32& nCha
 /******************/
 /* RealPropRecord */
 /******************/
-RealPropRecord::RealPropRecord(XnUInt8* pData, XnUInt32 nMaxSize) :
-	GeneralPropRecord(pData, nMaxSize, RECORD_REAL_PROPERTY),
+RealPropRecord::RealPropRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) :
+	GeneralPropRecord(pData, nMaxSize, bUseOld32Header, RECORD_REAL_PROPERTY),
 	m_dValue(0)
 {
 }
@@ -756,8 +766,8 @@ XnStatus RealPropRecord::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt32& nCh
 /********************/
 /* StringPropRecord */
 /********************/
-StringPropRecord::StringPropRecord(XnUInt8* pData, XnUInt32 nMaxSize) : 
-	GeneralPropRecord(pData, nMaxSize, RECORD_STRING_PROPERTY)
+StringPropRecord::StringPropRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) : 
+	GeneralPropRecord(pData, nMaxSize, bUseOld32Header, RECORD_STRING_PROPERTY)
 {
 }
 
@@ -793,8 +803,8 @@ XnStatus StringPropRecord::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt32& n
 /***********************/
 /* NodeDataBeginRecord */
 /***********************/
-NodeDataBeginRecord::NodeDataBeginRecord(XnUInt8* pData, XnUInt32 nMaxSize) : 
-	Record(pData, nMaxSize)
+NodeDataBeginRecord::NodeDataBeginRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) : 
+	Record(pData, nMaxSize, bUseOld32Header)
 {
 	xnOSMemSet(&m_seekInfo, 0, sizeof(m_seekInfo));
 }
@@ -851,8 +861,8 @@ XnStatus NodeDataBeginRecord::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt32
 /************************/
 /* NodeStateReadyRecord */
 /************************/
-NodeStateReadyRecord::NodeStateReadyRecord(XnUInt8* pData, XnUInt32 nMaxSize) : 
-	Record(pData, nMaxSize)
+NodeStateReadyRecord::NodeStateReadyRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) : 
+	Record(pData, nMaxSize, bUseOld32Header)
 {
 
 }
@@ -891,8 +901,8 @@ XnStatus NodeStateReadyRecord::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt3
 /***********************/
 /* NewDataRecordHeader */
 /***********************/
-NewDataRecordHeader::NewDataRecordHeader(XnUInt8* pData, XnUInt32 nMaxSize) :
-	Record(pData, nMaxSize),
+NewDataRecordHeader::NewDataRecordHeader(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) :
+	Record(pData, nMaxSize, bUseOld32Header),
 	m_nTimeStamp(0),
 	m_nFrameNumber(0)
 {
@@ -969,8 +979,8 @@ XnStatus NewDataRecordHeader::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt32
 /*******************/
 /* DataIndexRecordHeader */
 /*******************/
-DataIndexRecordHeader::DataIndexRecordHeader(XnUInt8* pData, XnUInt32 nMaxSize) :
-	Record(pData, nMaxSize)
+DataIndexRecordHeader::DataIndexRecordHeader(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) :
+	Record(pData, nMaxSize, bUseOld32Header)
 {
 }
 
@@ -1008,7 +1018,8 @@ XnStatus DataIndexRecordHeader::AsString(XnChar* strDest, XnUInt32 nSize, XnUInt
 /*************/
 /* EndRecord */
 /*************/
-EndRecord::EndRecord(XnUInt8* pData, XnUInt32 nMaxSize) : Record(pData, nMaxSize)
+EndRecord::EndRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header) : 
+	Record(pData, nMaxSize, bUseOld32Header)
 {
 }
 
diff --git a/Source/Modules/Common/DataRecords.h b/Source/Modules/Common/DataRecords.h
index 8e4c34f..dc077b7 100644
--- a/Source/Modules/Common/DataRecords.h
+++ b/Source/Modules/Common/DataRecords.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -47,8 +47,8 @@ enum RecordType
 	RECORD_SEEK_TABLE               = 0x0E,
 };
 
-enum {INVALID_NODE_ID = -1};
-enum {INVALID_TIMESTAMP = -1};
+#define INVALID_NODE_ID ((XnUInt32)-1)
+#define INVALID_TIMESTAMP ((XnUInt64)-1)
 
 struct RecordingHeader
 {
@@ -63,17 +63,17 @@ extern const RecordingHeader DEFAULT_RECORDING_HEADER;
 class Record
 {
 public:
-	Record(XnUInt8* pData, XnUInt32 nMaxSize);
+	Record(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	Record(const Record &other);
-	XnUInt32 GetType() const;
+	RecordType GetType() const;
 	XnUInt32 GetNodeID() const;
 	XnUInt32 GetSize() const; //GetSize() returns just the fields' size, not including the payload
 	XnUInt32 GetPayloadSize() const;
-	XnUInt32 GetUndoRecordPos() const;
+	XnUInt64 GetUndoRecordPos() const;
 
 	void SetNodeID(XnUInt32 nNodeID);
 	void SetPayloadSize(XnUInt32 nPayloadSize);
-	void SetUndoRecordPos(XnUInt32 nUndoRecordPos);
+	void SetUndoRecordPos(XnUInt64 nUndoRecordPos);
 
 	XnUInt8* GetData(); //GetData() returns the entire encoded record
 	const XnUInt8* GetData() const; //GetData() returns the entire encoded record
@@ -103,7 +103,7 @@ protected:
 	XnStatus FinishRead();
 
 private:
-	struct Header
+	struct Header_old32
 	{
 		XnUInt32 m_nMagic;
 		XnUInt32 m_nRecordType;
@@ -112,6 +112,15 @@ private:
 		XnUInt32 m_nPayloadSize;
 		XnUInt32 m_nUndoRecordPos;
 	};
+	struct Header
+	{
+		XnUInt32 m_nMagic;
+		XnUInt32 m_nRecordType;
+		XnUInt32 m_nNodeID;
+		XnUInt32 m_nFieldsSize;
+		XnUInt32 m_nPayloadSize;
+		XnUInt64 m_nUndoRecordPos;
+	};
 
 	union
 	{
@@ -122,15 +131,19 @@ private:
 	static const XnUInt32 MAGIC;
 	mutable XnUInt32 m_nReadOffset;
 	XnUInt32 m_nMaxSize;
+protected:
+	enum {HEADER_SIZE_current = sizeof(Header),
+	      HEADER_SIZE_old32   = sizeof(Header_old32)};
+	XnBool m_bUseOld32Header;
 
 public:
-	enum {HEADER_SIZE = sizeof(Header)};
+	XnUInt32 HEADER_SIZE;
 };
 
 class NodeAdded_1_0_0_4_Record : public Record
 {
 public:
-	NodeAdded_1_0_0_4_Record(XnUInt8* pData, XnUInt32 nMaxSize);
+	NodeAdded_1_0_0_4_Record(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	NodeAdded_1_0_0_4_Record(const Record& record);
 	void SetNodeName(const XnChar* strNodeName);
 	void SetNodeType(XnProductionNodeType type);
@@ -157,7 +170,7 @@ private:
 class NodeAdded_1_0_0_5_Record : public NodeAdded_1_0_0_4_Record
 {
 public:
-	NodeAdded_1_0_0_5_Record(XnUInt8* pData, XnUInt32 nMaxSize);
+	NodeAdded_1_0_0_5_Record(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	NodeAdded_1_0_0_5_Record(const Record& record);
 
 	void SetNumberOfFrames(XnUInt32 nNumberOfFrames);
@@ -185,25 +198,25 @@ private:
 class NodeAddedRecord : public NodeAdded_1_0_0_5_Record
 {
 public:
-	NodeAddedRecord(XnUInt8* pData, XnUInt32 nMaxSize);
+	NodeAddedRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	NodeAddedRecord(const Record& record);
 
-	void SetSeekTablePosition(XnUInt32 nPos);
+	void SetSeekTablePosition(XnUInt64 nPos);
 
-	XnUInt32 GetSeekTablePosition();
+	XnUInt64 GetSeekTablePosition();
 
 	XnStatus Encode();
 	XnStatus Decode();
 	XnStatus AsString(XnChar* strDest, XnUInt32 nSize, XnUInt32& nCharsWritten);
 
 private:
-	XnUInt32 m_nSeekTablePosition;
+	XnUInt64 m_nSeekTablePosition;
 };
 
 class NodeRemovedRecord : public Record
 {
 public:
-	NodeRemovedRecord(XnUInt8* pData, XnUInt32 nMaxSize);
+	NodeRemovedRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	NodeRemovedRecord(const Record& record);
 
 	XnStatus Encode();
@@ -214,7 +227,7 @@ public:
 class GeneralPropRecord : public Record
 {
 public:
-	GeneralPropRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnUInt32 nPropRecordType = RECORD_GENERAL_PROPERTY);
+	GeneralPropRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header, XnUInt32 nPropRecordType = RECORD_GENERAL_PROPERTY);
 	GeneralPropRecord(const Record& record);
 
 	void SetPropName(const XnChar* strPropName);
@@ -238,7 +251,7 @@ private:
 class IntPropRecord : public GeneralPropRecord
 {
 public:
-	IntPropRecord(XnUInt8* pData, XnUInt32 nMaxSize);
+	IntPropRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	IntPropRecord(const Record& record);
 	void SetValue(XnUInt64 nValue);
 	XnUInt64 GetValue() const;
@@ -251,7 +264,7 @@ private:
 class RealPropRecord : public GeneralPropRecord
 {
 public:
-	RealPropRecord(XnUInt8* pData, XnUInt32 nMaxSize);
+	RealPropRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	RealPropRecord(const Record& record);
 	void SetValue(XnDouble dValue);
 	XnDouble GetValue() const;
@@ -264,7 +277,7 @@ private:
 class StringPropRecord : public GeneralPropRecord
 {
 public:
-	StringPropRecord(XnUInt8* pData, XnUInt32 nMaxSize);
+	StringPropRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	StringPropRecord(const Record& record);
 	void SetValue(const XnChar* strValue);
 	const XnChar* GetValue() const;
@@ -280,7 +293,7 @@ struct SeekInfo
 class NodeDataBeginRecord : public Record
 {
 public:
-	NodeDataBeginRecord(XnUInt8* pData, XnUInt32 nMaxSize);
+	NodeDataBeginRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	NodeDataBeginRecord(const Record& record);
 
 	XnUInt32 GetNumFrames() const;
@@ -297,7 +310,7 @@ private:
 class NodeStateReadyRecord : public Record
 {
 public:
-	NodeStateReadyRecord(XnUInt8* pData, XnUInt32 nMaxSize);
+	NodeStateReadyRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	NodeStateReadyRecord(const Record& record);
 	XnStatus Encode();
 	XnStatus Decode();
@@ -309,12 +322,12 @@ public:
 class NewDataRecordHeader : public Record
 {
 public:
-	enum {MAX_SIZE = Record::HEADER_SIZE + //Record header
+	enum {MAX_SIZE = Record::HEADER_SIZE_current + //Record header
 	             (XN_MAX_NAME_LENGTH + 1) + //Max node name + terminating null
 	             sizeof(XnUInt64) + //Data timestamp
 				 sizeof(XnUInt32)}; //Frame number
 
-	NewDataRecordHeader(XnUInt8* pData, XnUInt32 nMaxSize);
+	NewDataRecordHeader(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	NewDataRecordHeader(const Record& record);
 	void SetTimeStamp(XnUInt64 nTimeStamp);
 	void SetFrameNumber(XnUInt32 nFrameNumber);
@@ -336,12 +349,26 @@ typedef struct
 	XnUInt64 nTimestamp;
 	XnUInt32 nConfigurationID;
 	XnUInt32 nSeekPos;
+} DataIndexEntry_old32;
+
+typedef struct _DataIndexEntry
+{
+	XnUInt64 nTimestamp;
+	XnUInt32 nConfigurationID;
+	XnUInt64 nSeekPos;
+
+	static void FillFromOld32Entry(struct _DataIndexEntry *newEntry, DataIndexEntry_old32 *old32Entry)
+	{
+		newEntry->nTimestamp 		= old32Entry->nTimestamp;
+		newEntry->nConfigurationID 	= old32Entry->nConfigurationID;
+		newEntry->nSeekPos 			= old32Entry->nSeekPos;
+	}
 } DataIndexEntry;
 
 class DataIndexRecordHeader : public Record
 {
 public:
-	DataIndexRecordHeader(XnUInt8* pData, XnUInt32 nMaxSize);
+	DataIndexRecordHeader(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	DataIndexRecordHeader(const Record& record);
 
 	XnStatus Encode();
@@ -352,7 +379,7 @@ public:
 class EndRecord : public Record
 {
 public:
-	EndRecord(XnUInt8* pData, XnUInt32 nMaxSize);
+	EndRecord(XnUInt8* pData, XnUInt32 nMaxSize, XnBool bUseOld32Header);
 	EndRecord(const Record& record);
 	XnStatus Encode();
 	XnStatus Decode();
@@ -360,4 +387,4 @@ public:
 };
 #pragma pack(pop)
 
-#endif //__DATA_RECORDS_H__
\ No newline at end of file
+#endif //__DATA_RECORDS_H__
diff --git a/Source/Modules/Common/InternalPropNames.h b/Source/Modules/Common/InternalPropNames.h
index feb78e9..0e6d1fb 100644
--- a/Source/Modules/Common/InternalPropNames.h
+++ b/Source/Modules/Common/InternalPropNames.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/ExportedCodec.cpp b/Source/Modules/nimCodecs/ExportedCodec.cpp
index 886cba0..ff137ca 100644
--- a/Source/Modules/nimCodecs/ExportedCodec.cpp
+++ b/Source/Modules/nimCodecs/ExportedCodec.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -20,6 +20,7 @@
 *                                                                           *
 ****************************************************************************/
 #include "ExportedCodec.h"
+#include <XnLog.h>
 
 ExportedCodec::ExportedCodec(XnCodecID codecId) : m_codecId(codecId)
 {
@@ -38,7 +39,7 @@ void ExportedCodec::GetDescription(XnProductionNodeDescription* pDescription)
 	pDescription->Version.nBuild = XN_BUILD_VERSION;
 }
 
-XnStatus ExportedCodec::EnumerateProductionTrees(Context& context, NodeInfoList& TreesList, xn::EnumerationErrors* pErrors)
+XnStatus ExportedCodec::EnumerateProductionTrees(Context& /*context*/, NodeInfoList& TreesList, xn::EnumerationErrors* /*pErrors*/)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
@@ -46,15 +47,13 @@ XnStatus ExportedCodec::EnumerateProductionTrees(Context& context, NodeInfoList&
 	GetDescription(&desc);
 
 	nRetVal = TreesList.Add(desc, NULL, NULL);
-	XN_IS_STATUS_OK(nRetVal);
+	XN_IS_STATUS_OK_LOG_ERROR("Add to trees list", nRetVal);
 
 	return (XN_STATUS_OK);
 }
 
-XnStatus ExportedCodec::Create(Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, NodeInfoList* pNeededTrees, const XnChar* strConfigurationDir, ModuleProductionNode** ppInstance)
+XnStatus ExportedCodec::Create(Context& /*context*/, const XnChar* /*strInstanceName*/, const XnChar* /*strCreationInfo*/, NodeInfoList* /*pNeededTrees*/, const XnChar* /*strConfigurationDir*/, ModuleProductionNode** ppInstance)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	XnCodec* pCodec = CreateCodec();
 	XN_VALIDATE_ALLOC_PTR(pCodec);
 
diff --git a/Source/Modules/nimCodecs/ExportedCodec.h b/Source/Modules/nimCodecs/ExportedCodec.h
index 1fb6970..9c8ffd8 100644
--- a/Source/Modules/nimCodecs/ExportedCodec.h
+++ b/Source/Modules/nimCodecs/ExportedCodec.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/Xn16zCodec.cpp b/Source/Modules/nimCodecs/Xn16zCodec.cpp
index 7ca0d37..06f4ec9 100644
--- a/Source/Modules/nimCodecs/Xn16zCodec.cpp
+++ b/Source/Modules/nimCodecs/Xn16zCodec.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/Xn16zCodec.h b/Source/Modules/nimCodecs/Xn16zCodec.h
index 2ed4ced..e53fa94 100644
--- a/Source/Modules/nimCodecs/Xn16zCodec.h
+++ b/Source/Modules/nimCodecs/Xn16zCodec.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/Xn16zEmbTablesCodec.cpp b/Source/Modules/nimCodecs/Xn16zEmbTablesCodec.cpp
index e07aa12..ee2f925 100644
--- a/Source/Modules/nimCodecs/Xn16zEmbTablesCodec.cpp
+++ b/Source/Modules/nimCodecs/Xn16zEmbTablesCodec.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -41,7 +41,7 @@ XnStatus Xn16zEmbTablesCodec::Init(const ProductionNode& node)
 	XnStatus nRetVal = XN_STATUS_OK;
 	
 	nRetVal = XnCodec::Init(node);
-	XN_IS_STATUS_OK(nRetVal);
+	XN_IS_STATUS_OK_LOG_ERROR("Init codec", nRetVal);
 	
 	if (node.GetInfo().GetDescription().Type != XN_NODE_TYPE_DEPTH)
 	{
diff --git a/Source/Modules/nimCodecs/Xn16zEmbTablesCodec.h b/Source/Modules/nimCodecs/Xn16zEmbTablesCodec.h
index ca01f4a..148e75b 100644
--- a/Source/Modules/nimCodecs/Xn16zEmbTablesCodec.h
+++ b/Source/Modules/nimCodecs/Xn16zEmbTablesCodec.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/Xn8zCodec.cpp b/Source/Modules/nimCodecs/Xn8zCodec.cpp
index eb21efe..26d2910 100644
--- a/Source/Modules/nimCodecs/Xn8zCodec.cpp
+++ b/Source/Modules/nimCodecs/Xn8zCodec.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/Xn8zCodec.h b/Source/Modules/nimCodecs/Xn8zCodec.h
index 4c52edd..920dc43 100644
--- a/Source/Modules/nimCodecs/Xn8zCodec.h
+++ b/Source/Modules/nimCodecs/Xn8zCodec.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/XnCodec.cpp b/Source/Modules/nimCodecs/XnCodec.cpp
index e2cf9f6..6cc78f2 100644
--- a/Source/Modules/nimCodecs/XnCodec.cpp
+++ b/Source/Modules/nimCodecs/XnCodec.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -32,7 +32,7 @@ XnCodec::~XnCodec()
 
 }
 
-XnStatus XnCodec::Init(const ProductionNode& node)
+XnStatus XnCodec::Init(const ProductionNode& /*node*/)
 {
 	return XN_STATUS_OK;
 }
@@ -51,7 +51,7 @@ XnStatus XnCodec::CompressData(const void* pSrc, XnUInt32 nSrcSize, void* pDst,
 	}
 
 	nRetVal = CompressImpl((const XnUChar*)pSrc, nSrcSize, (XnUChar*)pDst, &nDstSize);
-	XN_IS_STATUS_OK(nRetVal);
+	XN_IS_STATUS_OK_LOG_ERROR("Compress", nRetVal);
 
 	*pnBytesWritten = nDstSize;
 
@@ -67,7 +67,7 @@ XnStatus XnCodec::DecompressData(const void* pSrc, XnUInt32 nSrcSize, void* pDst
 	XN_VALIDATE_OUTPUT_PTR(pnBytesWritten);
 
 	nRetVal = DecompressImpl((const XnUChar*)pSrc, nSrcSize, (XnUChar*)pDst, &nDstSize);
-	XN_IS_STATUS_OK(nRetVal);
+	XN_IS_STATUS_OK_LOG_ERROR("Decompress", nRetVal);
 
 	*pnBytesWritten = nDstSize;
 
diff --git a/Source/Modules/nimCodecs/XnCodec.h b/Source/Modules/nimCodecs/XnCodec.h
index fb7577a..2d67acc 100644
--- a/Source/Modules/nimCodecs/XnCodec.h
+++ b/Source/Modules/nimCodecs/XnCodec.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/XnCodecs.cpp b/Source/Modules/nimCodecs/XnCodecs.cpp
index 3431a50..a085781 100644
--- a/Source/Modules/nimCodecs/XnCodecs.cpp
+++ b/Source/Modules/nimCodecs/XnCodecs.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/XnJpegCodec.cpp b/Source/Modules/nimCodecs/XnJpegCodec.cpp
index d447f78..ff4d30d 100644
--- a/Source/Modules/nimCodecs/XnJpegCodec.cpp
+++ b/Source/Modules/nimCodecs/XnJpegCodec.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -87,21 +87,22 @@ XnStatus XnJpegCodec::Init(const ProductionNode& node)
 
 	// register for changes in resolution or cropping
 	nRetVal = image.RegisterToMapOutputModeChange(NodeConfigurationChangedCallback, this, m_hOutputModeCallback);
-	XN_IS_STATUS_OK(nRetVal);
+	XN_IS_STATUS_OK_LOG_ERROR("Register to map output mode change", nRetVal);
 
 	if (image.IsCapabilitySupported(XN_CAPABILITY_CROPPING))
 	{
 		nRetVal = image.GetCroppingCap().RegisterToCroppingChange(NodeConfigurationChangedCallback, this, m_hCroppingCallback);
-		XN_IS_STATUS_OK(nRetVal);
+		XN_IS_STATUS_OK_LOG_ERROR("Register to cropping change", nRetVal);
 	}
 
 	// now init
 	nRetVal = XnStreamInitCompressImageJ(&m_CompJPEGContext);
-	XN_IS_STATUS_OK(nRetVal);
+	XN_IS_STATUS_OK_LOG_ERROR("Init image compressor", nRetVal);
 
 	nRetVal = XnStreamInitUncompressImageJ(&m_UncompJPEGContext);
 	if (nRetVal != XN_STATUS_OK)
 	{
+		xnLogError(XN_MASK_OPEN_NI, "Init image uncompressor");
 		XnStreamFreeCompressImageJ(&m_CompJPEGContext);
 		return (nRetVal);
 	}
@@ -109,7 +110,7 @@ XnStatus XnJpegCodec::Init(const ProductionNode& node)
 	m_image = image;
 
 	nRetVal = OnNodeConfigurationChanged();
-	XN_IS_STATUS_OK(nRetVal);
+	XN_IS_STATUS_OK_LOG_ERROR("Handle node configuration change", nRetVal);
 
 	m_bValid = TRUE;
 
@@ -126,10 +127,11 @@ XnUInt32 XnJpegCodec::GetOverheadSize() const
 	return 0;
 }
 
-XnStatus XnJpegCodec::CompressImpl(const XnUChar* pData, XnUInt32 nDataSize, XnUChar* pCompressedData, XnUInt32* pnCompressedDataSize) const
+XnStatus XnJpegCodec::CompressImpl(const XnUChar* pData, XnUInt32 /*nDataSize*/, XnUChar* pCompressedData, XnUInt32* pnCompressedDataSize) const
 {
 	if (!m_bValid)
 	{
+		xnLogError(XN_MASK_OPEN_NI, "Codec is not valid");
 		return XN_STATUS_ERROR;
 	}
 
@@ -161,7 +163,7 @@ XnStatus XnJpegCodec::OnNodeConfigurationChanged()
 	
 	XnMapOutputMode outputMode;
 	nRetVal = m_image.GetMapOutputMode(outputMode);
-	XN_IS_STATUS_OK(nRetVal);
+	XN_IS_STATUS_OK_LOG_ERROR("Get map output mode", nRetVal);
 
 	m_nXRes = outputMode.nXRes;
 	m_nYRes = outputMode.nYRes;
@@ -170,7 +172,7 @@ XnStatus XnJpegCodec::OnNodeConfigurationChanged()
 	{
 		XnCropping cropping;
 		nRetVal = m_image.GetCroppingCap().GetCropping(cropping);
-		XN_IS_STATUS_OK(nRetVal);
+		XN_IS_STATUS_OK_LOG_ERROR("Get cropping", nRetVal);
 
 		if (cropping.bEnabled)
 		{
@@ -183,15 +185,16 @@ XnStatus XnJpegCodec::OnNodeConfigurationChanged()
 
 	switch (pixelFormat)
 	{
-	case XN_PIXEL_FORMAT_RGB24:
-		m_bRGB = TRUE;
-		break;
-	case XN_PIXEL_FORMAT_GRAYSCALE_8_BIT:
-		m_bRGB = FALSE;
-		break;
-	case XN_PIXEL_FORMAT_YUV422:
-	case XN_PIXEL_FORMAT_GRAYSCALE_16_BIT:
-		XN_LOG_ERROR_RETURN(XN_STATUS_ERROR, XN_MASK_OPEN_NI, "Jpeg currently supports only RGB24 and Grayscale8 pixel formats!");
+		case XN_PIXEL_FORMAT_RGB24:
+			m_bRGB = TRUE;
+			break;
+		case XN_PIXEL_FORMAT_GRAYSCALE_8_BIT:
+			m_bRGB = FALSE;
+			break;
+		case XN_PIXEL_FORMAT_YUV422:
+		case XN_PIXEL_FORMAT_GRAYSCALE_16_BIT:
+		default:
+			XN_LOG_ERROR_RETURN(XN_STATUS_ERROR, XN_MASK_OPEN_NI, "Jpeg currently supports only RGB24 and Grayscale8 pixel formats!");
 	}
 
 	m_nQuality = XN_STREAM_COMPRESSION_JPEG_DEFAULT_QUALITY;
@@ -201,7 +204,7 @@ XnStatus XnJpegCodec::OnNodeConfigurationChanged()
 	return (XN_STATUS_OK);
 }
 
-void XN_CALLBACK_TYPE XnJpegCodec::NodeConfigurationChangedCallback( ProductionNode& node, void* pCookie )
+void XN_CALLBACK_TYPE XnJpegCodec::NodeConfigurationChangedCallback(ProductionNode& /*node*/, void* pCookie)
 {
 	XnJpegCodec* pThis = (XnJpegCodec*)pCookie;
 	pThis->OnNodeConfigurationChanged();
diff --git a/Source/Modules/nimCodecs/XnJpegCodec.h b/Source/Modules/nimCodecs/XnJpegCodec.h
index 5d747cb..7b18974 100644
--- a/Source/Modules/nimCodecs/XnJpegCodec.h
+++ b/Source/Modules/nimCodecs/XnJpegCodec.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/XnStreamCompression.cpp b/Source/Modules/nimCodecs/XnStreamCompression.cpp
index 7f6b42f..0a8693e 100644
--- a/Source/Modules/nimCodecs/XnStreamCompression.cpp
+++ b/Source/Modules/nimCodecs/XnStreamCompression.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -27,6 +27,8 @@
 #include <jerror.h>
 #include <XnLog.h>
 
+#define XN_MASK_STREAM_COMPRESSION "xnStreamCompression"
+
 //---------------------------------------------------------------------------
 // Code
 //---------------------------------------------------------------------------
@@ -67,7 +69,7 @@ XnStatus XnStreamCompressDepth16Z(const XnUInt16* pInput, const XnUInt32 nInputS
 		nCurrValue = *pInput;
 
 		nDiffValue = (nLastValue - nCurrValue);
-		nAbsDiffValue = abs(nDiffValue);
+		nAbsDiffValue = (XnUInt16)abs(nDiffValue);
 
 		if (nAbsDiffValue <= 6)
 		{
@@ -75,13 +77,13 @@ XnStatus XnStreamCompressDepth16Z(const XnUInt16* pInput, const XnUInt32 nInputS
 
 			if (cOutStage == 0)
 			{
-				cOutChar = nDiffValue << 4;
+				cOutChar = (XnUInt8)(nDiffValue << 4);
 
 				cOutStage = 1;
 			}
 			else
 			{
-				cOutChar += nDiffValue;
+				cOutChar += (XnUInt8)nDiffValue;
 
 				if (cOutChar == 0x66)
 				{
@@ -233,7 +235,7 @@ XnStatus XnStreamCompressDepth16ZWithEmbTable(const XnUInt16* pInput, const XnUI
 		nCurrValue = nEmbTable[*pInput];
 
 		nDiffValue = (nLastValue - nCurrValue);
-		nAbsDiffValue = abs(nDiffValue);
+		nAbsDiffValue = (XnUInt16)abs(nDiffValue);
 
 		if (nAbsDiffValue <= 6)
 		{
@@ -241,13 +243,13 @@ XnStatus XnStreamCompressDepth16ZWithEmbTable(const XnUInt16* pInput, const XnUI
 
 			if (cOutStage == 0)
 			{
-				cOutChar = nDiffValue << 4;
+				cOutChar = (XnUInt8)(nDiffValue << 4);
 
 				cOutStage = 1;
 			}
 			else
 			{
-				cOutChar += nDiffValue;
+				cOutChar += (XnUInt8)nDiffValue;
 
 				if (cOutChar == 0x66)
 				{
@@ -357,6 +359,7 @@ XnStatus XnStreamUncompressDepth16Z(const XnUInt8* pInput, const XnUInt32 nInput
 
 	if (nInputSize < sizeof(XnUInt16))
 	{
+		xnLogError(XN_MASK_STREAM_COMPRESSION, "Input size too small");
 		return (XN_STATUS_BAD_PARAM);
 	}
 
@@ -500,6 +503,7 @@ XnStatus XnStreamUncompressDepth16ZWithEmbTable(const XnUInt8* pInput, const XnU
 
 	if (nInputSize < sizeof(XnUInt16))
 	{
+		xnLogError(XN_MASK_STREAM_COMPRESSION, "Input size too small");
 		return (XN_STATUS_BAD_PARAM);
 	}
 
@@ -660,7 +664,7 @@ XnStatus XnStreamCompressImage8Z(const XnUInt8* pInput, const XnUInt32 nInputSiz
 		nCurrValue = *pInput;
 
 		nDiffValue = (nLastValue - nCurrValue);
-		nAbsDiffValue = abs(nDiffValue);
+		nAbsDiffValue = (XnUInt8)abs(nDiffValue);
 
 		if (nAbsDiffValue <= 6)
 		{
@@ -784,6 +788,7 @@ XnStatus XnStreamUncompressImage8Z(const XnUInt8* pInput, const XnUInt32 nInputS
 
 	if (nInputSize < sizeof(XnUInt8))
 	{
+		xnLogError(XN_MASK_STREAM_COMPRESSION, "Input size too small");
 		return (XN_STATUS_BAD_PARAM);
 	}
 
@@ -931,11 +936,13 @@ XnStatus XnStreamUncompressConf4(const XnUInt8* pInput, const XnUInt32 nInputSiz
 
 	if (nInputSize < sizeof(XnUInt8))
 	{
+		xnLogError(XN_MASK_STREAM_COMPRESSION, "Input size too small");
 		return (XN_STATUS_BAD_PARAM);
 	}
 
 	if (nInputSize % 2 != 0)
 	{
+		xnLogError(XN_MASK_STREAM_COMPRESSION, "Input size not word-aligned");
 		return (XN_STATUS_BAD_PARAM);
 	}
 
@@ -963,12 +970,12 @@ XnStatus XnStreamUncompressConf4(const XnUInt8* pInput, const XnUInt32 nInputSiz
 	return (XN_STATUS_OK);
 }
 
-void XnStreamJPEGCompDummyFunction(struct jpeg_compress_struct* pjCompStruct)
+void XnStreamJPEGCompDummyFunction(struct jpeg_compress_struct* /*pjCompStruct*/)
 {
 	// Dummy libjpeg function to wrap internal buffers usage...
 }
 
-boolean XnStreamJPEGCompDummyFailFunction(struct jpeg_compress_struct* pjCompStruct)
+boolean XnStreamJPEGCompDummyFailFunction(struct jpeg_compress_struct* /*pjCompStruct*/)
 {
 	// If we ever got to the point we need to allocate more memory, something is wrong!
 	return (FALSE);
@@ -1043,6 +1050,10 @@ XnStatus XnStreamFreeCompressImageJ(XnStreamCompJPEGContext* pStreamCompJPEGCont
 	return (XN_STATUS_OK);
 }
 
+// to allow the use of setjmp
+#pragma warning(push)
+#pragma warning(disable: 4611)
+
 XnStatus XnStreamCompressImage8J(XnStreamCompJPEGContext* pStreamCompJPEGContext, const XnUInt8* pInput, XnUInt8* pOutput, XnUInt32* pnOutputSize, const XnUInt32 nXRes, const XnUInt32 nYRes, const XnUInt32 nQuality)
 {
 	// Local function variables
@@ -1066,6 +1077,7 @@ XnStatus XnStreamCompressImage8J(XnStreamCompJPEGContext* pStreamCompJPEGContext
 
 		*pnOutputSize = 0;
 
+		xnLogError(XN_MASK_JPEG, "JPEG compressor error :(");
 		return (XN_STATUS_ERROR);
 	} 
 
@@ -1124,6 +1136,7 @@ XnStatus XnStreamCompressImage24J(XnStreamCompJPEGContext* pStreamCompJPEGContex
 
 		*pnOutputSize = 0;
 
+		xnLogError(XN_MASK_JPEG, "JPEG compressor error :(");
 		return (XN_STATUS_ERROR);
 	} 
 
@@ -1159,12 +1172,12 @@ XnStatus XnStreamCompressImage24J(XnStreamCompJPEGContext* pStreamCompJPEGContex
 	return (XN_STATUS_OK);
 }
 
-void XnStreamJPEGDecompDummyFunction(struct jpeg_decompress_struct* pjDecompStruct)
+void XnStreamJPEGDecompDummyFunction(struct jpeg_decompress_struct* /*pjDecompStruct*/)
 {
 	// Dummy libjpeg function to wrap internal buffers usage...
 }
 
-boolean XnStreamJPEGDecompDummyFailFunction(struct jpeg_decompress_struct* pjDecompStruct)
+boolean XnStreamJPEGDecompDummyFailFunction(struct jpeg_decompress_struct* /*pjDecompStruct*/)
 {
 	// If we ever got to the point we need to allocate more memory, something is wrong!
 	return (FALSE);
@@ -1228,6 +1241,7 @@ XnStatus XnStreamUncompressImageJ(XnStreamUncompJPEGContext* pStreamUncompJPEGCo
 
 	if (nInputSize == 0)
 	{
+		xnLogError(XN_MASK_JPEG, "Input size is 0");
 		return (XN_STATUS_BAD_PARAM);
 	}
 
@@ -1246,6 +1260,7 @@ XnStatus XnStreamUncompressImageJ(XnStreamUncompJPEGContext* pStreamUncompJPEGCo
 
 		*pnOutputSize = 0;
 
+		xnLogError(XN_MASK_JPEG, "JPEG compressor error :(");
 		return (XN_STATUS_ERROR);
 	} 
 
@@ -1263,6 +1278,7 @@ XnStatus XnStreamUncompressImageJ(XnStreamUncompJPEGContext* pStreamUncompJPEGCo
 
 		*pnOutputSize = 0;
 
+		xnLogError(XN_MASK_JPEG, "JPEG compressor error :(");
 		return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW);
 	}
 
@@ -1277,6 +1293,7 @@ XnStatus XnStreamUncompressImageJ(XnStreamUncompJPEGContext* pStreamUncompJPEGCo
 
 			*pnOutputSize = 0;
 
+			xnLogError(XN_MASK_JPEG, "JPEG compressor error :(");
 			return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW);
 		}
 
@@ -1291,3 +1308,5 @@ XnStatus XnStreamUncompressImageJ(XnStreamUncompJPEGContext* pStreamUncompJPEGCo
 	// All is good...
 	return (XN_STATUS_OK);
 }
+
+#pragma warning(pop)
diff --git a/Source/Modules/nimCodecs/XnStreamCompression.h b/Source/Modules/nimCodecs/XnStreamCompression.h
index c0d28a8..2473ee2 100644
--- a/Source/Modules/nimCodecs/XnStreamCompression.h
+++ b/Source/Modules/nimCodecs/XnStreamCompression.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimCodecs/XnUncompressedCodec.cpp b/Source/Modules/nimCodecs/XnUncompressedCodec.cpp
index f563bee..8567f4f 100644
--- a/Source/Modules/nimCodecs/XnUncompressedCodec.cpp
+++ b/Source/Modules/nimCodecs/XnUncompressedCodec.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -21,6 +21,7 @@
 ****************************************************************************/
 #include "XnUncompressedCodec.h"
 #include "XnCodecIDs.h"
+#include <XnLog.h>
 
 XnCodecID XnUncompressedCodec::GetCodecID() const
 {
@@ -41,6 +42,7 @@ XnStatus XnUncompressedCodec::CompressImpl(const XnUChar* pData, XnUInt32 nDataS
 {
 	if (nDataSize > *pnCompressedDataSize)
 	{
+		xnLogError(XN_MASK_OPEN_NI, "Output buffer overflow");
 		return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW);
 	}
 
@@ -53,6 +55,7 @@ XnStatus XnUncompressedCodec::DecompressImpl(const XnUChar* pCompressedData, XnU
 {
 	if (nCompressedDataSize > *pnDataSize)
 	{
+		xnLogError(XN_MASK_OPEN_NI, "Output buffer overflow");
 		return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW);
 	}
 
diff --git a/Source/Modules/nimCodecs/XnUncompressedCodec.h b/Source/Modules/nimCodecs/XnUncompressedCodec.h
index ef9cc51..51523da 100644
--- a/Source/Modules/nimCodecs/XnUncompressedCodec.h
+++ b/Source/Modules/nimCodecs/XnUncompressedCodec.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/ExportedMockNodes.cpp b/Source/Modules/nimMockNodes/ExportedMockNodes.cpp
index 10861e9..cf52ccc 100644
--- a/Source/Modules/nimMockNodes/ExportedMockNodes.cpp
+++ b/Source/Modules/nimMockNodes/ExportedMockNodes.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -51,15 +51,14 @@ void ExportedMockNodeBase::GetDescription(XnProductionNodeDescription* pDescript
 	pDescription->Version.nBuild = XN_BUILD_VERSION;
 }
 
-XnStatus ExportedMockNodeBase::EnumerateProductionTrees(xn::Context& context, xn::NodeInfoList& TreesList, xn::EnumerationErrors* pErrors)
+XnStatus ExportedMockNodeBase::EnumerateProductionTrees(xn::Context& /*context*/, xn::NodeInfoList& /*TreesList*/, xn::EnumerationErrors* /*pErrors*/)
 {
 	// Don't return this in a regular enumeration. Instead, mock nodes are created directly by OpenNI.
 	return XN_STATUS_OK;
 }
 
-XnStatus ExportedMockNodeBase::Create(xn::Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, xn::NodeInfoList* pNeededTrees, const XnChar* strConfigurationDir, xn::ModuleProductionNode** ppInstance)
+XnStatus ExportedMockNodeBase::Create(xn::Context& /*context*/, const XnChar* strInstanceName, const XnChar* /*strCreationInfo*/, xn::NodeInfoList* /*pNeededTrees*/, const XnChar* /*strConfigurationDir*/, xn::ModuleProductionNode** ppInstance)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
 	XN_VALIDATE_OUTPUT_PTR(ppInstance);
 
 	*ppInstance = CreateImpl(strInstanceName);
diff --git a/Source/Modules/nimMockNodes/ExportedMockNodes.h b/Source/Modules/nimMockNodes/ExportedMockNodes.h
index a6c4986..e578982 100644
--- a/Source/Modules/nimMockNodes/ExportedMockNodes.h
+++ b/Source/Modules/nimMockNodes/ExportedMockNodes.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockAudioGenerator.cpp b/Source/Modules/nimMockNodes/MockAudioGenerator.cpp
index 75b03ef..5854b83 100644
--- a/Source/Modules/nimMockNodes/MockAudioGenerator.cpp
+++ b/Source/Modules/nimMockNodes/MockAudioGenerator.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockAudioGenerator.h b/Source/Modules/nimMockNodes/MockAudioGenerator.h
index 55ae914..0376e64 100644
--- a/Source/Modules/nimMockNodes/MockAudioGenerator.h
+++ b/Source/Modules/nimMockNodes/MockAudioGenerator.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockDepthGenerator.cpp b/Source/Modules/nimMockNodes/MockDepthGenerator.cpp
index 07746d4..71a389e 100644
--- a/Source/Modules/nimMockNodes/MockDepthGenerator.cpp
+++ b/Source/Modules/nimMockNodes/MockDepthGenerator.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockDepthGenerator.h b/Source/Modules/nimMockNodes/MockDepthGenerator.h
index ddce33a..c6f77f6 100644
--- a/Source/Modules/nimMockNodes/MockDepthGenerator.h
+++ b/Source/Modules/nimMockNodes/MockDepthGenerator.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockDevice.cpp b/Source/Modules/nimMockNodes/MockDevice.cpp
index c5e391a..5851296 100644
--- a/Source/Modules/nimMockNodes/MockDevice.cpp
+++ b/Source/Modules/nimMockNodes/MockDevice.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockDevice.h b/Source/Modules/nimMockNodes/MockDevice.h
index 270c643..fa9fa6d 100644
--- a/Source/Modules/nimMockNodes/MockDevice.h
+++ b/Source/Modules/nimMockNodes/MockDevice.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockGenerator.cpp b/Source/Modules/nimMockNodes/MockGenerator.cpp
index 74fd03c..c78dc5f 100644
--- a/Source/Modules/nimMockNodes/MockGenerator.cpp
+++ b/Source/Modules/nimMockNodes/MockGenerator.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -21,6 +21,9 @@
 ****************************************************************************/
 #include "MockGenerator.h"
 #include <XnPropNames.h>
+#include <XnLog.h>
+
+#define XN_MOCK_LOG_MASK	"Mock"
 
 MockGenerator::MockGenerator(const XnChar* strName, XnBool bAggregateData /* = FALSE */) :
 	MockProductionNode(strName),
@@ -109,7 +112,10 @@ XnStatus MockGenerator::SetGeneralProperty(const XnChar* strName, XnUInt32 nBuff
 XnStatus MockGenerator::SetNextData(const void *pData, XnUInt32 nSize)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
-	
+
+	//Make sure the node is in Generating state so it would be recorded properly
+	SetGenerating(TRUE);
+
 	DataInfo& nextData = m_data[m_nNextDataIdx];
 
 	if (!m_bAggregateData)
@@ -306,8 +312,6 @@ XnUInt32 MockGenerator::GetRequiredBufferSize()
 
 XnStatus MockGenerator::ResizeBuffer(XnUInt32 nIndex, XnUInt32 nNeededSize)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-	
 	DataInfo& dataInfo = m_data[nIndex];
 	if (nNeededSize > dataInfo.nAllocatedSize)
 	{
diff --git a/Source/Modules/nimMockNodes/MockGenerator.h b/Source/Modules/nimMockNodes/MockGenerator.h
index 4817825..b96232a 100644
--- a/Source/Modules/nimMockNodes/MockGenerator.h
+++ b/Source/Modules/nimMockNodes/MockGenerator.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockIRGenerator.cpp b/Source/Modules/nimMockNodes/MockIRGenerator.cpp
index e0f6f98..3696ef1 100644
--- a/Source/Modules/nimMockNodes/MockIRGenerator.cpp
+++ b/Source/Modules/nimMockNodes/MockIRGenerator.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockIRGenerator.h b/Source/Modules/nimMockNodes/MockIRGenerator.h
index 35d6896..215d61f 100644
--- a/Source/Modules/nimMockNodes/MockIRGenerator.h
+++ b/Source/Modules/nimMockNodes/MockIRGenerator.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockImageGenerator.cpp b/Source/Modules/nimMockNodes/MockImageGenerator.cpp
index 831ecfe..73f5e71 100644
--- a/Source/Modules/nimMockNodes/MockImageGenerator.cpp
+++ b/Source/Modules/nimMockNodes/MockImageGenerator.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockImageGenerator.h b/Source/Modules/nimMockNodes/MockImageGenerator.h
index 0c76aaa..cf8246c 100644
--- a/Source/Modules/nimMockNodes/MockImageGenerator.h
+++ b/Source/Modules/nimMockNodes/MockImageGenerator.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockMapGenerator.cpp b/Source/Modules/nimMockNodes/MockMapGenerator.cpp
index 6d0ad72..f40d056 100644
--- a/Source/Modules/nimMockNodes/MockMapGenerator.cpp
+++ b/Source/Modules/nimMockNodes/MockMapGenerator.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockMapGenerator.h b/Source/Modules/nimMockNodes/MockMapGenerator.h
index 4d43732..c8b4b58 100644
--- a/Source/Modules/nimMockNodes/MockMapGenerator.h
+++ b/Source/Modules/nimMockNodes/MockMapGenerator.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockProductionNode.cpp b/Source/Modules/nimMockNodes/MockProductionNode.cpp
index 490cd0f..3d18a28 100644
--- a/Source/Modules/nimMockNodes/MockProductionNode.cpp
+++ b/Source/Modules/nimMockNodes/MockProductionNode.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/MockProductionNode.h b/Source/Modules/nimMockNodes/MockProductionNode.h
index 60c83ea..6ad9356 100644
--- a/Source/Modules/nimMockNodes/MockProductionNode.h
+++ b/Source/Modules/nimMockNodes/MockProductionNode.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/nimMockNodes.cpp b/Source/Modules/nimMockNodes/nimMockNodes.cpp
index 7f21db4..da529a3 100644
--- a/Source/Modules/nimMockNodes/nimMockNodes.cpp
+++ b/Source/Modules/nimMockNodes/nimMockNodes.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimMockNodes/nimMockNodes.h b/Source/Modules/nimMockNodes/nimMockNodes.h
index 3d6bb58..f9e2270 100644
--- a/Source/Modules/nimMockNodes/nimMockNodes.h
+++ b/Source/Modules/nimMockNodes/nimMockNodes.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimRecorder/ExportedPlayer.cpp b/Source/Modules/nimRecorder/ExportedPlayer.cpp
index 78ce3ab..83665cb 100644
--- a/Source/Modules/nimRecorder/ExportedPlayer.cpp
+++ b/Source/Modules/nimRecorder/ExportedPlayer.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -55,7 +55,7 @@ void ExportedPlayer::GetDescription(XnProductionNodeDescription* pDescription)
 	pDescription->Version.nBuild = XN_BUILD_VERSION;
 }
 
-XnStatus ExportedPlayer::EnumerateProductionTrees(xn::Context& context, xn::NodeInfoList& TreesList, xn::EnumerationErrors* pErrors)
+XnStatus ExportedPlayer::EnumerateProductionTrees(xn::Context& /*context*/, xn::NodeInfoList& TreesList, xn::EnumerationErrors* /*pErrors*/)
 {
 	XnProductionNodeDescription description;
 	XnStatus nRetVal = XN_STATUS_OK;
@@ -67,9 +67,8 @@ XnStatus ExportedPlayer::EnumerateProductionTrees(xn::Context& context, xn::Node
 	return XN_STATUS_OK;
 }
 
-XnStatus ExportedPlayer::Create(xn::Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, xn::NodeInfoList* pNeededTrees, const XnChar* strConfigurationDir, xn::ModuleProductionNode** ppInstance)
+XnStatus ExportedPlayer::Create(xn::Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, xn::NodeInfoList* /*pNeededTrees*/, const XnChar* /*strConfigurationDir*/, xn::ModuleProductionNode** ppInstance)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
 	XN_VALIDATE_INPUT_PTR(strInstanceName);
 	XN_VALIDATE_INPUT_PTR(strCreationInfo);
 	XN_VALIDATE_OUTPUT_PTR(ppInstance);
diff --git a/Source/Modules/nimRecorder/ExportedPlayer.h b/Source/Modules/nimRecorder/ExportedPlayer.h
index 13de40e..dd88e41 100644
--- a/Source/Modules/nimRecorder/ExportedPlayer.h
+++ b/Source/Modules/nimRecorder/ExportedPlayer.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimRecorder/ExportedRecorder.cpp b/Source/Modules/nimRecorder/ExportedRecorder.cpp
index 63531ad..72fb9ad 100644
--- a/Source/Modules/nimRecorder/ExportedRecorder.cpp
+++ b/Source/Modules/nimRecorder/ExportedRecorder.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -57,7 +57,7 @@ void ExportedRecorder::GetDescription(XnProductionNodeDescription* pDescription)
 	pDescription->Version.nBuild = XN_BUILD_VERSION;
 }
 
-XnStatus ExportedRecorder::EnumerateProductionTrees(xn::Context& context, xn::NodeInfoList& TreesList, xn::EnumerationErrors* pErrors)
+XnStatus ExportedRecorder::EnumerateProductionTrees(xn::Context& /*context*/, xn::NodeInfoList& TreesList, xn::EnumerationErrors* /*pErrors*/)
 {
 	XnProductionNodeDescription description;
 	XnStatus nRetVal = XN_STATUS_OK;
@@ -69,7 +69,7 @@ XnStatus ExportedRecorder::EnumerateProductionTrees(xn::Context& context, xn::No
 	return XN_STATUS_OK;
 }
 
-XnStatus ExportedRecorder::Create(xn::Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, xn::NodeInfoList* pNeededTrees, const XnChar* strConfigurationDir, xn::ModuleProductionNode** ppInstance)
+XnStatus ExportedRecorder::Create(xn::Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, xn::NodeInfoList* /*pNeededTrees*/, const XnChar* /*strConfigurationDir*/, xn::ModuleProductionNode** ppInstance)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 	XN_VALIDATE_INPUT_PTR(strInstanceName);
diff --git a/Source/Modules/nimRecorder/ExportedRecorder.h b/Source/Modules/nimRecorder/ExportedRecorder.h
index e420c06..42864bb 100644
--- a/Source/Modules/nimRecorder/ExportedRecorder.h
+++ b/Source/Modules/nimRecorder/ExportedRecorder.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimRecorder/PlayerNode.cpp b/Source/Modules/nimRecorder/PlayerNode.cpp
index ea7083d..382cb81 100644
--- a/Source/Modules/nimRecorder/PlayerNode.cpp
+++ b/Source/Modules/nimRecorder/PlayerNode.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -68,6 +68,7 @@ const XnUInt64 PlayerNode::RECORD_MAX_SIZE =
 	PlayerNode::DATA_MAX_SIZE; //Maximum data size
 
 const XnVersion PlayerNode::OLDEST_SUPPORTED_FILE_FORMAT_VERSION = {1, 0, 0, 4};
+const XnVersion PlayerNode::FIRST_FILESIZE64BIT_FILE_FORMAT_VERSION = {1, 0, 1, 0};
 
 PlayerNode::PlayerNode(xn::Context &context, const XnChar* strName) :
 	m_bOpen(FALSE),
@@ -84,7 +85,8 @@ PlayerNode::PlayerNode(xn::Context &context, const XnChar* strName) :
 	m_pNodeInfoMap(NULL),
 	m_nMaxNodes(0),
 	m_bEOF(FALSE),
-	m_aSeekTempArray(NULL)
+	m_aSeekTempArray(NULL),
+	m_hSelf(NULL)
 {
 	xnOSStrCopy(m_strName, strName, sizeof(m_strName));
 }
@@ -157,7 +159,7 @@ XnStatus PlayerNode::SetRepeat(XnBool bRepeat)
 	return XN_STATUS_OK;
 }
 
-XnStatus PlayerNode::SeekToTimeStamp(XnInt64 nTimeOffset, XnPlayerSeekOrigin origin)
+XnStatus PlayerNode::SeekToTimeStamp(XnInt64 /*nTimeOffset*/, XnPlayerSeekOrigin /*origin*/)
 {
 	/*
 	switch (origin)
@@ -217,12 +219,12 @@ XnStatus PlayerNode::SeekToFrame(const XnChar* strNodeName, XnInt32 nFrameOffset
 	return XN_STATUS_OK;
 }
 
-XnStatus PlayerNode::UndoRecord(PlayerNode::RecordUndoInfo& undoInfo, XnUInt32 nDestPos, XnBool& bUndone)
+XnStatus PlayerNode::UndoRecord(PlayerNode::RecordUndoInfo& undoInfo, XnUInt64 nDestPos, XnBool& bUndone)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
-	XnUInt32 nOriginalPos = TellStream();
+	XnUInt64 nOriginalPos = TellStream();
 	bUndone = FALSE;
-	Record record(m_pRecordBuffer, RECORD_MAX_SIZE);
+	Record record(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat);
 	while ((undoInfo.nRecordPos > nDestPos) && (undoInfo.nUndoRecordPos != 0))
 	{
 		nRetVal = SeekStream(XN_OS_SEEK_SET, undoInfo.nUndoRecordPos);
@@ -334,14 +336,18 @@ XnStatus PlayerNode::SeekToFrameAbsolute(XnUInt32 nNodeID, XnUInt32 nDestFrame)
 		//Just go back to position of current frame
 		nRetVal = SeekStream(XN_OS_SEEK_SET, pPlayerNodeInfo->nLastDataPos);
 		XN_IS_STATUS_OK(nRetVal);
+		// and re-read it
+		nRetVal = ReadNext();
+		XN_IS_STATUS_OK(nRetVal);
 
 		return XN_STATUS_OK;
 	}
 
+	// not same frame. Find seek locations of each stream
 	DataIndexEntry** pDataIndex = GetSeekLocationsFromDataIndex(nNodeID, nDestFrame);
 	if (pDataIndex != NULL)
 	{
-		XnUInt32 nLastPos = 0;
+		XnUInt64 nLastPos = 0;
 
 		// move each node to its relevant data
 		for (XnUInt32 i = 0; i < m_nMaxNodes; i++)
@@ -355,7 +361,7 @@ XnStatus PlayerNode::SeekToFrameAbsolute(XnUInt32 nNodeID, XnUInt32 nDestFrame)
 				XN_IS_STATUS_OK(nRetVal);
 
 				// check for latest position. This will be directly after the frame we seeked to.
-				XnUInt32 nPos = TellStream();
+				XnUInt64 nPos = TellStream();
 				if (nPos > nLastPos)
 				{
 					nLastPos = nPos;
@@ -368,24 +374,17 @@ XnStatus PlayerNode::SeekToFrameAbsolute(XnUInt32 nNodeID, XnUInt32 nDestFrame)
 	}
 	else
 	{
-		// perform old seek
-		XnUInt32 nStartPos = TellStream();
+		// perform old seek (no data indexes)
+		XnUInt64 nStartPos = TellStream();
 		XnUInt32 nNextFrame = pPlayerNodeInfo->nCurFrame + 1;
-		XnUInt32 nFrames = pPlayerNodeInfo->nFrames;
 		XnStatus nRetVal = XN_STATUS_OK;
 
-		if (nDestFrame == pPlayerNodeInfo->nCurFrame)
-		{
-			//Just go back to position of current frame
-			nRetVal = SeekStream(XN_OS_SEEK_SET, pPlayerNodeInfo->nLastDataPos);
-			XN_IS_STATUS_OK(nRetVal);
-		}
-		else if (nDestFrame < nNextFrame)
+		if (nDestFrame < nNextFrame)
 		{
 			//Seek backwards
-			XnUInt32 nDestRecordPos = pPlayerNodeInfo->newDataUndoInfo.nRecordPos;
-			XnUInt32 nUndoRecordPos = pPlayerNodeInfo->newDataUndoInfo.nUndoRecordPos;
-			NewDataRecordHeader record(m_pRecordBuffer, RECORD_MAX_SIZE);
+			XnUInt64 nDestRecordPos = pPlayerNodeInfo->newDataUndoInfo.nRecordPos;
+			XnUInt64 nUndoRecordPos = pPlayerNodeInfo->newDataUndoInfo.nUndoRecordPos;
+			NewDataRecordHeader record(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat);
 			
 			/*Scan back through the frames' undo positions until we get to a frame number that is smaller or equal
 			  to nDestFrame. We put the position of the frame we find in nDestRecordPos. */
@@ -604,7 +603,7 @@ XnStatus PlayerNode::ReadNext()
 XnStatus PlayerNode::ProcessRecord(XnBool bProcessPayload)
 {
 	//Read a record and handle it
-	Record record(m_pRecordBuffer, RECORD_MAX_SIZE);
+	Record record(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat);
 	XnStatus nRetVal = ReadRecord(record);
 	XN_IS_STATUS_OK(nRetVal);
 	nRetVal = HandleRecord(record, bProcessPayload);
@@ -639,6 +638,15 @@ XnStatus PlayerNode::OpenStream()
 		XN_LOG_ERROR_RETURN(XN_STATUS_UNSUPPORTED_VERSION, XN_MASK_OPEN_NI, "Unsupported file format version: %u.%u.%u.%u", header.version.nMajor, header.version.nMinor, header.version.nMaintenance, header.version.nBuild);
 	}
 
+	/* Do we need to parse an old 32bit-filesize file? */
+	if (xnVersionCompare(&header.version, &FIRST_FILESIZE64BIT_FILE_FORMAT_VERSION) >= 0)
+	{
+		m_bIs32bitFileFormat = FALSE;
+	} else {
+		m_bIs32bitFileFormat = TRUE;
+	}
+
+	m_fileVersion = header.version;
 	m_nGlobalMaxTimeStamp = header.nGlobalMaxTimeStamp;
 	m_nMaxNodes = header.nMaxNodeID + 1;
 	XN_ASSERT(m_nMaxNodes > 0);
@@ -676,8 +684,10 @@ XnStatus PlayerNode::Read(void *pData, XnUInt32 nSize, XnUInt32 &nBytesRead)
 XnStatus PlayerNode::ReadRecordHeader(Record &record)
 {
 	XnUInt32 nBytesRead = 0;
-	XnStatus nRetVal = Read(record.GetData(), Record::HEADER_SIZE, nBytesRead);
-	if (nBytesRead != Record::HEADER_SIZE)
+	XnStatus nRetVal = Read(record.GetData(), record.HEADER_SIZE, nBytesRead);
+	XN_IS_STATUS_OK(nRetVal);
+
+	if (nBytesRead != record.HEADER_SIZE)
 	{
 		XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Incorrect number of bytes read");
 	}
@@ -692,9 +702,9 @@ XnStatus PlayerNode::ReadRecordHeader(Record &record)
 
 XnStatus PlayerNode::ReadRecordFields(Record &record)
 {
-	XnUInt32 nBytesToRead = record.GetSize() - Record::HEADER_SIZE;
+	XnUInt32 nBytesToRead = record.GetSize() - record.HEADER_SIZE;
 	XnUInt32 nBytesRead = 0;
-	XnStatus nRetVal = Read(record.GetData() + Record::HEADER_SIZE, nBytesToRead, nBytesRead);
+	XnStatus nRetVal = Read(record.GetData() + record.HEADER_SIZE, nBytesToRead, nBytesRead);
 	XN_IS_STATUS_OK(nRetVal);
 	if (nBytesRead < nBytesToRead)
 	{
@@ -712,16 +722,16 @@ XnStatus PlayerNode::ReadRecord(Record &record)
 	return XN_STATUS_OK;
 }
 
-XnStatus PlayerNode::SeekStream(XnOSSeekType seekType, XnInt32 nOffset)
+XnStatus PlayerNode::SeekStream(XnOSSeekType seekType, XnInt64 nOffset)
 {
 	XN_VALIDATE_INPUT_PTR(m_pInputStream);
-	return m_pInputStream->Seek(m_pStreamCookie, seekType, nOffset);
+	return m_pInputStream->Seek64(m_pStreamCookie, seekType, nOffset);
 }
 
-XnUInt32 PlayerNode::TellStream()
+XnUInt64 PlayerNode::TellStream()
 {
-	XN_VALIDATE_PTR(m_pInputStream, (XnUInt32)-1);
-	return m_pInputStream->Tell(m_pStreamCookie);
+	XN_VALIDATE_PTR(m_pInputStream, (XnUInt64)-1);
+	return m_pInputStream->Tell64(m_pStreamCookie);
 }
 
 XnStatus PlayerNode::CloseStream()
@@ -794,10 +804,6 @@ XnStatus PlayerNode::RemovePlayerNodeInfo(XnUInt32 nNodeID)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
-	xn::Player playerNode;
-	nRetVal = m_context.GetProductionNodeByName(m_strName, playerNode);
-	XN_IS_STATUS_OK(nRetVal);
-
 	PlayerNodeInfo* pPlayerNodeInfo = GetPlayerNodeInfo(nNodeID);
 	XN_VALIDATE_PTR(pPlayerNodeInfo, XN_STATUS_CORRUPT_FILE);
 	if (pPlayerNodeInfo->bValid)
@@ -811,15 +817,18 @@ XnStatus PlayerNode::RemovePlayerNodeInfo(XnUInt32 nNodeID)
 			}
 		}
 
-		playerNode.RemoveNeededNode(pPlayerNodeInfo->codec);
-		pPlayerNodeInfo->codec = NULL;
+		if (pPlayerNodeInfo->codec.IsValid())
+		{
+			xnRemoveNeededNode(GetSelfNodeHandle(), pPlayerNodeInfo->codec);
+			pPlayerNodeInfo->codec.Release();
+		}
 		pPlayerNodeInfo->Reset(); //Now it's not valid anymore
 	}
 
 	return XN_STATUS_OK;
 }
 
-XnStatus PlayerNode::HandleNodeAddedImpl(XnUInt32 nNodeID, XnProductionNodeType type, const XnChar* strName, XnCodecID compression, XnUInt32 nNumberOfFrames, XnUInt64 nMinTimestamp, XnUInt64 nMaxTimestamp)
+XnStatus PlayerNode::HandleNodeAddedImpl(XnUInt32 nNodeID, XnProductionNodeType type, const XnChar* strName, XnCodecID compression, XnUInt32 nNumberOfFrames, XnUInt64 /*nMinTimestamp*/, XnUInt64 nMaxTimestamp)
 {
 	XN_VALIDATE_INPUT_PTR(m_pNodeNotifications);
 
@@ -888,13 +897,13 @@ XnStatus PlayerNode::HandleNodeAdded_1_0_0_4_Record(NodeAdded_1_0_0_4_Record rec
 	if (xnIsTypeGenerator(type))
 	{
 		// we need to look for the DataBegin record to have number of frames, etc.
-		XnUInt32 nStartPos = TellStream();
+		XnUInt64 nStartPos = TellStream();
 
 		// NOTE: this overwrites the current NodeAdded record buffer!!!
 		nRetVal = SeekToRecordByType(nNodeID, RECORD_NODE_DATA_BEGIN);
 		if (nRetVal == XN_STATUS_OK)
 		{
-			NodeDataBeginRecord dataBeginRecord(m_pRecordBuffer, RECORD_MAX_SIZE);
+			NodeDataBeginRecord dataBeginRecord(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat);
 			nRetVal = ReadRecord(dataBeginRecord);
 			XN_IS_STATUS_OK(nRetVal);
 
@@ -908,7 +917,7 @@ XnStatus PlayerNode::HandleNodeAdded_1_0_0_4_Record(NodeAdded_1_0_0_4_Record rec
 			nRetVal = SeekToRecordByType(record.GetNodeID(), RECORD_NEW_DATA);
 			if (nRetVal == XN_STATUS_OK)
 			{
-				NewDataRecordHeader newDataRecord(m_pRecordBuffer, RECORD_MAX_SIZE);
+				NewDataRecordHeader newDataRecord(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat);
 				nRetVal = ReadRecord(newDataRecord);
 				XN_IS_STATUS_OK(nRetVal);
 
@@ -952,6 +961,7 @@ XnStatus PlayerNode::HandleNodeAddedRecord(NodeAddedRecord record)
 	XnStatus nRetVal = XN_STATUS_OK;
 
 	nRetVal = record.Decode();
+
 	XN_IS_STATUS_OK(nRetVal);
 
 	DEBUG_LOG_RECORD(record, "NodeAdded");
@@ -964,12 +974,12 @@ XnStatus PlayerNode::HandleNodeAddedRecord(NodeAddedRecord record)
 	// get seek table (if exists)
 	if (record.GetNumberOfFrames() > 0 && record.GetSeekTablePosition() != 0)
 	{
-		XnUInt32 nCurrPos = TellStream();
+		XnUInt64 nCurrPos = TellStream();
 
 		nRetVal = SeekStream(XN_OS_SEEK_SET, record.GetSeekTablePosition());
 		XN_IS_STATUS_OK(nRetVal);
 
-		DataIndexRecordHeader seekTableHeader(m_pRecordBuffer, RECORD_MAX_SIZE);
+		DataIndexRecordHeader seekTableHeader(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat);
 		nRetVal = ReadRecord(seekTableHeader);
 		XN_IS_STATUS_OK(nRetVal);
 
@@ -988,12 +998,12 @@ XnStatus PlayerNode::SeekToRecordByType(XnUInt32 nNodeID, RecordType type)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 	
-	Record record(m_pRecordBuffer, RECORD_MAX_SIZE);
+	Record record(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat);
 
-	XnUInt32 nStartPos = TellStream();
+	XnUInt64 nStartPos = TellStream();
 
 	XnBool bFound = FALSE;
-	XnUInt32 nPosBeforeRecord = 0;
+	XnUInt64 nPosBeforeRecord = 0;
 	while (!bFound && nRetVal == XN_STATUS_OK)
 	{
 		nPosBeforeRecord = TellStream();
@@ -1112,10 +1122,22 @@ XnStatus PlayerNode::HandleIntPropRecord(IntPropRecord record)
 		return XN_STATUS_CORRUPT_FILE;
 	}
 
+	const XnChar* strPropName = record.GetPropName();
+	XnUInt64 nValue = record.GetValue();
+
+	// old files workaround: some old files recorded nodes as not generating though having frames.
+	// make them generating.
+	if (strcmp(strPropName, XN_PROP_IS_GENERATING) == 0 &&
+		nValue == FALSE &&
+		pPlayerNodeInfo->nFrames > 0)
+	{
+		nValue = TRUE;
+	}
+
 	nRetVal = m_pNodeNotifications->OnNodeIntPropChanged(m_pNotificationsCookie, 
 		pPlayerNodeInfo->strName,
-		record.GetPropName(),
-		record.GetValue());
+		strPropName,
+		nValue);
 	XN_IS_STATUS_OK(nRetVal);
 
 	nRetVal = SaveRecordUndoInfo(pPlayerNodeInfo, 
@@ -1236,29 +1258,15 @@ XnStatus PlayerNode::HandleNodeStateReadyRecord(NodeStateReadyRecord record)
 		  with the name pPlayerNodeInfo->strName should have been created by now. If it wasn't,
 		  GetProductionNodeByName() will fail. */
 		nRetVal = m_context.GetProductionNodeByName(pPlayerNodeInfo->strName, node);
-		XN_IS_STATUS_OK(nRetVal);
-		nRetVal = m_context.CreateCodec(pPlayerNodeInfo->compression, node, pPlayerNodeInfo->codec);
-		XN_IS_STATUS_OK(nRetVal);
+		XN_IS_STATUS_OK_LOG_ERROR("Get codec production node", nRetVal);
 
-		// make the player dependent on the codec
-		xn::Player playerNode;
-		nRetVal = m_context.GetProductionNodeByName(m_strName, playerNode);
-		if (nRetVal != XN_STATUS_OK)
-		{
-			pPlayerNodeInfo->codec.Release();
-			return (nRetVal);
-		}
-
-		nRetVal = playerNode.AddNeededNode(pPlayerNodeInfo->codec);
-		if (nRetVal != XN_STATUS_OK)
-		{
-			pPlayerNodeInfo->codec.Release();
-			return (nRetVal);
-		}
+		nRetVal = m_context.CreateCodec(pPlayerNodeInfo->compression, node, pPlayerNodeInfo->codec);
+		XN_IS_STATUS_OK_LOG_ERROR("Create codec", nRetVal);
 
-		// at this point, we can unref the codec (it will still have at least one ref, as we added it to needed nodes).
-		xn::Codec codec = pPlayerNodeInfo->codec;
-		codec.Release();
+		// we need to make the codec a needed node, so that if xnForceShutdown() is called, we will be
+		// destroyed *before* it does (as we hold a reference to it).
+		nRetVal = xnAddNeededNode(GetSelfNodeHandle(), pPlayerNodeInfo->codec);
+		XN_IS_STATUS_OK_LOG_ERROR("Add needed node", nRetVal);
 	}
 
 	pPlayerNodeInfo->bStateReady = TRUE;
@@ -1340,6 +1348,7 @@ XnStatus PlayerNode::HandleNewDataRecord(NewDataRecordHeader record, XnBool bRea
 		XN_IS_STATUS_OK(nRetVal);
 		if (nBytesRead < record.GetPayloadSize())
 		{
+			XN_ASSERT(FALSE);
 			XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Not enough bytes read");
 		}
 
@@ -1358,19 +1367,19 @@ XnStatus PlayerNode::HandleNewDataRecord(NewDataRecordHeader record, XnBool bRea
 			//Decode data with codec
 			nRetVal = pPlayerNodeInfo->codec.DecodeData(pCompressedData, nCompressedDataSize, 
 				m_pUncompressedData, DATA_MAX_SIZE, &nUncompressedDataSize);
-			XN_IS_STATUS_OK(nRetVal);
+			XN_IS_STATUS_OK_ASSERT(nRetVal);
 			pUncompressedData = m_pUncompressedData;
 		}
 
 		nRetVal = m_pNodeNotifications->OnNodeNewData(m_pNotificationsCookie, pPlayerNodeInfo->strName, 
 			record.GetTimeStamp(), record.GetFrameNumber(), pUncompressedData, nUncompressedDataSize);
-		XN_IS_STATUS_OK(nRetVal);
+		XN_IS_STATUS_OK_ASSERT(nRetVal);
 	}
 	else
 	{
 		//Just skip the data
 		nRetVal = SkipRecordPayload(record);
-		XN_IS_STATUS_OK(nRetVal);
+		XN_IS_STATUS_OK_ASSERT(nRetVal);
 	}
 
 	return XN_STATUS_OK;
@@ -1382,7 +1391,7 @@ XnStatus PlayerNode::HandleDataIndexRecord(DataIndexRecordHeader record, XnBool
 	
 	XN_VALIDATE_INPUT_PTR(m_pNodeNotifications);
 	nRetVal = record.Decode();
-	XN_IS_STATUS_OK(nRetVal);
+	XN_IS_STATUS_OK_ASSERT(nRetVal);
 	DEBUG_LOG_RECORD(record, "DataIndex");
 
 	XN_ASSERT(record.GetNodeID() != INVALID_NODE_ID);
@@ -1405,10 +1414,14 @@ XnStatus PlayerNode::HandleDataIndexRecord(DataIndexRecordHeader record, XnBool
 			return XN_STATUS_CORRUPT_FILE;
 		}
 
-		if (record.GetPayloadSize() != (pPlayerNodeInfo->nFrames+1) * sizeof(DataIndexEntry))
+		XnUInt32 DIESize;
+		if (m_bIs32bitFileFormat) 	DIESize = sizeof(DataIndexEntry_old32);
+		else						DIESize = sizeof(DataIndexEntry);
+
+		if (record.GetPayloadSize() != (pPlayerNodeInfo->nFrames+1) * DIESize)
 		{
 			XN_ASSERT(FALSE);
-			XN_LOG_WARNING_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Seek table has %u entries, but node has %u frames!", record.GetPayloadSize() / sizeof(DataIndexEntry), pPlayerNodeInfo->nFrames);
+			XN_LOG_WARNING_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Seek table has %u entries, but node has %u frames!", record.GetPayloadSize() / DIESize, pPlayerNodeInfo->nFrames);
 		}
 
 		// allocate our data index
@@ -1417,8 +1430,24 @@ XnStatus PlayerNode::HandleDataIndexRecord(DataIndexRecordHeader record, XnBool
 
 		//Now read the actual data
 		XnUInt32 nBytesRead = 0;
-		nRetVal = Read(pPlayerNodeInfo->pDataIndex, record.GetPayloadSize(), nBytesRead);
-		XN_IS_STATUS_OK(nRetVal);
+
+		if (m_bIs32bitFileFormat)
+		{
+			DataIndexEntry_old32 old32;
+			XnUInt32 nRead = 0;
+			for(XnUInt32 n = 0; n < pPlayerNodeInfo->nFrames+1; n++)
+			{
+				nRetVal = Read(&old32, sizeof(DataIndexEntry_old32), nRead);
+				XN_IS_STATUS_OK(nRetVal); nBytesRead += nRead;
+				DataIndexEntry::FillFromOld32Entry(&pPlayerNodeInfo->pDataIndex[n], &old32);
+			}
+		}
+		else
+		{
+			nRetVal = Read(pPlayerNodeInfo->pDataIndex, record.GetPayloadSize(), nBytesRead);
+			XN_IS_STATUS_OK(nRetVal);
+		}
+
 		if (nBytesRead < record.GetPayloadSize())
 		{
 			XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Not enough bytes read");
@@ -1504,7 +1533,7 @@ XnStatus PlayerNode::SeekToTimeStampAbsolute(XnUInt64 nDestTimeStamp)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 	XnUInt64 nRecordTimeStamp = 0LL;
-	XnUInt32 nStartPos = TellStream(); //We'll revert to this in case nDestTimeStamp is beyond end of stream
+	XnUInt64 nStartPos = TellStream(); //We'll revert to this in case nDestTimeStamp is beyond end of stream
 	XN_IS_STATUS_OK(nRetVal);
 
 	if (nDestTimeStamp < m_nTimeStamp)
@@ -1521,7 +1550,7 @@ XnStatus PlayerNode::SeekToTimeStampAbsolute(XnUInt64 nDestTimeStamp)
 		nDestTimeStamp = m_nGlobalMaxTimeStamp;
 	}
 
-	Record record(m_pRecordBuffer, RECORD_MAX_SIZE);
+	Record record(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat);
 	XnBool bEnd = FALSE;
 	XnUInt32 nBytesRead = 0;
 
@@ -1534,11 +1563,11 @@ XnStatus PlayerNode::SeekToTimeStampAbsolute(XnUInt64 nDestTimeStamp)
 			case RECORD_NEW_DATA:
 			{
 				//We already read Record::HEADER_SIZE, now read the rest of the new data record header
-				nRetVal = Read(m_pRecordBuffer + Record::HEADER_SIZE, 
-					NewDataRecordHeader::MAX_SIZE - Record::HEADER_SIZE, 
+				nRetVal = Read(m_pRecordBuffer + record.HEADER_SIZE, 
+					NewDataRecordHeader::MAX_SIZE - record.HEADER_SIZE, 
 					nBytesRead);
 				XN_IS_STATUS_OK(nRetVal);
-				if (nBytesRead < NewDataRecordHeader::MAX_SIZE - Record::HEADER_SIZE)
+				if (nBytesRead < NewDataRecordHeader::MAX_SIZE - record.HEADER_SIZE)
 				{
 					return XN_STATUS_CORRUPT_FILE;
 				}
@@ -1582,9 +1611,9 @@ XnStatus PlayerNode::SeekToTimeStampAbsolute(XnUInt64 nDestTimeStamp)
 			case RECORD_NODE_STATE_READY:
 			{
 				//Read rest of record and handle it normally
-				nRetVal = Read(m_pRecordBuffer + Record::HEADER_SIZE, record.GetSize() - Record::HEADER_SIZE, nBytesRead);
+				nRetVal = Read(m_pRecordBuffer + record.HEADER_SIZE, record.GetSize() - record.HEADER_SIZE, nBytesRead);
 				XN_IS_STATUS_OK(nRetVal);
-				Record record(m_pRecordBuffer, RECORD_MAX_SIZE);
+				Record record(m_pRecordBuffer, RECORD_MAX_SIZE, m_bIs32bitFileFormat);
 				nRetVal = HandleRecord(record, TRUE);
 				XN_IS_STATUS_OK(nRetVal);
 				break;
@@ -1633,8 +1662,8 @@ PlayerNode::PlayerNodeInfo* PlayerNode::GetPlayerNodeInfoByName(const XnChar* st
 
 XnStatus PlayerNode::SaveRecordUndoInfo(PlayerNodeInfo* pPlayerNodeInfo, 
 										const XnChar* strPropName, 
-										XnUInt32 nRecordPos, 
-										XnUInt32 nUndoRecordPos)
+										XnUInt64 nRecordPos,
+										XnUInt64 nUndoRecordPos)
 {
 	RecordUndoInfo recordUndoInfo;
 	recordUndoInfo.nRecordPos = nRecordPos;
@@ -1644,7 +1673,7 @@ XnStatus PlayerNode::SaveRecordUndoInfo(PlayerNodeInfo* pPlayerNodeInfo,
 	return XN_STATUS_OK;
 }
 
-XnStatus PlayerNode::GetRecordUndoInfo(PlayerNodeInfo* pPlayerNodeInfo, const XnChar* strPropName, XnUInt32& nRecordPos, XnUInt32& nUndoRecordPos)
+XnStatus PlayerNode::GetRecordUndoInfo(PlayerNodeInfo* pPlayerNodeInfo, const XnChar* strPropName, XnUInt64& nRecordPos, XnUInt64& nUndoRecordPos)
 {
 	RecordUndoInfo *pRecordUndoInfo = NULL;
 	XnStatus nRetVal = pPlayerNodeInfo->recordUndoInfoMap.Get(strPropName, pRecordUndoInfo);
@@ -1659,6 +1688,22 @@ XnStatus PlayerNode::SkipRecordPayload(Record record)
 	return SeekStream(XN_OS_SEEK_CUR, record.GetPayloadSize());
 }
 
+XnNodeHandle PlayerNode::GetSelfNodeHandle()
+{
+	if (m_hSelf == NULL)
+	{
+		xn::Player thisPlayer;
+		XnStatus nRetVal = m_context.GetProductionNodeByName(m_strName, thisPlayer);
+		XN_ASSERT(nRetVal == XN_STATUS_OK);
+
+		// we keep just the handle, without a reference (otherwise, we keep a reference to ourselves, 
+		// and we will never be destroyed)
+		m_hSelf = thisPlayer;
+	}
+
+	return m_hSelf;
+}
+
 PlayerNode::PlayerNodeInfo::PlayerNodeInfo()
 {
 	pDataIndex = NULL;
diff --git a/Source/Modules/nimRecorder/PlayerNode.h b/Source/Modules/nimRecorder/PlayerNode.h
index 9db7c5c..c24d89e 100644
--- a/Source/Modules/nimRecorder/PlayerNode.h
+++ b/Source/Modules/nimRecorder/PlayerNode.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -62,8 +62,8 @@ private:
 	{
 		RecordUndoInfo() { Reset(); }
 		void Reset() { nRecordPos = 0; nUndoRecordPos = 0; }
-		XnUInt32 nRecordPos;
-		XnUInt32 nUndoRecordPos;
+		XnUInt64 nRecordPos;
+		XnUInt64 nUndoRecordPos;
 	};
 
 	XN_DECLARE_STRINGS_HASH(RecordUndoInfo, RecordUndoInfoMap);
@@ -77,7 +77,7 @@ private:
 
 		XnBool bValid;
 		XnChar strName[XN_MAX_NAME_LENGTH];
-		XnUInt32 nLastDataPos;
+		XnUInt64 nLastDataPos;
 		XnCodecID compression;
 		XnUInt32 nFrames;
 		XnUInt32 nCurFrame;
@@ -93,7 +93,7 @@ private:
 	XnStatus ProcessRecord(XnBool bProcessPayload);
 	XnStatus SeekToTimeStampAbsolute(XnUInt64 nDestTimeStamp);
 	XnStatus SeekToTimeStampRelative(XnInt64 nOffset);
-	XnStatus UndoRecord(PlayerNode::RecordUndoInfo& undoInfo, XnUInt32 nDestPos, XnBool& nUndone);
+	XnStatus UndoRecord(PlayerNode::RecordUndoInfo& undoInfo, XnUInt64 nDestPos, XnBool& nUndone);
 	XnStatus SeekToFrameAbsolute(XnUInt32 nNodeID, XnUInt32 nFrameNumber);
 	XnStatus ProcessEachNodeLastData(XnUInt32 nIDToProcessLast);
 
@@ -103,8 +103,8 @@ private:
 	XnStatus ReadRecordFields(Record& record);
 	//ReadRecord reads just the fields of the record, not the payload.
 	XnStatus ReadRecord(Record& record);
-	XnStatus SeekStream(XnOSSeekType seekType, XnInt32 nOffset);
-	XnUInt32 TellStream();
+	XnStatus SeekStream(XnOSSeekType seekType, XnInt64 nOffset);
+	XnUInt64 TellStream();
 	XnStatus CloseStream();
 
 	XnStatus HandleRecord(Record& record, XnBool bHandleRecord);
@@ -126,12 +126,13 @@ private:
 	XnStatus RemovePlayerNodeInfo(XnUInt32 nNodeID);
 	XnUInt32 GetPlayerNodeIDByName(const XnChar* strNodeName);
 	PlayerNodeInfo* GetPlayerNodeInfoByName(const XnChar* strNodeName);
-	XnStatus SaveRecordUndoInfo(PlayerNodeInfo* pPlayerNodeInfo, const XnChar* strPropName, XnUInt32 nRecordPos, XnUInt32 nUndoRecordPos);
-	XnStatus GetRecordUndoInfo(PlayerNodeInfo* pPlayerNodeInfo, const XnChar* strPropName, XnUInt32& nRecordPos, XnUInt32& nUndoRecordPos);
+	XnStatus SaveRecordUndoInfo(PlayerNodeInfo* pPlayerNodeInfo, const XnChar* strPropName, XnUInt64 nRecordPos, XnUInt64 nUndoRecordPos);
+	XnStatus GetRecordUndoInfo(PlayerNodeInfo* pPlayerNodeInfo, const XnChar* strPropName, XnUInt64& nRecordPos, XnUInt64& nUndoRecordPos);
 	XnStatus SkipRecordPayload(Record record);
 	XnStatus SeekToRecordByType(XnUInt32 nNodeID, RecordType type);
 	DataIndexEntry* FindTimestampInDataIndex(XnUInt32 nNodeID, XnUInt64 nTimestamp);
 	DataIndexEntry** GetSeekLocationsFromDataIndex(XnUInt32 nNodeID, XnUInt32 nDestFrame);
+	XnNodeHandle GetSelfNodeHandle();
 
 	// BC functions
 	XnStatus HandleNodeAdded_1_0_0_5_Record(NodeAdded_1_0_0_5_Record record);
@@ -140,9 +141,12 @@ private:
 	static const XnUInt64 DATA_MAX_SIZE;
 	static const XnUInt64 RECORD_MAX_SIZE;
 	static const XnVersion OLDEST_SUPPORTED_FILE_FORMAT_VERSION;
+	static const XnVersion FIRST_FILESIZE64BIT_FILE_FORMAT_VERSION;
 
+	XnVersion m_fileVersion;
 	XnChar m_strName[XN_MAX_NAME_LENGTH];
 	XnBool m_bOpen;
+	XnBool m_bIs32bitFileFormat;
 	XnUInt8* m_pRecordBuffer;
 	XnUInt8* m_pUncompressedData;
 	void* m_pStreamCookie;
@@ -162,6 +166,7 @@ private:
 	PlayerNodeInfo* m_pNodeInfoMap;
 	XnUInt32 m_nMaxNodes;
 	xn::Context m_context;
+	XnNodeHandle m_hSelf;
 
 	DataIndexEntry** m_aSeekTempArray;
 };
diff --git a/Source/Modules/nimRecorder/RecorderDefines.h b/Source/Modules/nimRecorder/RecorderDefines.h
index b51b064..ab001fb 100644
--- a/Source/Modules/nimRecorder/RecorderDefines.h
+++ b/Source/Modules/nimRecorder/RecorderDefines.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimRecorder/RecorderNode.cpp b/Source/Modules/nimRecorder/RecorderNode.cpp
index a304f7c..aba041a 100644
--- a/Source/Modules/nimRecorder/RecorderNode.cpp
+++ b/Source/Modules/nimRecorder/RecorderNode.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -31,7 +31,7 @@ const XnUInt32 RecorderNode::RECORD_MAX_SIZE = 20 * 1024;
 /*PAYLOAD_DATA_SIZE is set to support a resolution of 1600x1200 with 24 bits per pixel with the worst case
   of compression.
 */
-const XnUInt32 RecorderNode::PAYLOAD_DATA_SIZE = 1600 * 1200 * 3;
+const XnUInt32 RecorderNode::PAYLOAD_DATA_SIZE = (XnUInt32)(1600 * 1200 * 3 * 1.2);
 
 RecorderNode::RecorderNode(xn::Context &context) : 
 	m_pStreamCookie(NULL),
@@ -88,7 +88,7 @@ XnStatus RecorderNode::OnNodeAdded(const XnChar* strNodeName, XnProductionNodeTy
 
 	m_nConfigurationID++;
 
-	NodeAddedRecord nodeAddedRecord(m_pRecordBuffer, RECORD_MAX_SIZE);
+	NodeAddedRecord nodeAddedRecord(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 	nodeAddedRecord.SetNodeName(strNodeName);
 	nodeAddedRecord.SetNodeType(type);
 	nodeAddedRecord.SetCompression(compression);
@@ -101,7 +101,7 @@ XnStatus RecorderNode::OnNodeAdded(const XnChar* strNodeName, XnProductionNodeTy
 		return nRetVal;
 	}
 
-	XnUInt32 nNodeAddedPos = TellStream();
+	XnUInt64 nNodeAddedPos = TellStream();
 	nRetVal = WriteRecordToStream(strNodeName, nodeAddedRecord);
 	if (nRetVal != XN_STATUS_OK)
 	{
@@ -145,12 +145,12 @@ XnStatus RecorderNode::OnNodeIntPropChanged(const XnChar* strNodeName, const XnC
 {
 	m_nConfigurationID++;
 
-	XnUInt32 nUndoRecordPos = 0;
+	XnUInt64 nUndoRecordPos = 0;
 	RecordedNodeInfo* pRecordedNodeInfo = NULL;
 	XnStatus nRetVal = UpdateNodePropInfo(strNodeName, strPropName, pRecordedNodeInfo, nUndoRecordPos);
 	XN_IS_STATUS_OK(nRetVal);
 
-	IntPropRecord intPropRecord(m_pRecordBuffer, RECORD_MAX_SIZE);
+	IntPropRecord intPropRecord(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 	intPropRecord.SetNodeID(pRecordedNodeInfo->nNodeID);
 	intPropRecord.SetPropName(strPropName);
 	intPropRecord.SetValue(nValue);
@@ -178,12 +178,12 @@ XnStatus RecorderNode::OnNodeRealPropChanged(const XnChar* strNodeName, const Xn
 {
 	m_nConfigurationID++;
 
-	XnUInt32 nUndoRecordPos = 0;
+	XnUInt64 nUndoRecordPos = 0;
 	RecordedNodeInfo* pRecordedNodeInfo = NULL;
 	XnStatus nRetVal = UpdateNodePropInfo(strNodeName, strPropName, pRecordedNodeInfo, nUndoRecordPos);
 	XN_IS_STATUS_OK(nRetVal);
 
-	RealPropRecord record(m_pRecordBuffer, RECORD_MAX_SIZE);
+	RealPropRecord record(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 	record.SetNodeID(pRecordedNodeInfo->nNodeID);
 	record.SetPropName(strPropName);
 	record.SetValue(dValue);
@@ -210,11 +210,11 @@ XnStatus RecorderNode::OnNodeStringPropChanged(const XnChar* strNodeName, const
 {
 	m_nConfigurationID++;
 
-	XnUInt32 nUndoRecordPos = 0;
+	XnUInt64 nUndoRecordPos = 0;
 	RecordedNodeInfo* pRecordedNodeInfo = NULL;
 	XnStatus nRetVal = UpdateNodePropInfo(strNodeName, strPropName, pRecordedNodeInfo, nUndoRecordPos);
 	XN_IS_STATUS_OK(nRetVal);
-	StringPropRecord record(m_pRecordBuffer, RECORD_MAX_SIZE);
+	StringPropRecord record(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 	record.SetNodeID(pRecordedNodeInfo->nNodeID);
 	record.SetPropName(strPropName);
 	record.SetValue(strValue);
@@ -242,10 +242,10 @@ XnStatus RecorderNode::OnNodeGeneralPropChanged(const XnChar* strNodeName, const
 	m_nConfigurationID++;
 
 	RecordedNodeInfo* pRecordedNodeInfo = NULL;
-	XnUInt32 nUndoRecordPos = 0;
+	XnUInt64 nUndoRecordPos = 0;
 	XnStatus nRetVal = UpdateNodePropInfo(strNodeName, strPropName, pRecordedNodeInfo, nUndoRecordPos);
 	XN_IS_STATUS_OK(nRetVal);
-	GeneralPropRecord record(m_pRecordBuffer, RECORD_MAX_SIZE);
+	GeneralPropRecord record(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 	record.SetNodeID(pRecordedNodeInfo->nNodeID);
 	record.SetPropName(strPropName);
 	record.SetPropData(pBuffer);
@@ -275,7 +275,7 @@ XnStatus RecorderNode::OnNodeStateReady(const XnChar* strNodeName)
 
 	RecordedNodeInfo* pRecordedNodeInfo = GetRecordedNodeInfo(strNodeName);
 	XN_VALIDATE_PTR(pRecordedNodeInfo, XN_STATUS_BAD_NODE_NAME);
-	NodeStateReadyRecord record(m_pRecordBuffer, RECORD_MAX_SIZE);
+	NodeStateReadyRecord record(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 	record.SetNodeID(pRecordedNodeInfo->nNodeID);
 	XnStatus nRetVal = record.Encode();
 	XN_IS_STATUS_OK(nRetVal);
@@ -284,7 +284,7 @@ XnStatus RecorderNode::OnNodeStateReady(const XnChar* strNodeName)
 	return XN_STATUS_OK;
 }
 
-XnStatus RecorderNode::OnNodeNewData(const XnChar* strNodeName, XnUInt64 nTimeStamp, XnUInt32 nFrame, const void* pData, XnUInt32 nSize)
+XnStatus RecorderNode::OnNodeNewData(const XnChar* strNodeName, XnUInt64 nTimeStamp, XnUInt32 /*nFrame*/, const void* pData, XnUInt32 nSize)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
@@ -339,12 +339,12 @@ XnStatus RecorderNode::OnNodeNewData(const XnChar* strNodeName, XnUInt64 nTimeSt
 
 	pRecordedNodeInfo->nMaxTimeStamp = nTimeStamp;
 
-	XnUInt32 nUndoRecordPos = 0;
+	XnUInt64 nUndoRecordPos = 0;
 	nRetVal = UpdateNodePropInfo(strNodeName, XN_PROP_NEWDATA, pRecordedNodeInfo, nUndoRecordPos);
 	XN_IS_STATUS_OK(nRetVal);
 
 	//Prepare data header
-	NewDataRecordHeader recordHeader(m_pRecordBuffer, RECORD_MAX_SIZE);
+	NewDataRecordHeader recordHeader(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 	recordHeader.SetNodeID(pRecordedNodeInfo->nNodeID);
 	recordHeader.SetTimeStamp(nTimeStamp);
 	recordHeader.SetFrameNumber(++pRecordedNodeInfo->nMaxFrameNum);
@@ -425,22 +425,24 @@ XnStatus RecorderNode::WriteRecordToStream(const XnChar* strNodeName, Record &re
 	return WriteToStream(strNodeName, record.GetData(), record.GetSize());
 }
 
-XnStatus RecorderNode::SeekStream(XnOSSeekType seekType, XnUInt32 nOffset)
+XnStatus RecorderNode::SeekStream(XnOSSeekType seekType, XnUInt64 nOffset)
 {
 	XN_VALIDATE_INPUT_PTR(m_pOutputStream);
-	return m_pOutputStream->Seek(m_pStreamCookie, seekType, nOffset);
+	XN_VALIDATE_INPUT_PTR(m_pOutputStream->Seek64);
+	return m_pOutputStream->Seek64(m_pStreamCookie, seekType, nOffset);
 }
 
-XnUInt32 RecorderNode::TellStream()
+XnUInt64 RecorderNode::TellStream()
 {
 	XN_VALIDATE_INPUT_PTR(m_pOutputStream);
-	return m_pOutputStream->Tell(m_pStreamCookie);
+	XN_VALIDATE_INPUT_PTR(m_pOutputStream->Tell64);
+	return m_pOutputStream->Tell64(m_pStreamCookie);
 }
 
 XnStatus RecorderNode::FinalizeStream()
 {
 	XN_VALIDATE_INPUT_PTR(m_pOutputStream);
-	EndRecord endRecord(m_pRecordBuffer, RECORD_MAX_SIZE);
+	EndRecord endRecord(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 	XnStatus nRetVal = endRecord.Encode();
 	XN_IS_STATUS_OK(nRetVal);
 	/* Write End Record */
@@ -484,7 +486,7 @@ XnStatus RecorderNode::WriteNodeDataBegin(const XnChar* strNodeName)
 {
 	RecordedNodeInfo* pRecordedNodeInfo = GetRecordedNodeInfo(strNodeName);
 	XN_VALIDATE_PTR(pRecordedNodeInfo, XN_STATUS_BAD_NODE_NAME);
-	NodeDataBeginRecord record(m_pRecordBuffer, RECORD_MAX_SIZE);
+	NodeDataBeginRecord record(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 	record.SetNodeID(pRecordedNodeInfo->nNodeID);
 	XnStatus nRetVal = record.Encode();
 	XN_IS_STATUS_OK(nRetVal);
@@ -499,12 +501,12 @@ XnStatus RecorderNode::UpdateNodeSeekInfo(const XnChar* strNodeName, const Recor
 
 	if (recordedNodeInfo.bGotData)
 	{
-		XnUInt32 nSeekTablePos = 0;
+		XnUInt64 nSeekTablePos = 0;
 
 		nSeekTablePos = TellStream();
 
 		// write seek table
-		DataIndexRecordHeader seekTableHeader(m_pRecordBuffer, RECORD_MAX_SIZE);
+		DataIndexRecordHeader seekTableHeader(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 		seekTableHeader.SetNodeID(recordedNodeInfo.nNodeID);
 		seekTableHeader.SetPayloadSize((recordedNodeInfo.nMaxFrameNum+1) * sizeof(DataIndexEntry));
 		nRetVal = seekTableHeader.Encode();
@@ -523,7 +525,7 @@ XnStatus RecorderNode::UpdateNodeSeekInfo(const XnChar* strNodeName, const Recor
 		{
 			*pPayload = *it;
 		}
-		XN_ASSERT((recordedNodeInfo.nMaxFrameNum+1) == (pPayload - (DataIndexEntry*)m_pPayloadData));
+		XN_ASSERT((recordedNodeInfo.nMaxFrameNum+1) == XnUInt32(pPayload - (DataIndexEntry*)m_pPayloadData));
 
 		nRetVal = WriteToStream(strNodeName, m_pPayloadData, (XnUInt8*)pPayload - m_pPayloadData);
 		if (nRetVal != XN_STATUS_OK)
@@ -533,14 +535,14 @@ XnStatus RecorderNode::UpdateNodeSeekInfo(const XnChar* strNodeName, const Recor
 			return nRetVal;
 		}
 
-		XnUInt32 nStartPos = TellStream();
+		XnUInt64 nStartPos = TellStream();
 
 		//Seek to position of node added record
 		nRetVal = SeekStream(XN_OS_SEEK_SET, recordedNodeInfo.nNodeAddedPos);
 		XN_IS_STATUS_OK(nRetVal);
 
 		// re-write this record, this time with seek data
-		NodeAddedRecord record(m_pRecordBuffer, RECORD_MAX_SIZE);
+		NodeAddedRecord record(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 		record.SetNodeID(recordedNodeInfo.nNodeID);
 		record.SetNodeName(strNodeName);
 		record.SetCompression(recordedNodeInfo.compression);
@@ -575,7 +577,7 @@ XnStatus RecorderNode::RemoveNode(const XnChar* strNodeName)
 	nRetVal = m_recordedNodesInfo.Remove(strNodeName, recordedNodeInfo);
 	XN_IS_STATUS_OK(nRetVal);
 
-	NodeRemovedRecord record(m_pRecordBuffer, RECORD_MAX_SIZE);
+	NodeRemovedRecord record(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
 	record.SetNodeID(recordedNodeInfo.nNodeID);
 	record.SetUndoRecordPos(recordedNodeInfo.nNodeAddedPos);
 
@@ -604,7 +606,7 @@ XnStatus RecorderNode::RemoveNode(const XnChar* strNodeName)
 
 
 XnStatus RecorderNode::UpdateNodePropInfo(const XnChar* strNodeName, const XnChar* strPropName, 
-										  RecordedNodeInfo*& pRecordedNodeInfo, XnUInt32& nUndoPos)
+										  RecordedNodeInfo*& pRecordedNodeInfo, XnUInt64& nUndoPos)
 {
 	XnStatus nRetVal = m_recordedNodesInfo.Get(strNodeName, pRecordedNodeInfo);
 	XN_IS_STATUS_OK(nRetVal);
@@ -642,4 +644,4 @@ void RecorderNode::RecordedNodeInfo::Reset()
 	compression = XN_CODEC_NULL;
 	propInfoMap.Clear();
 	dataIndex.Clear();
-}
\ No newline at end of file
+}
diff --git a/Source/Modules/nimRecorder/RecorderNode.h b/Source/Modules/nimRecorder/RecorderNode.h
index c112e95..610514a 100644
--- a/Source/Modules/nimRecorder/RecorderNode.h
+++ b/Source/Modules/nimRecorder/RecorderNode.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -58,7 +58,7 @@ private:
 			nPos = 0;
 		}
 
-		XnUInt32 nPos;		//Position in stream of record that did this property change
+		XnUInt64 nPos;		//Position in stream of record that did this property change
 	};
 
 	XN_DECLARE_STRINGS_HASH(RecordedNodePropInfo, RecordedNodePropInfoMap);
@@ -71,7 +71,7 @@ private:
 
 		XnUInt32 nNodeID;
 		XnProductionNodeType type;
-		XnUInt32 nNodeAddedPos;
+		XnUInt64 nNodeAddedPos;
 		XnUInt32 nMinFrameNum;
 		XnUInt32 nMaxFrameNum;
 		XnUInt32 nCurFrameNum;
@@ -90,8 +90,8 @@ private:
 	XnStatus WriteHeader(XnUInt64 nGlobalMaxTimeStamp, XnUInt32 nMaxNodeID);
 	XnStatus WriteToStream(const XnChar* strNodeName, const void* pData, XnUInt32 nSize);
 	XnStatus WriteRecordToStream(const XnChar* strNodeName, Record &record);
-	XnStatus SeekStream(XnOSSeekType seekType, XnUInt32 nOffset);
-	XnUInt32 TellStream();
+	XnStatus SeekStream(XnOSSeekType seekType, XnUInt64 nOffset);
+	XnUInt64 TellStream();
 	XnStatus FinalizeStream();
 	XnStatus CloseStream();
 	XnStatus WriteNodeDataBegin(const XnChar* strNodeName);
@@ -99,7 +99,7 @@ private:
 	XnStatus RemoveNode(const XnChar* strNodeName);
 	
 	//UpdateNodePropInfo() returns, in nUndoPos, the position in the file you should read to undo the property update.
-	XnStatus UpdateNodePropInfo(const XnChar* strNodeName, const XnChar* strPropName, RecordedNodeInfo*& pRecordedNodeInfo, XnUInt32& nUndoPos);
+	XnStatus UpdateNodePropInfo(const XnChar* strNodeName, const XnChar* strPropName, RecordedNodeInfo*& pRecordedNodeInfo, XnUInt64& nUndoPos);
 	RecordedNodeInfo* GetRecordedNodeInfo(const XnChar* strNodeName);
 
 	static const XnUInt32 RECORD_MAX_SIZE;
@@ -118,4 +118,4 @@ private:
 	XnUInt32 m_nConfigurationID;
 };
 
-#endif //__RECORDER_NODE_H__
\ No newline at end of file
+#endif //__RECORDER_NODE_H__
diff --git a/Source/Modules/nimRecorder/RecorderTypes.h b/Source/Modules/nimRecorder/RecorderTypes.h
index 90c0ec3..286af77 100644
--- a/Source/Modules/nimRecorder/RecorderTypes.h
+++ b/Source/Modules/nimRecorder/RecorderTypes.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/Modules/nimRecorder/nimRecorder.cpp b/Source/Modules/nimRecorder/nimRecorder.cpp
index 2f3f5ae..6bfde9b 100644
--- a/Source/Modules/nimRecorder/nimRecorder.cpp
+++ b/Source/Modules/nimRecorder/nimRecorder.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Development.txt b/Source/OpenNI/Development.txt
index 9efed3f..f817873 100644
--- a/Source/OpenNI/Development.txt
+++ b/Source/OpenNI/Development.txt
@@ -37,10 +37,14 @@ to the module).
 		  which gets the struct declared in XnModuleInterface.h and fills it up.
 		- If this is a new capability, add a call to the new __ModuleGetXXXInterface function
 		  in the __ModuleGetXXXInterface function of the corresponding node.
+    - XnModuleCppRegistration.h
+	    - If this is a new node, add it to the __ModuleGetGetInterfaceFunc function.
 	- XnModuleInterfaceContainers.h
 		- If this is a new node, create a new interface container for it.
 		- If this is a new capability, add the struct to the corresponding node interface
 		  container. Don't forget to memset it and set a pointer to it in the ctor.
+	- XnTypeManager
+	    - If this is a new node, in TypeManager ctor, add the type.
 	- XnModuleLoader
 	    - If this is a new node, add Load and Validate methods for it. Add a call to
 		  the Load method in LoadSpecificInterface().
diff --git a/Source/OpenNI/Documentation.txt b/Source/OpenNI/Documentation.txt
index 79f658e..7d6114d 100644
--- a/Source/OpenNI/Documentation.txt
+++ b/Source/OpenNI/Documentation.txt
@@ -11,7 +11,9 @@ It includes the following chapters:
 - @subpage xmlscripts
 - @subpage cmdutils
 - @subpage samples
+- @subpage modules_root
 - @subpage additional
+- @subpage legal
 */
 
 
@@ -293,8 +295,9 @@ additional licenses in run-time to the context using the @ref xnAddLicense() fun
 
 @page conc_refcount Reference Counting
 
-OpenNI uses reference counting for nodes. This is needed because several nodes might depend on the same
-node. When a node is created, it has a reference count of 1, and the node handle is returned to the
+OpenNI uses reference counting for objects that might be shared between several components of the application.
+Those objects include the context itself, all types of production nodes, and Node Info objects.
+When a node is created, it has a reference count of 1, and the node handle is returned to the
 creator. The creator can increase the ref count by calling @ref xnProductionNodeAddRef() or @ref xn::ProductionNode::AddRef().
 Once someone holding a node does not need it anymore, it may call @ref xnProductionNodeRelease() or @ref xn::ProductionNode::Release().
 If a node's reference count reaches 0, the node will be removed from context and destroyed.
@@ -308,14 +311,29 @@ it is forbidden for an application to use the node handle once it was unreferenc
 	</td></tr>
 </table>
 
+Initializing context from a script file (XML), using the @ref xnInitFromXmlFileEx() function, usually creates 
+some nodes (depending on the script). The function returns a node which is the owner of all created nodes. 
+Once this node is destroyed, all nodes created from the script will be release as well (unless the application 
+holds another reference to them).
+
+<table>
+	<tr><th>Note:</th></tr>
+	<tr><td>
+There is also a deprecated function named @ref xnInitFromXmlFile(). This function lets the context own all
+created nodes. The problem is there is no way of releasing those nodes except for calling @ref xnShutdown(), 
+which destroys everything in the context. This method is obsolete and should not be used. It only exists
+for backwards compatibility (this was the only API up to version 1.1).
+	</td></tr>
+</table>
+
 Please note that referencing a <b>Node Info</b> object of an existing node also counts as a reference to this
 node. For example, if the application called @ref xnEnumerateExistingNodes() (@ref xn::Context::EnumerateExistingNodes()),
 and received a <i>Node Info List</i> that contains this node, then the node reference count was increased by 1.
 The application must free the list in order to unref each node in that list. This can be done by calling
 @ref xnNodeInfoListFree() (in C++, the destructor of @ref xn::NodeInfoList does this for you).
 
-In any case, shutting down OpenNI by calling @ref xnShutdown() (@ref xn::Context::Shutdown()) destroys all nodes,
-even ones that have a reference count higher than 1.
+Object oriented wrappers, like C++ and .NET, perform all reference operations for the client (they add ref in
+c`tor, copy c`tor, or assignment operator, and release ref in d`tor).
 
 @page conc_generation Data Generation
 
@@ -559,7 +577,7 @@ To build and run a sample application:
 		(default: C:\\Program Files\\OpenNI)
 -# In OpenNI directory browse to: Samples\\NiSimpleViewer.
 -# Open the suitable project file, NiSimpleViewer_2008.vcproj, and build the application. If the build
-		fails, contact Prime Sense support.
+		fails, contact PrimeSense support.
 -# After successfully building the project, before trying to run it, please ensure that the 
 		SamplesConfig.xml file is correctly configured:
 		-# Browse to the 'Data' directory (the default location of this directory is C:\\Program Files\\OpenNI\\Data).
@@ -578,7 +596,7 @@ output executable.
 
 Therefore, in order for the sample application to execute correctly in Debug mode, you should modify 
 the Working Directory to be the sub-folder into which the executable is located.
-You can also use Visual Studio's macro $(TargetDir) instead of setting an actual path.
+You can also use Visual Studio's macro \$(TargetDir) instead of setting an actual path.
 
 Note: Use "Project Properties"->"Debugging"->"Working Directory" to set the value.
 			</td>
@@ -1065,6 +1083,24 @@ The type can be one of the following:
 In addition the "Node" element can optionally have a "name" string attribute which will hold the requested
 name of the created node.
 
+ at subsection xmlrecorder Recorder
+
+The "ProductionNodes" element may contain an element called "Recorder" telling it to record data from other
+nodes that were created in the xml script. Note that these nodes must be named explicitly.
+
+For example, if two nodes were defined, named Image1 and Depth1, and we'd like to record their data into a 
+file called MyFile.oni:
+
+ at code
+    <Node type="Recorder">
+      <Configuration>
+        <RecorderDestination name="MyFile.oni"/>
+        <AddNodeToRecording name="Image1" codec="JPEG"/>
+        <AddNodeToRecording name="Depth1" codec="16zT"/>
+      </Configuration>
+    </Node>
+ at endcode
+
 @subsubsection xmlquery Queries
 
 The "Node" element can also declare a query that will be used when enumerating for this node. It is done
@@ -1078,6 +1114,8 @@ by adding a "Query" element to the "Node" element, which can have the following
 		under a "MapOutputMode" object, containing three attributes: "xRes", "yRes" and "fps".
 - @b "MinUserPositions", specifying the minimum number of user positions supported by a depth generator that
 		has the "UserPosition" capability.
+- @b "ExistingNodeOnly", specifying that only existing nodes (e.g. nodes that were already created) will enumerate.
+- @b "NonExistingNodeOnly", specifying that only non-existing nodes (e.g. nodes that were not created yet) will enumerate.
 - @b "NeededNodes", specifying only production trees that contains specific nodes are valid. Those nodes are declared
 		using a sub-element named "Node".
 
@@ -1552,6 +1590,912 @@ Note: Keep in mind the memory used to store the frames.
 */
 
 
+/**
+ at page modules_root Creating OpenNI Modules
+
+OpenNI is a plugin system. It defines the interfaces and data flow of common 3D computer vision types.
+
+One can create a new OpenNI module. An OpenNI module is a shared-library which exports one or more node implementation.
+
+In this section, we'll go over the necessary steps of creating such a module.
+
+<table>
+	<tr><th>Note:</th></tr>
+	<tr><td>
+OpenNI native interface is written in C. However, just as there are C++ wrappers for the API, there are also C++ wrappers 
+for creating modules. Using the C++ wrappers is the easiest way to create a new module, so all further explanations will
+assume the use of C++.
+
+Creating new modules in C is not covered currently in this documentation.
+	</td></tr>
+</table>
+
+ at subpage modules_topology
+
+ at subpage modules_node
+
+ at subpage modules_exporter
+
+ at subpage modules_module
+
+ at subpage modules_registration
+
+*/
+
+/**
+ at page modules_topology Defining Nodes Topology
+
+The first thing to do when wanting to create new node implmentations is to define exactly what nodes we want to 
+implement and the input each node needs.
+
+For example, if I have a physical device which is able to create both depth data and color image, I would want to 
+create two node implementations: a depth generator and an image generator. It is also highly recommended to create
+a device implementation. The device node does not necessarily participate in the data flow, but can be useful when
+wanting the represent the physical device (to get serial number for example).
+
+In the above example, we'll define our topology as follows:
+- a device node, 
+- a depth generator, depended on the specific device node we defined, and
+- an image generator, depended on the specific device node we defined.
+
+Another example would be creating a module which is some sort of algorithm over another input. For example, a hand 
+generator which identifies hands in any color image. In this case, our module will include a single node implementation,
+a hand generator, which will depend on any image generator.
+
+*/
+
+/**
+ at page modules_node Creating a Node Implementation
+
+Now we need to create the node implementations we want. For each such implementation, we'll create a new class.
+
+The class should:
+- @subpage modules_node_interface
+- @subpage modules_node_inputs
+- @subpage modules_node_capabilities
+- @subpage modules_gen
+
+*/
+
+/**
+ at page modules_node_interface Implement the Proper Interface
+
+Note that OpenNI has a different interface for a node implementation than the actual API of the node. However sometimes very similar, 
+those interfaces are different.
+
+The module's interfaces (C++ ones) are defined in file @ref XnModuleCppInterface.h.
+
+The following table lists current OpenNI node types and their module interface.
+
+<table>
+	<tr>
+		<th>Node Type</th>
+		<th>Module Interface</th>
+	</tr>
+	<tr>
+		<td>Production Node</td>
+		<td>@ref xn::ModuleProductionNode</td>
+	</tr>
+	<tr>
+		<td>Device</td>
+		<td>@ref xn::ModuleDevice</td>
+	</tr>
+	<tr>
+		<td>Generator</td>
+		<td>@ref xn::ModuleGenerator</td>
+	</tr>
+	<tr>
+		<td>Recorder</td>
+		<td>@ref xn::ModuleRecorder</td>
+	</tr>
+	<tr>
+		<td>Player</td>
+		<td>@ref xn::ModulePlayer</td>
+	</tr>
+	<tr>
+		<td>Map Generator</td>
+		<td>@ref xn::ModuleMapGenerator</td>
+	</tr>
+	<tr>
+		<td>Depth Generator</td>
+		<td>@ref xn::ModuleDepthGenerator</td>
+	</tr>
+	<tr>
+		<td>Image Generator</td>
+		<td>@ref xn::ModuleImageGenerator</td>
+	</tr>
+	<tr>
+		<td>IR Generator</td>
+		<td>@ref xn::ModuleIRGenerator</td>
+	</tr>
+	<tr>
+		<td>Gestures Generator</td>
+		<td>@ref xn::ModuleGestureGenerator</td>
+	</tr>
+	<tr>
+		<td>Scene Analyzer</td>
+		<td>@ref xn::ModuleSceneAnalyzer</td>
+	</tr>
+	<tr>
+		<td>Hands Generator</td>
+		<td>@ref xn::ModuleHandsGenerator</td>
+	</tr>
+	<tr>
+		<td>User Generator</td>
+		<td>@ref xn::ModuleUserGenerator</td>
+	</tr>
+	<tr>
+		<td>Audio Generator</td>
+		<td>@ref xn::ModuleAudioGenerator</td>
+	</tr>
+	<tr>
+		<td>Codec</td>
+		<td>@ref xn::ModuleCodec</td>
+	</tr>
+	<tr>
+		<td>Script</td>
+		<td>@ref xn::ModuleScriptNode</td>
+	</tr>
+</table>
+
+Our newly created class should inherit virtually from the proper interface. For example, if we're creating
+a hand generator then our class declaration should start with:
+
+ at code
+class MyHandGenerator: public virtual xn::ModuleHandsGenerator
+{
+...
+};
+ at endcode
+
+*/
+
+/**
+ at page modules_node_inputs Obtain Inputs
+
+If our node implementation requires any inputs (it would normally need), we can pass them to this class in its
+constructor or in an initialization method. Later on, we'll pass those inputs to instances of this class. This will
+be done from the node exporter (see @ref modules_exporter_create).
+
+Note that if the inputs required are other nodes (for example, if our hands generator requires an image generator), then
+those nodes should be recevied as API objects, and not as module objects (i.e. we should use @ref xn::ImageGenerator 
+and not @ref xn::ModuleImageGenerator).
+
+In our example:
+ at code
+class MyHandGenerator: public virtual xn::ModuleHandsGenerator
+{
+public:
+	MyHandsGenerator(xn::ImageGenerator imageGen);
+	...
+};
+ at endcode
+
+*/
+
+/**
+ at page modules_node_capabilities Support Capabilities
+
+If our new node implementation supports any capabilities, it should both declare that and implement their interfaces.
+
+Declaring the node implementation supported capabilities is done by implementing the @ref xn::ModuleProductionNode::IsCapabilitySupported
+method. This method only declares if a certain capability is supported or not.
+
+The actual implementation of the capability is done by implementing this capability interface. This implementation can be 
+done in a different class, or in our node implementation class. In any case, our node implementation must implement the propert 
+get method for this interface.
+
+The following table summarizes all capabilities:
+
+<table>
+	<tr>
+		<th>Capability</th>
+		<th>Capability Name</th>
+		<th>Capability Interface</th>
+		<th>Get Interface Method</th>
+	</tr>
+	<tr>
+		<td>Extended Serialization</td>
+		<td>XN_CAPABILITY_EXTENDED_SERIALIZATION</td>
+		<td>xn::ModuleExtendedSerializationInterface</td>
+		<td>xn::ModuleProductionNode::GetExtendedSerializationInterface</td>
+	</tr>
+	<tr>
+		<td>Lock Aware</td>
+		<td>XN_CAPABILITY_LOCK_AWARE</td>
+		<td>xn::ModuleLockAwareInterface</td>
+		<td>xn::ModuleProductionNode::GetLockAwareInterface</td>
+	</tr>
+	<tr>
+		<td>Error State</td>
+		<td>XN_CAPABILITY_ERROR_STATE</td>
+		<td>xn::ModuleErrorStateInterface</td>
+		<td>xn::ModuleProductionNode::GetErrorStateInterface</td>
+	</tr>
+	<tr>
+		<td>Brightness</td>
+		<td>XN_CAPABILITY_BRIGHTNESS</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Contrast</td>
+		<td>XN_CAPABILITY_CONTRAST</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Hue</td>
+		<td>XN_CAPABILITY_HUE</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Saturation</td>
+		<td>XN_CAPABILITY_SATURATION</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Sharpness</td>
+		<td>XN_CAPABILITY_SHARPNESS</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Gamma</td>
+		<td>XN_CAPABILITY_GAMMA</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Color Temperature</td>
+		<td>XN_CAPABILITY_COLOR_TEMPERATURE</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Backlight Compensation</td>
+		<td>XN_CAPABILITY_BACKLIGHT_COMPENSATION</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Gain</td>
+		<td>XN_CAPABILITY_GAIN</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Pan</td>
+		<td>XN_CAPABILITY_PAN</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Tilt</td>
+		<td>XN_CAPABILITY_TILT</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Roll</td>
+		<td>XN_CAPABILITY_ROLL</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Zoom</td>
+		<td>XN_CAPABILITY_ZOOM</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Exposure</td>
+		<td>XN_CAPABILITY_EXPOSURE</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Iris</td>
+		<td>XN_CAPABILITY_IRIS</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Focus</td>
+		<td>XN_CAPABILITY_FOCUS</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Lowlight Compensation</td>
+		<td>XN_CAPABILITY_LOW_LIGHT_COMPENSATION</td>
+		<td>xn::ModuleGeneralIntInterface</td>
+		<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
+	</tr>
+	<tr>
+		<td>Device Identification</td>
+		<td>XN_CAPABILITY_DEVICE_IDENTIFICATION</td>
+		<td>xn::ModuleDeviceIdentificationInterface</td>
+		<td>xn::ModuleDevice::GetIdentificationInterface</td>
+	</tr>
+	<tr>
+		<td>Alternative Viewpoint</td>
+		<td>XN_CAPABILITY_ALTERNATIVE_VIEW_POINT</td>
+		<td>xn::ModuleAlternativeViewPointInterface</td>
+		<td>xn::ModuleGenerator::GetAlternativeViewPointInterface</td>
+	</tr>
+	<tr>
+		<td>Frame Sync</td>
+		<td>XN_CAPABILITY_FRAME_SYNC</td>
+		<td>xn::ModuleFrameSyncInterface</td>
+		<td>xn::ModuleGenerator::GetFrameSyncInterface</td>
+	</tr>
+	<tr>
+		<td>Mirror</td>
+		<td>XN_CAPABILITY_MIRROR</td>
+		<td>xn::ModuleMirrorInterface</td>
+		<td>xn::ModuleGenerator::GetMirrorInterface</td>
+	</tr>
+	<tr>
+		<td>Cropping</td>
+		<td>XN_CAPABILITY_CROPPING</td>
+		<td>xn::ModuleCroppingInterface</td>
+		<td>xn::ModuleMapGenerator::GetCroppingInterface</td>
+	</tr>
+	<tr>
+		<td>Anti Flicker</td>
+		<td>XN_CAPABILITY_ANTI_FLICKER</td>
+		<td>xn::ModuleAntiFlickerInterface</td>
+		<td>xn::ModuleMapGenerator::GetAntiFlickerInterface</td>
+	</tr>
+	<tr>
+		<td>User Position</td>
+		<td>XN_CAPABILITY_USER_POSITION</td>
+		<td>xn::ModuleUserPositionInterface</td>
+		<td>xn::ModuleDepthGenerator::GetUserPositionInterface</td>
+	</tr>
+	<tr>
+		<td>Hand Touching Field-of-View</td>
+		<td>XN_CAPABILITY_HAND_TOUCHING_FOV_EDGE</td>
+		<td>xn::ModuleHandTouchingFOVEdgeInterface</td>
+		<td>xn::ModuleHandsGenerator::GetHandTouchingFOVEdgeInterface</td>
+	</tr>
+	<tr>
+		<td>Skeleton</td>
+		<td>XN_CAPABILITY_SKELETON</td>
+		<td>xn::ModuleSkeletonInterface</td>
+		<td>xn::ModuleUserGenerator::GetSkeletonInterface</td>
+	</tr>
+	<tr>
+		<td>Pose Detection</td>
+		<td>XN_CAPABILITY_POSE_DETECTION</td>
+		<td>xn::ModulePoseDetectionInteface</td>
+		<td>xn::ModuleUserGenerator::GetPoseDetectionInteface</td>
+	</tr>
+</table>
+
+For example, let's say our hands generator supports the mirror capability as well as the error state capability. It implements
+error state in the same class and mirror in another one.
+
+ at code
+class MyHandsGeneratorMirror : public virtual xn::ModuleMirrorInterface
+{
+...
+};
+
+class MyHandGenerator: 
+	public virtual xn::ModuleHandsGenerator, 
+	public virtual xn::ModuleErrorStateInterface
+{
+public:
+	...
+	
+	virtual XnBool IsCapabilitySupported(const XnChar* strCapabilityName)
+	{
+		return (
+			strcmp(strCapabilityName, XN_CAPABILITY_MIRROR) == 0 ||
+			strcmp(strCapabilityName, XN_CAPABILITY_ERROR_STATE) == 0
+			);
+	}
+	
+	...
+	
+	virtual ModuleErrorStateInterface* GetErrorStateInterface() { return this; }
+	
+	...
+	
+	virtual ModuleMirrorInterface* GetMirrorInterface() { return &m_mirrorCap; }
+
+private:
+	MyHandsGeneratorMirror m_mirrorCap;
+};
+ at endcode
+*/
+
+/**
+ at page modules_gen Implemeting a Generator
+
+If our node implementation is some sort of generator (i.e. produces data), it can be usually implemeted
+in one of two ways - an active generator (i.e. generates data in the background somehow) or a passive one
+(i.e. processes other nodes data in order to create new data). While those two models are different when implementing,
+they both fit in OpenNI interfaces.
+
+When a generator has new data, it informs OpenNI by raising its <i>New Data Available</i> event. This will cause OpenNI
+to call its @ref xn::ModuleGenerator::UpdateData() method in the application main-loop (assuming the application is using
+one of the <i>WaitXUpdateAll</i> methods. The UpdateData method is the only place where the node implementation is allowed
+to change its <i>Last Updated Data</i>. This flow is explained in details in the following sections.
+
+ at section modules_gen_state The Generating State
+
+A generator can be in one of two states: generating and non-generating. When the node is created, it is in the non-generating
+state. This state is useful for choosing configuration before actually starting to generate new data.
+
+A generator's state can be changed to generating by calling its @ref xn::ModuleGenerator::StartGenerating() method, and can 
+be changed to non-generating by calling its @ref xn::ModuleGenerator::StopGenerating() method. The generator is responsible
+to raise the "Generation Running Changed" event whenever its generating state is changed.
+
+In essense, when in the generating state, the generator constantly generates new data (unless bounded by some input of course).
+
+ at section modules_gen_new New Data
+
+When a generator is in the generating state it generates "new" data, meaning, data that the application hasn't received yet.
+A generator does not simply replace its data when it can. Each generator is responsible of holding the last data that the 
+application received, and not to modify it. Instead, when new data is available, the generator should raise its <i>New Data
+Available</i> event, as well as to return TRUE when its @ref xn::ModuleGenerator::IsNewDataAvailable() method is called.
+
+The event is used by OpenNI to check current state if the application called one of the WaitXUpdateAll methods. In those methods,
+OpenNI waits for some new data to arrive and then checks if the requested condition was completed. If so, it updates all the nodes
+which has new data. It uses the @ref xn::ModuleGenerator::IsNewDataAvailable() method for checking if the node has new data, and
+the @ref xn::ModuleGenerator::UpdateData() to make the node update its data. The <i>UpdateData</i> method is the only place
+where the node implementation is allowed to modify its last updated data.
+
+ at section modules_gen_active Example A: An Active Generator
+
+An active generator is a generator that does its generation in a thread other than the application thread. 
+
+Usually, its implementation will be as follows:
+- The StartGenerating() method starts a worker thread (or perform an asynchronous call) that is responsible of
+  getting new data.
+- The StopGenerating() method stops the worker thread (or cancels the asynchronous call).
+- The node holds a buffer containing the last updated data (i.e. the "user" buffer, the buffer holding the data the 
+  application received after last UpdateData() method was called).
+- When the worker thread is done generating the new data (or the asynchronous call has returned), the data is stored
+  in another buffer (the "next" buffer), and the <i>New Data Available</i> event is raised.
+- The IsNewDataAvailable() methods checks if the "next" buffer exists.
+- The UpdateData() method changes the "next" buffer to be the "user" buffer, and deletes the previous "user" buffer.
+
+Of course, the explanation above is simplified. Usually, instead of allocating and deleting data buffers, a buffer pool
+is used, and the implementation should copy the data from one buffer to the other as little as possible, so that it
+wouldn't consume much hardware resources.
+
+ at section modules_gen_passive Example B: A Passive Generator
+
+A passive generator usually depends on the data of another generator. It does some processing in the application thread
+to produce new data from its input node's data.
+
+Usually, its implementation will be as follows:
+- The StartGenerating() method registers to its input node <i>New Data Available</i> event.
+- The StopGenerating() method unregisters from this event.
+- The node holds a buffer containing the last updated data (i.e. the "user" buffer, the buffer holding the data the 
+  application received after last UpdateData() method was called).
+- When the input node's <i>New Data Available</i> event is raised, it raises its own event, also marking that 
+  new input data is available for processing (using a member flag).
+- The IsNewDataAvailable() method checks if this flag is turned on. <b>Note:</b> it is not sufficient to check
+  if the input node has new data available, because this method might be called <b>after</b> the input node's UpdateData()
+  method was called, but before our node's UpdateData() method was called. In such a case, the input node will say it has
+  no new data, but its last data wasn't processed yet by our node.
+- The UpdateData() method takes the input data from the input node, does some processing and updates the "user" buffer.
+
+*/
+
+
+/**
+ at page modules_exporter Creating a Node Exporter
+
+Once we completed our node implementation class, we should create a node exporter class to export our new node to OpenNI.
+The node exporter is some sort of a factory. It allows getting some information about this node implementation, it supports 
+enumerating which instances of this implementation can be created at the moment, and allows creating such instances and
+destroying them.
+
+Creating a node exporter is done by defining a new class inheriting from @ref xn::ModuleExportedProductionNode.
+
+ at section modules_exporter_desc Node Description
+
+Each node implementation has a description. The description contains the following information:
+- Node Type (Depth Generator / Device / Hands Generator, etc.)
+- Vendor Name
+- Produce Name (To distinguish two products from the same vendor)
+- Version
+
+This description should be unique to each node implementation.
+
+ at section modules_exporter_enum Enumeration
+
+The enumeration process is where production graphs are created. When an application asks for a node of a specific type,
+OpenNI enumerates the node exporters which declared this type. The node exporter is responsible of returning the list
+of production graphs that can be created in order to have such a node. Of course, each such production graph will
+have our node implementation as its root.
+
+The enumeration process is the opportunity to:
+- Check if a specific hardware is attached and ready for operation. For example, an exporter of a device node will usually
+  query the operating system to find our if a specific USB device is connected right now. It can also check if this hardware
+  is not already in use by another software, and so cannot be used. If more than one device is connected, it can return
+  two different production graphs, one for each such device.
+- Check that a valid license exists to use the node implementation.
+- Enumerate nodes from another type that are required for this node implementation to function.
+
+A production graph alternative is represented by a @ref xn::NodeInfo object. It contains a description of the node (must be
+the same as the description returned by the @ref xn::ModuleExportedProductionNode::GetDescription() method), an optional
+creation info and a list of depended nodes (through which the entire graph can be described).
+
+Adding production graphs to the list is usually done using the @ref xn::NodeInfoList::Add() method.
+
+Note that one of the returned production graph alternatives might be used later on to create the production graph, so it's
+important that this alternative will fully describe the exact instance to be created. If two alternatives only differ in the
+way the root node (our node implementation) is created, the difference can be described in the <i>creation info</i> member.
+
+If the node implementation depends on exactly one input node, it can use the @ref xn::Context::AutoEnumerateOverSingleInput()
+utility method.
+
+If no production graphs alternatives are currently available, besides returning an empty list, it is also advised to return
+a return value other than XN_STATUS_OK. This return value will be added to the EnumerationErrors object, so that the application
+can later on check why a specific node failed to enumerate.
+
+<b>Note:</b> Current OpenNI interface can not pass state while enumerating. This causes a problem if production
+graph cycles might occur (for example, if a depth generator enumerates for depth generator, or if a hands generator
+enumerates for user generator which itself enumerates for hands generator). Right now, the best solution is to 
+use a static boolean inside your Enumerate() implementation, to recognize if the method is called recursively, and
+if so, return nothing.
+
+ at section modules_exporter_create Creating the Node
+
+Once enumeration is complete, the application can choose one of the returned production graphs alternatives and ask OpenNI 
+to create it. OpenNI assures the node exporter that all needed nodes in the production graphs will be created before
+calling to xn::ModuleExportedProductionNode::Create(), so that the exporter can take those nodes and use them.
+In addition to the information found in the NodeInfo object (needed nodes, creation info), OpenNI passes to the exporter
+an instance name (the name that this node will have in OpenNI context), and a configuration dir (taken from the module
+registration. see @ref modules_registration).
+
+The exporter should create the node implementation it exports, and return a pointer to it to OpenNI.
+
+ at section modules_exporter_destroy Destroying the Node
+
+Once OpenNI determines that the node is no longer needed, it will ask the exporter to destroy it by calling @ref
+xn::ModuleExportedProductionNode::Destroy().
+
+ at section modules_exporter_ex1 Example A: Exporter for a node which requires a physical device
+
+Let's take for example a device node which represent some USB physical device. The enumeration uses the operating system
+to find out which devices are connected right now, takes the path to each of them, and create a production graph for each.
+The exporter places the device path in the creation info, so it would know the right device to connect to.
+
+The Create() method takes the creation info and passes it to the device node constructor.
+
+ at code
+class MyDevice : public virtual xn::ModuleDevice
+{
+public:
+	MyDevice(const XnChar* strDevicePath);
+	...
+};
+
+class MyDeviceExporter : public virtual xn::ModuleExportedProductionNode
+{
+public:
+	virtual void GetDescription(XnProductionNodeDescription* pDescription) 
+	{
+		pDescription->Type = XN_NODE_TYPE_DEVICE;
+		strcpy(pDescription->strVendor, "New Devices Inc.");
+		strcpy(pDescription->strName, "MyDevice");
+		pDescription->Version.nMajor = 1;
+		pDescription->Version.nMinor = 0;
+		pDescription->Version.nMaintenance = 0;
+		pDescription->Version.nBuild = 7;
+	}
+
+	virtual XnStatus EnumerateProductionTrees(Context& context, NodeInfoList& TreesList, EnumerationErrors* pErrors) 
+	{
+		XnStatus nRetVal = XN_STATUS_OK;
+
+		XnProductionNodeDescription description;
+		GetDescription(&description);
+		
+		// find which USB device are connected
+		const XnUSBConnectionString* astrDevicePaths;
+		XnUInt32 nCount;
+
+		nRetVal = xnUSBEnumerateDevices(MY_VENDOR_ID, MY_PRODUCT_ID, astrDevicePaths, &nCount);
+		XN_IS_STATUS_OK(nRetVal);
+		
+		if (nCount == 0)
+		{
+			// no device was found. return an error
+			return XN_STATUS_DEVICE_NOT_CONNECTED;
+		}
+
+		// add a production graph alternative for each connected device
+		for (XnUInt32 i = 0; i < nCount; ++i)
+		{
+			nRetVal = TreesList.Add(description, astrDevicePaths[i], NULL);
+			XN_IS_STATUS_OK(nRetVal);
+		}
+
+		xnUSBFreeDevicesList(astrDevicePaths);
+
+		return (XN_STATUS_OK);
+	}
+
+	virtual XnStatus Create(Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, 
+							NodeInfoList* pNeededTrees, const XnChar* strConfigurationDir, ModuleProductionNode** ppInstance) 
+	{
+		*ppInstance = new MyDevice(strCreationInfo);
+		if (*ppInstance == NULL)
+		{
+			return XN_STATUS_ALLOC_FAILED;
+		}
+
+		return XN_STATUS_OK;
+	}
+
+	virtual void Destroy(ModuleProductionNode* pInstance) 
+	{
+		delete pInstance;
+	}
+};
+ at endcode
+
+ at section modules_exporter_ex2 Example B: Exporter for a node which requires one input node
+
+Let's take for example a hands generator that works on an RGB image. The exporter will declare
+the node needs an image generator as input.
+
+ at code
+class MyHandsGenerator : public virtual xn::ModuleHandsGenerator
+{
+public:
+	MyHandsGenerator(ImageGenerator imageGen);
+	...
+};
+
+class MyHandsExporter : public virtual xn::ModuleExportedProductionNode
+{
+public:
+	virtual void GetDescription(XnProductionNodeDescription* pDescription) 
+	{
+		pDescription->Type = XN_NODE_TYPE_DEVICE;
+		strcpy(pDescription->strVendor, "New Algorithms Inc.");
+		strcpy(pDescription->strName, "MyHandsGenerator");
+		pDescription->Version.nMajor = 1;
+		pDescription->Version.nMinor = 0;
+		pDescription->Version.nMaintenance = 0;
+		pDescription->Version.nBuild = 7;
+	}
+
+	virtual XnStatus EnumerateProductionTrees(Context& context, NodeInfoList& TreesList, EnumerationErrors* pErrors) 
+	{
+		XnStatus nRetVal = XN_STATUS_OK;
+
+		XnProductionNodeDescription description;
+		GetDescription(&description);
+
+		return context.AutoEnumerateOverSingleInput(
+			TreesList,			// the list to be filled
+			description,		// our description
+			NULL,				// creation info. Not needed in this example.
+			XN_NODE_TYPE_IMAGE, // type of the single input required
+			pErrors,			// the EnumerationErrors object
+			NULL				// query. Not needed in this example.
+			);
+	}
+
+	virtual XnStatus Create(Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, 
+							NodeInfoList* pNeededTrees, const XnChar* strConfigurationDir, ModuleProductionNode** ppInstance) 
+	{
+		XnStatus nRetVal = XN_STATUS_OK;
+		
+		// take the first needed node
+		NodeInfoList::Iterator it = pNeededTrees->Begin();
+		if (it == pNeededTrees->End())
+		{
+			xnLogError("MyHandsGenerator", "Got a production graph different from the one returned in Enumerate()!");
+			return XN_STATUS_ERROR;
+		}
+
+		NodeInfo imageInfo = *it;
+
+		// make sure its of the right type and that this is the only one
+		if (imageInfo.GetDescription().Type != XN_NODE_TYPE_IMAGE || ++it != pNeededTrees->End())
+		{
+			xnLogError("MyHandsGenerator", "Got a production graph different from the one returned in Enumerate()!");
+			return XN_STATUS_ERROR;
+		}
+
+		// OpenNI assures us the image node is already created
+		ImageGenerator image;
+		nRetVal = imageInfo.GetInstance(image);
+		XN_IS_STATUS_OK(nRetVal);
+
+		*ppInstance = new MyHandsGenerator(image);
+		if (*ppInstance == NULL)
+		{
+			return XN_STATUS_ALLOC_FAILED;
+		}
+
+		return XN_STATUS_OK;
+	}
+
+	virtual void Destroy(ModuleProductionNode* pInstance) 
+	{
+		delete pInstance;
+	}
+};
+ at endcode
+
+ at section modules_exporter_ex3 Example C: Exporter for a node which requires two different nodes
+
+Let's take for example a hands generator that needs both RGB information and depth information
+of the scene. The exporter will create production graphs alternatives that require both
+ImageGenerator and DepthGenerator.
+
+ at code
+class MyHandsGenerator : public virtual xn::ModuleHandsGenerator
+{
+public:
+	MyHandsGenerator(ImageGenerator& imageGen, DepthGenerator& depthGen);
+	...
+};
+
+class MyHandsExporter : public virtual xn::ModuleExportedProductionNode
+{
+public:
+	virtual void GetDescription(XnProductionNodeDescription* pDescription) 
+	{
+		pDescription->Type = XN_NODE_TYPE_DEVICE;
+		strcpy(pDescription->strVendor, "New Algorithms Inc.");
+		strcpy(pDescription->strName, "MyHandsGenerator");
+		pDescription->Version.nMajor = 1;
+		pDescription->Version.nMinor = 0;
+		pDescription->Version.nMaintenance = 0;
+		pDescription->Version.nBuild = 7;
+	}
+
+	virtual XnStatus EnumerateProductionTrees(Context& context, NodeInfoList& TreesList, EnumerationErrors* pErrors) 
+	{
+		XnStatus nRetVal = XN_STATUS_OK;
+
+		XnProductionNodeDescription description;
+		GetDescription(&description);
+
+		// find production graph alternatives for image
+		NodeInfoList imageList;
+		nRetVal = context.EnumerateProductionTrees(XN_NODE_TYPE_IMAGE, NULL, imageList, pErrors);
+		XN_IS_STATUS_OK(nRetVal);
+
+		// find production graph alternatives for depth
+		NodeInfoList depthList;
+		nRetVal = context.EnumerateProductionTrees(XN_NODE_TYPE_DEPTH, NULL, depthList, pErrors);
+		XN_IS_STATUS_OK(nRetVal);
+
+		// now for each combination, we create one alternative
+		for (NodeInfoList::Iterator imageIt = imageList.Begin(); imageIt != imageList.End(); ++imageIt)
+		{
+			for (NodeInfoList::Iterator depthIt = depthList.Begin(); depthIt != depthList.End(); ++depthIt)
+			{
+				// create needed nodes list
+				NodeInfoList neededNodes;
+
+				nRetVal = neededNodes.AddNodeFromAnotherList(imageIt);
+				XN_IS_STATUS_OK(nRetVal);
+
+				nRetVal = neededNodes.AddNodeFromAnotherList(depthIt);
+				XN_IS_STATUS_OK(nRetVal);
+
+				nRetVal = TreesList.Add(
+					description,	// our description
+					NULL,			// creation info. not needed in this example
+					&neededNodes	// needed nodes list
+					);
+				XN_IS_STATUS_OK(nRetVal);
+			}
+		}
+
+		return XN_STATUS_OK;
+	}
+
+	virtual XnStatus Create(Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, 
+							NodeInfoList* pNeededTrees, const XnChar* strConfigurationDir, ModuleProductionNode** ppInstance) 
+	{
+		XnStatus nRetVal = XN_STATUS_OK;
+		
+		// take the first needed node
+		NodeInfoList::Iterator it = pNeededTrees->Begin();
+		if (it == pNeededTrees->End())
+		{
+			xnLogError("MyHandsGenerator", "Got a production graph different from the one returned in Enumerate()!");
+			return XN_STATUS_ERROR;
+		}
+
+		NodeInfo imageInfo = *it;
+
+		// take the second needed node
+		++it;
+		if (it == pNeededTrees->End())
+		{
+			xnLogError("MyHandsGenerator", "Got a production graph different from the one returned in Enumerate()!");
+			return XN_STATUS_ERROR;
+		}
+
+		NodeInfo depthInfo = *it;
+
+		// make sure types are correct and that no more nodes were received
+		if (imageInfo.GetDescription().Type != XN_NODE_TYPE_IMAGE || 
+			depthInfo.GetDescription().Type != XN_NODE_TYPE_DEPTH ||
+			++it != pNeededTrees->End())
+		{
+			xnLogError("MyHandsGenerator", "Got a production graph different from the one returned in Enumerate()!");
+			return XN_STATUS_ERROR;
+		}
+
+		// OpenNI assures us the nodes are already created
+		ImageGenerator image;
+		nRetVal = imageInfo.GetInstance(image);
+		XN_IS_STATUS_OK(nRetVal);
+
+		DepthGenerator depth;
+		nRetVal = depthInfo.GetInstance(depth);
+		XN_IS_STATUS_OK(nRetVal);
+
+		*ppInstance = new MyHandsGenerator(image, depth);
+		if (*ppInstance == NULL)
+		{
+			return XN_STATUS_ALLOC_FAILED;
+		}
+
+		return XN_STATUS_OK;
+	}
+
+	virtual void Destroy(ModuleProductionNode* pInstance) 
+	{
+		delete pInstance;
+	}
+};
+ at endcode
+
+*/
+
+/**
+ at page modules_module Module Entry Points
+
+Now that we have a node implementation and an exporter which exports it to OpenNI, all that is
+left is to let OpenNI know which exporters exist in your module.
+
+The best way to do so is to create a new cpp file, and in it:
+*-	Include OpenNI C++ registration header:
+	@code
+	#include <XnModuleCppRegistratration.h>
+	@endcode
+*-	Declare this module. This is done by the following line:
+	@code
+	XN_EXPORT_MODULE(xn::Module)
+	@endcode
+	If you want your module to behave differently than default (for example, do some extra initialization
+	upon shared library loading), you can create a new class, inheriting from xn::Module, and export it instead.
+*-	Declare all exporters using the corresponding macros. For example, to declare a HandsGenerator exporter:
+	@code
+	XN_EXPORT_HANDS(xn::MyHandsExporter)
+	@endcode
+
+*/
+
+/**
+ at page modules_registration Registering the new Module
+
+Our module is now complete. All we need to do now is to register our shared library with OpenNI. This can
+be done using OpenNI's niReg utility. see @ref nireg for usage.
+
+*/
 
 
 /**
@@ -1570,3 +2514,14 @@ Those utilities are also available to any application using OpenNI. OpenNI guare
 for this framework (up to a certain extent, as opposed to OpenNI actual API, which guarentees full backwards
 compatibility).
 */
+
+
+
+/**
+ at page legal Legal Stuff & Acknowledgments
+
+"This software is based in part on the work of the Independent JPEG Group"
+
+OpenNI uses TinyXML for its implementation (www.sourceforge.net/projects/tinyxml).
+
+*/
\ No newline at end of file
diff --git a/Source/OpenNI/FilesOnly/FilesOnlyCriticalSections.cpp b/Source/OpenNI/FilesOnly/FilesOnlyCriticalSections.cpp
index 82d8d57..700dc8c 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlyCriticalSections.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlyCriticalSections.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/FilesOnlyEvents.cpp b/Source/OpenNI/FilesOnly/FilesOnlyEvents.cpp
index 97f496d..d7f6a27 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlyEvents.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlyEvents.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/FilesOnlyFiles.cpp b/Source/OpenNI/FilesOnly/FilesOnlyFiles.cpp
index 67a5ad8..6528cc9 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlyFiles.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlyFiles.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/FilesOnlyINI.cpp b/Source/OpenNI/FilesOnly/FilesOnlyINI.cpp
index 5806cfb..9b4a6af 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlyINI.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlyINI.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -56,7 +56,7 @@
 //---------------------------------------------------------------------------
 // Code
 //---------------------------------------------------------------------------
-XnStatus FindEntry(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnChar* cpDest)
+static XnStatus FindEntry(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnChar* cpDest)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 	
diff --git a/Source/OpenNI/FilesOnly/FilesOnlyMemory.cpp b/Source/OpenNI/FilesOnly/FilesOnlyMemory.cpp
index 6787711..02f1a3b 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlyMemory.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlyMemory.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/FilesOnlyMutex.cpp b/Source/OpenNI/FilesOnly/FilesOnlyMutex.cpp
index f45a155..deb71c2 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlyMutex.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlyMutex.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/FilesOnlyNetwork.cpp b/Source/OpenNI/FilesOnly/FilesOnlyNetwork.cpp
index 9b6fa91..cfb0589 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlyNetwork.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlyNetwork.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/FilesOnlySharedLibs.cpp b/Source/OpenNI/FilesOnly/FilesOnlySharedLibs.cpp
index 44578ad..1d0b61d 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlySharedLibs.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlySharedLibs.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/FilesOnlyStrings.cpp b/Source/OpenNI/FilesOnly/FilesOnlyStrings.cpp
index 729d756..538e35f 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlyStrings.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlyStrings.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -172,6 +172,12 @@ XN_C_API XnStatus xnOSStrCopy(XnChar* cpDestString, const XnChar* cpSrcString, c
 	return (XN_STATUS_OK);
 }
 
+XN_C_API XnUInt32 xnOSStrLen(const XnChar* cpString)
+{
+	XN_VALIDATE_PTR(cpString, 0);
+	return (XnUInt32)strlen(cpString);
+}
+
 XN_C_API XnStatus xnOSStrNCopy(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nCopyLength, const XnUInt32 nDestLength)
 {
 	// Validate the input/output pointers (to make sure none of them is NULL)
diff --git a/Source/OpenNI/FilesOnly/FilesOnlyThreads.cpp b/Source/OpenNI/FilesOnly/FilesOnlyThreads.cpp
index 331b380..a8d6901 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlyThreads.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlyThreads.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/FilesOnlyTime.cpp b/Source/OpenNI/FilesOnly/FilesOnlyTime.cpp
index 2c80438..aa11890 100644
--- a/Source/OpenNI/FilesOnly/FilesOnlyTime.cpp
+++ b/Source/OpenNI/FilesOnly/FilesOnlyTime.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/XnOSFilesOnly.cpp b/Source/OpenNI/FilesOnly/XnOSFilesOnly.cpp
index 1abf337..e5cd3e2 100644
--- a/Source/OpenNI/FilesOnly/XnOSFilesOnly.cpp
+++ b/Source/OpenNI/FilesOnly/XnOSFilesOnly.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/XnUSBFilesOnly.cpp b/Source/OpenNI/FilesOnly/XnUSBFilesOnly.cpp
index ea76868..462d68b 100644
--- a/Source/OpenNI/FilesOnly/XnUSBFilesOnly.cpp
+++ b/Source/OpenNI/FilesOnly/XnUSBFilesOnly.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/FilesOnly/XnUSBFilesOnly.h b/Source/OpenNI/FilesOnly/XnUSBFilesOnly.h
index cda254d..b331e81 100644
--- a/Source/OpenNI/FilesOnly/XnUSBFilesOnly.h
+++ b/Source/OpenNI/FilesOnly/XnUSBFilesOnly.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Linux-x86/Linux-x86CriticalSections.cpp b/Source/OpenNI/Linux-x86/Linux-x86CriticalSections.cpp
deleted file mode 100644
index 41dca09..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86CriticalSections.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API XnStatus xnOSCreateCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle)
-{
-	return xnOSCreateMutex(pCriticalSectionHandle);
-}
-
-XN_C_API XnStatus xnOSCloseCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle)
-{
-	return xnOSCloseMutex(pCriticalSectionHandle);
-}
-
-XN_C_API XnStatus xnOSEnterCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle)
-{
-	return xnOSLockMutex(*pCriticalSectionHandle, XN_WAIT_INFINITE);
-}
-
-XN_C_API XnStatus xnOSLeaveCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle)
-{
-	return xnOSUnLockMutex(*pCriticalSectionHandle);
-}
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Debug.cpp b/Source/OpenNI/Linux-x86/Linux-x86Debug.cpp
deleted file mode 100644
index a30f569..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Debug.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <execinfo.h>
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-
-XN_C_API XnStatus xnOSGetCurrentCallStack(XnUInt32 nFramesToSkip, XnChar** astrFrames, XnUInt32 nMaxNameLength, XnUInt32* pnFrames)
-{
-	if (*pnFrames == 0 || nMaxNameLength == 0)
-	{
-		return XN_STATUS_OK;
-	}
-	
-	void* aFrames[256];
-	int nTotalFrames = backtrace(aFrames, *pnFrames + nFramesToSkip);
-	
-	if (nFramesToSkip >= nTotalFrames)
-	{
-		*pnFrames = 0;
-        return (XN_STATUS_OK);
-	}
-	
-	// now resolve names
-    XnUInt32 nResolve = nTotalFrames - nFramesToSkip;
-	char** pstrFrames = backtrace_symbols(aFrames + nFramesToSkip, nResolve);
-    if (pstrFrames == NULL)
-    {
-        *pnFrames = 0;
-        return (XN_STATUS_OK);
-    }
-    
-    for (XnUInt i = 0; i < nResolve; ++i)
-    {
-        strncpy(astrFrames[i], pstrFrames[i], nMaxNameLength);
-    }
-    
-    free(pstrFrames);
-    
-    *pnFrames = nResolve;
-
-	return XN_STATUS_OK;
-}
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Events.cpp b/Source/OpenNI/Linux-x86/Linux-x86Events.cpp
deleted file mode 100644
index bc2c6df..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Events.cpp
+++ /dev/null
@@ -1,464 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-#include <XnLog.h>
-
-//---------------------------------------------------------------------------
-// Defines
-//---------------------------------------------------------------------------
-enum _XN_EVENT_SEM_TYPE
-{
-	XN_EVENT_SEM_REF_COUNT = 0,
-	XN_EVENT_SEM_SIGNALED,
-	XN_EVENT_SEM_MANUAL_RESET,
-	XN_EVENT_NUM_OF_SEMS
-};
-
-//---------------------------------------------------------------------------
-// Types
-//---------------------------------------------------------------------------
-#ifndef XN_PLATFORM_HAS_BUILTIN_SEMUN
-union semun {
-               int              val;    /* Value for SETVAL */
-               struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
-               unsigned short  *array;  /* Array for GETALL, SETALL */
-               struct seminfo  *__buf;  /* Buffer for IPC_INFO
-                                           (Linux-specific) */
-           };
-#endif
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API XnStatus xnOSCreateEvent(XN_EVENT_HANDLE* pEventHandle, XnBool bManualReset)
-{
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pEventHandle);
-	
-	// allocate event struct
-	XN_VALIDATE_ALLOC(*pEventHandle, _XnEvent);
-	
-	XN_EVENT_HANDLE pEvent = *pEventHandle;
-	pEvent->bSignaled = FALSE;
-
-	// Create a cond object
-	if (0 != pthread_cond_init(&pEvent->cond, NULL))
-	{
-		XN_FREE_AND_NULL(*pEventHandle);
-		return (XN_STATUS_OS_EVENT_CREATION_FAILED);
-	}
-	
-	// create the restriction mutex object
-	if (0 != pthread_mutex_init(&pEvent->mutex, NULL))
-	{
-		XN_FREE_AND_NULL(*pEventHandle);
-		pthread_cond_destroy(&pEvent->cond);
-		return (XN_STATUS_OS_EVENT_CREATION_FAILED);
-	}
-
-	pEvent->bManualReset = bManualReset;
-	pEvent->bNamed = FALSE;
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCreateNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pEventHandle);
-	
-	// allocate event struct
-	XN_VALIDATE_ALLOC(*pEventHandle, _XnEvent);
-	
-	XN_EVENT_HANDLE pEvent = *pEventHandle;
-	pEvent->bSignaled = FALSE;
-
-	// translate event name to key file name
-	XnUInt32 nBytesWritten;
-	xnOSStrFormat(pEvent->csSemFileName,XN_FILE_MAX_PATH,&nBytesWritten,"/tmp/XnCore.Event.%s.key", cpEventName);
-
-	// create the file (must exist for ftok)
-	pEvent->hSemFile = open(pEvent->csSemFileName, O_CREAT | O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
-	if (-1 == pEvent->hSemFile)
-	{
-		XN_FREE_AND_NULL(*pEventHandle);
-		return XN_STATUS_OS_FILE_OPEN_FAILED;
-	}
-
-	// create the key
-	key_t key = ftok(pEvent->csSemFileName,1);
-	
-	// Try to create the semaphore
-	// Creating two semaphores. First semaphore will be used as reference count, and second for the signaled state
-	pEvent->NamedSem = semget(key, XN_EVENT_NUM_OF_SEMS, IPC_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
-	if (-1 == pEvent->NamedSem)
-	{
-		xnLogWarning(XN_MASK_OS, "Failed creating named event - semget failed with errno %d", errno);
-		XN_FREE_AND_NULL(*pEventHandle);
-		return XN_STATUS_OS_EVENT_CREATION_FAILED;
-	}
-	
-	// if no one is using it so far (this is a newly created event), reset it
-	if (0 == semctl(pEvent->NamedSem, XN_EVENT_SEM_REF_COUNT, GETVAL))
-	{
-		// set it to the non-signaled state
-		semun val;
-		val.val = 0;
-		if (0 != semctl(pEvent->NamedSem, XN_EVENT_SEM_SIGNALED, SETVAL, val))
-		{
-			xnLogWarning(XN_MASK_OS, "Failed creating named event - semctl for signaled failed with errno %d", errno);
-			semctl(pEvent->NamedSem, 0, IPC_RMID);
-			XN_FREE_AND_NULL(*pEventHandle);
-			return XN_STATUS_OS_EVENT_CREATION_FAILED;
-		}
-		
-		// set its manual reset value
-		val.val = bManualReset;
-		if (0 != semctl(pEvent->NamedSem, XN_EVENT_SEM_MANUAL_RESET, SETVAL, val))
-		{
-			xnLogWarning(XN_MASK_OS, "Failed creating named event - semctl for manual reset failed with errno %d", errno);
-			semctl(pEvent->NamedSem, 0, IPC_RMID);
-			XN_FREE_AND_NULL(*pEventHandle);
-			return XN_STATUS_OS_EVENT_CREATION_FAILED;
-		}
-	}
-	
-	// adding 1 to reference count
-	struct sembuf op;
-	op.sem_op = 1;
-	op.sem_num = XN_EVENT_SEM_REF_COUNT;
-	op.sem_flg = SEM_UNDO;
-	semop(pEvent->NamedSem, &op, 1);
-
-	pEvent->bManualReset = semctl(pEvent->NamedSem, XN_EVENT_SEM_MANUAL_RESET, GETVAL);
-	pEvent->bNamed = TRUE;
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSOpenNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pEventHandle);
-	
-	// allocate event struct
-	XN_VALIDATE_ALLOC(*pEventHandle, _XnEvent);
-	
-	XN_EVENT_HANDLE pEvent = *pEventHandle;
-	pEvent->bSignaled = FALSE;
-
-	// translate event name to key file name
-	XnUInt32 nBytesWritten;
-	xnOSStrFormat(pEvent->csSemFileName,XN_FILE_MAX_PATH,&nBytesWritten,"/tmp/XnCore.Event.%s.key", cpEventName);
-
-	// create the key
-	key_t key = ftok(pEvent->csSemFileName,1);
-	if (-1 == key)
-	{
-		// event does not exist
-		XN_FREE_AND_NULL(*pEventHandle);
-		return XN_STATUS_OS_EVENT_OPEN_FAILED;
-	}
-	
-	// Try to open the semaphore
-	pEvent->NamedSem = semget(key, XN_EVENT_NUM_OF_SEMS, 0);
-	if (-1 == pEvent->NamedSem)
-	{
-		XN_FREE_AND_NULL(*pEventHandle);
-		return XN_STATUS_OS_EVENT_OPEN_FAILED;
-	}
-	
-	// if ref count is 0, the event does not really exist
-	if (0 == semctl(pEvent->NamedSem, XN_EVENT_SEM_REF_COUNT, GETVAL))
-	{
-		XN_FREE_AND_NULL(*pEventHandle);
-		return XN_STATUS_OS_EVENT_OPEN_FAILED;
-	}
-	
-	// adding 1 to reference count
-	struct sembuf op;
-	op.sem_op = 1;
-	op.sem_num = XN_EVENT_SEM_REF_COUNT;
-	op.sem_flg = SEM_UNDO;
-	semop(pEvent->NamedSem, &op, 1);
-
-	pEvent->bManualReset = semctl(pEvent->NamedSem, XN_EVENT_SEM_MANUAL_RESET, GETVAL);
-	pEvent->bNamed = TRUE;
-
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSCloseEvent(XN_EVENT_HANDLE* pEventHandle)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pEventHandle);
-
-	// Make sure the actual event handle isn't NULL
-	XN_RET_IF_NULL(*pEventHandle, XN_STATUS_OS_INVALID_EVENT);
-	
-	XN_EVENT_HANDLE pEvent = *pEventHandle;
-
-	if(pEvent->bNamed)
-	{
-		// dec ref count
-		struct sembuf op;
-		op.sem_num = XN_EVENT_SEM_REF_COUNT;
-		op.sem_op = -1;
-		op.sem_flg = IPC_NOWAIT | SEM_UNDO;
-		semop(pEvent->NamedSem, &op, 1); 
-
-		// check current ref count. If 0, destroy it
-		int val = semctl(pEvent->NamedSem, 0, GETVAL);
-		if (0 == val)
-		{
-			// destroy the semaphore
-			semctl(pEvent->NamedSem, 0, IPC_RMID);
-			// and remove file
-			xnOSDeleteFile(pEvent->csSemFileName);
-		}
-	}
-	else
-	{
-		// Destroy the cond and mutex objects
-		if (0 != pthread_cond_destroy(&pEvent->cond) || 0 != pthread_mutex_destroy(&pEvent->mutex))
-		{
-			return (XN_STATUS_OS_EVENT_CLOSE_FAILED);
-		}
-	}
-	
-	// free the event struct
-	XN_FREE_AND_NULL(*pEventHandle);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSSetEvent(const XN_EVENT_HANDLE EventHandle)
-{
-	// Make sure the actual event handle isn't NULL
-	XN_RET_IF_NULL(EventHandle, XN_STATUS_OS_INVALID_EVENT);
-
-	if (EventHandle->bNamed)
-	{
-		struct sembuf op[2];
-		
-		// check if it's not signaled (by waiting for 0, with IPC_NOWAIT)
-		op[0].sem_num = XN_EVENT_SEM_SIGNALED;
-		op[0].sem_op = 0;
-		op[0].sem_flg = IPC_NOWAIT;
-		
-		// signal (if zero)
-		op[1].sem_num = XN_EVENT_SEM_SIGNALED;
-		op[1].sem_op = 1;
-		op[1].sem_flg = SEM_UNDO;
-		
-		semop(EventHandle->NamedSem, op, 2);
-		// no need to check error code. either it succeeded, or the event is already signaled
-	}
-	else
-	{
-		// lock the mutex
-		if (0 != pthread_mutex_lock(&EventHandle->mutex))
-		{
-			return (XN_STATUS_OS_EVENT_SET_FAILED);
-		}
-		
-		// signal the condition
-		EventHandle->bSignaled = TRUE;
-		
-		// wake other threads
-		if (0 != pthread_cond_broadcast(&EventHandle->cond))
-		{
-			pthread_mutex_unlock(&EventHandle->mutex);
-			return XN_STATUS_OS_EVENT_SET_FAILED;
-		}
-			
-		// unlock the mutex
-		if (0 != pthread_mutex_unlock(&EventHandle->mutex))
-		{
-			return (XN_STATUS_OS_EVENT_SET_FAILED);
-		}
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
- }
-
-XN_C_API XnStatus xnOSResetEvent(const XN_EVENT_HANDLE EventHandle)
-{
-	// Make sure the actual event handle isn't NULL
-	XN_RET_IF_NULL(EventHandle, XN_STATUS_OS_INVALID_EVENT);
-
-	if (EventHandle->bNamed)
-	{
-		// unsignal it, with NOWAIT (that way, if it's not signaled, nothing will happen)
-		struct sembuf op;
-		op.sem_num = XN_EVENT_SEM_SIGNALED;
-		op.sem_op = -1;
-		op.sem_flg = IPC_NOWAIT;
-		semop(EventHandle->NamedSem, &op, 1);
-	}
-	else
-	{	
-		EventHandle->bSignaled = FALSE;
-	}
-	
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnBool xnOSIsEventSet(const XN_EVENT_HANDLE EventHandle)
-{
-	return (xnOSWaitEvent(EventHandle, 0) == XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSWaitEvent(const XN_EVENT_HANDLE EventHandle, XnUInt32 nMilliseconds)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// Make sure the actual event handle isn't NULL
-	XN_RET_IF_NULL(EventHandle, XN_STATUS_OS_INVALID_EVENT);
-
-	struct timespec time = {0};
-
-	if(EventHandle->bNamed)
-	{
-		if (nMilliseconds != XN_WAIT_INFINITE)
-		{
-			nRetVal = xnOSGetTimeout(&time, nMilliseconds);
-			if (nRetVal != XN_STATUS_OK)
-			{
-				return XN_STATUS_OS_EVENT_WAIT_FAILED;
-			}
-		}
-
-		struct sembuf op[2];
-		
-		// wait for it to be 1
-		op[0].sem_num = XN_EVENT_SEM_SIGNALED;
-		op[0].sem_op = -1;
-		op[0].sem_flg = 0;
-		
-		// re set it (if manual reset)
-		op[1].sem_num = XN_EVENT_SEM_SIGNALED;
-		op[1].sem_op = 1;
-		op[1].sem_flg = 0;
-		
-		XnInt32 nOpsCount = EventHandle->bManualReset ? 2 : 1;
-		
-		if (XN_WAIT_INFINITE != nMilliseconds)
-		{
-#ifndef XN_PLATFORM_HAS_NO_TIMED_OPS
-			if (0 != semtimedop(EventHandle->NamedSem, op, nOpsCount, &time))
-#else
-			if (0 != semop(EventHandle->NamedSem, op, nOpsCount))	
-#endif
-			{
-				if(EAGAIN == errno)
-				{
-					return XN_STATUS_OS_EVENT_TIMEOUT;
-				}
-				return XN_STATUS_OS_EVENT_WAIT_FAILED;
-			}
-		}
-		else
-		{
-			if (0 != semop(EventHandle->NamedSem, op, nOpsCount))
-			{
-				return XN_STATUS_OS_EVENT_WAIT_FAILED;
-			}
-		}
-	}
-	else // not named
-	{
-		if (nMilliseconds != XN_WAIT_INFINITE)
-		{
-			nRetVal = xnOSGetAbsTimeout(&time, nMilliseconds);
-			if (nRetVal != XN_STATUS_OK)
-			{
-				return XN_STATUS_OS_EVENT_WAIT_FAILED;
-			}
-		}
-		
-		// lock the mutex
-		if (0 != pthread_mutex_lock(&EventHandle->mutex))
-		{
-			return (XN_STATUS_OS_EVENT_WAIT_FAILED);
-		}
-	
-		// wait for the condition to become signaled (or a failure)
-		int rc;
-		while (nRetVal == XN_STATUS_OK && !EventHandle->bSignaled)
-		{
-			if (nMilliseconds != XN_WAIT_INFINITE)
-			{
-				rc = pthread_cond_timedwait(&EventHandle->cond, &EventHandle->mutex, &time);
-			}
-			else // infinite
-			{
-				rc = pthread_cond_wait(&EventHandle->cond, &EventHandle->mutex);
-			}
-			
-			if (rc == ETIMEDOUT)
-			{
-				nRetVal = XN_STATUS_OS_EVENT_TIMEOUT;
-			}
-			else if (rc != 0)
-			{
-				nRetVal = XN_STATUS_OS_EVENT_WAIT_FAILED;
-			}
-		}
-		
-		// check all went well
-		if (nRetVal != XN_STATUS_OK)
-		{
-			pthread_mutex_unlock(&EventHandle->mutex);
-			return nRetVal;	
-		}
-		
-		if (!EventHandle->bManualReset)
-		{
-			// auto-reset the event
-			EventHandle->bSignaled = FALSE;
-		}
-		
-		// unlock the mutex
-		if (0 != pthread_mutex_unlock(&EventHandle->mutex))
-		{
-			return (XN_STATUS_OS_EVENT_WAIT_FAILED);
-		}
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Files.cpp b/Source/OpenNI/Linux-x86/Linux-x86Files.cpp
deleted file mode 100644
index 266ab40..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Files.cpp
+++ /dev/null
@@ -1,502 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <glob.h>
-#include <libgen.h>
-#include <errno.h>
-#include <limits.h>
-#include <XnLog.h>
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API XnStatus xnOSGetFileList(const XnChar* cpSearchPattern, const XnChar* cpPrefixPath, XnChar cpFileList[][XN_FILE_MAX_PATH], const XnUInt32 nMaxFiles, XnUInt32* pnFoundFiles)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpSearchPattern);
-	XN_VALIDATE_OUTPUT_PTR(cpFileList);
-	XN_VALIDATE_OUTPUT_PTR(pnFoundFiles);
-
-	// Reset the number of found files counter
-	*pnFoundFiles = 0;
-
-	// now call the OS glob function
-	glob_t tGlob;
-	glob(cpSearchPattern, 0, NULL, &tGlob);
-	
-	XnUInt32 nFoundFiles = XN_MIN(tGlob.gl_pathc, nMaxFiles);
-	for (XnUInt32 i = 0; i < nFoundFiles; ++i)
-	{
-		// Copy the file string into its place in the file list
-		xnOSStrCopy(cpFileList[i], tGlob.gl_pathv[i], XN_FILE_MAX_PATH);
-
-		if (cpPrefixPath != NULL)
-		{
-			xnOSStrPrefix(cpPrefixPath, cpFileList[i], XN_FILE_MAX_PATH);
-		}
-	}
-	
-	// free memory allocated by OS
-	globfree(&tGlob);
-	
-	// Return a file not found error if no files were found...
-	if (nFoundFiles == 0)
-	{
-		return (XN_STATUS_OS_FILE_NOT_FOUND);
-	}
-
-	// Write the temporary number of found files counter into the output
-	*pnFoundFiles = nFoundFiles;
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSOpenFile(const XnChar* cpFileName, const XnUInt32 nFlags, XN_FILE_HANDLE* pFile)
-{
-	// Local function variables
-	XnUInt32 nOSOpenFlags = 0;
-	
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpFileName);
-	XN_VALIDATE_OUTPUT_PTR(pFile);
-	
-	// Update the OS Open flags according the user request
-	if ((nFlags & XN_OS_FILE_READ) && (nFlags & XN_OS_FILE_WRITE))
-	{
-		nOSOpenFlags |= O_RDWR | O_CREAT;
-	}
-	else if (nFlags & XN_OS_FILE_READ)
-	{
-		nOSOpenFlags |= O_RDONLY;
-	}
-	else if (nFlags & XN_OS_FILE_WRITE)
-	{
-		nOSOpenFlags |= O_WRONLY | O_CREAT;
-	}
-	
-	if (nFlags & XN_OS_FILE_CREATE_NEW_ONLY)
-	{
-		// It's OK to create a new file, but fail if the file already exist
-		nOSOpenFlags |= O_EXCL;
-	}
-	
-	if (nFlags & XN_OS_FILE_TRUNCATE)
-	{
-		// If the file exists, we need to truncate it to zero
-		nOSOpenFlags |= O_TRUNC;
-	}
-	
-	if ((nFlags & XN_OS_FILE_WRITE) && (nFlags & XN_OS_FILE_AUTO_FLUSH))
-	{
-		nOSOpenFlags |= O_SYNC;
-	}
-	
-	if (nFlags & XN_OS_FILE_APPEND)
-	{
-		nOSOpenFlags |= O_APPEND;
-	}
-
-	// Open the file via the OS (give read permissions to ALL)
-	*pFile = open(cpFileName, nOSOpenFlags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-
-	// handle failure...
-	if (*pFile == XN_INVALID_FILE_HANDLE)
-	{
-		switch (errno)
-		{
-			case EEXIST:
-				return XN_STATUS_OS_FILE_ALREDY_EXISTS;
-			case ENOENT:
-				return XN_STATUS_OS_FILE_NOT_FOUND;
-			default:
-				return XN_STATUS_OS_FILE_OPEN_FAILED;
-		}
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCloseFile(XN_FILE_HANDLE* pFile)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pFile);
-	
-	// make sure this is a valid file descriptor
-	if (*pFile == XN_INVALID_FILE_HANDLE)
-	{
-		return XN_STATUS_OS_INVALID_FILE;
-	}
-	
-	if (0 != close(*pFile))
-	{
-		// Something went wrong while trying to close the file...
-		return (XN_STATUS_OS_FILE_CLOSE_FAILED);
-	}
-	
-	// make the user file descriptor invalid
-	*pFile = XN_INVALID_FILE_HANDLE;
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSReadFile(const XN_FILE_HANDLE File, void* pBuffer, XnUInt32* pnBufferSize)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pBuffer);
-	XN_VALIDATE_INPUT_PTR(pnBufferSize);
-
-	// Make sure the actual file handle isn't invalid
-	if (File == XN_INVALID_FILE_HANDLE)
-	{
-		return XN_STATUS_OS_INVALID_FILE;
-	}
-
-	// Read a buffer from a file handle via the OS
-	ssize_t nBytesRead = read(File, pBuffer, *pnBufferSize);
-	if (nBytesRead == -1)
-	{
-		return XN_STATUS_OS_FILE_READ_FAILED;
-	}
-	
-	// update the number of bytes read
-	*pnBufferSize = nBytesRead;
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSWriteFile(const XN_FILE_HANDLE File, const void* pBuffer, const XnUInt32 nBufferSize)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pBuffer);
-
-	// Make sure the actual file handle isn't invalid
-	if (File == XN_INVALID_FILE_HANDLE)
-	{
-		return XN_STATUS_OS_INVALID_FILE;
-	}
-
-	// Write a buffer to a file handle via the OS
-	ssize_t nBytesWritten = write(File, pBuffer, nBufferSize);
-	
-	// Make sure it succeeded (return value is not -1) and that the correct number of bytes were written
-	if ((nBytesWritten == -1) || (nBufferSize != nBytesWritten))
-	{
-		return XN_STATUS_OS_FILE_WRITE_FAILED;
-	}
-	
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSSeekFile(const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt32 nOffset)
-{
-	// Local function variables
-	off_t nRealSeekType = 0;
-	off_t nRetOffset = 0;
-
-	// Make sure the actual file handle isn't invalid
-	if (File == XN_INVALID_FILE_HANDLE)
-	{
-		return XN_STATUS_OS_INVALID_FILE;
-	}
-
-	// Convert the Xiron seek type into OS seek type
-	switch (SeekType)
-	{
-		case XN_OS_SEEK_SET:
-			// Absolute seek from the file beginning
-			nRealSeekType = SEEK_SET;
-			break;
-		case XN_OS_SEEK_CUR:
-			// Relative seek from the current location
-			nRealSeekType = SEEK_CUR;
-			break;
-		case XN_OS_SEEK_END:
-			// Absolute seek from the file ending
-			nRealSeekType = SEEK_END;
-			break;
-		default:
-			return (XN_STATUS_OS_INVALID_SEEK_TYPE);
-	}
-
-	// Seek a file handle via the OS
-	nRetOffset = lseek(File, nOffset, nRealSeekType);
-
-	// Make sure it succeeded (return value is valid) and that we reached the expected file offset
-	if (nRetOffset == (off_t)-1)
-	{
-		return (XN_STATUS_OS_FILE_SEEK_FAILED);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSTellFile(const XN_FILE_HANDLE File, XnUInt32* pnFilePos)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_OUTPUT_PTR(pnFilePos);
-	
-	// Make sure the actual file handle isn't invalid
-	if (File == XN_INVALID_FILE_HANDLE)
-	{
-		return XN_STATUS_OS_INVALID_FILE;
-	}
-	
-		// Seek a file handle by 0 bytes in order to read the file position
-	off_t nFilePos = lseek(File, 0, SEEK_CUR);
-
-	// Make sure it succeeded (return value is valid)
-	if (nFilePos == (off_t)-1)
-	{
-		return (XN_STATUS_OS_FILE_TELL_FAILED);
-	}
-	
-	*pnFilePos = nFilePos;
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSFlushFile(const XN_FILE_HANDLE File)
-{
-	// Make sure the actual file handle isn't invalid
-	if (File == XN_INVALID_FILE_HANDLE)
-	{
-		return XN_STATUS_OS_INVALID_FILE;
-	}
-	
-	// flush via the OS
-	if (-1 == fsync(File))
-	{
-		return XN_STATUS_OS_FILE_FLUSH_FAILED;
-	}
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSFileExists(const XnChar* cpFileName, XnBool* bResult)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpFileName);
-	XN_VALIDATE_OUTPUT_PTR(bResult);
-
-	// Reset the output result
-	*bResult = FALSE;
-
-	// Check if the file exists and update the result accordingly
-	if ((access(cpFileName, F_OK)) != -1)
-	{
-		*bResult = TRUE;
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetFileSize(const XnChar* cpFileName, XnUInt32* pnFileSize)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpFileName);
-	XN_VALIDATE_OUTPUT_PTR(pnFileSize);
-	
-	struct stat fileStat;
-	if (-1 == stat(cpFileName, &fileStat))
-	{
-		return (XN_STATUS_OS_FILE_GET_SIZE_FAILED);	
-	}
-	
-	*pnFileSize = fileStat.st_size;
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCreateDirectory(const XnChar* cpDirName)
-{
-	// Local function variables
-	XnInt32 nRetVal = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpDirName);
-
-	nRetVal = mkdir(cpDirName, S_IRWXU | S_IRWXG | S_IRWXO);
-	if (nRetVal != 0)
-	{
-		return (XN_STATUS_OS_FAILED_TO_CREATE_DIR);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetDirName(const XnChar* cpFilePath, XnChar* cpDirName, const XnUInt32 nBufferSize)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// first copy the string (OS may change the argument)
-	XnChar cpInput[XN_FILE_MAX_PATH];
-	nRetVal = xnOSStrCopy(cpInput, cpFilePath, XN_FILE_MAX_PATH);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	// now call the OS
-	XnChar* cpResult = dirname(cpInput);
-	
-	// copy result to user buffer
-	nRetVal = xnOSStrCopy(cpDirName, cpResult, nBufferSize);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetFileName(const XnChar* cpFilePath, XnChar* cpDirName, const XnUInt32 nBufferSize)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// first copy the string (OS may change the argument)
-	XnChar cpInput[XN_FILE_MAX_PATH];
-	nRetVal = xnOSStrCopy(cpInput, cpFilePath, XN_FILE_MAX_PATH);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	// now call the OS
-	XnChar* cpResult = basename(cpInput);
-	
-	// copy result to user buffer
-	nRetVal = xnOSStrCopy(cpDirName, cpResult, nBufferSize);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetFullPathName(const XnChar* strFilePath, XnChar* strFullPath, XnUInt32 nBufferSize)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	// pass a temp string (with max size)
-	XnChar strResult[PATH_MAX];
-
-	if (NULL == realpath(strFilePath, strResult))
-	{
-		xnLogWarning(XN_MASK_OS, "Failed getting full path name: errno is %d", errno);
-		return XN_STATUS_ERROR;
-	}
-
-	// now check if we can copy
-	if (strlen(strResult) >= nBufferSize)
-	{
-		return XN_STATUS_OUTPUT_BUFFER_OVERFLOW;
-	}
-
-	// and copy
-	strcpy(strFullPath, strResult);
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetCurrentDir(XnChar* cpDirName, const XnUInt32 nBufferSize)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	if (NULL == getcwd(cpDirName, nBufferSize))
-	{
-		if (errno == ERANGE)
-			return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW);
-		else
-			return (XN_STATUS_ERROR);
-	}
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSSetCurrentDir(const XnChar* cpDirName)
-{
-	if (0 != chdir(cpDirName))
-	{
-		return (XN_STATUS_ERROR);
-	}
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSDeleteFile(const XnChar* cpFileName)
-{
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpFileName);
-
-	if (0 != unlink(cpFileName))
-	{
-		return (XN_STATUS_OS_FAILED_TO_DELETE_FILE);
-	}
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSDoesFileExist(const XnChar* cpFileName, XnBool* pbResult)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpFileName);
-	XN_VALIDATE_OUTPUT_PTR(pbResult);
-
-	// Reset the output result
-	*pbResult = FALSE;
-
-	// Check if the file exists and update the result accordingly
-	if ((access(cpFileName, F_OK)) != -1)
-	{
-		*pbResult = TRUE;
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSDoesDirecotyExist(const XnChar* cpDirName, XnBool* pbResult)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpDirName);
-	XN_VALIDATE_OUTPUT_PTR(pbResult);
-
-	// Reset the output result
-	*pbResult = FALSE;
-
-	// Check if the file exists and update the result accordingly
-	struct stat nodeStat;
-	if (stat(cpDirName, &nodeStat) == 0 &&
-		S_ISDIR(nodeStat.st_mode))
-	{
-		*pbResult = TRUE;
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
diff --git a/Source/OpenNI/Linux-x86/Linux-x86INI.cpp b/Source/OpenNI/Linux-x86/Linux-x86INI.cpp
deleted file mode 100644
index 5806cfb..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86INI.cpp
+++ /dev/null
@@ -1,270 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <string.h>
-
-#define XN_READ_IXN_BUFFER_SIZE	10*1024
-
-#define XN_IS_SPACE(p)		(*p == ' ' || *p == '\t')
-#define XN_IS_NEWLINE(p)	(*p == '\r' || *p == '\n')
-
-#define XN_SKIP_LINE(p)							\
-	/* first read till end of line. */			\
-	while (*p && *p != '\n' && *p != '\r')		\
-		p++;									\
-	/* now skip end of line tokens. */			\
-	while (*p && (*p == '\n' || *p == '\r'))	\
-		p++;
-
-#define XN_READ_TILL(p, endCond, dest, destSize)			\
-	{														\
-		XnChar* pStart = p;								\
-		destSize = 0;										\
-		while (*p && !(endCond))							\
-		{													\
-			if (destSize + 1 > XN_INI_MAX_LEN)				\
-				break;										\
-															\
-			dest[destSize++] = *p;							\
-			p++;											\
-		}													\
-		dest[destSize] = '\0';								\
-	}			
-			
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XnStatus FindEntry(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnChar* cpDest)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// get file size
-	XnUInt32 nFileSize;
-	nRetVal = xnOSGetFileSize(cpINIFile, &nFileSize);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	// read entire file to memory
-	XnChar* csFileData = (XnChar*)xnOSMalloc(sizeof(XnChar)*nFileSize + 1);
-	XN_VALIDATE_ALLOC_PTR(csFileData);
-	
-	nRetVal = xnOSLoadFile(cpINIFile, csFileData, nFileSize);
-	if (nRetVal != XN_STATUS_OK)
-	{
-		xnOSFree(csFileData);
-		return nRetVal;
-	}
-	
-	// place NULL at the end
-	csFileData[nFileSize] = '\0';
-	
-	// now parse file
-	XnChar* pCurPos = csFileData;
-	XnBool bIsInRequestedSection = FALSE;
-	
-	XnChar csTempString[XN_INI_MAX_LEN];
-	XnUInt32 nTempStringLength = 0;
-	
-	while (TRUE)
-	{
-		// ignore spaces
-		while (*pCurPos && XN_IS_SPACE(pCurPos))
-		{
-			pCurPos++;
-		}
-			
-		// check we haven't reached the end
-		if (!*pCurPos)
-		{
-			break;
-		}
-		
-		if (*pCurPos == ';' || *pCurPos == '#') // comment
-		{
-			XN_SKIP_LINE(pCurPos);
-			continue;
-		}
-		
-		if (*pCurPos == '[') // start of section
-		{
-			pCurPos++;
-			XN_READ_TILL(pCurPos, *pCurPos == ']' || XN_IS_NEWLINE(pCurPos), csTempString, nTempStringLength);
-			
-			if (*pCurPos == ']') // valid section name
-			{
-				if (bIsInRequestedSection) 
-				{
-					// we're leaving the requested section, and string wasn't found
-					xnOSFree(csFileData);
-					return XN_STATUS_OS_INI_READ_FAILED;
-				}
-				
-				if (strcmp(csTempString, cpSection) == 0)
-				{
-					bIsInRequestedSection = TRUE;
-				}
-			}
-			
-			// in any case, move to the next line
-			XN_SKIP_LINE(pCurPos);
-			continue;
-		} // section
-		
-		// if we're not in the right section, we don't really care what's written in this line. Just skip it.
-		if (!bIsInRequestedSection)
-		{
-			XN_SKIP_LINE(pCurPos);
-			continue;
-		}
-		
-		// regular line. check if this is a key (look for the '=' sign)
-		XN_READ_TILL(pCurPos, *pCurPos == '=' || XN_IS_NEWLINE(pCurPos), csTempString, nTempStringLength);
-		
-		if (*pCurPos == '=') // we found a key
-		{
-			if (strcmp(csTempString, cpKey) == 0)
-			{
-				// we found our key. The value is the rest of the line
-				pCurPos++;
-				XN_READ_TILL(pCurPos, XN_IS_NEWLINE(pCurPos), cpDest, nTempStringLength);
-				xnOSFree(csFileData);
-				return XN_STATUS_OK;
-			}
-		}
-		
-		// if we got here, skip to the next line
-		XN_SKIP_LINE(pCurPos);
-		
-	} // while loop
-	
-	xnOSFree(csFileData);
-	return (XN_STATUS_OS_INI_READ_FAILED);
-}
-
-XN_C_API XnStatus xnOSReadStringFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnChar* cpDest, const XnUInt32 nDestLength)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	XnBool bINIFileExists = FALSE;
-	
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpSection);
-	XN_VALIDATE_INPUT_PTR(cpKey);
-	XN_VALIDATE_INPUT_PTR(cpINIFile);
-	XN_VALIDATE_OUTPUT_PTR(cpDest);
-
-	// Make sure the INI file exists
-	XN_VALIDATE_FILE_EXISTS_RET(cpINIFile, nRetVal, bINIFileExists, XN_STATUS_OS_INI_FILE_NOT_FOUND);
-
-	// find value
-	XnChar cpValueString[XN_INI_MAX_LEN];
-	nRetVal = FindEntry(cpINIFile, cpSection, cpKey, cpValueString);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	nRetVal = xnOSStrCopy(cpDest, cpValueString, nDestLength);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSReadFloatFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnFloat* fDest)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_OUTPUT_PTR(fDest);
-	
-	XnDouble dTemp;
-	XnStatus nRetVal = xnOSReadDoubleFromINI(cpINIFile, cpSection, cpKey, &dTemp);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	*fDest = (XnFloat)dTemp;
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSReadDoubleFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnDouble* fDest)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	XnBool bINIFileExists = FALSE;
-	
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpSection);
-	XN_VALIDATE_INPUT_PTR(cpKey);
-	XN_VALIDATE_INPUT_PTR(cpINIFile);
-	XN_VALIDATE_OUTPUT_PTR(fDest);
-
-	// Make sure the INI file exists
-	XN_VALIDATE_FILE_EXISTS_RET(cpINIFile, nRetVal, bINIFileExists, XN_STATUS_OS_INI_FILE_NOT_FOUND);
-
-	// find value
-	XnChar cpValueString[XN_INI_MAX_LEN];
-	nRetVal = FindEntry(cpINIFile, cpSection, cpKey, cpValueString);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	*fDest = atof(cpValueString);
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSReadIntFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnUInt32* nDest)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	XnBool bINIFileExists = FALSE;
-	
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpSection);
-	XN_VALIDATE_INPUT_PTR(cpKey);
-	XN_VALIDATE_INPUT_PTR(cpINIFile);
-	XN_VALIDATE_OUTPUT_PTR(nDest);
-
-	// Make sure the INI file exists
-	XN_VALIDATE_FILE_EXISTS_RET(cpINIFile, nRetVal, bINIFileExists, XN_STATUS_OS_INI_FILE_NOT_FOUND);
-
-	// find value
-	XnChar cpValueString[XN_INI_MAX_LEN];
-	nRetVal = FindEntry(cpINIFile, cpSection, cpKey, cpValueString);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	*nDest = atoi(cpValueString);
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSWriteStringToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnChar* cpSrc)
-{
-	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
-}
-
-XN_C_API XnStatus xnOSWriteFloatToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnFloat fSrc)
-{
-	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
-}
-
-XN_C_API XnStatus xnOSWriteDoubleToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnDouble fSrc)
-{
-	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
-}
-
-XN_C_API XnStatus xnOSWriteIntToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnUInt32 nSrc)
-{
-	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
-}
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Keyboard.cpp b/Source/OpenNI/Linux-x86/Linux-x86Keyboard.cpp
deleted file mode 100644
index 6340d22..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Keyboard.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <termios.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API XnBool xnOSWasKeyboardHit()
-{
-	struct termios oldt, newt;
-	int ch;
-	int oldf;
-
-	// don't echo and don't wait for ENTER
-	tcgetattr(STDIN_FILENO, &oldt);
-	newt = oldt;
-	newt.c_lflag &= ~(ICANON | ECHO);
-	tcsetattr(STDIN_FILENO, TCSANOW, &newt);
-	oldf = fcntl(STDIN_FILENO, F_GETFL, 0);
-	
-	// make it non-blocking (so we can check without waiting)
-	if (0 != fcntl(STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK))
-	{
-		return FALSE;
-	}
-
-	ch = getchar();
-
-	tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
-	if (0 != fcntl(STDIN_FILENO, F_SETFL, oldf))
-	{
-		return FALSE;
-	}
-
-	if(ch != EOF)
-	{
-		ungetc(ch, stdin);
-		return TRUE;
-	}
-
-	return FALSE;
-}
-
-XN_C_API XnChar xnOSReadCharFromInput()
-{
-	return (XnChar)getchar();
-}
-
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Memory.cpp b/Source/OpenNI/Linux-x86/Linux-x86Memory.cpp
deleted file mode 100644
index 37028e6..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Memory.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-// NOTE: you must define XN_OS_IMPL before including xnOS.h, otherwise, when mem profiling this file will not compile.
-#define XN_OS_IMPL
-#include <XnOS.h>
-#if (XN_PLATFORM == XN_PLATFORM_MACOSX)
-	#include <sys/malloc.h>
-#else
-	#include <malloc.h>
-#endif
-#include <XnLog.h>
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API void* xnOSMalloc(const XnSizeT nAllocSize)
-{
-	// Return a pointer to the requested allocation size
-	return (malloc(nAllocSize));
-}
-
-XN_C_API void* xnOSMallocAligned(const XnSizeT nAllocSize, const XnSizeT nAlignment)
-{
-	void* pResult = NULL;
-	if (0 != posix_memalign(&pResult, nAlignment, nAllocSize))
-		return NULL;
-		
-	return pResult;
-}
-
-XN_C_API void* xnOSCalloc(const XnSizeT nAllocNum, const XnSizeT nAllocSize)
-{
-	// Return a pointer to the requested allocation size and write zeros on the entire memory block (C Alloc)
-	return (calloc(nAllocNum, nAllocSize));
-}
-
-XN_C_API void* xnOSCallocAligned(const XnSizeT nAllocNum, const XnSizeT nAllocSize, const XnSizeT nAlignment)
-{
-	// Local function variables
-	void* pMemBlock = NULL;
-	XnUInt32 nBlockSize = nAllocNum * nAllocSize;
-
-	// Allocate the aligned memory block
-	pMemBlock = xnOSMallocAligned(nBlockSize, nAlignment);
-
-	// If it succeeded (the returned block wasn't NULL, let's zero it)
-	if (pMemBlock != NULL)
-	{
-		memset(pMemBlock, 0, nBlockSize);
-	}
-
-	return (pMemBlock);
-}
-
-XN_C_API void* xnOSRealloc(void* pMemory, const XnSizeT nAllocSize)
-{
-	// Return a pointer to the requested allocation size
-	return (realloc(pMemory, nAllocSize));
-}
-
-XN_C_API void* xnOSReallocAligned(void* pMemory, const XnSizeT nAllocSize, const XnSizeT nAlignment)
-{
-	xnLogError("xnOS", "Does not know how to realloc aligned memory!");
-	return NULL;
-}
-
-XN_C_API void* xnOSRecalloc(void* pMemory, const XnSizeT nAllocNum, const XnSizeT nAllocSize)
-{
-	xnLogError("xnOS", "Does not know how to realloc aligned memory!");
-	// Return a pointer to the requested allocation size and write zeros on the entire memory block (C Alloc)
-	return NULL;
-}
-
-XN_C_API void xnOSFree(const void* pMemBlock)
-{
-	// Note: No need to check if pMemBlock is NULL because free is guaranteed to handle this case correctly.
-
-	// Free the requested memory block
-	free ((void*)pMemBlock);
-}
-
-XN_C_API void  xnOSFreeAligned(const void* pMemBlock)
-{
-	// Note: No need to check if pMemBlock is NULL because free is guaranteed to handle this case correctly.
-
-	// Free the requested memory block
-	free ((void*)pMemBlock);
-}
-
-XN_C_API void xnOSMemCopy(void* pDest, const void* pSource, XnSizeT nCount)
-{
-	memcpy(pDest, pSource, nCount);
-}
-
-XN_C_API XnInt32 xnOSMemCmp(const void *pBuf1, const void *pBuf2, XnSizeT nCount)
-{
-	return memcmp(pBuf1, pBuf2, nCount);
-}
-
-XN_C_API void xnOSMemSet(void* pDest, XnUInt8 nValue, XnSizeT nCount)
-{
-	memset(pDest, nValue, nCount);
-}
-
-XN_C_API void xnOSMemMove(void* pDest, const void* pSource, XnSizeT nCount)
-{
-	memmove(pDest, pSource, nCount);
-}
-
-XN_C_API XnUInt64  xnOSEndianSwapUINT64(XnUInt64 nValue)
-{
-	return ((nValue >> 56) ) | ((nValue >> 40) & 0x000000000000ff00ULL) |
-			((nValue >> 24) & 0x0000000000ff0000ULL) | ((nValue >> 8 ) & 0x00000000ff000000ULL) |
-			((nValue << 8 ) & 0x000000ff00000000ULL) | ((nValue << 24) & 0x0000ff0000000000ULL) |
-			((nValue << 40) & 0x00ff000000000000ULL) | ((nValue << 56) );
-}
-
-XN_C_API XnUInt32  xnOSEndianSwapUINT32(XnUInt32 nValue)
-{
-	return  (nValue>>24) | 
-			((nValue<<8) & 0x00FF0000) |
-			((nValue>>8) & 0x0000FF00) |
-			(nValue<<24);
-}
-
-XN_C_API XnUInt16 xnOSEndianSwapUINT16(XnUInt16 nValue)
-{
-	return ((nValue>>8) | (nValue<<8));
-}
-XN_C_API XnFloat xnOSEndianSwapFLOAT(XnFloat fValue)
-{
-	XnUInt32* pnValue = (XnUInt32*)&fValue;
-	XnUInt32 nValue = xnOSEndianSwapUINT32(*pnValue);
-	XnFloat* pfValue = (XnFloat*)&nValue;
-	return *pfValue;
-}
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Mutex.cpp b/Source/OpenNI/Linux-x86/Linux-x86Mutex.cpp
deleted file mode 100644
index b6e7aa1..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Mutex.cpp
+++ /dev/null
@@ -1,386 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-
-//---------------------------------------------------------------------------
-// Types
-//---------------------------------------------------------------------------
-struct XnMutex
-{
-	XnBool bIsNamed;
-	pthread_mutex_t ThreadMutex;
-	int NamedSem;
-	XnChar csSemFileName[XN_FILE_MAX_PATH];
-	int hSemFile;
-	XnBool bIsLocked; // used for named semaphore, to make sure a porcess doesn't unlock more than once (counting semaphore will no longer be a mutex).
-};
-
-typedef struct XnMutex XnMutex;
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XnStatus xnOSUnNamedMutexCreate(XnMutex* pMutex)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// make the mutex recursive (re-entrent)
-	pthread_mutexattr_t tAttributes;
-
-	if (0 != pthread_mutexattr_init(&tAttributes))
-		return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
-	
-	if (0 != pthread_mutexattr_settype(&tAttributes, PTHREAD_MUTEX_RECURSIVE))
-		return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
-	
-	// Init the mutex
-	int rc = pthread_mutex_init(&pMutex->ThreadMutex, &tAttributes);
-	
-	// destroy the attributes object
-	pthread_mutexattr_destroy(&tAttributes);
-	
-	// check if init succeeded
-	if (0 != rc)
-	{
-		return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
-	}
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnOSNamedMutexCreate(XnMutex* pMutex, const XnChar* csMutexName)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	int rc;
-
-	// tanslate mutex name to key file name
-	XnUInt32 nBytesWritten;
-	xnOSStrFormat(pMutex->csSemFileName, XN_FILE_MAX_PATH, &nBytesWritten, "/tmp/XnCore.Mutex.%s.key", csMutexName);
-	
-	// open this file (we hold it open until mutex is closed. That way it cannot be deleted as long
-	// as any process is holding the mutex, and the mutex can be destroyed if the file can be deleted).
-	pMutex->hSemFile = open(pMutex->csSemFileName, O_CREAT | O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
-	if (pMutex->hSemFile == -1)
-	{
-		return XN_STATUS_OS_FILE_OPEN_FAILED;
-	}
-	
-	// create the key
-	key_t key = ftok(pMutex->csSemFileName, 1);
-
-	// first we try to create it. If we fail, we'll know it already existed
-	XnBool bCreated = TRUE;
-	
-	// we created a set of 2 sems - first is the lock, second counts processes
-	pMutex->NamedSem = semget(key, 2, IPC_CREAT | IPC_EXCL | 0666);
-	if (pMutex->NamedSem == -1 && errno == EEXIST)
-	{
-		// get existing one
-		pMutex->NamedSem = semget(key, 2, IPC_CREAT | 0666);
-		if (pMutex->NamedSem == -1)
-		{
-			close(pMutex->hSemFile);
-			return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
-		}
-		
-		bCreated = FALSE;
-	}
-
-	if (bCreated)
-	{
-		union semun 
-		{
-				   int              val;    /* Value for SETVAL */
-				   struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
-				   unsigned short  *array;  /* Array for GETALL, SETALL */
-				   struct seminfo  *__buf;  /* Buffer for IPC_INFO
-											   (Linux-specific) */
-		} init;
-		
-		// init lock semaphore to 1 (not locked)
-		init.val = 1;
-		rc = semctl(pMutex->NamedSem, 0, SETVAL, init);
-		if (rc != 0)
-		{
-			semctl(pMutex->NamedSem, 0, IPC_RMID);
-			return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
-		}
-
-		// init process counter to 0
-		init.val = 0;
-		rc = semctl(pMutex->NamedSem, 1, SETVAL, init);
-		if (rc != 0)
-		{
-			semctl(pMutex->NamedSem, 0, IPC_RMID);
-			return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
-		}
-	}
-
-	// increment second sem
-	struct sembuf op;
-	op.sem_num = 1;
-	op.sem_op = 1;
-	op.sem_flg = SEM_UNDO; // mark it to be decreased when process terminates
-	
-	rc = semop(pMutex->NamedSem, &op, 1);
-	if (rc != 0)
-	{
-		xnOSCloseMutex(&pMutex);
-		return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
-	}
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCreateMutex(XN_MUTEX_HANDLE* pMutexHandle)
-{
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-	int rc = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_OUTPUT_PTR(pMutexHandle);
-	
-	XnMutex* pMutex;
-	XN_VALIDATE_CALLOC(pMutex, XnMutex, 1);
-	pMutex->bIsNamed = FALSE;
-	
-	nRetVal = xnOSUnNamedMutexCreate(pMutex);
-	if (nRetVal != XN_STATUS_OK)
-	{
-		xnOSFree(pMutex);
-		return (nRetVal);
-	}
-	
-	*pMutexHandle = pMutex;
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCreateNamedMutex(XN_MUTEX_HANDLE* pMutexHandle, const XnChar* cpMutexName)
-{
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-	int rc = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_OUTPUT_PTR(pMutexHandle);
-	
-	XnMutex* pMutex;
-	XN_VALIDATE_CALLOC(pMutex, XnMutex, 1);
-	pMutex->bIsNamed = TRUE;
-	
-	nRetVal = xnOSNamedMutexCreate(pMutex, cpMutexName);
-	if (nRetVal != XN_STATUS_OK)
-	{
-		xnOSFree(pMutex);
-		return (nRetVal);
-	}
-	
-	*pMutexHandle = pMutex;
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCloseMutex(XN_MUTEX_HANDLE* pMutexHandle)
-{
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pMutexHandle);
-
-	// Make sure the actual mutex handle isn't NULL
-	XN_RET_IF_NULL(*pMutexHandle, XN_STATUS_OS_INVALID_MUTEX);
-	
-	XnMutex* pMutex = *pMutexHandle;
-
-	// check the kind of mutex
-	if (pMutex->bIsNamed)
-	{
-		// decrement second sem
-		struct sembuf op;
-		op.sem_num = 1;
-		op.sem_op = -1;
-		op.sem_flg = SEM_UNDO;
-		
-		if (0 != semop(pMutex->NamedSem, &op, 1))
-		{
-			return (XN_STATUS_OS_MUTEX_CLOSE_FAILED);
-		}
-		
-		// check if sem reached 0 (if so, it can be deleted)
-		int val = semctl(pMutex->NamedSem, 1, GETVAL);
-		if (val == 0)
-		{
-			// destroy the semaphore
-			semctl(pMutex->NamedSem, 0, IPC_RMID);
-			// and remove file
-			xnOSDeleteFile(pMutex->csSemFileName);
-		}
-		
-		// in any case, close the file
-		close(pMutex->hSemFile);
-	}
-	else
-	{
-		// destroy the mutex via the OS
-		if (0 != pthread_mutex_destroy(&pMutex->ThreadMutex))
-		{
-			return (XN_STATUS_OS_MUTEX_CLOSE_FAILED);
-		}
-	}
-	
-	// free the handle
-	XN_FREE_AND_NULL(*pMutexHandle);
-	
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSLockMutex(const XN_MUTEX_HANDLE MutexHandle, XnUInt32 nMilliseconds)
-{
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-	int rc = 0;
-
-	// Make sure the actual mutex handle isn't NULL
-	XN_RET_IF_NULL(MutexHandle, XN_STATUS_OS_INVALID_MUTEX);
-
-	struct sembuf op;
-	// try to decrease it by 1 (if it's 0, we'll wait)
-	op.sem_num = 0;
-	op.sem_op = -1;
-	op.sem_flg = SEM_UNDO;
-
-	if (nMilliseconds == XN_WAIT_INFINITE)
-	{
-		// lock via the OS
-		if (MutexHandle->bIsNamed)
-		{
-			if (0 != semop(MutexHandle->NamedSem, &op, 1))
-			{
-				rc = errno;
-			}
-		}
-		else
-		{
-			rc = pthread_mutex_lock(&MutexHandle->ThreadMutex);
-		}
-	}
-	else
-	{
-		struct timespec time;
-		
-		// lock via the OS
-		if (MutexHandle->bIsNamed)
-		{
-			nRetVal = xnOSGetTimeout(&time, nMilliseconds);
-			if (nRetVal != XN_STATUS_OK)
-			{
-				return XN_STATUS_OS_MUTEX_LOCK_FAILED;
-			}
-
-#ifndef XN_PLATFORM_HAS_NO_TIMED_OPS
-			if (0 != semtimedop(MutexHandle->NamedSem, &op, 1, &time))
-#else
-			if (0 != semop(MutexHandle->NamedSem, &op, 1))
-#endif
-			{
-				rc = errno;
-			}
-		}
-		else
-		{
-			// calculate timeout absolute time. First we take current time
-			nRetVal = xnOSGetAbsTimeout(&time, nMilliseconds);
-			if (nRetVal != XN_STATUS_OK)
-			{
-				return XN_STATUS_OS_MUTEX_LOCK_FAILED;
-			}
-			
-#ifndef XN_PLATFORM_HAS_NO_TIMED_OPS
-			rc = pthread_mutex_timedlock(&MutexHandle->ThreadMutex, &time);
-#else
-			rc = pthread_mutex_lock(&MutexHandle->ThreadMutex);
-#endif
-		}
-	}
-	
-	// check for failures
-	if (rc == ETIMEDOUT)
-	{
-		return (XN_STATUS_OS_MUTEX_TIMEOUT);
-	}
-	else if (rc != 0)
-	{
-		return (XN_STATUS_OS_MUTEX_LOCK_FAILED);
-	}
-	
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSUnLockMutex(const XN_MUTEX_HANDLE MutexHandle)
-{
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-	int rc = 0;
-
-	// Make sure the actual mutex handle isn't NULL
-	XN_RET_IF_NULL(MutexHandle, XN_STATUS_OS_INVALID_MUTEX);
-	
-	// unlock via the OS
-	if (MutexHandle->bIsNamed)
-	{
-		struct sembuf op;
-		op.sem_num = 0;
-		op.sem_op = 1; // increase by 1
-		op.sem_flg = SEM_UNDO;
-		
-		if (0 != semop(MutexHandle->NamedSem, &op, 1))
-		{
-			rc = errno;
-		}
-	}
-	else
-	{
-		rc = pthread_mutex_unlock(&MutexHandle->ThreadMutex);
-	}
-	
-	if (0 != rc)
-	{
-		return (XN_STATUS_OS_MUTEX_UNLOCK_FAILED);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Network.cpp b/Source/OpenNI/Linux-x86/Linux-x86Network.cpp
deleted file mode 100644
index 4cdbd83..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Network.cpp
+++ /dev/null
@@ -1,514 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <ctype.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <XnLog.h>
-
-//---------------------------------------------------------------------------
-// Structs
-//---------------------------------------------------------------------------
-/** The Xiron OS network socket structure. */ 
-typedef struct xnOSSocket
-{
-	/** The OS socket handle. */ 
-	int Socket;
-
-	/** The OS socket address (IP and port). */ 
-	sockaddr_in SocketAddress;
-	socklen_t nSocketAddressLen;
-
-	/** The socket type enum (UDP, TDP, etc...) */ 
-	XnUInt32 nSocketType;
-} xnOSSocket;
-
-//---------------------------------------------------------------------------
-// Macros
-//---------------------------------------------------------------------------
-/** Returns Y if X is -1. */
-#define XN_RET_IF_INVALID(x, y)	\
-		if (x == -1)			\
-		{						\
-			return (y);			\
-		}
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API XnStatus xnOSInitNetwork()
-{
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSShutdownNetwork()
-{
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCreateSocket(const XnOSSocketType SocketType, const XnChar* cpIPAddress, const XnUInt16 nPort, XN_SOCKET_HANDLE* SocketPtr)
-{
-	// Local function variables
-	hostent* HostEnt = NULL;
-	XN_SOCKET_HANDLE Socket = NULL;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpIPAddress);
-	XN_VALIDATE_OUTPUT_PTR(SocketPtr);
-
-	XN_VALIDATE_ALIGNED_CALLOC(*SocketPtr, xnOSSocket, 1, XN_DEFAULT_MEM_ALIGN);
-
-	Socket = *SocketPtr;
-
-	if (SocketType == XN_OS_UDP_SOCKET)
-	{
-		// Create a UDP socket
-		Socket->Socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
-	}
-	else if (SocketType == XN_OS_TCP_SOCKET)
-	{
-		// Create a TCP socket
-		Socket->Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-	}
-	else
-	{
-		// Unknown socket type...
-		XN_ALIGNED_FREE_AND_NULL(Socket);
-		return (XN_STATUS_OS_NETWORK_INVALID_SOCKET_TYPE);
-	}
-
-	if (Socket->Socket == -1)
-	{
-		XN_ALIGNED_FREE_AND_NULL(Socket);
-		return (XN_STATUS_OS_NETWORK_SOCKET_CREATION_FAILED);
-	}
-
-	// Set the socket server address
-	Socket->SocketAddress.sin_family = AF_INET;
-
-	if (isalpha(cpIPAddress[0])) 
-	{
-		HostEnt = gethostbyname(cpIPAddress);
-		if (HostEnt == NULL)
-		{
-			XN_ALIGNED_FREE_AND_NULL(Socket);
-			return (XN_STATUS_OS_NETWORK_BAD_HOST_NAME);
-		}
-
-		xnOSMemCopy(&Socket->SocketAddress.sin_addr, HostEnt->h_addr, HostEnt->h_length);
-	}
-	else
-	{
-		Socket->SocketAddress.sin_addr.s_addr = inet_addr(cpIPAddress);
-	}
-
-	Socket->SocketAddress.sin_port = htons(nPort);
-
-	// Update socket address size
-	Socket->nSocketAddressLen = sizeof(Socket->SocketAddress);
-
-	// Remember the socket type
-	Socket->nSocketType = SocketType;
-
-	// turn on NODELAY option
-	int on = 1;
-	setsockopt(Socket->Socket, IPPROTO_TCP, TCP_NODELAY, (char*)&on, sizeof(on));
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCloseSocket(XN_SOCKET_HANDLE Socket)
-{
-	// Local function variables
-	XnInt32 nRetVal = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(Socket);
-
-	// Make sure the actual socket handle isn't NULL
-	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
-
-	// shut down the socket
-	if (-1 == shutdown(Socket->Socket, SHUT_RDWR))
-	{
-		return(XN_STATUS_OS_NETWORK_SHUTDOWN_FAILED);
-	}
-
-	// Close the socket and make sure it succeeded (return value is 0)
-	if (-1 == close(Socket->Socket))
-	{
-		return(XN_STATUS_OS_NETWORK_SHUTDOWN_FAILED);
-	}
-
-	XN_ALIGNED_FREE_AND_NULL(Socket);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSBindSocket(XN_SOCKET_HANDLE Socket)
-{
-	// Local function variables
-	XnInt32 nRetVal = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(Socket);
-
-	// Make sure the actual socket handle isn't NULL
-	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
-	
-	// Workaround Linux annoying behavior. Linux keeps a port open in a TIME_WAIT state after it is close,
-	// and does not allow to bind it again. If socket is closed, you have to wait a couple of minutes before
-	// you can re-bind it. We disable this option
-	const int bOn = 1;
-	setsockopt(Socket->Socket, SOL_SOCKET, SO_REUSEADDR, &bOn, sizeof(bOn));
-
-	// Bind the socket and make sure it succeeded
-	nRetVal = bind(Socket->Socket, (const sockaddr*)&Socket->SocketAddress, sizeof(Socket->SocketAddress));
-	if (nRetVal	== -1)
-	{
-		xnLogWarning(XN_MASK_OS, "Failed to bind socket: errno is %d", errno);
-		return(XN_STATUS_OS_NETWORK_SOCKET_BIND_FAILED);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSListenSocket(XN_SOCKET_HANDLE Socket)
-{
-	// Local function variables
-	XnInt32 nRetVal = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(Socket);
-
-	// Make sure the actual socket handle isn't NULL
-	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
-
-	// Listen to the socket and make sure it succeeded
-	nRetVal = listen(Socket->Socket, SOMAXCONN);
-	if (nRetVal	== -1)
-	{
-		return(XN_STATUS_OS_NETWORK_SOCKET_LISTEN_FAILED);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-static struct timeval* xnOSMillisecsToTimeVal(XnUInt32 nMilliseconds, struct timeval* pTv)
-{
-	if (nMilliseconds == XN_WAIT_INFINITE)
-	{
-		return NULL;
-	}
-
-	pTv->tv_sec = nMilliseconds / 1000; //Seconds
-	pTv->tv_usec = (nMilliseconds % 1000) * 1000; //Microseconds
-	return pTv;
-}
-
-XN_C_API XnStatus xnOSAcceptSocket(XN_SOCKET_HANDLE ListenSocket, XN_SOCKET_HANDLE* AcceptSocketPtr, XnUInt32 nMillisecondsTimeout)
-{
-	// Local function variables
-	XnInt32 nRetVal = 0;
-	struct timeval selectTimeOut;
-	struct timeval* pTimeout = xnOSMillisecsToTimeVal(nMillisecondsTimeout, &selectTimeOut);
-	fd_set fdReadHandles;
-	XN_SOCKET_HANDLE AcceptSocket = NULL;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(ListenSocket);
-	XN_VALIDATE_OUTPUT_PTR(AcceptSocketPtr);
-
-	// Make sure the actual socket handle isn't NULL
-	XN_RET_IF_INVALID(ListenSocket->Socket, XN_STATUS_OS_INVALID_SOCKET);
-	// Wait for connection request
-	FD_ZERO(&fdReadHandles);
-	FD_SET(ListenSocket->Socket, &fdReadHandles);
-	nRetVal = select(ListenSocket->Socket + 1, &fdReadHandles, NULL, NULL, pTimeout);
-	if (nRetVal == 0)
-	{
-		return (XN_STATUS_OS_NETWORK_TIMEOUT);
-	}
-	else if (nRetVal == -1)
-	{
-		XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_ACCEPT_FAILED, XN_MASK_OS, "select() returned error: %d", errno);
-	}
-
-	// Allocate a new socket
-	XN_VALIDATE_ALIGNED_CALLOC(*AcceptSocketPtr, xnOSSocket, 1, XN_DEFAULT_MEM_ALIGN);
-
-	AcceptSocket = *AcceptSocketPtr;
-
-	// Accept the socket and make sure it succeeded
-	AcceptSocket->nSocketAddressLen = sizeof(AcceptSocket->SocketAddress);
-	AcceptSocket->Socket = accept(ListenSocket->Socket, (sockaddr*)&AcceptSocket->SocketAddress, &AcceptSocket->nSocketAddressLen);
-	if (AcceptSocket->Socket== -1)
-	{
-		xnOSCloseSocket(AcceptSocket);
-		xnOSFreeAligned(*AcceptSocketPtr);
-		return(XN_STATUS_OS_NETWORK_SOCKET_ACCEPT_FAILED);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSConnectSocket(XN_SOCKET_HANDLE Socket, XnUInt32 nMillisecsTimeout)
-{
-	// Local function variables
-	XnInt32 nRetVal = 0;
-	sockaddr SocketAddress;
-	fd_set fdWriteHandles;
-	fd_set fdExceptHandles;
-	struct timeval selectTimeOut;
-	struct timeval* pTimeout = xnOSMillisecsToTimeVal(nMillisecsTimeout, &selectTimeOut);
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(Socket);
-
-	// Make sure the actual socket handle isn't NULL
-	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
-
-	// Connect to the socket and make sure it succeeded
-	if (sizeof(SocketAddress) != sizeof(Socket->SocketAddress))
-	{
-		return(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED);
-	}
-
-	xnOSMemCopy(&SocketAddress, &Socket->SocketAddress, sizeof(SocketAddress));
-	
-	// Make the socket non-blocking temporarily
-	int nFlags = fcntl(Socket->Socket, F_GETFL, 0);
-	int nNonBlockFlags = nFlags | O_NONBLOCK;
-	if (-1 == fcntl(Socket->Socket, F_SETFL, nNonBlockFlags))
-	{
-		XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED, XN_MASK_OS, "fcntl() failed with error %d", errno);
-	}
-
-	//This is a non-blocking connect() call - it doesn't do anything until we call select()
-	nRetVal = connect(Socket->Socket, &SocketAddress, sizeof(SocketAddress));
-	if (nRetVal	== -1 && errno != EINPROGRESS)
-	{
-		xnLogError(XN_MASK_OS, "connect() failed with error %d", errno);
-		return(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED);
-	}
-
-	FD_ZERO(&fdWriteHandles);
-	FD_SET(Socket->Socket, &fdWriteHandles);
-	FD_ZERO(&fdExceptHandles);
-	FD_SET(Socket->Socket, &fdExceptHandles);
-	nRetVal = select(Socket->Socket + 1, NULL, &fdWriteHandles, &fdExceptHandles, pTimeout);
-
-	//Make the socket blocking again before we check select()'s success
-	fcntl(Socket->Socket, F_SETFL, nFlags);
-
-	if (nRetVal == 0)
-	{
-		return (XN_STATUS_OS_NETWORK_TIMEOUT);
-	}
-	else if (nRetVal == -1)
-	{
-		XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_ACCEPT_FAILED, XN_MASK_OS, "select() returned error: %d", errno);
-	}
-	else
-	{
-		// select returned due to socket state change. Check if an error occurred or everything is OK.
-		if (FD_ISSET(Socket->Socket, &fdExceptHandles))
-		{
-			XnUInt32 nLastError = 0;
-			XnUInt32 nLastErrorSize = sizeof(nLastError);
-			getsockopt(Socket->Socket, SOL_SOCKET, SO_ERROR, &nLastError, &nLastErrorSize);
-			XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED, XN_MASK_OS, "Connect failed with error: %u", nLastError);
-		}
-		// else, it means it's in the writable state, which means connect succeeded.
-		XN_ASSERT(FD_ISSET(Socket->Socket, &fdWriteHandles));
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSSetSocketBufferSize(XN_SOCKET_HANDLE Socket, const XnUInt32 nSocketBufferSize)
-{
-	// Local function variables
-	XnInt32 nOptLen = sizeof(XnUInt32);
-	XnInt32 nRetVal = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(Socket);
-
-	// Make sure the actual socket handle isn't NULL
-	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
-
-	// Change the socket sending buffer and make sure it succeeded
-	nRetVal = setsockopt(Socket->Socket, SOL_SOCKET, SO_SNDBUF, (XnChar*)&nSocketBufferSize, nOptLen);
-	if (nRetVal	== -1)
-	{
-		return(XN_STATUS_OS_NETWORK_SOCKET_BUFFER_FAILED);
-	}
-
-	// Change the socket receive buffer and make sure it succeeded
-	nRetVal = setsockopt(Socket->Socket, SOL_SOCKET, SO_RCVBUF, (XnChar*)&nSocketBufferSize, nOptLen);
-	if (nRetVal	== -1)
-	{
-		return(XN_STATUS_OS_NETWORK_SOCKET_BUFFER_FAILED);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSSendNetworkBuffer(XN_SOCKET_HANDLE Socket, const XnChar* cpBuffer, const XnUInt32 nBufferSize)
-{
-	// Local function variables
-	XnInt32 nRetVal = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(Socket);
-	XN_VALIDATE_INPUT_PTR(cpBuffer);
-
-	// Make sure the actual socket handle isn't NULL
-	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
-
-	// Send the data over our UDP socket to the server and make sure the wanted number of bytes were actually sent
-	// Linux note: we use MSG_NOSIGNAL so that we won't get SIGPIPE if socket is closed on the other side. instead,
-	// we'll get EPIPE.
-#if (XN_PLATFORM == XN_PLATFORM_MACOSX)
-	int on = 1;
-	setsockopt(Socket->Socket, SOL_SOCKET, SO_NOSIGPIPE, (char*)&on, sizeof(on));	
-	nRetVal = send(Socket->Socket, cpBuffer, nBufferSize, NULL); 
-#else
-	nRetVal = send(Socket->Socket, cpBuffer, nBufferSize, MSG_NOSIGNAL);
-#endif
-
-	if (nRetVal != nBufferSize)
-	{
-		return (XN_STATUS_OS_NETWORK_SEND_FAILED);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSSendToNetworkBuffer(XN_SOCKET_HANDLE Socket, const XnChar* cpBuffer, const XnUInt32 nBufferSize, XN_SOCKET_HANDLE SocketTo)
-{
-	// Local function variables
-	XnInt32 nRetVal = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(Socket);
-	XN_VALIDATE_INPUT_PTR(SocketTo);
-	XN_VALIDATE_INPUT_PTR(cpBuffer);
-
-	// Make sure the actual socket handle isn't NULL
-	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
-
-	// Send the data over our UDP socket to the server and make sure the wanted number of bytes were actually sent
-	nRetVal = sendto(Socket->Socket, cpBuffer, nBufferSize, 0, (const sockaddr*)&SocketTo->SocketAddress, sizeof(sockaddr));
-	if (nRetVal != nBufferSize)
-	{
-		return (XN_STATUS_OS_NETWORK_SEND_FAILED);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSReceiveNetworkBuffer(XN_SOCKET_HANDLE Socket, XnChar* cpBuffer, XnUInt32* pnBufferSize, XnUInt32 nMillisecondsTimeout)
-{
-	// Local function variables
-	XnInt32 nRetVal = 0;
-	XnInt32 nLen = sizeof(sockaddr);	
-	struct timeval selectTimeOut;
-	struct timeval* pTimeout = xnOSMillisecsToTimeVal(nMillisecondsTimeout, &selectTimeOut);
-	fd_set fdReadHandles;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(Socket);
-	XN_VALIDATE_OUTPUT_PTR(cpBuffer);
-	XN_VALIDATE_OUTPUT_PTR(pnBufferSize);
-
-	// Make sure the actual socket handle isn't NULL
-	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
-
-	FD_ZERO(&fdReadHandles);
-	FD_SET(Socket->Socket, &fdReadHandles);
-	nRetVal = select(Socket->Socket + 1, &fdReadHandles, NULL, NULL, pTimeout);
-	if (nRetVal != 1)
-	{
-		return (XN_STATUS_OS_NETWORK_TIMEOUT);
-	}
-
-	// Receive the data from our socket to the buffer and make sure it succeeded
-	*pnBufferSize = recv(Socket->Socket, cpBuffer, *pnBufferSize, 0);
-	if (*pnBufferSize == 0)
-	{
-		xnLogVerbose(XN_MASK_OS, "Socket has been gracefully closed");
-		return (XN_STATUS_OS_NETWORK_CONNECTION_CLOSED);
-	}
-	else if (*pnBufferSize == -1)
-	{
-		XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_RECEIVE_FAILED, XN_MASK_OS, "recv() failed with error %d", errno);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSReceiveFromNetworkBuffer(XN_SOCKET_HANDLE Socket, XnChar* cpBuffer, XnUInt32* pnBufferSize, XN_SOCKET_HANDLE* SocketFrom)
-{
-	// Local function variables
-	XnInt32 nRetVal = 0;
-	socklen_t nLen = sizeof(sockaddr);	
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(Socket);
-	XN_VALIDATE_INPUT_PTR(SocketFrom);
-	XN_VALIDATE_OUTPUT_PTR(cpBuffer);
-	XN_VALIDATE_OUTPUT_PTR(pnBufferSize);
-
-	// Make sure the actual socket handle isn't NULL
-	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
-
-	// Receive the data from our UDP socket to the buffer and make sure it succeeded
-	*pnBufferSize = recvfrom(Socket->Socket, cpBuffer, *pnBufferSize, 0, (sockaddr*)&(*SocketFrom)->SocketAddress, &nLen);
-	if (*pnBufferSize == -1)
-	{
-		return (XN_STATUS_OS_NETWORK_RECEIVE_FAILED);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Processes.cpp b/Source/OpenNI/Linux-x86/Linux-x86Processes.cpp
deleted file mode 100644
index 28ce5e4..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Processes.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <errno.h>
-#if (XN_PLATFORM == XN_PLATFORM_MACOSX)
-	#include <sys/wait.h>
-#else
-	#include <wait.h>
-#endif
-#include <XnLog.h>
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API XnStatus xnOSGetCurrentProcessID(XN_PROCESS_ID* pProcID)
-{
-	// Validate output pointer
-	XN_VALIDATE_OUTPUT_PTR(pProcID);
-
-	// Get the current process id
-	*pProcID = getpid();
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCreateProcess(const XnChar* strExecutable, XnUInt32 nArgs, const XnChar** pstrArgs, XN_PROCESS_ID* pProcID)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	// NOTE: execv, for some weird reason, accepts the arguments as non-const strings, but in the documentation
-	// it is explicitly stated that it does not change anything, so we can just use const_cast for it.
-	XnChar* astrArgs[100];
-	if (nArgs > 98)
-	{
-		xnLogWarning(XN_MASK_OS, "Too many arguments!");
-		return XN_STATUS_OS_PROCESS_CREATION_FAILED;
-	}
-
-	astrArgs[0] = const_cast<char*>(strExecutable);
-	for (XnUInt i = 0; i < nArgs; ++i)
-	{
-		astrArgs[i+1] = const_cast<char*>(pstrArgs[i]);
-	}
-	astrArgs[nArgs+1] = NULL;
-	
-	pid_t child_pid = fork();
-	if (child_pid == -1) // fail
-	{
-		xnLogWarning(XN_MASK_OS, "Failed to start process! fork() error code is %d.", errno);
-		return XN_STATUS_OS_PROCESS_CREATION_FAILED;
-	}
-	else if (child_pid == 0) // child process
-	{
-		// fork again
-		// we want our process to be totally detached from creator process. To do so, we fork() twice, so that the creator process
-		// is terminated, and the new process becomes the child of init.
-		pid_t grandchild_pid = fork();
-		if (grandchild_pid == -1)
-		{
-			exit(XN_STATUS_OS_PROCESS_CREATION_FAILED);
-		}
-		else if (grandchild_pid == 0) // grandchild process
-		{
-			// close standard streams (this is a background process)
-			close(STDIN_FILENO);
-			close(STDOUT_FILENO);
-			close(STDERR_FILENO);
-			
-			// detach it from current process (so it will keep running, even if process is terminated)
-			setsid();
-			
-			// load the executable
-			if (-1 == execv(strExecutable, astrArgs))
-			{
-				xnLogWarning(XN_MASK_OS, "Failed to start process! execv() error code is %d.", errno);
-				return XN_STATUS_OS_PROCESS_CREATION_FAILED;
-			}
-		}
-		else // child process
-		{
-			_exit(XN_STATUS_OK);
-		}
-	}
-	else // parent process
-	{
-		// wait for the child process (the one creating the grandchild process), and make sure it succeeded)
-		int status = 0;
-		waitpid(child_pid, &status, 0);
-		if (status != 0)
-		{
-			return XN_STATUS_OS_PROCESS_CREATION_FAILED;
-		}
-
-		// we have no way to get the grandchild pid
-		*pProcID = 0;
-	}
-	
-	return (XN_STATUS_OK);
-}
diff --git a/Source/OpenNI/Linux-x86/Linux-x86SharedLibs.cpp b/Source/OpenNI/Linux-x86/Linux-x86SharedLibs.cpp
deleted file mode 100644
index d0032b6..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86SharedLibs.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <dlfcn.h>
-#include <XnLog.h>
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API XnStatus xnOSLoadLibrary(const XnChar* cpFileName, XN_LIB_HANDLE* pLibHandle)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpFileName);
-	XN_VALIDATE_OUTPUT_PTR(pLibHandle);
-
-	// Load the requested shared library via the OS
-	*pLibHandle = dlopen(cpFileName, RTLD_NOW);
-	
-	// Make sure it succeeded (return value is not NULL). If not return an error....
-	if (*pLibHandle == NULL)
-	{
-		xnLogWarning(XN_MASK_OS, "Failed loading lib: %s\n", dlerror());
-		return XN_STATUS_OS_CANT_LOAD_LIB;
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSFreeLibrary(const XN_LIB_HANDLE LibHandle)
-{
-	// Make sure the actual shared library handle isn't NULL
-	XN_RET_IF_NULL(LibHandle, XN_STATUS_OS_INVALID_LIBRARY);
-
-	// Free the shared library via the OS and make sure it succeeded
-	if (dlclose(LibHandle) != 0)
-	{
-		return (XN_STATUS_OS_CANT_FREE_LIB);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetProcAddress(const XN_LIB_HANDLE LibHandle, const XnChar* cpProcName, XnFarProc* pProcAddr)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpProcName);
-	XN_VALIDATE_OUTPUT_PTR(pProcAddr);
-
-	// Make sure the actual shared library handle isn't NULL
-	XN_RET_IF_NULL(LibHandle, XN_STATUS_OS_INVALID_LIBRARY);
-
-	// Get the requested procedure address from the shared library via the OS
-	*pProcAddr = (XnFarProc)dlsym(LibHandle, cpProcName);
-
-	// Make sure it succeeded (return value is not NULL). If not return an error....
-	XN_VALIDATE_PTR(*pProcAddr, XN_STATUS_OS_PROC_NOT_FOUND);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
diff --git a/Source/OpenNI/Linux-x86/Linux-x86SharedMemory.cpp b/Source/OpenNI/Linux-x86/Linux-x86SharedMemory.cpp
deleted file mode 100644
index 499164d..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86SharedMemory.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <XnLog.h>
-#include <sys/mman.h>
-#include <errno.h>
-
-//---------------------------------------------------------------------------
-// Types
-//---------------------------------------------------------------------------
-struct XnOSSharedMemory
-{
-	bool bCreate;
-	XnChar strFileName[XN_FILE_MAX_PATH];
-	int nSize;
-	void* pAddress;
-};
-
-XnStatus AccessFlagsToMMapProt(XnUInt32 nAccessFlags, int* pProt)
-{
-	int result = PROT_NONE;
-
-	if ((nAccessFlags & XN_OS_FILE_READ) != 0)
-	{
-		result |= PROT_READ;
-	}
-
-	if ((nAccessFlags & XN_OS_FILE_WRITE) != 0)
-	{
-		result |= PROT_WRITE;
-	}
-
-	*pProt = result;
-
-	return XN_STATUS_OK;
-}
-
-XnStatus AccessFlagsToOpenFlags(XnUInt32 nAccessFlags, int* pFlags)
-{
-	int result = 0;
-
-	if ((nAccessFlags & XN_OS_FILE_READ) == 0)
-	{
-		return (XN_STATUS_INVALID_OPERATION);
-	}
-
-	if ((nAccessFlags & XN_OS_FILE_WRITE) != 0)
-	{
-		result = O_RDWR;
-	}
-	else
-	{
-		result = O_RDONLY;
-	}
-
-	*pFlags = result;
-
-	return (XN_STATUS_OK);
-}
-
-static void NameToFileName(const XnChar* strName, XnChar* strFileName)
-{
-	int i = 0;
-	for (; strName[i] != '\0'; ++i)
-	{
-		// replace slashes with dots
-		strFileName[i] = strName[i] == '/' ? '.' : strName[i];
-	}
-	strFileName[i] = '\0';
-}
-
-static XnStatus OpenSharedMemoryImpl(const XnChar* strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem, XnUInt32 nSize)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	XN_VALIDATE_INPUT_PTR(strName);
-	XN_VALIDATE_OUTPUT_PTR(phSharedMem);
-	
-	// if (nSize) is a number - create, otherwise - open
-	XnBool bCreate = (nSize != 0);
-
-	// convert to local OS types
-	int prot = 0;
-	int nCreateFlags = 0;
-	int nMode = 0;
-
-	nRetVal = AccessFlagsToMMapProt(nAccessFlags, &prot);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = AccessFlagsToOpenFlags(nAccessFlags, &nCreateFlags);
-	XN_IS_STATUS_OK(nRetVal);
-
-	// allocate handle
-	XnOSSharedMemory* pHandle;
-	XN_VALIDATE_CALLOC(pHandle, XnOSSharedMemory, 1);
-
-	pHandle->bCreate = bCreate;
-
-	NameToFileName(strName, pHandle->strFileName);
-
-	if (bCreate)
-	{
-		nCreateFlags |= O_CREAT;
-		nMode |= S_IRWXU | S_IRWXG | S_IRWXO;
-	}
-
-	// open file
-	int fd = shm_open(pHandle->strFileName, nCreateFlags, nMode);
-	if (fd == -1)
-	{
-		xnOSFree(pHandle);
-		XN_LOG_WARNING_RETURN(XN_STATUS_OS_FAILED_TO_CREATE_SHARED_MEMORY, XN_MASK_OS, "Could not create file '%s' for shared memory (%d).", pHandle->strFileName, errno);
-	}
-
-	if (bCreate)
-	{
-		// set it to the right size
-		if (-1 == ftruncate(fd, nSize))
-		{
-			close(fd);
-			shm_unlink(pHandle->strFileName);
-			xnOSFree(pHandle);
-			XN_LOG_WARNING_RETURN(XN_STATUS_OS_FAILED_TO_CREATE_SHARED_MEMORY, XN_MASK_OS, "Could not seek to position (%d).", pHandle->strFileName, errno);
-		}
-
-		pHandle->nSize = nSize;
-	}
-	else
-	{
-		// read shared object size
-		pHandle->nSize = lseek(fd, 0, SEEK_END);
-	}
-
-	// and map it
-	pHandle->pAddress = mmap(NULL, pHandle->nSize, prot, MAP_SHARED, fd, 0);
-	if (pHandle->pAddress == MAP_FAILED)
-	{
-		close(fd);
-		shm_unlink(pHandle->strFileName);
-		xnOSFree(pHandle);
-		XN_LOG_WARNING_RETURN(XN_STATUS_OS_FAILED_TO_CREATE_SHARED_MEMORY, XN_MASK_OS, "Could not create file mapping object (%d).", errno);
-	}
-	
-	close(fd);
-
-	*phSharedMem = pHandle;
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem)
-{
-	return OpenSharedMemoryImpl(strName, nAccessFlags, phSharedMem, nSize);
-}
-
-XN_C_API XnStatus xnOSOpenSharedMemory(const XnChar* strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem)
-{
-	return OpenSharedMemoryImpl(strName, nAccessFlags, phSharedMem, 0);
-}
-
-XN_C_API XnStatus xnOSCloseSharedMemory(XN_SHARED_MEMORY_HANDLE hSharedMem)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	XN_VALIDATE_INPUT_PTR(hSharedMem);
-
-	// unmap
-	munmap(hSharedMem->pAddress, hSharedMem->nSize);
-
-	if (hSharedMem->bCreate)
-	{
-		// remove the file
-		shm_unlink(hSharedMem->strFileName);
-	}
-	
-	xnOSFree(hSharedMem);
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSSharedMemoryGetAddress(XN_SHARED_MEMORY_HANDLE hSharedMem, void** ppAddress)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	XN_VALIDATE_INPUT_PTR(hSharedMem);
-	XN_VALIDATE_OUTPUT_PTR(ppAddress);
-
-	*ppAddress = hSharedMem->pAddress;
-
-	return (XN_STATUS_OK);
-}
-
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Strings.cpp b/Source/OpenNI/Linux-x86/Linux-x86Strings.cpp
deleted file mode 100644
index 628206e..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Strings.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-
-//---------------------------------------------------------------------------
-// Globals
-//---------------------------------------------------------------------------
-static const XnUInt32 xnOSStrCRC32Table[0x100] =
-{
-	0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
-	0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
-	0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
-	0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
-	0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
-	0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
-	0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
-	0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
-	0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
-	0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
-	0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
-	0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
-	0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
-	0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
-	0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
-	0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
-	0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
-	0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
-	0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
-	0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
-	0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
-	0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
-	0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
-	0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
-	0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
-	0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
-	0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
-	0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
-	0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
-	0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
-	0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
-	0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
-	0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
-	0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
-	0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
-	0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
-	0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
-	0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
-	0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
-	0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
-	0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
-	0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
-	0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
-	0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
-	0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
-	0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
-	0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
-	0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
-	0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
-	0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
-	0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
-	0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
-	0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
-	0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
-	0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
-	0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
-	0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
-	0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
-	0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
-	0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
-	0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
-	0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
-	0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
-	0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
-}; 
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API XnStatus xnOSStrPrefix(const XnChar* cpPrefixString, XnChar* cpDestString, const XnUInt32 nDestLength)
-{
-	// Local function variables
-	XnChar* cpTempBuffer = NULL;
-	XnUInt32 nOutStringLength = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpPrefixString);
-	XN_VALIDATE_INPUT_PTR(cpDestString);
-
-	// Calculate the final string length
-	nOutStringLength = strlen(cpPrefixString) + strlen(cpDestString);
-
-	// Make sure the destination string can hold the required information
-	if (nOutStringLength >= nDestLength)
-	{
-		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
-	}
-
-	// Allocate the temp buffer
-	XN_VALIDATE_CALLOC(cpTempBuffer, XnChar, nOutStringLength + sizeof(XnChar));
-
-	// Prefix the string
-	strncat (cpTempBuffer, cpPrefixString, nOutStringLength);
-	strncat (cpTempBuffer, cpDestString, nOutStringLength);
-
-	// Copy the temp buffer into the output
-	strncpy (cpDestString, cpTempBuffer, nOutStringLength);
-
-	// Free the temporary buffer
-	XN_FREE_AND_NULL(cpTempBuffer);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSStrAppend(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nDestLength)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpSrcString);
-	XN_VALIDATE_INPUT_PTR(cpDestString);
-
-	// Make sure the destination string can hold the required information
-	if (strlen(cpSrcString) + strlen(cpDestString) >= nDestLength)
-	{
-		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
-	}
-
-	// Prefix the string
-	strncat (cpDestString, cpSrcString, nDestLength - strlen(cpDestString));
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSStrCopy(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nDestLength)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpSrcString);
-	XN_VALIDATE_INPUT_PTR(cpDestString);
-
-	// Make sure the destination string can hold the required information
-	if (strlen(cpSrcString) >= nDestLength)
-	{
-		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
-	}
-
-	// Copy the string
-	strncpy (cpDestString, cpSrcString, nDestLength);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnUInt32 xnOSStrLen(const XnChar* cpString)
-{
-	XN_VALIDATE_PTR(cpString, 0);
-	return strlen(cpString);
-}
-
-XN_C_API XnStatus xnOSStrNCopy(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nCopyLength, const XnUInt32 nDestLength)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpSrcString);
-	XN_VALIDATE_INPUT_PTR(cpDestString);
-
-	// Make sure the destination string can hold the required information
-	if (nCopyLength > nDestLength)
-	{
-		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
-	}
-
-	// Copy the string
-	strncpy(cpDestString, cpSrcString, nCopyLength);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSStrCRC32(const XnChar* cpString, XnUInt32* nCRC32)
-{
-	// Local function variables
-	XnUInt32 nTempCRC32 = 0xffffffff;
-	XnUInt32 nStrLen = 0;
-	XnUInt32 nIdx = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpString);
-	XN_VALIDATE_OUTPUT_PTR(nCRC32);
-
-	*nCRC32 = 0;
-
-	nStrLen = strlen(cpString);
-
-	for (nIdx = 0; nIdx < nStrLen; nIdx++)
-	{
-		nTempCRC32 = (nTempCRC32 >> 8) ^ xnOSStrCRC32Table[(nTempCRC32 & 0xFF) ^ *cpString++];
-	}
-
-	*nCRC32 = nTempCRC32 ^ 0xffffffff; 
-
-	// All is good...
-	return (XN_STATUS_OK);
-
-}
-
-XN_C_API XnStatus xnOSStrNCRC32(XnUChar* cpBuffer, XnUInt32 nBufferSize, XnUInt32* nCRC32)
-{
-	// Local function variables
-	XnUInt32 nTempCRC32 = 0xffffffff;
-	XnUInt32 nStrLen = 0;
-	XnUInt32 nIdx = 0;
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpBuffer);
-	XN_VALIDATE_OUTPUT_PTR(nCRC32);
-
-	*nCRC32 = 0;
-
-	for (nIdx = 0; nIdx < nBufferSize; nIdx++)
-	{
-		nTempCRC32 = (nTempCRC32 >> 8) ^ xnOSStrCRC32Table[(nTempCRC32 & 0xFF) ^ *cpBuffer++];
-	}
-
-	*nCRC32 = nTempCRC32 ^ 0xffffffff; 
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSStrFormatV(XnChar* cpDestString, const XnUInt32 nDestLength, XnUInt32* pnBytesWritten, const XnChar* cpFormat, va_list args)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpDestString);
-	XN_VALIDATE_INPUT_PTR(cpFormat);
-	XN_VALIDATE_OUTPUT_PTR(pnBytesWritten);
-
-	*pnBytesWritten = 0;
-
-	XnInt32 nRes = vsnprintf(cpDestString, nDestLength, cpFormat, args);
-
-	// nRes is the number of bytes written, not including NULL termination
-
-	if ((nRes == -1) ||	// string was truncated
-		(nRes == nDestLength && cpDestString[nRes] != '\0')) // no space for the NULL termination
-	{
-		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
-	}
-
-	// return byte count (string length)
-	*pnBytesWritten = nRes;
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API void xnOSItoA(XnInt32 nValue, XnChar* cpStr, XnInt32 nBase)
-{
-	static XnChar cNum[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-	XnChar* cpWStr = cpStr;
-	XnInt32 nSign;
-
-	// Validate base
-	if (nBase < 2 || nBase > 35)
-	{
-		*cpWStr = '\0';
-		return;
-	}
-
-	// Take care of sign
-	if ((nSign = nValue) < 0)
-	{
-		nValue = -nValue;
-	}
-
-	// Conversion. Number is reversed.
-	do *cpWStr++ = cNum[nValue % nBase]; while(nValue /= nBase);
-
-	if(nSign<0) *cpWStr++='-';
-
-	*cpWStr='\0';
-
-	// Reverse string
-	XnChar cAux;
-	XnChar* cpBegin = cpStr;
-	XnChar* cpEnd = cpWStr-1;
-
-	while(cpEnd > cpBegin)
-	{
-		cAux=*cpEnd;
-		*cpEnd--=*cpBegin;
-		*cpBegin++=cAux;
-	}
-}
-
-XN_C_API XnInt32 xnOSStrCmp(const XnChar* cpFirstString, const XnChar* cpSecondString)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpFirstString);
-	XN_VALIDATE_INPUT_PTR(cpSecondString);
-
-	return strcmp(cpFirstString, cpSecondString);
-}
-
-XN_C_API XnInt32 xnOSStrCaseCmp(const XnChar* cpFirstString, const XnChar* cpSecondString)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(cpFirstString);
-	XN_VALIDATE_INPUT_PTR(cpSecondString);
-
-	return strcasecmp(cpFirstString, cpSecondString);
-}
-
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Threads.cpp b/Source/OpenNI/Linux-x86/Linux-x86Threads.cpp
deleted file mode 100644
index 165a769..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Threads.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <XnLog.h>
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API XnStatus xnOSCreateThread(XN_THREAD_PROC_PROTO pThreadProc, const XN_THREAD_PARAM pThreadParam, XN_THREAD_HANDLE* pThreadHandle)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pThreadProc);
-	XN_VALIDATE_OUTPUT_PTR(pThreadHandle);
-
-	// allocate thread handle
-	XN_VALIDATE_ALLOC(*pThreadHandle, pthread_t);
-
-	// Create a thread via the OS
-	int rc = pthread_create(*pThreadHandle, NULL, pThreadProc, pThreadParam);
-	if (rc != 0)
-	{
-		XN_FREE_AND_NULL(*pThreadHandle);
-		return (XN_STATUS_OS_THREAD_CREATION_FAILED);
-	}
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSTerminateThread(XN_THREAD_HANDLE* pThreadHandle)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pThreadHandle);
-
-	// Make sure the actual thread handle isn't NULL
-	XN_RET_IF_NULL(*pThreadHandle, XN_STATUS_OS_INVALID_THREAD);
-	
-	XN_THREAD_HANDLE handle = *pThreadHandle;
-
-	// send the KILL signal to the thread
-	if (0 != pthread_cancel(*handle))
-	{
-		return (XN_STATUS_OS_THREAD_TERMINATION_FAILED);
-	}
-	
-	// Close the handle
-	XnStatus nRetVal = xnOSCloseThread(pThreadHandle);
-	XN_IS_STATUS_OK(nRetVal);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSCloseThread(XN_THREAD_HANDLE* pThreadHandle)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pThreadHandle);
-
-	// Make sure the actual thread handle isn't NULL
-	XN_RET_IF_NULL(*pThreadHandle, XN_STATUS_OS_INVALID_THREAD);
-
-	// free handle
-	XN_FREE_AND_NULL(*pThreadHandle);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSWaitForThreadExit(XN_THREAD_HANDLE ThreadHandle, XnUInt32 nMilliseconds)
-{
-	int rc = 0;
-	
-	// Make sure the actual thread handle isn't NULL
-	XN_RET_IF_NULL(ThreadHandle, XN_STATUS_OS_INVALID_THREAD);
-	
-	if (nMilliseconds == XN_WAIT_INFINITE)
-	{
-		// join via the OS
-		void* pReturnValue;
-		rc = pthread_join(*ThreadHandle, &pReturnValue);
-	}
-	else
-	{
-		// calculate timeout absolute time. First we take current time
-		struct timespec time;
-		XnStatus nRetVal = xnOSGetAbsTimeout(&time, nMilliseconds);
-		if (nRetVal != XN_STATUS_OK)
-		{
-			return XN_STATUS_OS_THREAD_TERMINATION_FAILED;
-		}
-		
-		// join via the OS
-		void* pReturnValue;
-#ifndef XN_PLATFORM_HAS_NO_TIMED_OPS
-		rc = pthread_timedjoin_np(*ThreadHandle, &pReturnValue, &time);
-#else
-		rc = pthread_join(*ThreadHandle, &pReturnValue);
-#endif
-	}
-
-	// check for failures
-	if (rc == ETIMEDOUT)
-	{
-		return (XN_STATUS_OS_THREAD_TIMEOUT);
-	}
-	else if (rc != 0)
-	{
-		return (XN_STATUS_OS_THREAD_TERMINATION_FAILED);
-	}
-	
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSSetThreadPriority(XN_THREAD_HANDLE ThreadHandle, XnThreadPriority nPriority)
-{
-	// Make sure the actual thread handle isn't NULL
-	XN_RET_IF_NULL(ThreadHandle, XN_STATUS_OS_INVALID_THREAD);
-
-	int nPolicy = 0;
-	sched_param param;
-	int rc = 0;
-	
-	if (nPriority == XN_PRIORITY_CRITICAL)
-	{
-#ifndef XN_PLATFORM_HAS_NO_SCHED_PARAM
-		param.__sched_priority = 5;
-#endif
-		nPolicy = SCHED_RR;
-	}
-	else
-	{
-		return (XN_STATUS_OS_THREAD_UNSUPPORTED_PRIORITY);
-	}
-	
-	rc = pthread_setschedparam(*ThreadHandle, nPolicy, &param);
-	if (rc != 0)
-	{
-		xnLogWarning(XN_MASK_OS, "Failed to set thread priority: %s", sys_errlist[rc]);
-		return (XN_STATUS_OS_THREAD_SET_PRIORITY_FAILED);
-	}
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetCurrentThreadID(XN_THREAD_ID* pThreadID)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_OUTPUT_PTR(pThreadID);
-
-	// Get the current thread id
-	*pThreadID = pthread_self();
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
diff --git a/Source/OpenNI/Linux-x86/Linux-x86Time.cpp b/Source/OpenNI/Linux-x86/Linux-x86Time.cpp
deleted file mode 100644
index 5a3ec76..0000000
--- a/Source/OpenNI/Linux-x86/Linux-x86Time.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-
-//---------------------------------------------------------------------------
-// Global Variables
-//---------------------------------------------------------------------------
-XnOSTimer g_xnOSHighResGlobalTimer;
-
-//---------------------------------------------------------------------------
-// Macros
-//---------------------------------------------------------------------------
-/* Translates from struct timespec to microseconds. */
-#define TIMESPEC_TO_MICRO_SECS(ts)	(ts.tv_sec * 1000000 + ts.tv_nsec / 1000)
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_C_API XnStatus xnOSGetEpochTime(XnUInt32* nEpochTime)
-{
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	*nEpochTime = (XnUInt32)time(NULL);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetTimeStamp(XnUInt64* nTimeStamp)
-{
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	// Get the high resolution global timer value
-	nRetVal = xnOSGetHighResTimeStamp(nTimeStamp);
-	XN_IS_STATUS_OK(nRetVal);
-
-	// Convert from microseconds to milliseconds
-	*nTimeStamp /= 1000;
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetHighResTimeStamp(XnUInt64* nTimeStamp)
-{
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	// TODO: Check if the core subsystem is initialized
-
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_OUTPUT_PTR(nTimeStamp);
-
-	// Get the high resolution global timer value
-	nRetVal = xnOSQueryTimer(g_xnOSHighResGlobalTimer, nTimeStamp);
-	XN_IS_STATUS_OK(nRetVal);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSSleep(XnUInt32 nMilliseconds)
-{
-	// Sleep via the OS (function needs time in microseconds)
-	usleep(nMilliseconds*1000);
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSStartTimer(XnOSTimer* pTimer)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pTimer);
-	
-	if (XN_STATUS_OK != xnOSGetMonoTime(&pTimer->tStartTime))
-	{
-		return XN_STATUS_OS_TIMER_QUERY_FAILED;
-	}
-	
-	pTimer->bHighRes = false;
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSStartHighResTimer(XnOSTimer* pTimer)
-{
-	// start a normal timer
-	XnStatus nRetVal = xnOSStartTimer(pTimer);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	// now make it high-res
-	pTimer->bHighRes = true;
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSQueryTimer(XnOSTimer Timer, XnUInt64* pnTimeSinceStart)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_OUTPUT_PTR(pnTimeSinceStart);
-
-	struct timespec now;
-	
-	if (XN_STATUS_OK != xnOSGetMonoTime(&now))
-	{
-		return XN_STATUS_OS_TIMER_QUERY_FAILED;
-	}
-	
-	*pnTimeSinceStart = ((now.tv_sec - Timer.tStartTime.tv_sec) * 1E6 + (now.tv_nsec - Timer.tStartTime.tv_nsec) / 1E3);
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSStopTimer(XnOSTimer* pTimer)
-{
-	// Validate the input/output pointers (to make sure none of them is NULL)
-	XN_VALIDATE_INPUT_PTR(pTimer);
-
-	memset(pTimer, 0, sizeof(XnOSTimer));
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetMonoTime(struct timespec* pTime)
-{
-#ifndef XN_PLATFORM_HAS_NO_CLOCK_GETTIME
-	if (0 != clock_gettime(CLOCK_REALTIME, pTime))
-	{
-		return (XN_STATUS_OS_EVENT_WAIT_FAILED);
-	}
-#else
-	struct timeval tv;
-	gettimeofday(&tv, NULL);
-	pTime->tv_sec = tv.tv_sec;
-	pTime->tv_nsec = tv.tv_usec * 1000;  
-#endif
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnOSGetTimeout(struct timespec* pTime, XnUInt32 nMilliseconds)
-{
-	pTime->tv_sec = (nMilliseconds / 1000);
-	pTime->tv_nsec = ((nMilliseconds % 1000) * 1000000);
-
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnOSGetAbsTimeout(struct timespec* pTime, XnUInt32 nMilliseconds)
-{
-	XnStatus nRetVal = xnOSGetMonoTime(pTime);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	pTime->tv_sec += (nMilliseconds / 1000);
-	pTime->tv_nsec += ((nMilliseconds % 1000) * 1000000);
-
-	if (pTime->tv_nsec >= 1000000000)
-	{
-		pTime->tv_nsec -= 1000000000;
-		pTime->tv_sec++;
-	}
-	
-	return XN_STATUS_OK;
-}
diff --git a/Source/OpenNI/Linux-x86/XnUSBLinux-x86.cpp b/Source/OpenNI/Linux-x86/XnUSBLinux-x86.cpp
deleted file mode 100644
index cca9607..0000000
--- a/Source/OpenNI/Linux-x86/XnUSBLinux-x86.cpp
+++ /dev/null
@@ -1,1282 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnUSB.h>
-#include <libusb-1.0/libusb.h>
-#include "XnUSBLinux-x86.h"
-#include "../XnUSBInternal.h"
-#include <XnOS.h>
-#include <XnLog.h>
-
-//---------------------------------------------------------------------------
-// Defines
-//---------------------------------------------------------------------------
-#define MAX_DEVPATH_LENGTH 256
-#define USB_TYPE_STANDARD		(0x00 << 5)
-#define USB_TYPE_CLASS			(0x01 << 5)
-#define USB_TYPE_VENDOR			(0x02 << 5)
-#define USB_ENDPOINT_IN			0x80
-
-#define XN_MASK_USB "xnUSB"
-
-#define XN_USB_HANDLE_EVENTS_TIMEOUT 1000
-
-#define XN_VALIDATE_DEVICE_HANDLE(x)					\
-	if (x == NULL)									\
-		return (XN_STATUS_USB_DEVICE_NOT_VALID);
-		
-#define XN_VALIDATE_EP_HANDLE(x)						\
-	if (x == NULL)									\
-		return (XN_STATUS_USB_ENDPOINT_NOT_VALID);
-
-struct xnUSBInitData
-{
-	libusb_context* pContext;
-	XN_THREAD_HANDLE hThread;
-	XnBool bShouldThreadRun;
-} g_InitData = {NULL, NULL, FALSE};
-
-XnStatus xnUSBPlatformSpecificShutdown();
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XN_THREAD_PROC xnUSBHandleEventsThread(XN_THREAD_PARAM pThreadParam)
-{
-	// init timeout
-	struct timeval timeout;
-	timeout.tv_sec = XN_USB_HANDLE_EVENTS_TIMEOUT / 1000;
-	timeout.tv_usec = XN_USB_HANDLE_EVENTS_TIMEOUT % 1000;
-	
-	while (g_InitData.bShouldThreadRun)
-	{
-		// let libusb process its asynchronous events
-		libusb_handle_events_timeout(g_InitData.pContext, &timeout);
-	}
-	
-	XN_THREAD_PROC_RETURN(XN_STATUS_OK);
-}
-
-XnStatus xnUSBPlatformSpecificInit()
-{
-	xnLogVerbose(XN_MASK_USB, "Initializing USB...");
-
-	// initialize the library
-	int rc = libusb_init(&g_InitData.pContext);
-	if (rc != 0)
-	{
-		return (XN_STATUS_USB_INIT_FAILED);
-	}
-	
-	//libusb_set_debug(g_InitData.pContext, 3);
-	
-	xnLogInfo(XN_MASK_USB, "USB is initialized.");
-	return (XN_STATUS_OK);	
-}
-
-XnStatus xnUSBStartReading()
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	if (g_InitData.hThread == NULL)
-	{
-		xnLogVerbose(XN_MASK_USB, "Starting libusb asynch thread...");
-		
-		// mark thread should run
-		g_InitData.bShouldThreadRun = TRUE;
-		
-		// and start thread
-		nRetVal = xnOSCreateThread(xnUSBHandleEventsThread, NULL, &g_InitData.hThread);
-		if (nRetVal != XN_STATUS_OK)
-		{
-			// clean-up
-			xnUSBPlatformSpecificShutdown();
-			return nRetVal;
-		}
-
-		// set thread priority to critical
-		nRetVal = xnOSSetThreadPriority(g_InitData.hThread, XN_PRIORITY_CRITICAL);
-		if (nRetVal != 0)
-		{
-			xnLogWarning(XN_MASK_USB, "USB events thread: Failed to set thread priority to critical. This might cause loss of data...");
-			printf("Warning: USB events thread - failed to set priority. This might cause loss of data...\n");
-		}
-	}
-	
-	return (XN_STATUS_OK);	
-}
-
-XnStatus xnUSBPlatformSpecificShutdown()
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	if (g_InitData.hThread != NULL)
-	{
-		// mark for thread to exit
-		g_InitData.bShouldThreadRun = FALSE;
-		
-		// wait for it to exit
-		nRetVal = xnOSWaitForThreadExit(g_InitData.hThread, XN_USB_HANDLE_EVENTS_TIMEOUT);
-		if (nRetVal != XN_STATUS_OK)
-		{
-			xnOSTerminateThread(&g_InitData.hThread);
-		}
-		else
-		{
-			xnOSCloseThread(&g_InitData.hThread);
-		}
-		
-		g_InitData.hThread = NULL;
-	}
-	
-	if (g_InitData.pContext != NULL)
-	{
-		// close the library
-		libusb_exit(g_InitData.pContext);
-		g_InitData.pContext = NULL;
-	}
-	
-	return (XN_STATUS_OK);
-}
-
-/*
-* Finds a USB device.
-* the returned device must be unreferenced when it is no longer needed using libusb_unref_device.
-*/
-XnStatus FindDevice(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, libusb_device** ppDevice)
-{
-	*ppDevice = NULL;
-
-	// get device list
-	libusb_device** ppDevices;
-	ssize_t nDeviceCount = libusb_get_device_list(g_InitData.pContext, &ppDevices);
-	
-	// check for error
-	if (nDeviceCount < 0)
-	{
-		return (XN_STATUS_USB_ENUMERATE_FAILED);
-	}
-	
-	// enumerate over the devices
-	for (ssize_t i = 0; i < nDeviceCount; ++i)
-	{
-		libusb_device* pDevice = ppDevices[i];
-		
-		// get device descriptor
-		libusb_device_descriptor desc;
-		int rc = libusb_get_device_descriptor(pDevice, &desc);
-		if (rc != 0)
-		{
-			return (XN_STATUS_USB_ENUMERATE_FAILED);
-		}
-		
-		// check if this is the requested device
-		if (desc.idVendor == nVendorID && desc.idProduct == nProductID)
-		{
-			// add a reference to the device (so it won't be destroyed when list is freed)
-			libusb_ref_device(pDevice);
-			*ppDevice = pDevice;
-			break;
-		}
-	}
-	
-	// free the list (also dereference each device)
-	libusb_free_device_list(ppDevices, 1);
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBIsDevicePresent(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, XnBool* pbDevicePresent)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// make sure library was initialized
-	XN_VALIDATE_USB_INIT();
-	
-	// Validate parameters
-	XN_VALIDATE_OUTPUT_PTR(pbDevicePresent);
-
-	*pbDevicePresent = FALSE;
-	
-	libusb_device* pDevice;
-	nRetVal = FindDevice(nVendorID, nProductID, pExtraParam, &pDevice);
-	XN_IS_STATUS_OK(nRetVal);
-		
-	if (pDevice != NULL)
-	{
-		*pbDevicePresent = TRUE;
-		
-		// unref device
-		libusb_unref_device(pDevice);
-	}
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBEnumerateDevices(XnUInt16 nVendorID, XnUInt16 nProductID, const XnUSBConnectionString** pastrDevicePaths, XnUInt32* pnCount)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// get device list
-	libusb_device** ppDevices;
-	ssize_t nDeviceCount = libusb_get_device_list(g_InitData.pContext, &ppDevices);
-	
-	// first enumeration - count
-	XnUInt32 nCount = 0;
-	
-	for (ssize_t i = 0; i < nDeviceCount; ++i)
-	{
-		libusb_device* pDevice = ppDevices[i];
-		
-		// get device descriptor
-		libusb_device_descriptor desc;
-		int rc = libusb_get_device_descriptor(pDevice, &desc);
-		if (rc != 0)
-		{
-			libusb_free_device_list(ppDevices, 1);
-			return (XN_STATUS_USB_ENUMERATE_FAILED);
-		}
-		
-		// check if this is the requested device
-		if (desc.idVendor == nVendorID && desc.idProduct == nProductID)
-		{
-			++nCount;
-		}
-	}
-	
-	// allocate array
-	XnUSBConnectionString* aResult = (XnUSBConnectionString*)xnOSCalloc(nCount, sizeof(XnUSBConnectionString));
-	if (aResult == NULL)
-	{
-		libusb_free_device_list(ppDevices, 1);
-		return XN_STATUS_ALLOC_FAILED;
-	}
-	
-	// second enumeration - fill
-	XnUInt32 nCurrent = 0;
-	for (ssize_t i = 0; i < nDeviceCount; ++i)
-	{
-		libusb_device* pDevice = ppDevices[i];
-		
-		// get device descriptor
-		libusb_device_descriptor desc;
-		int rc = libusb_get_device_descriptor(pDevice, &desc);
-		if (rc != 0)
-		{
-			libusb_free_device_list(ppDevices, 1);
-			return (XN_STATUS_USB_ENUMERATE_FAILED);
-		}
-		
-		// check if this is the requested device
-		if (desc.idVendor == nVendorID && desc.idProduct == nProductID)
-		{
-			sprintf(aResult[nCurrent], "%04hx/%04hx@%hhu/%hhu", nVendorID, nProductID, libusb_get_bus_number(pDevice), libusb_get_device_address(pDevice));
-			nCurrent++;
-		}
-	}
-	
-	*pastrDevicePaths = aResult;
-	*pnCount = nCount;
-		
-	// free the list (also dereference each device)
-	libusb_free_device_list(ppDevices, 1);
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API void xnUSBFreeDevicesList(const XnUSBConnectionString* astrDevicePaths)
-{
-	xnOSFree(astrDevicePaths);
-}
-
-XN_C_API XnStatus xnUSBOpenDeviceImpl(libusb_device* pDevice, XN_USB_DEV_HANDLE* pDevHandlePtr)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	if (pDevice == NULL)
-	{
-		return (XN_STATUS_USB_DEVICE_NOT_FOUND);
-	}
-
-	// allocate device handle
-	libusb_device_handle* handle;
-	
-	// open device
-	int rc = libusb_open(pDevice, &handle);
-	
-	// in any case, unref the device (we don't need it anymore)
-	libusb_unref_device(pDevice);
-	pDevice = NULL;
-	
-	// now check if open failed
-	if (rc != 0)
-	{
-		return (XN_STATUS_USB_DEVICE_OPEN_FAILED);
-	}
-	
-/*	
-	// set for the first (and only) configuration (this will perform a light-weight reset)
-	rc = libusb_set_configuration(handle, 1);
-	if (rc != 0)
-	{
-		libusb_close(handle);
-		return (XN_STATUS_USB_SET_CONFIG_FAILED);
-	}
-*/	
-	// claim the interface (you cannot open any end point before claiming the interface)
-	rc = libusb_claim_interface(handle, 0);
-	if (rc != 0)
-	{
-		libusb_close(handle);
-		return (XN_STATUS_USB_SET_INTERFACE_FAILED);
-	}
-	
-/*	
-	// set the alternate setting to default
-	rc = libusb_set_interface_alt_setting(handle, 0, 0);
-	if (rc != 0)
-	{
-		libusb_close(handle);
-		return (XN_STATUS_USB_SET_INTERFACE_FAILED);
-	}
-*/	
-	XN_VALIDATE_ALLOC(*pDevHandlePtr, XnUSBDeviceHandle);
-	XN_USB_DEV_HANDLE pDevHandle = *pDevHandlePtr;
-	pDevHandle->hDevice = handle;
-	pDevHandle->nInterface = 0;
-	pDevHandle->nAltSetting = 0;
-	
-	// mark the device is of high-speed
-	pDevHandle->nDevSpeed = XN_USB_DEVICE_HIGH_SPEED;
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBOpenDevice(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, void* pExtraParam2, XN_USB_DEV_HANDLE* pDevHandlePtr)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-		
-	// make sure library was initialized
-	XN_VALIDATE_USB_INIT();
-	
-	// Validate parameters
-	XN_VALIDATE_OUTPUT_PTR(pDevHandlePtr);
-
-	libusb_device* pDevice;
-	nRetVal = FindDevice(nVendorID, nProductID, pExtraParam, &pDevice);
-	XN_IS_STATUS_OK(nRetVal);
-		
-	nRetVal = xnUSBOpenDeviceImpl(pDevice, pDevHandlePtr);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBOpenDeviceByPath(const XnUSBConnectionString strDevicePath, XN_USB_DEV_HANDLE* pDevHandlePtr)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// parse connection string
-	XnUInt16 nVendorID = 0;
-	XnUInt16 nProductID = 0;
-	XnUInt8 nBus = 0;
-	XnUInt8 nAddress = 0;
-	sscanf(strDevicePath, "%hx/%hx@%hhu/%hhu", &nVendorID, &nProductID, &nBus, &nAddress);
-	
-	if (nVendorID == 0 || nProductID == 0 || nBus == 0 || nAddress == 0)
-	{
-		XN_LOG_WARNING_RETURN(XN_STATUS_USB_DEVICE_OPEN_FAILED, "Invalid connection string: %s", strDevicePath);
-	}
-
-	// find device	
-	libusb_device** ppDevices;
-	ssize_t nDeviceCount = libusb_get_device_list(g_InitData.pContext, &ppDevices);
-	
-	libusb_device* pRequestedDevice = NULL;
-	
-	for (ssize_t i = 0; i < nDeviceCount; ++i)
-	{
-		libusb_device* pDevice = ppDevices[i];
-		
-		// get device descriptor
-		libusb_device_descriptor desc;
-		int rc = libusb_get_device_descriptor(pDevice, &desc);
-		if (rc != 0)
-		{
-			libusb_free_device_list(ppDevices, 1);
-			return (XN_STATUS_USB_ENUMERATE_FAILED);
-		}
-		
-		// check if this is the requested device
-		if (desc.idVendor == nVendorID && desc.idProduct == nProductID && libusb_get_bus_number(pDevice) == nBus && libusb_get_device_address(pDevice) == nAddress)
-		{
-			// add a reference to the device (so it won't be destroyed when list is freed)
-			libusb_ref_device(pDevice);
-			pRequestedDevice = pDevice;
-			break;	
-		}
-	}
-
-	libusb_free_device_list(ppDevices, 1);
-	
-	nRetVal = xnUSBOpenDeviceImpl(pRequestedDevice, pDevHandlePtr);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBCloseDevice(XN_USB_DEV_HANDLE pDevHandle)
-{
-	// validate parameters
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
-
-	int rc = libusb_release_interface(pDevHandle->hDevice, pDevHandle->nInterface);
-	if (0 != rc)
-	{
-		return (XN_STATUS_USB_DEVICE_CLOSE_FAILED);
-	}
-
-	libusb_close(pDevHandle->hDevice);
-
-	XN_FREE_AND_NULL(pDevHandle);
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBGetDeviceSpeed(XN_USB_DEV_HANDLE pDevHandle, XnUSBDeviceSpeed* pDevSpeed)
-{
-	// validate parameters
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
-	XN_VALIDATE_OUTPUT_PTR(pDevSpeed);
-
-	*pDevSpeed = pDevHandle->nDevSpeed;
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBSetConfig(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 nConfig)
-{
-	return (XN_STATUS_OS_UNSUPPORTED_FUNCTION);
-}
-
-XN_C_API XnStatus xnUSBGetConfig(XN_USB_DEV_HANDLE pDevHandle, XnUInt8* pnConfig)
-{
-	return (XN_STATUS_OS_UNSUPPORTED_FUNCTION);
-}
-
-XN_C_API XnStatus xnUSBSetInterface(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 nInterface, XnUInt8 nAltInterface)
-{
-	// validate parameters
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
-	
-	int rc = libusb_set_interface_alt_setting(pDevHandle->hDevice, nInterface, nAltInterface);
-	if (rc != 0)
-	{
-		return (XN_STATUS_USB_SET_INTERFACE_FAILED);
-	}
-	
-	pDevHandle->nInterface = nInterface;
-	pDevHandle->nAltSetting = nAltInterface;
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBGetInterface(XN_USB_DEV_HANDLE pDevHandle, XnUInt8* pnInterface, XnUInt8* pnAltInterface)
-{
-	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
-}
-
-XN_C_API XnStatus xnUSBOpenEndPoint(XN_USB_DEV_HANDLE pDevHandle, XnUInt16 nEndPointID, XnUSBEndPointType nEPType, XnUSBDirectionType nDirType, XN_USB_EP_HANDLE* pEPHandlePtr)
-{
-	// validate parameters
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
-	XN_VALIDATE_OUTPUT_PTR(pEPHandlePtr);
-
-	// get the device from the handle
-	libusb_device* pDevice = libusb_get_device(pDevHandle->hDevice);
-	
-	// get the configuration descriptor
-	libusb_config_descriptor* pConfig;
-	int rc = libusb_get_active_config_descriptor(pDevice, &pConfig);
-	if (rc != 0)
-	{
-		return (XN_STATUS_USB_CONFIG_QUERY_FAILED);
-	}
-	
-	// make sure configuration contains the interface we need
-	if (pConfig->bNumInterfaces <= pDevHandle->nInterface)
-	{
-		libusb_free_config_descriptor(pConfig);
-		return (XN_STATUS_USB_INTERFACE_QUERY_FAILED);
-	}
-	
-	// take that interface
-	const libusb_interface* pInterface = &pConfig->interface[pDevHandle->nInterface];
-	
-	// make sure interface contains the alternate setting we work with
-	if (pInterface->num_altsetting <= pDevHandle->nAltSetting)
-	{
-		libusb_free_config_descriptor(pConfig);
-		return (XN_STATUS_USB_INTERFACE_QUERY_FAILED);
-	}
-	
-	// take that setting
-	const libusb_interface_descriptor* pInterfaceDesc = &pInterface->altsetting[pDevHandle->nAltSetting];
-	
-	// search for the requested endpoint
-	const libusb_endpoint_descriptor* pEndpointDesc = NULL;
-	
-	for (uint8_t i = 0; i < pInterfaceDesc->bNumEndpoints; ++i)
-	{
-		if (pInterfaceDesc->endpoint[i].bEndpointAddress == nEndPointID)
-		{
-			pEndpointDesc = &pInterfaceDesc->endpoint[i];
-			break;
-		}
-	}
-	
-	if (pEndpointDesc == NULL)
-	{
-		libusb_free_config_descriptor(pConfig);
-		return (XN_STATUS_USB_ENDPOINT_NOT_FOUND);
-	}
-	
-	libusb_transfer_type transfer_type = (libusb_transfer_type)(pEndpointDesc->bmAttributes & 0x3); // lower 2-bits
-
-    // calculate max packet size
-	// NOTE: we do not use libusb functions (libusb_get_max_packet_size/libusb_get_max_iso_packet_size) because
-	// they hace a bug and does not consider alternative interface
-    XnUInt32 nMaxPacketSize = 0;
-	
-	if (transfer_type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS)
-	{
-		XnUInt32 wMaxPacketSize = pEndpointDesc->wMaxPacketSize;
-		// bits 11 and 12 mark the number of additional transactions, bits 0-10 mark the size
-		XnUInt32 nAdditionalTransactions = wMaxPacketSize >> 11;
-		XnUInt32 nPacketSize = wMaxPacketSize & 0x7FF;
-		nMaxPacketSize = (nAdditionalTransactions + 1) * (nPacketSize);
-	}
-	else
-	{
-		nMaxPacketSize = pEndpointDesc->wMaxPacketSize;
-	}
-
-	// free the configuration descriptor. no need of it anymore
-	libusb_free_config_descriptor(pConfig);
-	pConfig = NULL;
-	
-	// Make sure the endpoint matches the required endpoint type
-	if (nEPType == XN_USB_EP_BULK)
-	{
-		if (transfer_type != LIBUSB_TRANSFER_TYPE_BULK)
-		{
-			return (XN_STATUS_USB_WRONG_ENDPOINT_TYPE);
-		}
-	}
-	else if (nEPType == XN_USB_EP_INTERRUPT)
-	{
-		if (transfer_type != LIBUSB_TRANSFER_TYPE_INTERRUPT)
-		{
-			return (XN_STATUS_USB_WRONG_ENDPOINT_TYPE);
-		}
-	}
-	else if (nEPType == XN_USB_EP_ISOCHRONOUS)
-	{
-		if (transfer_type != LIBUSB_TRANSFER_TYPE_ISOCHRONOUS)
-		{
-			return (XN_STATUS_USB_WRONG_ENDPOINT_TYPE);
-		}
-	}
-	else
-	{
-		return (XN_STATUS_USB_UNKNOWN_ENDPOINT_TYPE);
-	}
-
-	// Make sure the endpoint matches the required direction
-	libusb_endpoint_direction direction = (libusb_endpoint_direction)(nEndPointID & 0x80); // 8th bit
-	if (nDirType == XN_USB_DIRECTION_IN)
-	{
-		if (direction != LIBUSB_ENDPOINT_IN)
-		{
-			return (XN_STATUS_USB_WRONG_ENDPOINT_DIRECTION);
-		}
-	}
-	else if (nDirType == XN_USB_DIRECTION_OUT)
-	{
-		if (direction != LIBUSB_ENDPOINT_OUT)
-		{
-			return (XN_STATUS_USB_WRONG_ENDPOINT_DIRECTION);
-		}
-	}
-	else
-	{
-		return (XN_STATUS_USB_UNKNOWN_ENDPOINT_DIRECTION);
-	}
-	
-	// allocate handle
-	XN_VALIDATE_ALIGNED_CALLOC(*pEPHandlePtr, XnUSBEPHandle, 1, XN_DEFAULT_MEM_ALIGN);
-	XN_USB_EP_HANDLE pHandle = *pEPHandlePtr;
-	pHandle->hDevice = pDevHandle->hDevice;
-	pHandle->nAddress = nEndPointID;
-	pHandle->nType = nEPType;
-	pHandle->nDirection = nDirType;
-	pHandle->nMaxPacketSize = nMaxPacketSize;
-
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnUSBCloseEndPoint(XN_USB_EP_HANDLE pEPHandle)
-{
-	// validate parameters
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_EP_HANDLE(pEPHandle);
-	
-	XN_ALIGNED_FREE_AND_NULL(pEPHandle);
-	
-	return XN_STATUS_OK;
-}
-
-XN_C_API XnStatus xnUSBGetEndPointMaxPacketSize(XN_USB_EP_HANDLE pEPHandle, XnUInt32* pnMaxPacketSize)
-{
-	// Validate xnUSB
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_EP_HANDLE(pEPHandle);
-
-	// Validate the input/output pointers
-	XN_VALIDATE_INPUT_PTR(pEPHandle);
-	XN_VALIDATE_OUTPUT_PTR(pnMaxPacketSize);
-
-	*pnMaxPacketSize = pEPHandle->nMaxPacketSize;
-
-	// All is good...
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBAbortEndPoint(XN_USB_EP_HANDLE pEPHandle)
-{
-	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
-}
-
-XN_C_API XnStatus xnUSBFlushEndPoint(XN_USB_EP_HANDLE pEPHandle)
-{
-	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
-}
-
-XN_C_API XnStatus xnUSBResetEndPoint(XN_USB_EP_HANDLE pEPHandle)
-{
-	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
-}
-
-XN_C_API XnStatus xnUSBSendControl(XN_USB_DEV_HANDLE pDevHandle, XnUSBControlType nType, XnUInt8 nRequest, XnUInt16 nValue, XnUInt16 nIndex, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut)
-{
-	// validate parameters
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
-	
-	if (nBufferSize != 0)
-	{
-		XN_VALIDATE_INPUT_PTR(pBuffer);
-	}
-	
-	uint8_t bmRequestType;
-	
-	if (nType == XN_USB_CONTROL_TYPE_VENDOR )
-	{
-		bmRequestType = LIBUSB_REQUEST_TYPE_VENDOR;
-	}
-	else if (nType == XN_USB_CONTROL_TYPE_CLASS)
-	{
-		bmRequestType = LIBUSB_REQUEST_TYPE_CLASS;
-	}
-	else if (nType == XN_USB_CONTROL_TYPE_STANDARD)
-	{
-		bmRequestType = LIBUSB_REQUEST_TYPE_STANDARD;
-	}
-	else
-	{
-		return (XN_STATUS_USB_WRONG_CONTROL_TYPE);
-	}
-	
-	bmRequestType |= LIBUSB_ENDPOINT_OUT;
-	
-	// send	
-	int nBytesSent = libusb_control_transfer(pDevHandle->hDevice, bmRequestType, nRequest, nValue, nIndex, pBuffer, nBufferSize, nTimeOut);
-	
-	// check everything went OK
-	if (nBytesSent == LIBUSB_ERROR_TIMEOUT)
-	{
-		return (XN_STATUS_USB_TRANSFER_TIMEOUT);
-	}
-	else if (nBytesSent < 0)
-	{
-		return (XN_STATUS_USB_CONTROL_SEND_FAILED);
-	}
-	
-	if (nBytesSent != nBufferSize)
-	{
-		return (XN_STATUS_USB_GOT_UNEXPECTED_BYTES);
-	}
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBReceiveControl(XN_USB_DEV_HANDLE pDevHandle, XnUSBControlType nType, XnUInt8 nRequest, XnUInt16 nValue, XnUInt16 nIndex, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut)
-{
-	// validate parameters
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
-	XN_VALIDATE_OUTPUT_PTR(pBuffer);
-	XN_VALIDATE_OUTPUT_PTR(pnBytesReceived);
-	
-	if (nBufferSize == 0)
-	{
-		return (XN_STATUS_USB_BUFFER_TOO_SMALL);
-	}
-	
-	*pnBytesReceived = 0;
-
-	uint8_t bmRequestType;
-	
-	if (nType == XN_USB_CONTROL_TYPE_VENDOR )
-	{
-		bmRequestType = LIBUSB_REQUEST_TYPE_VENDOR;
-	}
-	else if (nType == XN_USB_CONTROL_TYPE_CLASS)
-	{
-		bmRequestType = LIBUSB_REQUEST_TYPE_CLASS;
-	}
-	else if (nType == XN_USB_CONTROL_TYPE_STANDARD)
-	{
-		bmRequestType = LIBUSB_REQUEST_TYPE_STANDARD;
-	}
-	else
-	{
-		return (XN_STATUS_USB_WRONG_CONTROL_TYPE);
-	}
-	
-	bmRequestType |= LIBUSB_ENDPOINT_IN;
-	
-	// send	
-	int nBytesReceived = libusb_control_transfer(pDevHandle->hDevice, bmRequestType, nRequest, nValue, nIndex, pBuffer, nBufferSize, nTimeOut);
-	
-	// check everything went OK
-	if (nBytesReceived == LIBUSB_ERROR_TIMEOUT)
-	{
-		return (XN_STATUS_USB_TRANSFER_TIMEOUT);
-	}
-	else if (nBytesReceived < 0) // error
-	{
-		return (XN_STATUS_USB_CONTROL_SEND_FAILED);
-	}
-	else if (nBytesReceived == 0) // nothing received
-	{
-		return (XN_STATUS_USB_NOT_ENOUGH_DATA);
-	}
-	else if (nBytesReceived > nBufferSize) // too much
-	{
-		return (XN_STATUS_USB_TOO_MUCH_DATA);
-	}
-	
-	// return number of bytes received
-	*pnBytesReceived = nBytesReceived;
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBWriteEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut)
-{
-	// validate parameters
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_EP_HANDLE(pEPHandle);
-	XN_VALIDATE_INPUT_PTR(pBuffer);
-
-	if (pEPHandle->nDirection != XN_USB_DIRECTION_OUT)
-	{
-		return (XN_STATUS_USB_WRONG_ENDPOINT_DIRECTION);
-	}
-	
-	if (nBufferSize == 0)
-	{
-		return (XN_STATUS_USB_BUFFER_TOO_SMALL);
-	}
-
-	// send (according to EP type)
-	int nBytesSent = 0;
-	int rc = 0;
-	
-	if (pEPHandle->nType == XN_USB_EP_BULK)
-	{
-		rc = libusb_bulk_transfer(pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, &nBytesSent, nTimeOut);
-	}
-	else if (pEPHandle->nType == XN_USB_EP_INTERRUPT)
-	{
-		rc = libusb_interrupt_transfer(pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, &nBytesSent, nTimeOut);
-	}
-	else
-	{
-		return (XN_STATUS_USB_UNSUPPORTED_ENDPOINT_TYPE);
-	}
-	
-	// check result
-	if (rc == LIBUSB_ERROR_TIMEOUT)
-	{
-		return (XN_STATUS_USB_TRANSFER_TIMEOUT);
-	}
-	else if (rc != 0)
-	{
-		return (XN_STATUS_USB_ENDPOINT_WRITE_FAILED);
-	}
-	
-	if (nBytesSent != nBufferSize)
-	{
-		return (XN_STATUS_USB_GOT_UNEXPECTED_BYTES);
-	}
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut)
-{
-	// validate parameters
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_EP_HANDLE(pEPHandle);
-	XN_VALIDATE_OUTPUT_PTR(pBuffer);
-	XN_VALIDATE_OUTPUT_PTR(pnBytesReceived);
-
-	if (pEPHandle->nDirection != XN_USB_DIRECTION_IN)
-	{
-		return (XN_STATUS_USB_WRONG_ENDPOINT_DIRECTION);
-	}
-
-	if (nBufferSize == 0)
-	{
-		return (XN_STATUS_USB_BUFFER_TOO_SMALL);
-	}
-	
-	// receive (according to EP type)
-	*pnBytesReceived = 0;
-
-	int nBytesReceived = 0;
-	int rc = 0;
-	
-	if (pEPHandle->nType == XN_USB_EP_BULK)
-	{
-		rc = libusb_bulk_transfer(pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, &nBytesReceived, nTimeOut);
-	}
-	else if (pEPHandle->nType == XN_USB_EP_INTERRUPT)
-	{
-		rc = libusb_interrupt_transfer(pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, &nBytesReceived, nTimeOut);
-	}
-	else
-	{
-		return (XN_STATUS_USB_UNSUPPORTED_ENDPOINT_TYPE);
-	}
-	
-	// check result
-	if (rc == LIBUSB_ERROR_TIMEOUT)
-	{
-		return (XN_STATUS_USB_TRANSFER_TIMEOUT);
-	}
-	else if (rc != 0)
-	{
-		return (XN_STATUS_USB_ENDPOINT_WRITE_FAILED);
-	}
-	
-	if (nBytesReceived == 0)
-	{
-		return (XN_STATUS_USB_NOT_ENOUGH_DATA);
-	}
-
-	*pnBytesReceived = nBytesReceived;
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBQueueReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut)
-{
-	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
-}
-
-XN_C_API XnStatus xnUSBFinishReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut)
-{	
-	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
-}
-
-void xnCleanupThreadData(XnUSBReadThreadData* pThreadData)
-{
-	for (XnUInt32 i = 0; i < pThreadData->nNumBuffers; ++i)
-	{
-		if (pThreadData->pBuffersInfo[i].transfer != NULL)
-		{
-			XN_ALIGNED_FREE_AND_NULL(pThreadData->pBuffersInfo[i].transfer->buffer);
-			libusb_free_transfer(pThreadData->pBuffersInfo[i].transfer);
-			pThreadData->pBuffersInfo[i].transfer = NULL;
-			xnOSCloseEvent(&pThreadData->pBuffersInfo[i].hEvent);
-		}
-	}
-	
-	XN_ALIGNED_FREE_AND_NULL(pThreadData->pBuffersInfo);
-}
-
-/** Checks if any transfer of the thread is queued. */
-XnBool xnIsAnyTransferQueued(XnUSBReadThreadData* pThreadData)
-{
-	for (XnUInt32 i = 0; i < pThreadData->nNumBuffers; ++i)
-	{
-		if (pThreadData->pBuffersInfo[i].bIsQueued)
-			return (TRUE);
-	}
-	
-	return (FALSE);
-}
-
-XN_THREAD_PROC xnUSBReadThreadMain(XN_THREAD_PARAM pThreadParam)
-{
-	XnUSBReadThreadData* pThreadData = (XnUSBReadThreadData*)pThreadParam;
-
-	// set thread priority to critical
-	XnStatus nRetVal = xnOSSetThreadPriority(pThreadData->hReadThread, XN_PRIORITY_CRITICAL);
-	if (nRetVal != 0)
-	{
-		xnLogWarning(XN_MASK_USB, "Failed to set thread priority to critical. This might cause loss of data...");
-	}
-	
-	// first of all, submit all transfers
-	for (XnUInt32 i = 0; i < pThreadData->nNumBuffers; ++i)
-	{
-		XnUSBBuffersInfo* pBufferInfo = &pThreadData->pBuffersInfo[i];
-		libusb_transfer* pTransfer = pBufferInfo->transfer;
-		
-		// submit request
-		pBufferInfo->bIsQueued = TRUE;
-		int rc = libusb_submit_transfer(pTransfer);
-		if (rc != 0)
-		{
-			xnLogError(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Failed to submit asynch I/O transfer (err=%d)!", pTransfer->endpoint, pBufferInfo->nBufferID, rc);
-		}
-	}
-	
-	// now let libusb process asynchornous I/O
-	
-	while (TRUE)
-	{
-		for (XnUInt32 i = 0; i < pThreadData->nNumBuffers; ++i)
-		{
-			// check if thread can exit (only after kill was requested, and all transfers returned)
-			if (pThreadData->bKillReadThread && !xnIsAnyTransferQueued(pThreadData))
-			{
-				XN_THREAD_PROC_RETURN(XN_STATUS_OK);
-			}
-
-			XnUSBBuffersInfo* pBufferInfo = &pThreadData->pBuffersInfo[i];
-			libusb_transfer* pTransfer = pBufferInfo->transfer;
-
-			// wait for the next transfer to be completed, and process it
-			nRetVal = xnOSWaitEvent(pBufferInfo->hEvent, pThreadData->bKillReadThread ? 0 : pThreadData->nTimeOut);
-			if (nRetVal == XN_STATUS_OS_EVENT_TIMEOUT)
-			{
-//				xnLogWarning(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: timeout. cancelling transfer...", pTransfer->endpoint, pBufferInfo->nBufferID);
-				
-				// cancel it
-				int rc = libusb_cancel_transfer(pBufferInfo->transfer);
-				if (rc != 0)
-				{
-					xnLogError(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Failed to cancel asynch I/O transfer (err=%d)!", pTransfer->endpoint, pBufferInfo->nBufferID, rc);
-				}
-			
-				// wait for it to cancel	
-				nRetVal = xnOSWaitEvent(pBufferInfo->hEvent, XN_WAIT_INFINITE);
-			}
-			
-			if (nRetVal != XN_STATUS_OK)
-			{
-				// not much we can do
-				xnLogWarning(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Failed waiting on asynch transfer event: %s", pTransfer->endpoint, pBufferInfo->nBufferID, xnGetStatusString(nRetVal));
-			}
-			
-			// check the result of the transfer
-			if (pBufferInfo->bIsQueued)
-			{
-				xnLogWarning(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Transfer is still queued though event was raised!", pTransfer->endpoint, pBufferInfo->nBufferID);
-				// TODO: cancel it?
-			}
-			else // transfer done
-			{
-				if (pBufferInfo->nLastStatus == LIBUSB_TRANSFER_COMPLETED || // read succeeded
-					pBufferInfo->nLastStatus == LIBUSB_TRANSFER_CANCELLED)   // cancelled, but maybe some data arrived
-				{
-					if (pTransfer->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS)
-					{
-						XnUInt32 nTotalBytes = 0;
-						
-						// some packets may return empty, so we need to remove spaces, and make the buffer sequential
-						for (XnUInt32 i = 0; i < pTransfer->num_iso_packets; ++i)
-						{
-							struct libusb_iso_packet_descriptor* pPacket = &pTransfer->iso_packet_desc[i];
-							if (pPacket->status == LIBUSB_TRANSFER_COMPLETED && pPacket->actual_length != 0)
-							{
-								XnUChar* pBuffer = libusb_get_iso_packet_buffer_simple(pTransfer, i);
-								// if buffer is not at same offset, move it
-								if (pTransfer->buffer + nTotalBytes != pBuffer)
-								{
-//									printf("buffer %d has %d bytes. Moving to offset %d...\n", i, pPacket->actual_length, nTotalBytes);
-									memcpy(pTransfer->buffer + nTotalBytes, pBuffer, pPacket->actual_length);
-								}
-								nTotalBytes += pPacket->actual_length;
-							}
-							else if (pPacket->status != LIBUSB_TRANSFER_COMPLETED)
-							{
-								xnLogWarning(XN_MASK_USB, "Endpoint 0x%x, Buffer %d, packet %d Asynch transfer failed (status: %d)", pTransfer->endpoint, pBufferInfo->nBufferID, i, pPacket->status);
-							}
-						}
-						
-						if (nTotalBytes != 0)
-						{
-							// call callback method
-							pBufferInfo->pThreadData->pCallbackFunction(pTransfer->buffer, nTotalBytes, pBufferInfo->pThreadData->pCallbackData);
-						}
-					}
-					else
-					{
-						// call callback method
-						pBufferInfo->pThreadData->pCallbackFunction(pTransfer->buffer, pTransfer->actual_length, pBufferInfo->pThreadData->pCallbackData);
-					}
-				}
-				else if (pBufferInfo->nLastStatus == LIBUSB_TRANSFER_TIMED_OUT)
-				{
-					// no need to do anything.
-				}
-				else
-				{
-					xnLogWarning(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Asynch transfer failed (status: %d)", pTransfer->endpoint, pBufferInfo->nBufferID, pTransfer->status);
-				}
-
-				// as long as running should continue, resubmit transfer
-				if (!pBufferInfo->pThreadData->bKillReadThread)
-				{
-					pBufferInfo->bIsQueued = TRUE;
-					int rc = libusb_submit_transfer(pTransfer);
-					if (rc != 0)
-					{
-						xnLogError(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Failed to re-submit asynch I/O transfer (err=%d)!", pTransfer->endpoint, pBufferInfo->nBufferID, rc);
-					}
-				}
-			}
-		}
-	}
-	
-	XN_THREAD_PROC_RETURN(XN_STATUS_OK);
-}
-
-/* This function is called whenever transfer is done (successfully or with an error). */
-void xnTransferCallback(libusb_transfer *pTransfer)
-{
-	XnUSBBuffersInfo* pBufferInfo = (XnUSBBuffersInfo*)pTransfer->user_data;
-	
-	// mark that buffer is done
-	pBufferInfo->bIsQueued = FALSE;
-	
-	// keep the status (according to libusb documentation, this field is invalid outside the callback method)
-	pBufferInfo->nLastStatus = pTransfer->status;
-	
-	// notify endpoint thread this buffer is done
-	XnStatus nRetVal = xnOSSetEvent(pBufferInfo->hEvent);
-	if (nRetVal != XN_STATUS_OK)
-	{
-		// we don't have much to do if set event failed, log a warning
-		xnLogWarning(XN_MASK_USB, "Failed to set event for buffer: %s", xnGetStatusString(nRetVal));
-	}
-}
-
-XN_C_API XnStatus xnUSBInitReadThread(XN_USB_EP_HANDLE pEPHandle, XnUInt32 nBufferSize, XnUInt32 nNumBuffers, XnUInt32 nTimeOut, XnUSBReadCallbackFunctionPtr pCallbackFunction, void* pCallbackData)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// validate parameters
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_EP_HANDLE(pEPHandle);
-	XN_VALIDATE_INPUT_PTR(pCallbackFunction);
-	
-	nRetVal = xnUSBStartReading();
-	XN_IS_STATUS_OK(nRetVal);
-	
-	xnLogVerbose(XN_MASK_USB, "Starting a USB read thread...");
-
-	XnUSBReadThreadData* pThreadData = &pEPHandle->ThreadData;
-
-	if (pThreadData->bIsRunning == TRUE)
-	{
-		return (XN_STATUS_USB_READTHREAD_ALREADY_INIT);
-	}
-
-	memset(pThreadData, 0, sizeof(XnUSBReadThreadData));
-	pThreadData->nNumBuffers = nNumBuffers;
-	pThreadData->pCallbackFunction = pCallbackFunction;
-	pThreadData->pCallbackData = pCallbackData;
-	pThreadData->bKillReadThread = FALSE;
-	pThreadData->nTimeOut = nTimeOut;
-
-	// allocate buffers
-	XN_VALIDATE_ALIGNED_CALLOC(pThreadData->pBuffersInfo, XnUSBBuffersInfo, nNumBuffers, XN_DEFAULT_MEM_ALIGN);
-	
-	int nNumIsoPackets = 0;
-	int nMaxPacketSize = 0;
-	
-	if (pEPHandle->nType == XN_USB_EP_ISOCHRONOUS)
-	{
-		// calculate how many packets can be set in this buffer
-		nMaxPacketSize = pEPHandle->nMaxPacketSize;
-		nNumIsoPackets = nBufferSize / nMaxPacketSize;
-	}
-
-	for (XnUInt32 i = 0; i < nNumBuffers; i++)
-	{
-		XnUSBBuffersInfo* pBufferInfo = &pThreadData->pBuffersInfo[i];
-		pBufferInfo->nBufferID = i;
-		pBufferInfo->pThreadData = pThreadData;
-		
-		// allocate transfer
-		pBufferInfo->transfer = libusb_alloc_transfer(nNumIsoPackets);
-		
-		libusb_transfer* pTransfer = pBufferInfo->transfer;
-
-		if (pTransfer == NULL)
-		{
-			xnCleanupThreadData(pThreadData);
-			return (XN_STATUS_ALLOC_FAILED);
-		}
-
-		// allocate buffer
-		XnUChar* pBuffer = (unsigned char*)xnOSCallocAligned(nBufferSize, sizeof(XnUChar), XN_DEFAULT_MEM_ALIGN);
-		if (pBuffer == NULL)
-		{
-			xnCleanupThreadData(pThreadData);
-			return (XN_STATUS_ALLOC_FAILED);
-		}
-
-		// fill transfer params
-		if (pEPHandle->nType == XN_USB_EP_BULK)
-		{
-			libusb_fill_bulk_transfer(pTransfer, pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, xnTransferCallback, pBufferInfo, 0);
-		}
-		else if (pEPHandle->nType == XN_USB_EP_INTERRUPT)
-		{
-			libusb_fill_interrupt_transfer(pTransfer, pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, xnTransferCallback, pBufferInfo, 0);
-		}
-		else if (pEPHandle->nType == XN_USB_EP_ISOCHRONOUS)
-		{
-			libusb_fill_iso_transfer(pTransfer, pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, nNumIsoPackets, xnTransferCallback, pBufferInfo, 0);
-			libusb_set_iso_packet_lengths(pTransfer, nMaxPacketSize);
-		}
-		else
-		{
-			return (XN_STATUS_USB_UNSUPPORTED_ENDPOINT_TYPE);
-		}
-
-		// create event
-		nRetVal = xnOSCreateEvent(&pBufferInfo->hEvent,FALSE);
-		if (nRetVal != XN_STATUS_OK)
-		{
-			xnCleanupThreadData(pThreadData);
-			return (nRetVal);
-		}
-	}
-
-	// create a thread to perform the asynchronous read operations
-	nRetVal = xnOSCreateThread(xnUSBReadThreadMain, &pEPHandle->ThreadData, &pThreadData->hReadThread);
-	if (nRetVal != XN_STATUS_OK)
-	{
-		xnCleanupThreadData(pThreadData);
-		return (nRetVal);
-	}
-
-	pThreadData->bIsRunning = TRUE;
-	
-	xnLogInfo(XN_MASK_USB, "USB read thread was started.");
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBShutdownReadThread(XN_USB_EP_HANDLE pEPHandle)
-{
-	XN_VALIDATE_USB_INIT();
-	XN_VALIDATE_EP_HANDLE(pEPHandle);
-
-	XnUSBReadThreadData* pThreadData = &pEPHandle->ThreadData;
-
-	if (pThreadData->bIsRunning == FALSE)
-	{
-		return (XN_STATUS_USB_READTHREAD_NOT_INIT);
-	}
-
-	if (pThreadData->hReadThread != NULL)
-	{
-		// mark thread should be killed
-		pThreadData->bKillReadThread = TRUE;
-
-		// PATCH: we don't cancel the requests, because there is a bug causing segmentation fault.
-		// instead, we will just wait for all of them to return.
-
-/*		// cancel all pending requests
-		for (XnUInt32 i = 0; i < pThreadData->nNumBuffers; ++i)
-		{
-			if (pThreadData->pBuffersInfo[i].bIsQueued)
-			{
-				printf("cancelling %d\n", i);
-				int rc = libusb_cancel_transfer(pThreadData->pBuffersInfo[i].transfer);
-				if (rc != 0)
-				{
-					xnLogWarning(XN_MASK_USB, "Failed to cancel asynchronous I/O operation (err = %d)! Will wait for it to complete...", rc);
-				}
-			}
-		}
-*/
-
-		// now wait for thread to exit (we wait the timeout of all buffers + an extra second)
-		XnStatus nRetVal = xnOSWaitForThreadExit(pThreadData->hReadThread, pThreadData->nTimeOut * pThreadData->nNumBuffers + 1000);
-		if (nRetVal != XN_STATUS_OK)
-		{
-			xnOSTerminateThread(&pThreadData->hReadThread);
-		}
-		else
-		{
-			xnOSCloseThread(&pThreadData->hReadThread);
-		}
-	}
-	
-	xnCleanupThreadData(pThreadData);
-
-	pThreadData->bIsRunning = FALSE;
-
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnUSBSetCallbackHandler(XnUInt16 nVendorID, XnUInt16 /*nProductID*/, void* pExtraParam, XnUSBEventCallbackFunctionPtr pCallbackFunction, void* pCallbackData)
-{
-	return (XN_STATUS_OS_UNSUPPORTED_FUNCTION);
-}
diff --git a/Source/OpenNI/Linux-x86/XnUSBLinux-x86.h b/Source/OpenNI/Linux-x86/XnUSBLinux-x86.h
deleted file mode 100644
index ec95e20..0000000
--- a/Source/OpenNI/Linux-x86/XnUSBLinux-x86.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-#ifndef _XN_USBLINUX_X86_H_
-#define _XN_USBLINUX_X86_H_
-
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOS.h>
-
-//---------------------------------------------------------------------------
-// Defines
-//---------------------------------------------------------------------------
-#define XN_USB_DEFAULT_EP_TIMEOUT 1000
-#define XN_USB_READ_THREAD_KILL_TIMEOUT 10000
-
-//---------------------------------------------------------------------------
-// Structures & Enums
-//---------------------------------------------------------------------------
-typedef struct XnUSBDeviceHandle
-{
-//	XnBool bValid;
-	libusb_device_handle* hDevice;
-	XnUSBDeviceSpeed nDevSpeed;
-	XnUInt8 nInterface;
-	XnUInt8 nAltSetting;
-} XnUSBDevHandle;
-
-struct XnUSBReadThreadData; // Forward declaration
-
-typedef struct XnUSBBuffersInfo
-{
-	/* A pointer back to the thread data. */
-	XnUSBReadThreadData* pThreadData;
-	/* transfer object (through which asynch operations take place). */
-	libusb_transfer* transfer;
-	/* TRUE when transfer is queued. */
-	XnBool bIsQueued;
-	/* An event to notify when buffer is ready. */
-	XN_EVENT_HANDLE hEvent;
-	XnUInt32 nBufferID;
-	/* Holds the last status received. */
-	libusb_transfer_status nLastStatus;
-} XnUSBBuffersInfo;
-
-/* Information about a thread reading from an endpoint. */
-typedef struct XnUSBReadThreadData
-{
-	/* TRUE when thread is running. */
-	XnBool bIsRunning;
-	/* Number of buffers allocated. */
-	XnUInt32 nNumBuffers;
-	/* Array of buffers. */
-	XnUSBBuffersInfo* pBuffersInfo;
-	/* Size of each buffer. */
-	XnUInt32 nBufferSize;
-	/* Timeout value. */
-	XnUInt32 nTimeOut;
-	/* User callback function. */
-	XnUSBReadCallbackFunctionPtr pCallbackFunction;
-	/* User callback data. */
-	void* pCallbackData;
-	/* Handle to the read thread. */
-	XN_THREAD_HANDLE hReadThread;
-	/* When TRUE, signals the thread to exit. */
-	XnBool bKillReadThread;
-} XnUSBReadThreadData;
-
-typedef struct XnUSBEndPointHandle
-{
-	libusb_device_handle* hDevice;
-	unsigned char nAddress;
-	XnUSBEndPointType  nType;
-	XnUSBDirectionType nDirection;
-	XnUSBReadThreadData ThreadData;
-	XnUInt32 nMaxPacketSize;
-} XnUSBEPHandle;
-
-#endif //_XN_USBLINUX_X86_H_
diff --git a/Source/OpenNI/Linux/LinuxCriticalSections.cpp b/Source/OpenNI/Linux/LinuxCriticalSections.cpp
new file mode 100644
index 0000000..29bd01e
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxCriticalSections.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API XnStatus xnOSCreateCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle)
+{
+	return xnOSCreateMutex(pCriticalSectionHandle);
+}
+
+XN_C_API XnStatus xnOSCloseCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle)
+{
+	return xnOSCloseMutex(pCriticalSectionHandle);
+}
+
+XN_C_API XnStatus xnOSEnterCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle)
+{
+	return xnOSLockMutex(*pCriticalSectionHandle, XN_WAIT_INFINITE);
+}
+
+XN_C_API XnStatus xnOSLeaveCriticalSection(XN_CRITICAL_SECTION_HANDLE* pCriticalSectionHandle)
+{
+	return xnOSUnLockMutex(*pCriticalSectionHandle);
+}
diff --git a/Source/OpenNI/Linux/LinuxDebug.cpp b/Source/OpenNI/Linux/LinuxDebug.cpp
new file mode 100644
index 0000000..df0eb18
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxDebug.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+
+#ifndef XN_PLATFORM_LINUX_NO_GLIBC
+#include <execinfo.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+
+XN_C_API XnStatus xnOSGetCurrentCallStack(XnUInt32 nFramesToSkip, XnChar** astrFrames, XnUInt32 nMaxNameLength, XnUInt32* pnFrames)
+{
+	if (*pnFrames == 0 || nMaxNameLength == 0)
+	{
+		return XN_STATUS_OK;
+	}
+	
+	void* aFrames[256];
+	int nTotalFrames = backtrace(aFrames, *pnFrames + nFramesToSkip);
+	
+	if (nFramesToSkip >= nTotalFrames)
+	{
+		*pnFrames = 0;
+        return (XN_STATUS_OK);
+	}
+	
+	// now resolve names
+    XnUInt32 nResolve = nTotalFrames - nFramesToSkip;
+	char** pstrFrames = backtrace_symbols(aFrames + nFramesToSkip, nResolve);
+    if (pstrFrames == NULL)
+    {
+        *pnFrames = 0;
+        return (XN_STATUS_OK);
+    }
+    
+    for (XnUInt i = 0; i < nResolve; ++i)
+    {
+        strncpy(astrFrames[i], pstrFrames[i], nMaxNameLength);
+    }
+    
+    free(pstrFrames);
+    
+    *pnFrames = nResolve;
+
+	return XN_STATUS_OK;
+}
+
+#else
+
+XN_C_API XnStatus xnOSGetCurrentCallStack(XnUInt32 nFramesToSkip, XnChar** astrFrames, XnUInt32 nMaxNameLength, XnUInt32* pnFrames)
+{
+	*pnFrames = 0;
+	return (XN_STATUS_OK);
+}
+
+#endif
\ No newline at end of file
diff --git a/Source/OpenNI/Linux/LinuxEvents.cpp b/Source/OpenNI/Linux/LinuxEvents.cpp
new file mode 100644
index 0000000..aa3b563
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxEvents.cpp
@@ -0,0 +1,161 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+#include "LinuxPosixEvents.h"
+#include "LinuxPosixNamedEvents.h"
+#include "LinuxSysVNamedEvents.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API XnStatus xnOSCreateEvent(XN_EVENT_HANDLE* pEventHandle, XnBool bManualReset)
+{
+	// Local function variables
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pEventHandle);
+
+	*pEventHandle = NULL;
+
+	XnLinuxEvent* pEvent = NULL;
+	XN_VALIDATE_NEW(pEvent, XnLinuxPosixEvent, bManualReset);
+
+	nRetVal = pEvent->Init();
+	if (nRetVal != XN_STATUS_OK)
+	{
+		XN_DELETE(pEvent);
+		return (nRetVal);
+	}
+
+	*pEventHandle = pEvent;
+	
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XnStatus CreateNamedEventObject(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bCreate, XnBool bManualReset)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpEventName);
+	XN_VALIDATE_OUTPUT_PTR(pEventHandle);
+
+	*pEventHandle = NULL;
+
+	XnLinuxNamedEvent* pEvent = NULL;
+
+#ifdef XN_PLATFORM_LINUX_NO_SYSV
+	XN_VALIDATE_NEW(pEvent, XnLinuxPosixNamedEvent, bManualReset, cpEventName, bCreate);
+#else
+	XN_VALIDATE_NEW(pEvent, XnLinuxSysVNamedEvent, bManualReset, cpEventName, bCreate);
+#endif
+
+	nRetVal = pEvent->Init();
+	if (nRetVal != XN_STATUS_OK)
+	{
+		XN_DELETE(pEvent);
+		return (nRetVal);
+	}
+
+	*pEventHandle = pEvent;
+
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset)
+{
+	return xnOSCreateNamedEventEx(pEventHandle, cpEventName, bManualReset, FALSE);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedEventEx(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset, XnBool bAllowOtherUsers)
+{
+	return CreateNamedEventObject(pEventHandle, cpEventName, TRUE, bManualReset);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSOpenNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName)
+{
+	return xnOSOpenNamedEventEx(pEventHandle, cpEventName, FALSE);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSOpenNamedEventEx(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bAllowOtherUsers)
+{
+	return CreateNamedEventObject(pEventHandle, cpEventName, FALSE, FALSE);
+}
+
+XN_C_API XnStatus xnOSCloseEvent(XN_EVENT_HANDLE* pEventHandle)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pEventHandle);
+
+	// Make sure the actual event handle isn't NULL
+	XN_RET_IF_NULL(*pEventHandle, XN_STATUS_OS_INVALID_EVENT);
+
+	XnLinuxEvent* pEvent = (XnLinuxEvent*)*pEventHandle;
+	nRetVal = pEvent->Destroy();
+	XN_IS_STATUS_OK(nRetVal);
+
+	XN_DELETE(pEvent);
+
+	*pEventHandle = NULL;
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSetEvent(const XN_EVENT_HANDLE EventHandle)
+{
+	// Make sure the actual event handle isn't NULL
+	XN_RET_IF_NULL(EventHandle, XN_STATUS_OS_INVALID_EVENT);
+
+	XnLinuxEvent* pEvent = (XnLinuxEvent*)EventHandle;
+	return pEvent->Set();
+}
+
+XN_C_API XnStatus xnOSResetEvent(const XN_EVENT_HANDLE EventHandle)
+{
+	// Make sure the actual event handle isn't NULL
+	XN_RET_IF_NULL(EventHandle, XN_STATUS_OS_INVALID_EVENT);
+
+	XnLinuxEvent* pEvent = (XnLinuxEvent*)EventHandle;
+	return pEvent->Reset();
+}
+
+XN_C_API XnBool xnOSIsEventSet(const XN_EVENT_HANDLE EventHandle)
+{
+	return (xnOSWaitEvent(EventHandle, 0) == XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSWaitEvent(const XN_EVENT_HANDLE EventHandle, XnUInt32 nMilliseconds)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// Make sure the actual event handle isn't NULL
+	XN_RET_IF_NULL(EventHandle, XN_STATUS_OS_INVALID_EVENT);
+
+	XnLinuxEvent* pEvent = (XnLinuxEvent*)EventHandle;
+	return pEvent->Wait(nMilliseconds);
+}
diff --git a/Source/OpenNI/Linux/LinuxEvents.h b/Source/OpenNI/Linux/LinuxEvents.h
new file mode 100644
index 0000000..596d0bf
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxEvents.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __LINUX_EVENTS_H__
+#define __LINUX_EVENTS_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/ipc.h>
+#include <XnLog.h>
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+struct _XnEvent {};
+
+class XnLinuxEvent : public _XnEvent
+{
+public:
+	XnLinuxEvent(XnBool bManualReset) : m_bSignaled(FALSE), m_bManualReset(bManualReset) {}
+	virtual XnStatus Init() = 0;
+	virtual XnStatus Destroy() = 0;
+	virtual XnStatus Set() = 0;
+	virtual XnStatus Reset() = 0;
+	virtual XnStatus Wait(XnUInt32 nMilliseconds) = 0;
+
+protected:
+	XnBool m_bSignaled;
+	XnBool m_bManualReset;
+};
+
+class XnLinuxNamedEvent : public XnLinuxEvent
+{
+public:
+	XnLinuxNamedEvent(XnBool bManualReset, const XnChar* strName, XnBool bCreate) : XnLinuxEvent(bManualReset), m_strName(strName), m_bCreate(bCreate) {}
+
+	virtual XnStatus Init()
+	{
+		if (m_bCreate)
+		{
+			return CreateNamed(m_strName);
+		}
+		else
+		{
+			return OpenNamed(m_strName);
+		}
+	}
+
+protected:
+	virtual XnStatus CreateNamed(const XnChar* strName) = 0;
+	virtual XnStatus OpenNamed(const XnChar* strName) = 0;
+
+private:
+	XnBool m_bCreate;
+	const XnChar* m_strName; // Valid only on creation
+};
+
+#endif // __LINUX_EVENTS_H__
diff --git a/Source/OpenNI/Linux/LinuxFiles.cpp b/Source/OpenNI/Linux/LinuxFiles.cpp
new file mode 100644
index 0000000..d8f5cae
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxFiles.cpp
@@ -0,0 +1,626 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+
+#ifndef ANDROID
+	// This define enables Large File Support (64bit version of I/O functions and data types).
+	// for more information - 'man 7 feature_test_macros'
+	// Moreover, it MUST be defined before ANY other include from this file.
+	#define _FILE_OFFSET_BITS	64
+	
+	#define OFF_T off_t
+	#define LSEEK lseek
+#else
+	#define OFF_T off64_t
+	#define LSEEK lseek64
+#endif
+
+#include <XnOS.h>
+#include <libgen.h>
+#include <errno.h>
+#include <limits.h>
+#include <XnLog.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+#ifndef XN_PLATFORM_LINUX_NO_GLOB
+#include <glob.h>
+
+XN_C_API XnStatus xnOSGetFileList(const XnChar* cpSearchPattern, const XnChar* cpPrefixPath, XnChar cpFileList[][XN_FILE_MAX_PATH], const XnUInt32 nMaxFiles, XnUInt32* pnFoundFiles)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpSearchPattern);
+	XN_VALIDATE_OUTPUT_PTR(cpFileList);
+	XN_VALIDATE_OUTPUT_PTR(pnFoundFiles);
+
+	// Reset the number of found files counter
+	*pnFoundFiles = 0;
+
+	// now call the OS glob function
+	glob_t tGlob;
+	glob(cpSearchPattern, 0, NULL, &tGlob);
+	
+	XnUInt32 nFoundFiles = XN_MIN(tGlob.gl_pathc, nMaxFiles);
+	for (XnUInt32 i = 0; i < nFoundFiles; ++i)
+	{
+		// Copy the file string into its place in the file list
+		xnOSStrCopy(cpFileList[i], tGlob.gl_pathv[i], XN_FILE_MAX_PATH);
+
+		if (cpPrefixPath != NULL)
+		{
+			xnOSStrPrefix(cpPrefixPath, cpFileList[i], XN_FILE_MAX_PATH);
+		}
+	}
+	
+	// free memory allocated by OS
+	globfree(&tGlob);
+	
+	// Return a file not found error if no files were found...
+	if (nFoundFiles == 0)
+	{
+		return (XN_STATUS_OS_FILE_NOT_FOUND);
+	}
+
+	// Write the temporary number of found files counter into the output
+	*pnFoundFiles = nFoundFiles;
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+#else
+
+XN_C_API XnStatus xnOSGetFileList(const XnChar* cpSearchPattern, const XnChar* cpPrefixPath, XnChar cpFileList[][XN_FILE_MAX_PATH], const XnUInt32 nMaxFiles, XnUInt32* pnFoundFiles)
+{
+	XN_ASSERT(FALSE);
+	return XN_STATUS_OS_FILE_NOT_FOUND;
+}
+
+#endif
+
+XN_C_API XnStatus xnOSOpenFile(const XnChar* cpFileName, const XnUInt32 nFlags, XN_FILE_HANDLE* pFile)
+{
+	// Local function variables
+	XnUInt32 nOSOpenFlags = 0;
+	
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpFileName);
+	XN_VALIDATE_OUTPUT_PTR(pFile);
+	
+	// Update the OS Open flags according the user request
+	if ((nFlags & XN_OS_FILE_READ) && (nFlags & XN_OS_FILE_WRITE))
+	{
+		nOSOpenFlags |= O_RDWR | O_CREAT;
+	}
+	else if (nFlags & XN_OS_FILE_READ)
+	{
+		nOSOpenFlags |= O_RDONLY;
+	}
+	else if (nFlags & XN_OS_FILE_WRITE)
+	{
+		nOSOpenFlags |= O_WRONLY | O_CREAT;
+	}
+	
+	if (nFlags & XN_OS_FILE_CREATE_NEW_ONLY)
+	{
+		// It's OK to create a new file, but fail if the file already exist
+		nOSOpenFlags |= O_EXCL;
+	}
+	
+	if (nFlags & XN_OS_FILE_TRUNCATE)
+	{
+		// If the file exists, we need to truncate it to zero
+		nOSOpenFlags |= O_TRUNC;
+	}
+	
+	if ((nFlags & XN_OS_FILE_WRITE) && (nFlags & XN_OS_FILE_AUTO_FLUSH))
+	{
+		nOSOpenFlags |= O_SYNC;
+	}
+	
+	if (nFlags & XN_OS_FILE_APPEND)
+	{
+		nOSOpenFlags |= O_APPEND;
+	}
+
+	// Open the file via the OS (give read permissions to ALL)
+	*pFile = open(cpFileName, nOSOpenFlags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+	// handle failure...
+	if (*pFile == XN_INVALID_FILE_HANDLE)
+	{
+		switch (errno)
+		{
+			case EEXIST:
+				return XN_STATUS_OS_FILE_ALREDY_EXISTS;
+			case ENOENT:
+				return XN_STATUS_OS_FILE_NOT_FOUND;
+			default:
+				return XN_STATUS_OS_FILE_OPEN_FAILED;
+		}
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSCloseFile(XN_FILE_HANDLE* pFile)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pFile);
+	
+	// make sure this is a valid file descriptor
+	if (*pFile == XN_INVALID_FILE_HANDLE)
+	{
+		return XN_STATUS_OS_INVALID_FILE;
+	}
+	
+	if (0 != close(*pFile))
+	{
+		// Something went wrong while trying to close the file...
+		return (XN_STATUS_OS_FILE_CLOSE_FAILED);
+	}
+	
+	// make the user file descriptor invalid
+	*pFile = XN_INVALID_FILE_HANDLE;
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnOSReadFile(const XN_FILE_HANDLE File, void* pBuffer, XnUInt32* pnBufferSize)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pBuffer);
+	XN_VALIDATE_INPUT_PTR(pnBufferSize);
+
+	// Make sure the actual file handle isn't invalid
+	if (File == XN_INVALID_FILE_HANDLE)
+	{
+		return XN_STATUS_OS_INVALID_FILE;
+	}
+
+	// Read a buffer from a file handle via the OS
+	ssize_t nBytesRead = read(File, pBuffer, *pnBufferSize);
+	if (nBytesRead == -1)
+	{
+		return XN_STATUS_OS_FILE_READ_FAILED;
+	}
+	
+	// update the number of bytes read
+	*pnBufferSize = nBytesRead;
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSWriteFile(const XN_FILE_HANDLE File, const void* pBuffer, const XnUInt32 nBufferSize)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pBuffer);
+
+	// Make sure the actual file handle isn't invalid
+	if (File == XN_INVALID_FILE_HANDLE)
+	{
+		return XN_STATUS_OS_INVALID_FILE;
+	}
+
+	// Write a buffer to a file handle via the OS
+	ssize_t nBytesWritten = write(File, pBuffer, nBufferSize);
+	
+	// Make sure it succeeded (return value is not -1) and that the correct number of bytes were written
+	if ((nBytesWritten == -1) || (nBufferSize != nBytesWritten))
+	{
+		return XN_STATUS_OS_FILE_WRITE_FAILED;
+	}
+	
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSeekFile(const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt32 nOffset)
+{
+	// Local function variables
+	int nRealSeekType = 0;
+	OFF_T nRetOffset = 0;
+
+	// Make sure the actual file handle isn't invalid
+	if (File == XN_INVALID_FILE_HANDLE)
+	{
+		return XN_STATUS_OS_INVALID_FILE;
+	}
+
+	// Convert the Xiron seek type into OS seek type
+	switch (SeekType)
+	{
+		case XN_OS_SEEK_SET:
+			// Absolute seek from the file beginning
+			nRealSeekType = SEEK_SET;
+			break;
+		case XN_OS_SEEK_CUR:
+			// Relative seek from the current location
+			nRealSeekType = SEEK_CUR;
+			break;
+		case XN_OS_SEEK_END:
+			// Absolute seek from the file ending
+			nRealSeekType = SEEK_END;
+			break;
+		default:
+			return (XN_STATUS_OS_INVALID_SEEK_TYPE);
+	}
+
+	// Seek a file handle via the OS
+	nRetOffset = LSEEK(File, (OFF_T)nOffset, nRealSeekType);
+
+	// Make sure it succeeded (return value is valid) and that we reached the expected file offset
+	if (nRetOffset == (OFF_T)-1)
+	{
+		return (XN_STATUS_OS_FILE_SEEK_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSeekFile64(const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt64 nOffset)
+{
+	// Local function variables
+	int nRealSeekType = 0;
+	OFF_T nRetOffset = 0;
+
+	// Make sure the actual file handle isn't invalid
+	if (File == XN_INVALID_FILE_HANDLE)
+	{
+		return XN_STATUS_OS_INVALID_FILE;
+	}
+	
+	// Convert the Xiron seek type into OS seek type
+	switch (SeekType)
+	{
+		case XN_OS_SEEK_SET:
+			// Absolute seek from the file beginning
+			nRealSeekType = SEEK_SET;
+			break;
+		case XN_OS_SEEK_CUR:
+			// Relative seek from the current location
+			nRealSeekType = SEEK_CUR;
+			break;
+		case XN_OS_SEEK_END:
+			// Absolute seek from the file ending
+			nRealSeekType = SEEK_END;
+			break;
+		default:
+			return (XN_STATUS_OS_INVALID_SEEK_TYPE);
+	}
+
+	// Seek a file handle via the OS
+	nRetOffset = LSEEK(File, nOffset, nRealSeekType);
+
+	// Make sure it succeeded (return value is valid) and that we reached the expected file offset
+	if (nRetOffset == (OFF_T)-1)
+	{
+		return (XN_STATUS_OS_FILE_SEEK_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSTellFile(const XN_FILE_HANDLE File, XnUInt32* pnFilePos)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_OUTPUT_PTR(pnFilePos);
+	
+	// Make sure the actual file handle isn't invalid
+	if (File == XN_INVALID_FILE_HANDLE)
+	{
+		return XN_STATUS_OS_INVALID_FILE;
+	}
+	
+	// Seek a file handle by 0 bytes in order to read the file position
+	OFF_T nFilePos = LSEEK(File, 0, SEEK_CUR);
+
+	// Make sure it succeeded (return value is valid)
+	if (nFilePos == (OFF_T)-1)
+	{
+		return (XN_STATUS_OS_FILE_TELL_FAILED);
+	}
+
+	// Enforce uint32 limitation
+	if ((nFilePos >> 32) != 0)
+	{
+		return XN_STATUS_INTERNAL_BUFFER_TOO_SMALL;
+	}
+	
+	*pnFilePos = (XnUInt32)nFilePos;
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSTellFile64(const XN_FILE_HANDLE File, XnUInt64* pnFilePos)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_OUTPUT_PTR(pnFilePos);
+	
+	// Make sure the actual file handle isn't invalid
+	if (File == XN_INVALID_FILE_HANDLE)
+	{
+		return XN_STATUS_OS_INVALID_FILE;
+	}
+	
+	// Seek a file handle by 0 bytes in order to read the file position
+	OFF_T nFilePos = LSEEK(File, 0, SEEK_CUR);
+
+	// Make sure it succeeded (return value is valid)
+	if (nFilePos == (OFF_T)-1)
+	{
+		return (XN_STATUS_OS_FILE_TELL_FAILED);
+	}
+	
+	*pnFilePos = nFilePos;
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSFlushFile(const XN_FILE_HANDLE File)
+{
+	// Make sure the actual file handle isn't invalid
+	if (File == XN_INVALID_FILE_HANDLE)
+	{
+		return XN_STATUS_OS_INVALID_FILE;
+	}
+	
+	// flush via the OS
+	if (-1 == fsync(File))
+	{
+		return XN_STATUS_OS_FILE_FLUSH_FAILED;
+	}
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnOSFileExists(const XnChar* cpFileName, XnBool* bResult)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpFileName);
+	XN_VALIDATE_OUTPUT_PTR(bResult);
+
+	// Reset the output result
+	*bResult = FALSE;
+
+	// Check if the file exists and update the result accordingly
+	if ((access(cpFileName, F_OK)) != -1)
+	{
+		*bResult = TRUE;
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetFileSize(const XnChar* cpFileName, XnUInt32* pnFileSize)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpFileName);
+	XN_VALIDATE_OUTPUT_PTR(pnFileSize);
+	
+	struct stat fileStat;
+	if (-1 == stat(cpFileName, &fileStat))
+	{
+		return (XN_STATUS_OS_FILE_GET_SIZE_FAILED);	
+	}
+	
+	// Enforce uint32 limitation
+	if (fileStat.st_size >> 32)
+	{
+		return XN_STATUS_INTERNAL_BUFFER_TOO_SMALL;
+	}
+
+	*pnFileSize = (XnUInt32)fileStat.st_size;
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetFileSize64(const XnChar* cpFileName, XnUInt64* pnFileSize)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpFileName);
+	XN_VALIDATE_OUTPUT_PTR(pnFileSize);
+	
+	struct stat fileStat;
+	if (-1 == stat(cpFileName, &fileStat))
+	{
+		return (XN_STATUS_OS_FILE_GET_SIZE_FAILED);	
+	}
+	
+	*pnFileSize = fileStat.st_size;
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSCreateDirectory(const XnChar* cpDirName)
+{
+	// Local function variables
+	XnInt32 nRetVal = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpDirName);
+
+	nRetVal = mkdir(cpDirName, S_IRWXU | S_IRWXG | S_IRWXO);
+	if (nRetVal != 0)
+	{
+		return (XN_STATUS_OS_FAILED_TO_CREATE_DIR);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetDirName(const XnChar* cpFilePath, XnChar* cpDirName, const XnUInt32 nBufferSize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// first copy the string (OS may change the argument)
+	XnChar cpInput[XN_FILE_MAX_PATH];
+	nRetVal = xnOSStrCopy(cpInput, cpFilePath, XN_FILE_MAX_PATH);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	// now call the OS
+	XnChar* cpResult = dirname(cpInput);
+	
+	// copy result to user buffer
+	nRetVal = xnOSStrCopy(cpDirName, cpResult, nBufferSize);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetFileName(const XnChar* cpFilePath, XnChar* cpDirName, const XnUInt32 nBufferSize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// first copy the string (OS may change the argument)
+	XnChar cpInput[XN_FILE_MAX_PATH];
+	nRetVal = xnOSStrCopy(cpInput, cpFilePath, XN_FILE_MAX_PATH);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	// now call the OS
+	XnChar* cpResult = basename(cpInput);
+	
+	// copy result to user buffer
+	nRetVal = xnOSStrCopy(cpDirName, cpResult, nBufferSize);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetFullPathName(const XnChar* strFilePath, XnChar* strFullPath, XnUInt32 nBufferSize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// pass a temp string (with max size)
+	XnChar strResult[PATH_MAX];
+
+	if (NULL == realpath(strFilePath, strResult))
+	{
+		xnLogWarning(XN_MASK_OS, "Failed getting full path name: errno is %d", errno);
+		return XN_STATUS_ERROR;
+	}
+
+	// now check if we can copy
+	if (strlen(strResult) >= nBufferSize)
+	{
+		return XN_STATUS_OUTPUT_BUFFER_OVERFLOW;
+	}
+
+	// and copy
+	strcpy(strFullPath, strResult);
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetCurrentDir(XnChar* cpDirName, const XnUInt32 nBufferSize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	if (NULL == getcwd(cpDirName, nBufferSize))
+	{
+		if (errno == ERANGE)
+			return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW);
+		else
+			return (XN_STATUS_ERROR);
+	}
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSetCurrentDir(const XnChar* cpDirName)
+{
+	if (0 != chdir(cpDirName))
+	{
+		return (XN_STATUS_ERROR);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSDeleteFile(const XnChar* cpFileName)
+{
+	// Local function variables
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpFileName);
+
+	if (0 != unlink(cpFileName))
+	{
+		return (XN_STATUS_OS_FAILED_TO_DELETE_FILE);
+	}
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSDoesFileExist(const XnChar* cpFileName, XnBool* pbResult)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpFileName);
+	XN_VALIDATE_OUTPUT_PTR(pbResult);
+
+	// Reset the output result
+	*pbResult = FALSE;
+
+	// Check if the file exists and update the result accordingly
+	if ((access(cpFileName, F_OK)) != -1)
+	{
+		*pbResult = TRUE;
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSDoesDirecotyExist(const XnChar* cpDirName, XnBool* pbResult)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpDirName);
+	XN_VALIDATE_OUTPUT_PTR(pbResult);
+
+	// Reset the output result
+	*pbResult = FALSE;
+
+	// Check if the file exists and update the result accordingly
+	struct stat nodeStat;
+	if (stat(cpDirName, &nodeStat) == 0 &&
+		S_ISDIR(nodeStat.st_mode))
+	{
+		*pbResult = TRUE;
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
diff --git a/Source/OpenNI/Linux/LinuxINI.cpp b/Source/OpenNI/Linux/LinuxINI.cpp
new file mode 100644
index 0000000..b7b85d7
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxINI.cpp
@@ -0,0 +1,270 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+#include <string.h>
+
+#define XN_READ_IXN_BUFFER_SIZE	10*1024
+
+#define XN_IS_SPACE(p)		(*p == ' ' || *p == '\t')
+#define XN_IS_NEWLINE(p)	(*p == '\r' || *p == '\n')
+
+#define XN_SKIP_LINE(p)							\
+	/* first read till end of line. */			\
+	while (*p && *p != '\n' && *p != '\r')		\
+		p++;									\
+	/* now skip end of line tokens. */			\
+	while (*p && (*p == '\n' || *p == '\r'))	\
+		p++;
+
+#define XN_READ_TILL(p, endCond, dest, destSize)			\
+	{														\
+		XnChar* pStart = p;								\
+		destSize = 0;										\
+		while (*p && !(endCond))							\
+		{													\
+			if (destSize + 1 > XN_INI_MAX_LEN)				\
+				break;										\
+															\
+			dest[destSize++] = *p;							\
+			p++;											\
+		}													\
+		dest[destSize] = '\0';								\
+	}			
+			
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XnStatus FindEntry(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnChar* cpDest)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// get file size
+	XnUInt64 nFileSize;
+	nRetVal = xnOSGetFileSize64(cpINIFile, &nFileSize);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	// read entire file to memory
+	XnChar* csFileData = (XnChar*)xnOSMalloc(sizeof(XnChar)*nFileSize + 1);
+	XN_VALIDATE_ALLOC_PTR(csFileData);
+	
+	nRetVal = xnOSLoadFile(cpINIFile, csFileData, nFileSize);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(csFileData);
+		return nRetVal;
+	}
+	
+	// place NULL at the end
+	csFileData[nFileSize] = '\0';
+	
+	// now parse file
+	XnChar* pCurPos = csFileData;
+	XnBool bIsInRequestedSection = FALSE;
+	
+	XnChar csTempString[XN_INI_MAX_LEN];
+	XnUInt32 nTempStringLength = 0;
+	
+	while (TRUE)
+	{
+		// ignore spaces
+		while (*pCurPos && XN_IS_SPACE(pCurPos))
+		{
+			pCurPos++;
+		}
+			
+		// check we haven't reached the end
+		if (!*pCurPos)
+		{
+			break;
+		}
+		
+		if (*pCurPos == ';' || *pCurPos == '#') // comment
+		{
+			XN_SKIP_LINE(pCurPos);
+			continue;
+		}
+		
+		if (*pCurPos == '[') // start of section
+		{
+			pCurPos++;
+			XN_READ_TILL(pCurPos, *pCurPos == ']' || XN_IS_NEWLINE(pCurPos), csTempString, nTempStringLength);
+			
+			if (*pCurPos == ']') // valid section name
+			{
+				if (bIsInRequestedSection) 
+				{
+					// we're leaving the requested section, and string wasn't found
+					xnOSFree(csFileData);
+					return XN_STATUS_OS_INI_READ_FAILED;
+				}
+				
+				if (strcmp(csTempString, cpSection) == 0)
+				{
+					bIsInRequestedSection = TRUE;
+				}
+			}
+			
+			// in any case, move to the next line
+			XN_SKIP_LINE(pCurPos);
+			continue;
+		} // section
+		
+		// if we're not in the right section, we don't really care what's written in this line. Just skip it.
+		if (!bIsInRequestedSection)
+		{
+			XN_SKIP_LINE(pCurPos);
+			continue;
+		}
+		
+		// regular line. check if this is a key (look for the '=' sign)
+		XN_READ_TILL(pCurPos, *pCurPos == '=' || XN_IS_NEWLINE(pCurPos), csTempString, nTempStringLength);
+		
+		if (*pCurPos == '=') // we found a key
+		{
+			if (strcmp(csTempString, cpKey) == 0)
+			{
+				// we found our key. The value is the rest of the line
+				pCurPos++;
+				XN_READ_TILL(pCurPos, XN_IS_NEWLINE(pCurPos), cpDest, nTempStringLength);
+				xnOSFree(csFileData);
+				return XN_STATUS_OK;
+			}
+		}
+		
+		// if we got here, skip to the next line
+		XN_SKIP_LINE(pCurPos);
+		
+	} // while loop
+	
+	xnOSFree(csFileData);
+	return (XN_STATUS_OS_INI_READ_FAILED);
+}
+
+XN_C_API XnStatus xnOSReadStringFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnChar* cpDest, const XnUInt32 nDestLength)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	XnBool bINIFileExists = FALSE;
+	
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpSection);
+	XN_VALIDATE_INPUT_PTR(cpKey);
+	XN_VALIDATE_INPUT_PTR(cpINIFile);
+	XN_VALIDATE_OUTPUT_PTR(cpDest);
+
+	// Make sure the INI file exists
+	XN_VALIDATE_FILE_EXISTS_RET(cpINIFile, nRetVal, bINIFileExists, XN_STATUS_OS_INI_FILE_NOT_FOUND);
+
+	// find value
+	XnChar cpValueString[XN_INI_MAX_LEN];
+	nRetVal = FindEntry(cpINIFile, cpSection, cpKey, cpValueString);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	nRetVal = xnOSStrCopy(cpDest, cpValueString, nDestLength);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnOSReadFloatFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnFloat* fDest)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_OUTPUT_PTR(fDest);
+	
+	XnDouble dTemp;
+	XnStatus nRetVal = xnOSReadDoubleFromINI(cpINIFile, cpSection, cpKey, &dTemp);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	*fDest = (XnFloat)dTemp;
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnOSReadDoubleFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnDouble* fDest)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	XnBool bINIFileExists = FALSE;
+	
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpSection);
+	XN_VALIDATE_INPUT_PTR(cpKey);
+	XN_VALIDATE_INPUT_PTR(cpINIFile);
+	XN_VALIDATE_OUTPUT_PTR(fDest);
+
+	// Make sure the INI file exists
+	XN_VALIDATE_FILE_EXISTS_RET(cpINIFile, nRetVal, bINIFileExists, XN_STATUS_OS_INI_FILE_NOT_FOUND);
+
+	// find value
+	XnChar cpValueString[XN_INI_MAX_LEN];
+	nRetVal = FindEntry(cpINIFile, cpSection, cpKey, cpValueString);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	*fDest = atof(cpValueString);
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnOSReadIntFromINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, XnUInt32* nDest)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	XnBool bINIFileExists = FALSE;
+	
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpSection);
+	XN_VALIDATE_INPUT_PTR(cpKey);
+	XN_VALIDATE_INPUT_PTR(cpINIFile);
+	XN_VALIDATE_OUTPUT_PTR(nDest);
+
+	// Make sure the INI file exists
+	XN_VALIDATE_FILE_EXISTS_RET(cpINIFile, nRetVal, bINIFileExists, XN_STATUS_OS_INI_FILE_NOT_FOUND);
+
+	// find value
+	XnChar cpValueString[XN_INI_MAX_LEN];
+	nRetVal = FindEntry(cpINIFile, cpSection, cpKey, cpValueString);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	*nDest = atoi(cpValueString);
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnOSWriteStringToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnChar* cpSrc)
+{
+	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
+}
+
+XN_C_API XnStatus xnOSWriteFloatToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnFloat fSrc)
+{
+	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
+}
+
+XN_C_API XnStatus xnOSWriteDoubleToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnDouble fSrc)
+{
+	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
+}
+
+XN_C_API XnStatus xnOSWriteIntToINI(const XnChar* cpINIFile, const XnChar* cpSection, const XnChar* cpKey, const XnUInt32 nSrc)
+{
+	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
+}
diff --git a/Source/OpenNI/Linux/LinuxKeyboard.cpp b/Source/OpenNI/Linux/LinuxKeyboard.cpp
new file mode 100644
index 0000000..5dcf021
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxKeyboard.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API XnBool xnOSWasKeyboardHit()
+{
+	struct termios oldt, newt;
+	int ch;
+	int oldf;
+
+	// don't echo and don't wait for ENTER
+	tcgetattr(STDIN_FILENO, &oldt);
+	newt = oldt;
+	newt.c_lflag &= ~(ICANON | ECHO);
+	tcsetattr(STDIN_FILENO, TCSANOW, &newt);
+	oldf = fcntl(STDIN_FILENO, F_GETFL, 0);
+	
+	// make it non-blocking (so we can check without waiting)
+	if (0 != fcntl(STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK))
+	{
+		return FALSE;
+	}
+
+	ch = getchar();
+
+	tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
+	if (0 != fcntl(STDIN_FILENO, F_SETFL, oldf))
+	{
+		return FALSE;
+	}
+
+	if(ch != EOF)
+	{
+		ungetc(ch, stdin);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+XN_C_API XnChar xnOSReadCharFromInput()
+{
+	return (XnChar)getchar();
+}
+
diff --git a/Source/OpenNI/Linux/LinuxMemory.cpp b/Source/OpenNI/Linux/LinuxMemory.cpp
new file mode 100644
index 0000000..f441b74
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxMemory.cpp
@@ -0,0 +1,163 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+// NOTE: you must define XN_OS_IMPL before including xnOS.h, otherwise, when mem profiling this file will not compile.
+#define XN_OS_IMPL
+#include <XnOS.h>
+#if (XN_PLATFORM == XN_PLATFORM_MACOSX)
+	#include <sys/malloc.h>
+#else
+	#include <malloc.h>
+#endif
+#include <XnLog.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API void* xnOSMalloc(const XnSizeT nAllocSize)
+{
+	// Return a pointer to the requested allocation size
+	return (malloc(nAllocSize));
+}
+
+XN_C_API void* xnOSMallocAligned(const XnSizeT nAllocSize, const XnSizeT nAlignment)
+{
+	void* pResult = NULL;
+	
+#ifndef XN_PLATFORM_LINUX_NO_POSIX_MEMALIGN
+	if (0 != posix_memalign(&pResult, nAlignment, nAllocSize))
+		return NULL;
+#else
+	pResult = memalign(nAlignment, nAllocSize);
+#endif
+		
+	return pResult;
+}
+
+XN_C_API void* xnOSCalloc(const XnSizeT nAllocNum, const XnSizeT nAllocSize)
+{
+	// Return a pointer to the requested allocation size and write zeros on the entire memory block (C Alloc)
+	return (calloc(nAllocNum, nAllocSize));
+}
+
+XN_C_API void* xnOSCallocAligned(const XnSizeT nAllocNum, const XnSizeT nAllocSize, const XnSizeT nAlignment)
+{
+	// Local function variables
+	void* pMemBlock = NULL;
+	XnUInt32 nBlockSize = nAllocNum * nAllocSize;
+
+	// Allocate the aligned memory block
+	pMemBlock = xnOSMallocAligned(nBlockSize, nAlignment);
+
+	// If it succeeded (the returned block wasn't NULL, let's zero it)
+	if (pMemBlock != NULL)
+	{
+		memset(pMemBlock, 0, nBlockSize);
+	}
+
+	return (pMemBlock);
+}
+
+XN_C_API void* xnOSRealloc(void* pMemory, const XnSizeT nAllocSize)
+{
+	// Return a pointer to the requested allocation size
+	return (realloc(pMemory, nAllocSize));
+}
+
+XN_C_API void* xnOSReallocAligned(void* pMemory, const XnSizeT nAllocSize, const XnSizeT nAlignment)
+{
+	xnLogError("xnOS", "Does not know how to realloc aligned memory!");
+	return NULL;
+}
+
+XN_C_API void* xnOSRecalloc(void* pMemory, const XnSizeT nAllocNum, const XnSizeT nAllocSize)
+{
+	xnLogError("xnOS", "Does not know how to realloc aligned memory!");
+	// Return a pointer to the requested allocation size and write zeros on the entire memory block (C Alloc)
+	return NULL;
+}
+
+XN_C_API void xnOSFree(const void* pMemBlock)
+{
+	// Note: No need to check if pMemBlock is NULL because free is guaranteed to handle this case correctly.
+
+	// Free the requested memory block
+	free ((void*)pMemBlock);
+}
+
+XN_C_API void  xnOSFreeAligned(const void* pMemBlock)
+{
+	// Note: No need to check if pMemBlock is NULL because free is guaranteed to handle this case correctly.
+
+	// Free the requested memory block
+	free ((void*)pMemBlock);
+}
+
+XN_C_API void xnOSMemCopy(void* pDest, const void* pSource, XnSizeT nCount)
+{
+	memcpy(pDest, pSource, nCount);
+}
+
+XN_C_API XnInt32 xnOSMemCmp(const void *pBuf1, const void *pBuf2, XnSizeT nCount)
+{
+	return memcmp(pBuf1, pBuf2, nCount);
+}
+
+XN_C_API void xnOSMemSet(void* pDest, XnUInt8 nValue, XnSizeT nCount)
+{
+	memset(pDest, nValue, nCount);
+}
+
+XN_C_API void xnOSMemMove(void* pDest, const void* pSource, XnSizeT nCount)
+{
+	memmove(pDest, pSource, nCount);
+}
+
+XN_C_API XnUInt64  xnOSEndianSwapUINT64(XnUInt64 nValue)
+{
+	return ((nValue >> 56) ) | ((nValue >> 40) & 0x000000000000ff00ULL) |
+			((nValue >> 24) & 0x0000000000ff0000ULL) | ((nValue >> 8 ) & 0x00000000ff000000ULL) |
+			((nValue << 8 ) & 0x000000ff00000000ULL) | ((nValue << 24) & 0x0000ff0000000000ULL) |
+			((nValue << 40) & 0x00ff000000000000ULL) | ((nValue << 56) );
+}
+
+XN_C_API XnUInt32  xnOSEndianSwapUINT32(XnUInt32 nValue)
+{
+	return  (nValue>>24) | 
+			((nValue<<8) & 0x00FF0000) |
+			((nValue>>8) & 0x0000FF00) |
+			(nValue<<24);
+}
+
+XN_C_API XnUInt16 xnOSEndianSwapUINT16(XnUInt16 nValue)
+{
+	return ((nValue>>8) | (nValue<<8));
+}
+XN_C_API XnFloat xnOSEndianSwapFLOAT(XnFloat fValue)
+{
+	XnUInt32* pnValue = (XnUInt32*)&fValue;
+	XnUInt32 nValue = xnOSEndianSwapUINT32(*pnValue);
+	XnFloat* pfValue = (XnFloat*)&nValue;
+	return *pfValue;
+}
diff --git a/Source/OpenNI/Linux/LinuxMutex.cpp b/Source/OpenNI/Linux/LinuxMutex.cpp
new file mode 100644
index 0000000..655c897
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxMutex.cpp
@@ -0,0 +1,426 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/ipc.h>
+#include <XnLog.h>
+
+#ifndef XN_PLATFORM_LINUX_NO_SYSV
+#include <sys/sem.h>
+#endif
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+struct XnMutex
+{
+	XnBool bIsNamed;
+	pthread_mutex_t ThreadMutex;
+	int NamedSem;
+	XnChar csSemFileName[XN_FILE_MAX_PATH];
+	int hSemFile;
+	XnBool bIsLocked; // used for named semaphore, to make sure a porcess doesn't unlock more than once (counting semaphore will no longer be a mutex).
+};
+
+typedef struct XnMutex XnMutex;
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XnStatus xnOSUnNamedMutexCreate(XnMutex* pMutex)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// make the mutex recursive (re-entrent)
+	pthread_mutexattr_t tAttributes;
+
+	if (0 != pthread_mutexattr_init(&tAttributes))
+		return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
+	
+	if (0 != pthread_mutexattr_settype(&tAttributes, PTHREAD_MUTEX_RECURSIVE))
+		return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
+	
+	// Init the mutex
+	int rc = pthread_mutex_init(&pMutex->ThreadMutex, &tAttributes);
+	
+	// destroy the attributes object
+	pthread_mutexattr_destroy(&tAttributes);
+	
+	// check if init succeeded
+	if (0 != rc)
+	{
+		return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnOSNamedMutexCreate(XnMutex* pMutex, const XnChar* csMutexName)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	int rc;
+
+#ifdef XN_PLATFORM_LINUX_NO_SYSV
+	xnLogError(XN_MASK_OS, "Named mutex is not implemented for this platform!");
+	return XN_STATUS_OS_MUTEX_CREATION_FAILED;
+#else
+
+	// remove bad chars from name
+	XnChar strMutexOSName[XN_FILE_MAX_PATH];
+	int i = 0;
+	for (; (i < XN_FILE_MAX_PATH) && (csMutexName[i] != '\0'); ++i)
+		strMutexOSName[i] = csMutexName[i] == '/' ? '_' : csMutexName[i];
+
+	if (i == XN_FILE_MAX_PATH)
+	{
+		xnLogWarning(XN_MASK_OS, "Mutex name is too long!");
+		return XN_STATUS_OS_MUTEX_CREATION_FAILED;
+	}
+
+	strMutexOSName[i] = '\0';
+
+	// tanslate mutex name to key file name
+	XnUInt32 nBytesWritten;
+	xnOSStrFormat(pMutex->csSemFileName, XN_FILE_MAX_PATH, &nBytesWritten, "/tmp/XnCore.Mutex.%s.key", strMutexOSName);
+	
+	// open this file (we hold it open until mutex is closed. That way it cannot be deleted as long
+	// as any process is holding the mutex, and the mutex can be destroyed if the file can be deleted).
+	pMutex->hSemFile = open(pMutex->csSemFileName, O_CREAT | O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
+	if (pMutex->hSemFile == -1)
+	{
+		return XN_STATUS_OS_FILE_OPEN_FAILED;
+	}
+	
+	// create the key
+	key_t key = ftok(pMutex->csSemFileName, 1);
+
+	// first we try to create it. If we fail, we'll know it already existed
+	XnBool bCreated = TRUE;
+	
+	// we created a set of 2 sems - first is the lock, second counts processes
+	pMutex->NamedSem = semget(key, 2, IPC_CREAT | IPC_EXCL | 0666);
+	if (pMutex->NamedSem == -1 && errno == EEXIST)
+	{
+		// get existing one
+		pMutex->NamedSem = semget(key, 2, IPC_CREAT | 0666);
+		if (pMutex->NamedSem == -1)
+		{
+			close(pMutex->hSemFile);
+			return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
+		}
+		
+		bCreated = FALSE;
+	}
+
+	if (bCreated)
+	{
+		union semun 
+		{
+				   int              val;    /* Value for SETVAL */
+				   struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
+				   unsigned short  *array;  /* Array for GETALL, SETALL */
+				   struct seminfo  *__buf;  /* Buffer for IPC_INFO
+											   (Linux-specific) */
+		} init;
+		
+		// init lock semaphore to 1 (not locked)
+		init.val = 1;
+		rc = semctl(pMutex->NamedSem, 0, SETVAL, init);
+		if (rc != 0)
+		{
+			semctl(pMutex->NamedSem, 0, IPC_RMID);
+			return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
+		}
+
+		// init process counter to 0
+		init.val = 0;
+		rc = semctl(pMutex->NamedSem, 1, SETVAL, init);
+		if (rc != 0)
+		{
+			semctl(pMutex->NamedSem, 0, IPC_RMID);
+			return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
+		}
+	}
+
+	// increment second sem
+	struct sembuf op;
+	op.sem_num = 1;
+	op.sem_op = 1;
+	op.sem_flg = SEM_UNDO; // mark it to be decreased when process terminates
+	
+	rc = semop(pMutex->NamedSem, &op, 1);
+	if (rc != 0)
+	{
+		xnOSCloseMutex(&pMutex);
+		return (XN_STATUS_OS_MUTEX_CREATION_FAILED);
+	}
+#endif
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSCreateMutex(XN_MUTEX_HANDLE* pMutexHandle)
+{
+	// Local function variables
+	XnStatus nRetVal = XN_STATUS_OK;
+	int rc = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_OUTPUT_PTR(pMutexHandle);
+	
+	XnMutex* pMutex;
+	XN_VALIDATE_CALLOC(pMutex, XnMutex, 1);
+	pMutex->bIsNamed = FALSE;
+	
+	nRetVal = xnOSUnNamedMutexCreate(pMutex);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pMutex);
+		return (nRetVal);
+	}
+	
+	*pMutexHandle = pMutex;
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSCreateNamedMutex(XN_MUTEX_HANDLE* pMutexHandle, const XnChar* cpMutexName)
+{
+	return xnOSCreateNamedMutexEx(pMutexHandle, cpMutexName, FALSE);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedMutexEx(XN_MUTEX_HANDLE* pMutexHandle, const XnChar* cpMutexName, XnBool bAllowOtherUsers)
+{
+	// Local function variables
+	XnStatus nRetVal = XN_STATUS_OK;
+	int rc = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_OUTPUT_PTR(pMutexHandle);
+	
+	XnMutex* pMutex;
+	XN_VALIDATE_CALLOC(pMutex, XnMutex, 1);
+	pMutex->bIsNamed = TRUE;
+	
+	nRetVal = xnOSNamedMutexCreate(pMutex, cpMutexName);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pMutex);
+		return (nRetVal);
+	}
+	
+	*pMutexHandle = pMutex;
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSCloseMutex(XN_MUTEX_HANDLE* pMutexHandle)
+{
+	// Local function variables
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pMutexHandle);
+
+	// Make sure the actual mutex handle isn't NULL
+	XN_RET_IF_NULL(*pMutexHandle, XN_STATUS_OS_INVALID_MUTEX);
+	
+	XnMutex* pMutex = *pMutexHandle;
+
+	// check the kind of mutex
+	if (pMutex->bIsNamed)
+	{
+#ifndef XN_PLATFORM_LINUX_NO_SYSV
+
+		// decrement second sem
+		struct sembuf op;
+		op.sem_num = 1;
+		op.sem_op = -1;
+		op.sem_flg = SEM_UNDO;
+		
+		if (0 != semop(pMutex->NamedSem, &op, 1))
+		{
+			return (XN_STATUS_OS_MUTEX_CLOSE_FAILED);
+		}
+		
+		// check if sem reached 0 (if so, it can be deleted)
+		int val = semctl(pMutex->NamedSem, 1, GETVAL);
+		if (val == 0)
+		{
+			// destroy the semaphore
+			semctl(pMutex->NamedSem, 0, IPC_RMID);
+			// and remove file
+			xnOSDeleteFile(pMutex->csSemFileName);
+		}
+		
+		// in any case, close the file
+		close(pMutex->hSemFile);
+#endif
+	}
+	else
+	{
+		// destroy the mutex via the OS
+		if (0 != pthread_mutex_destroy(&pMutex->ThreadMutex))
+		{
+			return (XN_STATUS_OS_MUTEX_CLOSE_FAILED);
+		}
+	}
+	
+	// free the handle
+	XN_FREE_AND_NULL(*pMutexHandle);
+	
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSLockMutex(const XN_MUTEX_HANDLE MutexHandle, XnUInt32 nMilliseconds)
+{
+	// Local function variables
+	XnStatus nRetVal = XN_STATUS_OK;
+	int rc = 0;
+
+	// Make sure the actual mutex handle isn't NULL
+	XN_RET_IF_NULL(MutexHandle, XN_STATUS_OS_INVALID_MUTEX);
+
+#ifndef XN_PLATFORM_LINUX_NO_SYSV
+	struct sembuf op;
+	// try to decrease it by 1 (if it's 0, we'll wait)
+	op.sem_num = 0;
+	op.sem_op = -1;
+	op.sem_flg = SEM_UNDO;
+#endif
+
+	if (nMilliseconds == XN_WAIT_INFINITE)
+	{
+		// lock via the OS
+		if (MutexHandle->bIsNamed)
+		{
+#ifndef XN_PLATFORM_LINUX_NO_SYSV
+			if (0 != semop(MutexHandle->NamedSem, &op, 1))
+			{
+				rc = errno;
+			}
+#endif
+		}
+		else
+		{
+			rc = pthread_mutex_lock(&MutexHandle->ThreadMutex);
+		}
+	}
+	else
+	{
+		struct timespec time;
+		
+		// lock via the OS
+		if (MutexHandle->bIsNamed)
+		{
+#ifndef XN_PLATFORM_LINUX_NO_SYSV
+			nRetVal = xnOSGetTimeout(&time, nMilliseconds);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				return XN_STATUS_OS_MUTEX_LOCK_FAILED;
+			}
+
+#ifndef XN_PLATFORM_HAS_NO_TIMED_OPS
+			if (0 != semtimedop(MutexHandle->NamedSem, &op, 1, &time))
+#else
+			if (0 != semop(MutexHandle->NamedSem, &op, 1))
+#endif
+			{
+				rc = errno;
+			}
+#endif
+		}
+		else
+		{
+			// calculate timeout absolute time. First we take current time
+			nRetVal = xnOSGetAbsTimeout(&time, nMilliseconds);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				return XN_STATUS_OS_MUTEX_LOCK_FAILED;
+			}
+			
+#ifndef XN_PLATFORM_HAS_NO_TIMED_OPS
+			rc = pthread_mutex_timedlock(&MutexHandle->ThreadMutex, &time);
+#else
+			rc = pthread_mutex_lock(&MutexHandle->ThreadMutex);
+#endif
+		}
+	}
+	
+	// check for failures
+	if (rc == ETIMEDOUT)
+	{
+		return (XN_STATUS_OS_MUTEX_TIMEOUT);
+	}
+	else if (rc != 0)
+	{
+		return (XN_STATUS_OS_MUTEX_LOCK_FAILED);
+	}
+	
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSUnLockMutex(const XN_MUTEX_HANDLE MutexHandle)
+{
+	// Local function variables
+	XnStatus nRetVal = XN_STATUS_OK;
+	int rc = 0;
+
+	// Make sure the actual mutex handle isn't NULL
+	XN_RET_IF_NULL(MutexHandle, XN_STATUS_OS_INVALID_MUTEX);
+	
+	// unlock via the OS
+	if (MutexHandle->bIsNamed)
+	{
+#ifndef XN_PLATFORM_LINUX_NO_SYSV
+		struct sembuf op;
+		op.sem_num = 0;
+		op.sem_op = 1; // increase by 1
+		op.sem_flg = SEM_UNDO;
+		
+		if (0 != semop(MutexHandle->NamedSem, &op, 1))
+		{
+			rc = errno;
+		}
+#endif
+	}
+	else
+	{
+		rc = pthread_mutex_unlock(&MutexHandle->ThreadMutex);
+	}
+	
+	if (0 != rc)
+	{
+		return (XN_STATUS_OS_MUTEX_UNLOCK_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
diff --git a/Source/OpenNI/Linux/LinuxNetwork.cpp b/Source/OpenNI/Linux/LinuxNetwork.cpp
new file mode 100644
index 0000000..a591ebe
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxNetwork.cpp
@@ -0,0 +1,521 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#include <ctype.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <errno.h>
+#include <XnLog.h>
+
+//---------------------------------------------------------------------------
+// Structs
+//---------------------------------------------------------------------------
+/** The Xiron OS network socket structure. */ 
+typedef struct xnOSSocket
+{
+	/** The OS socket handle. */ 
+	int Socket;
+
+	/** The OS socket address (IP and port). */ 
+	sockaddr_in SocketAddress;
+	socklen_t nSocketAddressLen;
+
+	/** The socket type enum (UDP, TDP, etc...) */ 
+	XnUInt32 nSocketType;
+} xnOSSocket;
+
+//---------------------------------------------------------------------------
+// Macros
+//---------------------------------------------------------------------------
+/** Returns Y if X is -1. */
+#define XN_RET_IF_INVALID(x, y)	\
+		if (x == -1)			\
+		{						\
+			return (y);			\
+		}
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API XnStatus xnOSInitNetwork()
+{
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSShutdownNetwork()
+{
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSCreateSocket(const XnOSSocketType SocketType, const XnChar* cpIPAddress, const XnUInt16 nPort, XN_SOCKET_HANDLE* SocketPtr)
+{
+	// Local function variables
+	hostent* HostEnt = NULL;
+	XN_SOCKET_HANDLE Socket = NULL;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpIPAddress);
+	XN_VALIDATE_OUTPUT_PTR(SocketPtr);
+
+	XN_VALIDATE_ALIGNED_CALLOC(*SocketPtr, xnOSSocket, 1, XN_DEFAULT_MEM_ALIGN);
+
+	Socket = *SocketPtr;
+
+	if (SocketType == XN_OS_UDP_SOCKET)
+	{
+		// Create a UDP socket
+		Socket->Socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+	}
+	else if (SocketType == XN_OS_TCP_SOCKET)
+	{
+		// Create a TCP socket
+		Socket->Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+	}
+	else
+	{
+		// Unknown socket type...
+		XN_ALIGNED_FREE_AND_NULL(Socket);
+		return (XN_STATUS_OS_NETWORK_INVALID_SOCKET_TYPE);
+	}
+
+	if (Socket->Socket == -1)
+	{
+		XN_ALIGNED_FREE_AND_NULL(Socket);
+		return (XN_STATUS_OS_NETWORK_SOCKET_CREATION_FAILED);
+	}
+
+	// Set the socket server address
+	Socket->SocketAddress.sin_family = AF_INET;
+
+	if (isalpha(cpIPAddress[0])) 
+	{
+		HostEnt = gethostbyname(cpIPAddress);
+		if (HostEnt == NULL)
+		{
+			XN_ALIGNED_FREE_AND_NULL(Socket);
+			return (XN_STATUS_OS_NETWORK_BAD_HOST_NAME);
+		}
+
+		xnOSMemCopy(&Socket->SocketAddress.sin_addr, HostEnt->h_addr, HostEnt->h_length);
+	}
+	else
+	{
+		Socket->SocketAddress.sin_addr.s_addr = inet_addr(cpIPAddress);
+	}
+
+	Socket->SocketAddress.sin_port = htons(nPort);
+
+	// Update socket address size
+	Socket->nSocketAddressLen = sizeof(Socket->SocketAddress);
+
+	// Remember the socket type
+	Socket->nSocketType = SocketType;
+
+	// turn on NODELAY option
+	int on = 1;
+	setsockopt(Socket->Socket, IPPROTO_TCP, TCP_NODELAY, (char*)&on, sizeof(on));
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSCloseSocket(XN_SOCKET_HANDLE Socket)
+{
+	// Local function variables
+	XnInt32 nRetVal = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(Socket);
+
+	// Make sure the actual socket handle isn't NULL
+	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
+
+	// shut down the socket
+	if (-1 == shutdown(Socket->Socket, SHUT_RDWR))
+	{
+		return(XN_STATUS_OS_NETWORK_SHUTDOWN_FAILED);
+	}
+
+	// Close the socket and make sure it succeeded (return value is 0)
+	if (-1 == close(Socket->Socket))
+	{
+		return(XN_STATUS_OS_NETWORK_SHUTDOWN_FAILED);
+	}
+
+	XN_ALIGNED_FREE_AND_NULL(Socket);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSBindSocket(XN_SOCKET_HANDLE Socket)
+{
+	// Local function variables
+	XnInt32 nRetVal = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(Socket);
+
+	// Make sure the actual socket handle isn't NULL
+	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
+	
+	// Workaround Linux annoying behavior. Linux keeps a port open in a TIME_WAIT state after it is close,
+	// and does not allow to bind it again. If socket is closed, you have to wait a couple of minutes before
+	// you can re-bind it. We disable this option
+	const int bOn = 1;
+	setsockopt(Socket->Socket, SOL_SOCKET, SO_REUSEADDR, &bOn, sizeof(bOn));
+
+	// Bind the socket and make sure it succeeded
+	nRetVal = bind(Socket->Socket, (const sockaddr*)&Socket->SocketAddress, sizeof(Socket->SocketAddress));
+	if (nRetVal	== -1)
+	{
+		xnLogWarning(XN_MASK_OS, "Failed to bind socket: errno is %d", errno);
+		return(XN_STATUS_OS_NETWORK_SOCKET_BIND_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSListenSocket(XN_SOCKET_HANDLE Socket)
+{
+	// Local function variables
+	XnInt32 nRetVal = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(Socket);
+
+	// Make sure the actual socket handle isn't NULL
+	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
+
+	// Listen to the socket and make sure it succeeded
+	nRetVal = listen(Socket->Socket, SOMAXCONN);
+	if (nRetVal	== -1)
+	{
+		return(XN_STATUS_OS_NETWORK_SOCKET_LISTEN_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+static struct timeval* xnOSMillisecsToTimeVal(XnUInt32 nMilliseconds, struct timeval* pTv)
+{
+	if (nMilliseconds == XN_WAIT_INFINITE)
+	{
+		return NULL;
+	}
+
+	pTv->tv_sec = nMilliseconds / 1000; //Seconds
+	pTv->tv_usec = (nMilliseconds % 1000) * 1000; //Microseconds
+	return pTv;
+}
+
+XN_C_API XnStatus xnOSAcceptSocket(XN_SOCKET_HANDLE ListenSocket, XN_SOCKET_HANDLE* AcceptSocketPtr, XnUInt32 nMillisecondsTimeout)
+{
+	// Local function variables
+	XnInt32 nRetVal = 0;
+	struct timeval selectTimeOut;
+	struct timeval* pTimeout = xnOSMillisecsToTimeVal(nMillisecondsTimeout, &selectTimeOut);
+	fd_set fdReadHandles;
+	XN_SOCKET_HANDLE AcceptSocket = NULL;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(ListenSocket);
+	XN_VALIDATE_OUTPUT_PTR(AcceptSocketPtr);
+
+	// Make sure the actual socket handle isn't NULL
+	XN_RET_IF_INVALID(ListenSocket->Socket, XN_STATUS_OS_INVALID_SOCKET);
+	// Wait for connection request
+	FD_ZERO(&fdReadHandles);
+	FD_SET(ListenSocket->Socket, &fdReadHandles);
+	nRetVal = select(ListenSocket->Socket + 1, &fdReadHandles, NULL, NULL, pTimeout);
+	if (nRetVal == 0)
+	{
+		return (XN_STATUS_OS_NETWORK_TIMEOUT);
+	}
+	else if (nRetVal == -1)
+	{
+		XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_ACCEPT_FAILED, XN_MASK_OS, "select() returned error: %d", errno);
+	}
+
+	// Allocate a new socket
+	XN_VALIDATE_ALIGNED_CALLOC(*AcceptSocketPtr, xnOSSocket, 1, XN_DEFAULT_MEM_ALIGN);
+
+	AcceptSocket = *AcceptSocketPtr;
+
+	// Accept the socket and make sure it succeeded
+	AcceptSocket->nSocketAddressLen = sizeof(AcceptSocket->SocketAddress);
+	AcceptSocket->Socket = accept(ListenSocket->Socket, (sockaddr*)&AcceptSocket->SocketAddress, &AcceptSocket->nSocketAddressLen);
+	if (AcceptSocket->Socket== -1)
+	{
+		xnOSCloseSocket(AcceptSocket);
+		xnOSFreeAligned(*AcceptSocketPtr);
+		return(XN_STATUS_OS_NETWORK_SOCKET_ACCEPT_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSConnectSocket(XN_SOCKET_HANDLE Socket, XnUInt32 nMillisecsTimeout)
+{
+	// Local function variables
+	XnInt32 nRetVal = 0;
+	sockaddr SocketAddress;
+	fd_set fdWriteHandles;
+	fd_set fdExceptHandles;
+	struct timeval selectTimeOut;
+	int nFlags;
+	struct timeval* pTimeout = xnOSMillisecsToTimeVal(nMillisecsTimeout, &selectTimeOut);
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(Socket);
+
+	// Make sure the actual socket handle isn't NULL
+	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
+
+	// Connect to the socket and make sure it succeeded
+	if (sizeof(SocketAddress) != sizeof(Socket->SocketAddress))
+	{
+		return(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED);
+	}
+
+	xnOSMemCopy(&SocketAddress, &Socket->SocketAddress, sizeof(SocketAddress));
+	
+	// if timeout is XN_SOCKET_DEFAULT_TIMEOUT, leave the socket as a blocking one
+	if (nMillisecsTimeout != XN_SOCKET_DEFAULT_TIMEOUT)
+	{
+		// Make the socket non-blocking temporarily
+		nFlags = fcntl(Socket->Socket, F_GETFL, 0);
+		int nNonBlockFlags = nFlags | O_NONBLOCK;
+		if (-1 == fcntl(Socket->Socket, F_SETFL, nNonBlockFlags))
+		{
+			XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED, XN_MASK_OS, "fcntl() failed with error %d", errno);
+		}
+	}
+
+	nRetVal = connect(Socket->Socket, &SocketAddress, sizeof(SocketAddress));
+	if (nRetVal	== -1 && errno != EINPROGRESS)
+	{
+		xnLogError(XN_MASK_OS, "connect() failed with error %d", errno);
+		return(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED);
+	}
+
+	if (nMillisecsTimeout != XN_SOCKET_DEFAULT_TIMEOUT)
+	{
+		FD_ZERO(&fdWriteHandles);
+		FD_SET(Socket->Socket, &fdWriteHandles);
+		FD_ZERO(&fdExceptHandles);
+		FD_SET(Socket->Socket, &fdExceptHandles);
+		nRetVal = select(Socket->Socket + 1, NULL, &fdWriteHandles, &fdExceptHandles, pTimeout);
+
+		//Make the socket blocking again before we check select()'s success
+		fcntl(Socket->Socket, F_SETFL, nFlags);
+
+		if (nRetVal == 0)
+		{
+			return (XN_STATUS_OS_NETWORK_TIMEOUT);
+		}
+		else if (nRetVal == -1)
+		{
+			XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_ACCEPT_FAILED, XN_MASK_OS, "select() returned error: %d", errno);
+		}
+		else
+		{
+			// select returned due to socket state change. Check if an error occurred or everything is OK.
+			if (FD_ISSET(Socket->Socket, &fdExceptHandles))
+			{
+				XnUInt32 nLastError = 0;
+				socklen_t nLastErrorSize = sizeof(nLastError);
+				getsockopt(Socket->Socket, SOL_SOCKET, SO_ERROR, &nLastError, &nLastErrorSize);
+				XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED, XN_MASK_OS, "Connect failed with error: %u", nLastError);
+			}
+			// else, it means it's in the writable state, which means connect succeeded.
+			XN_ASSERT(FD_ISSET(Socket->Socket, &fdWriteHandles));
+		}
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSetSocketBufferSize(XN_SOCKET_HANDLE Socket, const XnUInt32 nSocketBufferSize)
+{
+	// Local function variables
+	XnInt32 nOptLen = sizeof(XnUInt32);
+	XnInt32 nRetVal = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(Socket);
+
+	// Make sure the actual socket handle isn't NULL
+	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
+
+	// Change the socket sending buffer and make sure it succeeded
+	nRetVal = setsockopt(Socket->Socket, SOL_SOCKET, SO_SNDBUF, (XnChar*)&nSocketBufferSize, nOptLen);
+	if (nRetVal	== -1)
+	{
+		return(XN_STATUS_OS_NETWORK_SOCKET_BUFFER_FAILED);
+	}
+
+	// Change the socket receive buffer and make sure it succeeded
+	nRetVal = setsockopt(Socket->Socket, SOL_SOCKET, SO_RCVBUF, (XnChar*)&nSocketBufferSize, nOptLen);
+	if (nRetVal	== -1)
+	{
+		return(XN_STATUS_OS_NETWORK_SOCKET_BUFFER_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSendNetworkBuffer(XN_SOCKET_HANDLE Socket, const XnChar* cpBuffer, const XnUInt32 nBufferSize)
+{
+	// Local function variables
+	XnInt32 nRetVal = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(Socket);
+	XN_VALIDATE_INPUT_PTR(cpBuffer);
+
+	// Make sure the actual socket handle isn't NULL
+	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
+
+	// Send the data over our UDP socket to the server and make sure the wanted number of bytes were actually sent
+	// Linux note: we use MSG_NOSIGNAL so that we won't get SIGPIPE if socket is closed on the other side. instead,
+	// we'll get EPIPE.
+#if (XN_PLATFORM == XN_PLATFORM_MACOSX)
+	int on = 1;
+	setsockopt(Socket->Socket, SOL_SOCKET, SO_NOSIGPIPE, (char*)&on, sizeof(on));	
+	nRetVal = send(Socket->Socket, cpBuffer, nBufferSize, NULL); 
+#else
+	nRetVal = send(Socket->Socket, cpBuffer, nBufferSize, MSG_NOSIGNAL);
+#endif
+
+	if (nRetVal != nBufferSize)
+	{
+		return (XN_STATUS_OS_NETWORK_SEND_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSendToNetworkBuffer(XN_SOCKET_HANDLE Socket, const XnChar* cpBuffer, const XnUInt32 nBufferSize, XN_SOCKET_HANDLE SocketTo)
+{
+	// Local function variables
+	XnInt32 nRetVal = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(Socket);
+	XN_VALIDATE_INPUT_PTR(SocketTo);
+	XN_VALIDATE_INPUT_PTR(cpBuffer);
+
+	// Make sure the actual socket handle isn't NULL
+	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
+
+	// Send the data over our UDP socket to the server and make sure the wanted number of bytes were actually sent
+	nRetVal = sendto(Socket->Socket, cpBuffer, nBufferSize, 0, (const sockaddr*)&SocketTo->SocketAddress, sizeof(sockaddr));
+	if (nRetVal != nBufferSize)
+	{
+		return (XN_STATUS_OS_NETWORK_SEND_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSReceiveNetworkBuffer(XN_SOCKET_HANDLE Socket, XnChar* cpBuffer, XnUInt32* pnBufferSize, XnUInt32 nMillisecondsTimeout)
+{
+	// Local function variables
+	XnInt32 nRetVal = 0;
+	XnInt32 nLen = sizeof(sockaddr);	
+	struct timeval selectTimeOut;
+	struct timeval* pTimeout = xnOSMillisecsToTimeVal(nMillisecondsTimeout, &selectTimeOut);
+	fd_set fdReadHandles;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(Socket);
+	XN_VALIDATE_OUTPUT_PTR(cpBuffer);
+	XN_VALIDATE_OUTPUT_PTR(pnBufferSize);
+
+	// Make sure the actual socket handle isn't NULL
+	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
+
+	FD_ZERO(&fdReadHandles);
+	FD_SET(Socket->Socket, &fdReadHandles);
+	nRetVal = select(Socket->Socket + 1, &fdReadHandles, NULL, NULL, pTimeout);
+	if (nRetVal != 1)
+	{
+		return (XN_STATUS_OS_NETWORK_TIMEOUT);
+	}
+
+	// Receive the data from our socket to the buffer and make sure it succeeded
+	*pnBufferSize = recv(Socket->Socket, cpBuffer, *pnBufferSize, 0);
+	if (*pnBufferSize == 0)
+	{
+		xnLogVerbose(XN_MASK_OS, "Socket has been gracefully closed");
+		return (XN_STATUS_OS_NETWORK_CONNECTION_CLOSED);
+	}
+	else if (*pnBufferSize == -1)
+	{
+		XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_RECEIVE_FAILED, XN_MASK_OS, "recv() failed with error %d", errno);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSReceiveFromNetworkBuffer(XN_SOCKET_HANDLE Socket, XnChar* cpBuffer, XnUInt32* pnBufferSize, XN_SOCKET_HANDLE* SocketFrom)
+{
+	// Local function variables
+	XnInt32 nRetVal = 0;
+	socklen_t nLen = sizeof(sockaddr);	
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(Socket);
+	XN_VALIDATE_INPUT_PTR(SocketFrom);
+	XN_VALIDATE_OUTPUT_PTR(cpBuffer);
+	XN_VALIDATE_OUTPUT_PTR(pnBufferSize);
+
+	// Make sure the actual socket handle isn't NULL
+	XN_RET_IF_INVALID(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
+
+	// Receive the data from our UDP socket to the buffer and make sure it succeeded
+	*pnBufferSize = recvfrom(Socket->Socket, cpBuffer, *pnBufferSize, 0, (sockaddr*)&(*SocketFrom)->SocketAddress, &nLen);
+	if (*pnBufferSize == -1)
+	{
+		return (XN_STATUS_OS_NETWORK_RECEIVE_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
diff --git a/Source/OpenNI/Linux/LinuxPosixEvents.cpp b/Source/OpenNI/Linux/LinuxPosixEvents.cpp
new file mode 100644
index 0000000..1a5d16a
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxPosixEvents.cpp
@@ -0,0 +1,155 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#include "LinuxPosixEvents.h"
+
+XnLinuxPosixEvent::XnLinuxPosixEvent(XnBool bManualReset) : XnLinuxEvent(bManualReset)
+{
+
+}
+
+XnStatus XnLinuxPosixEvent::Init()
+{
+	// Create a cond object
+	if (0 != pthread_cond_init(&m_cond, NULL))
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_OS_EVENT_CREATION_FAILED, XN_MASK_OS, "Failed to create event: cond_init returned %d", errno);
+	}
+
+	// create the restriction mutex object
+	if (0 != pthread_mutex_init(&m_mutex, NULL))
+	{
+		pthread_cond_destroy(&m_cond);
+		XN_LOG_WARNING_RETURN(XN_STATUS_OS_EVENT_CREATION_FAILED, XN_MASK_OS, "Failed to create event: mutex_init returned %d", errno);
+	}
+
+	return XN_STATUS_OK;
+}
+
+XnStatus XnLinuxPosixEvent::Destroy()
+{
+	// Destroy the cond and mutex objects
+	if (0 != pthread_cond_destroy(&m_cond) || 0 != pthread_mutex_destroy(&m_mutex))
+	{
+		return (XN_STATUS_OS_EVENT_CLOSE_FAILED);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus XnLinuxPosixEvent::Set()
+{
+	// lock the mutex
+	if (0 != pthread_mutex_lock(&m_mutex))
+	{
+		return (XN_STATUS_OS_EVENT_SET_FAILED);
+	}
+
+	// signal the condition
+	m_bSignaled = TRUE;
+
+	// wake other threads
+	if (0 != pthread_cond_broadcast(&m_cond))
+	{
+		pthread_mutex_unlock(&m_mutex);
+		return XN_STATUS_OS_EVENT_SET_FAILED;
+	}
+
+	// unlock the mutex
+	if (0 != pthread_mutex_unlock(&m_mutex))
+	{
+		return (XN_STATUS_OS_EVENT_SET_FAILED);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus XnLinuxPosixEvent::Reset()
+{
+	m_bSignaled = FALSE;
+	
+	return (XN_STATUS_OK);
+}
+
+XnStatus XnLinuxPosixEvent::Wait(XnUInt32 nMilliseconds)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	struct timespec time = {0};
+	if (nMilliseconds != XN_WAIT_INFINITE)
+	{
+		nRetVal = xnOSGetAbsTimeout(&time, nMilliseconds);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			return XN_STATUS_OS_EVENT_WAIT_FAILED;
+		}
+	}
+
+	// lock the mutex
+	if (0 != pthread_mutex_lock(&m_mutex))
+	{
+		return (XN_STATUS_OS_EVENT_WAIT_FAILED);
+	}
+
+	// wait for the condition to become signaled (or a failure)
+	int rc;
+	while (nRetVal == XN_STATUS_OK && !m_bSignaled)
+	{
+		if (nMilliseconds != XN_WAIT_INFINITE)
+		{
+			rc = pthread_cond_timedwait(&m_cond, &m_mutex, &time);
+		}
+		else // infinite
+		{
+			rc = pthread_cond_wait(&m_cond, &m_mutex);
+		}
+
+		if (rc == ETIMEDOUT)
+		{
+			nRetVal = XN_STATUS_OS_EVENT_TIMEOUT;
+		}
+		else if (rc != 0)
+		{
+			nRetVal = XN_STATUS_OS_EVENT_WAIT_FAILED;
+		}
+	}
+
+	// check all went well
+	if (nRetVal != XN_STATUS_OK)
+	{
+		pthread_mutex_unlock(&m_mutex);
+		return nRetVal;	
+	}
+
+	if (!m_bManualReset)
+	{
+		// auto-reset the event
+		m_bSignaled = FALSE;
+	}
+
+	// unlock the mutex
+	if (0 != pthread_mutex_unlock(&m_mutex))
+	{
+		return (XN_STATUS_OS_EVENT_WAIT_FAILED);
+	}
+
+	return (XN_STATUS_OK);
+}
\ No newline at end of file
diff --git a/Source/OpenNI/Linux/LinuxPosixEvents.h b/Source/OpenNI/Linux/LinuxPosixEvents.h
new file mode 100644
index 0000000..a99961f
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxPosixEvents.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#include "LinuxEvents.h"
+
+class XnLinuxPosixEvent : public XnLinuxEvent
+{
+public:
+	XnLinuxPosixEvent(XnBool bManualReset);
+
+	virtual XnStatus Init();
+	virtual XnStatus Destroy();
+	virtual XnStatus Set();
+	virtual XnStatus Reset();
+	virtual XnStatus Wait(XnUInt32 nMilliseconds);
+
+private:
+	pthread_cond_t m_cond;
+	pthread_mutex_t m_mutex;
+};
+
diff --git a/Source/OpenNI/Linux/LinuxPosixNamedEvents.cpp b/Source/OpenNI/Linux/LinuxPosixNamedEvents.cpp
new file mode 100644
index 0000000..7235a06
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxPosixNamedEvents.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "LinuxPosixNamedEvents.h"
+
+#ifdef XN_PLATFORM_LINUX_NO_SYSV
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XnLinuxPosixNamedEvent::XnLinuxPosixNamedEvent(XnBool bManualReset, const XnChar* strName, XnBool bCreate) : 
+	XnLinuxNamedEvent(bManualReset, strName, bCreate), m_pSem(NULL)
+{
+}
+
+XnStatus XnLinuxPosixNamedEvent::CreateNamed(const XnChar* strName)
+{
+	// Create a new semaphore or open existing
+	m_pSem = sem_open(strName, O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO , 0);
+	if (SEM_FAILED == m_pSem)
+	{
+		return XN_STATUS_OS_EVENT_CREATION_FAILED;
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus XnLinuxPosixNamedEvent::OpenNamed(const XnChar* strName)
+{
+	return XN_STATUS_OS_EVENT_OPEN_FAILED;
+
+	// Open the existing samaphore
+	m_pSem = sem_open(strName,  0);
+	if (SEM_FAILED == m_pSem)
+	{
+		return XN_STATUS_OS_EVENT_OPEN_FAILED;
+	}
+
+	// TODO: find a way to get manual reset
+	//pEvent->bManualReset
+}
+
+XnStatus XnLinuxPosixNamedEvent::Destroy()
+{
+	// Destroy the named semaphore
+	if (0 != sem_close(m_pSem))
+	{
+		return (XN_STATUS_OS_EVENT_CLOSE_FAILED);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus XnLinuxPosixNamedEvent::Set()
+{
+	return (XN_STATUS_OS_EVENT_SET_FAILED);
+}
+
+XnStatus XnLinuxPosixNamedEvent::Reset()
+{
+	return (XN_STATUS_OS_EVENT_RESET_FAILED);
+}
+
+XnStatus XnLinuxPosixNamedEvent::Wait(XnUInt32 nTimeout)
+{
+	return (XN_STATUS_OS_EVENT_WAIT_FAILED);
+}
+
+#endif // if no SysV
\ No newline at end of file
diff --git a/Source/OpenNI/Linux/LinuxPosixNamedEvents.h b/Source/OpenNI/Linux/LinuxPosixNamedEvents.h
new file mode 100644
index 0000000..de3f042
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxPosixNamedEvents.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __LINUX_POSIX_NAMED_EVENTS_H__
+#define __LINUX_POSIX_NAMED_EVENTS_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "LinuxEvents.h"
+
+#ifdef XN_PLATFORM_LINUX_NO_SYSV
+#include <semaphore.h>
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+class XnLinuxPosixNamedEvent : public XnLinuxNamedEvent
+{
+public:
+	XnLinuxPosixNamedEvent(XnBool bManualReset, const XnChar* strName, XnBool bCreate);
+
+	virtual XnStatus CreateNamed(const XnChar* strName);
+	virtual XnStatus OpenNamed(const XnChar* strName);
+	virtual XnStatus Destroy();
+	virtual XnStatus Set();
+	virtual XnStatus Reset();
+	virtual XnStatus Wait(XnUInt32 nTimeout);
+
+private:
+	sem_t* m_pSem;
+};
+
+#endif // if no SysV
+
+#endif // __LINUX_POSIX_NAMED_EVENTS_H__
diff --git a/Source/OpenNI/Linux/LinuxProcesses.cpp b/Source/OpenNI/Linux/LinuxProcesses.cpp
new file mode 100644
index 0000000..ed7b3fe
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxProcesses.cpp
@@ -0,0 +1,122 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+#include <errno.h>
+#if (XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
+	#include <sys/wait.h>
+#else
+	#include <wait.h>
+#endif
+#include <XnLog.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API XnStatus xnOSGetCurrentProcessID(XN_PROCESS_ID* pProcID)
+{
+	// Validate output pointer
+	XN_VALIDATE_OUTPUT_PTR(pProcID);
+
+	// Get the current process id
+	*pProcID = getpid();
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSCreateProcess(const XnChar* strExecutable, XnUInt32 nArgs, const XnChar** pstrArgs, XN_PROCESS_ID* pProcID)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// NOTE: execv, for some weird reason, accepts the arguments as non-const strings, but in the documentation
+	// it is explicitly stated that it does not change anything, so we can just use const_cast for it.
+	XnChar* astrArgs[100];
+	if (nArgs > 98)
+	{
+		xnLogWarning(XN_MASK_OS, "Too many arguments!");
+		return XN_STATUS_OS_PROCESS_CREATION_FAILED;
+	}
+
+	astrArgs[0] = const_cast<char*>(strExecutable);
+	for (XnUInt i = 0; i < nArgs; ++i)
+	{
+		astrArgs[i+1] = const_cast<char*>(pstrArgs[i]);
+	}
+	astrArgs[nArgs+1] = NULL;
+	
+	pid_t child_pid = fork();
+	if (child_pid == -1) // fail
+	{
+		xnLogWarning(XN_MASK_OS, "Failed to start process! fork() error code is %d.", errno);
+		return XN_STATUS_OS_PROCESS_CREATION_FAILED;
+	}
+	else if (child_pid == 0) // child process
+	{
+		// fork again
+		// we want our process to be totally detached from creator process. To do so, we fork() twice, so that the creator process
+		// is terminated, and the new process becomes the child of init.
+		pid_t grandchild_pid = fork();
+		if (grandchild_pid == -1)
+		{
+			exit(XN_STATUS_OS_PROCESS_CREATION_FAILED);
+		}
+		else if (grandchild_pid == 0) // grandchild process
+		{
+			// close standard streams (this is a background process)
+			close(STDIN_FILENO);
+			close(STDOUT_FILENO);
+			close(STDERR_FILENO);
+			
+			// detach it from current process (so it will keep running, even if process is terminated)
+			setsid();
+			
+			// load the executable
+			if (-1 == execv(strExecutable, astrArgs))
+			{
+				xnLogWarning(XN_MASK_OS, "Failed to start process! execv() error code is %d.", errno);
+				return XN_STATUS_OS_PROCESS_CREATION_FAILED;
+			}
+		}
+		else // child process
+		{
+			_exit(XN_STATUS_OK);
+		}
+	}
+	else // parent process
+	{
+		// wait for the child process (the one creating the grandchild process), and make sure it succeeded)
+		int status = 0;
+		waitpid(child_pid, &status, 0);
+		if (status != 0)
+		{
+			return XN_STATUS_OS_PROCESS_CREATION_FAILED;
+		}
+
+		// we have no way to get the grandchild pid
+		*pProcID = 0;
+	}
+	
+	return (XN_STATUS_OK);
+}
diff --git a/Source/OpenNI/Linux/LinuxSharedLibs.cpp b/Source/OpenNI/Linux/LinuxSharedLibs.cpp
new file mode 100644
index 0000000..9de262f
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxSharedLibs.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+#include <dlfcn.h>
+#include <XnLog.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API XnStatus xnOSLoadLibrary(const XnChar* cpFileName, XN_LIB_HANDLE* pLibHandle)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpFileName);
+	XN_VALIDATE_OUTPUT_PTR(pLibHandle);
+
+	// Load the requested shared library via the OS
+	*pLibHandle = dlopen(cpFileName, RTLD_NOW);
+	
+	// Make sure it succeeded (return value is not NULL). If not return an error....
+	if (*pLibHandle == NULL)
+	{
+		xnLogWarning(XN_MASK_OS, "Failed loading lib: %s\n", dlerror());
+		return XN_STATUS_OS_CANT_LOAD_LIB;
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSFreeLibrary(const XN_LIB_HANDLE LibHandle)
+{
+	// Make sure the actual shared library handle isn't NULL
+	XN_RET_IF_NULL(LibHandle, XN_STATUS_OS_INVALID_LIBRARY);
+
+	// Free the shared library via the OS and make sure it succeeded
+	if (dlclose(LibHandle) != 0)
+	{
+		return (XN_STATUS_OS_CANT_FREE_LIB);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetProcAddress(const XN_LIB_HANDLE LibHandle, const XnChar* cpProcName, XnFarProc* pProcAddr)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpProcName);
+	XN_VALIDATE_OUTPUT_PTR(pProcAddr);
+
+	// Make sure the actual shared library handle isn't NULL
+	XN_RET_IF_NULL(LibHandle, XN_STATUS_OS_INVALID_LIBRARY);
+
+	// Get the requested procedure address from the shared library via the OS
+	*pProcAddr = (XnFarProc)dlsym(LibHandle, cpProcName);
+
+	// Make sure it succeeded (return value is not NULL). If not return an error....
+	XN_VALIDATE_PTR(*pProcAddr, XN_STATUS_OS_PROC_NOT_FOUND);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
diff --git a/Source/OpenNI/Linux/LinuxSharedMemory.cpp b/Source/OpenNI/Linux/LinuxSharedMemory.cpp
new file mode 100644
index 0000000..42f9ed3
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxSharedMemory.cpp
@@ -0,0 +1,278 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+#include <XnLog.h>
+#include <sys/mman.h>
+#include <errno.h>
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+#ifndef XN_PLATFORM_LINUX_NO_SHM
+
+struct XnOSSharedMemory
+{
+	bool bCreate;
+	XnChar strFileName[XN_FILE_MAX_PATH];
+	int nSize;
+	void* pAddress;
+};
+
+XnStatus AccessFlagsToMMapProt(XnUInt32 nAccessFlags, int* pProt)
+{
+	int result = PROT_NONE;
+
+	if ((nAccessFlags & XN_OS_FILE_READ) != 0)
+	{
+		result |= PROT_READ;
+	}
+
+	if ((nAccessFlags & XN_OS_FILE_WRITE) != 0)
+	{
+		result |= PROT_WRITE;
+	}
+
+	*pProt = result;
+
+	return XN_STATUS_OK;
+}
+
+XnStatus AccessFlagsToOpenFlags(XnUInt32 nAccessFlags, int* pFlags)
+{
+	int result = 0;
+
+	if ((nAccessFlags & XN_OS_FILE_READ) == 0)
+	{
+		return (XN_STATUS_INVALID_OPERATION);
+	}
+
+	if ((nAccessFlags & XN_OS_FILE_WRITE) != 0)
+	{
+		result = O_RDWR;
+	}
+	else
+	{
+		result = O_RDONLY;
+	}
+
+	*pFlags = result;
+
+	return (XN_STATUS_OK);
+}
+
+static void NameToFileName(const XnChar* strName, XnChar* strFileName)
+{
+	int i = 0;
+	for (; strName[i] != '\0'; ++i)
+	{
+		// replace slashes with dots
+		strFileName[i] = strName[i] == '/' ? '.' : strName[i];
+	}
+	strFileName[i] = '\0';
+}
+
+static XnStatus OpenSharedMemoryImpl(const XnChar* strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem, XnUInt32 nSize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XN_VALIDATE_INPUT_PTR(strName);
+	XN_VALIDATE_OUTPUT_PTR(phSharedMem);
+	
+	// if (nSize) is a number - create, otherwise - open
+	XnBool bCreate = (nSize != 0);
+
+	// convert to local OS types
+	int prot = 0;
+	int nCreateFlags = 0;
+	int nMode = 0;
+
+	nRetVal = AccessFlagsToMMapProt(nAccessFlags, &prot);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = AccessFlagsToOpenFlags(nAccessFlags, &nCreateFlags);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// allocate handle
+	XnOSSharedMemory* pHandle;
+	XN_VALIDATE_CALLOC(pHandle, XnOSSharedMemory, 1);
+
+	pHandle->bCreate = bCreate;
+
+	NameToFileName(strName, pHandle->strFileName);
+
+	if (bCreate)
+	{
+		nCreateFlags |= O_CREAT;
+		nMode |= S_IRWXU | S_IRWXG | S_IRWXO;
+	}
+
+	// open file
+	int fd = shm_open(pHandle->strFileName, nCreateFlags, nMode);
+	if (fd == -1)
+	{
+		xnOSFree(pHandle);
+		XN_LOG_WARNING_RETURN(XN_STATUS_OS_FAILED_TO_CREATE_SHARED_MEMORY, XN_MASK_OS, "Could not create file '%s' for shared memory (%d).", pHandle->strFileName, errno);
+	}
+
+	if (bCreate)
+	{
+		// set it to the right size
+		if (-1 == ftruncate(fd, nSize))
+		{
+			close(fd);
+			shm_unlink(pHandle->strFileName);
+			xnOSFree(pHandle);
+			XN_LOG_WARNING_RETURN(XN_STATUS_OS_FAILED_TO_CREATE_SHARED_MEMORY, XN_MASK_OS, "Could not seek to position (%d).", pHandle->strFileName, errno);
+		}
+
+		pHandle->nSize = nSize;
+	}
+	else
+	{
+		// read shared object size
+		pHandle->nSize = lseek(fd, 0, SEEK_END);
+	}
+
+	// and map it
+	pHandle->pAddress = mmap(NULL, pHandle->nSize, prot, MAP_SHARED, fd, 0);
+	if (pHandle->pAddress == MAP_FAILED)
+	{
+		close(fd);
+		shm_unlink(pHandle->strFileName);
+		xnOSFree(pHandle);
+		XN_LOG_WARNING_RETURN(XN_STATUS_OS_FAILED_TO_CREATE_SHARED_MEMORY, XN_MASK_OS, "Could not create file mapping object (%d).", errno);
+	}
+	
+	close(fd);
+
+	*phSharedMem = pHandle;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem)
+{
+	return xnOSCreateSharedMemoryEx(strName, nSize, nAccessFlags, FALSE, phSharedMem);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemoryEx(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE* phSharedMem)
+{
+	return OpenSharedMemoryImpl(strName, nAccessFlags, phSharedMem, nSize);
+}
+
+XN_C_API XnStatus xnOSOpenSharedMemory(const XnChar* strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem)
+{
+	return xnOSOpenSharedMemoryEx(strName, nAccessFlags, FALSE, phSharedMem);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSOpenSharedMemoryEx(const XnChar* strName, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE* phSharedMem)
+{
+	return OpenSharedMemoryImpl(strName, nAccessFlags, phSharedMem, 0);
+}
+
+XN_C_API XnStatus xnOSCloseSharedMemory(XN_SHARED_MEMORY_HANDLE hSharedMem)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XN_VALIDATE_INPUT_PTR(hSharedMem);
+
+	// unmap
+	munmap(hSharedMem->pAddress, hSharedMem->nSize);
+
+	if (hSharedMem->bCreate)
+	{
+		// remove the file
+		shm_unlink(hSharedMem->strFileName);
+	}
+	
+	xnOSFree(hSharedMem);
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSharedMemoryGetAddress(XN_SHARED_MEMORY_HANDLE hSharedMem, void** ppAddress)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XN_VALIDATE_INPUT_PTR(hSharedMem);
+	XN_VALIDATE_OUTPUT_PTR(ppAddress);
+
+	*ppAddress = hSharedMem->pAddress;
+
+	return (XN_STATUS_OK);
+}
+
+#else
+
+struct XnOSSharedMemory
+{
+	void* pAddress;
+};
+
+XN_C_API XnStatus xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem)
+{
+	void* pAddress = xnOSMallocAligned(nSize, XN_DEFAULT_MEM_ALIGN);
+	XN_VALIDATE_ALLOC_PTR(pAddress);
+	
+	*phSharedMem = (XN_SHARED_MEMORY_HANDLE)pAddress;
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSCreateSharedMemoryEx(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE* phSharedMem)
+{
+	void* pAddress = xnOSMallocAligned(nSize, XN_DEFAULT_MEM_ALIGN);
+	XN_VALIDATE_ALLOC_PTR(pAddress);
+	
+	*phSharedMem = (XN_SHARED_MEMORY_HANDLE)pAddress;
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSOpenSharedMemory(const XnChar* strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem)
+{
+	return XN_STATUS_OS_FAILED_TO_CREATE_SHARED_MEMORY;
+}
+
+XN_C_API XnStatus xnOSOpenSharedMemoryEx(const XnChar* strName, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE* phSharedMem)
+{
+	return XN_STATUS_OS_FAILED_TO_CREATE_SHARED_MEMORY;
+}
+
+XN_C_API XnStatus xnOSCloseSharedMemory(XN_SHARED_MEMORY_HANDLE hSharedMem)
+{
+	xnOSFreeAligned(hSharedMem);
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSharedMemoryGetAddress(XN_SHARED_MEMORY_HANDLE hSharedMem, void** ppAddress)
+{
+	*ppAddress = hSharedMem;
+	
+	return (XN_STATUS_OK);
+}
+
+#endif
diff --git a/Source/OpenNI/Linux/LinuxStrings.cpp b/Source/OpenNI/Linux/LinuxStrings.cpp
new file mode 100644
index 0000000..b06a259
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxStrings.cpp
@@ -0,0 +1,355 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+
+//---------------------------------------------------------------------------
+// Globals
+//---------------------------------------------------------------------------
+static const XnUInt32 xnOSStrCRC32Table[0x100] =
+{
+	0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
+	0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
+	0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
+	0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
+	0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
+	0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
+	0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
+	0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
+	0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
+	0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
+	0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
+	0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
+	0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
+	0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
+	0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
+	0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
+	0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
+	0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
+	0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
+	0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
+	0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
+	0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
+	0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
+	0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
+	0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
+	0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
+	0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
+	0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
+	0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
+	0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
+	0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
+	0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
+	0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
+	0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
+	0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
+	0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
+	0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
+	0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
+	0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
+	0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
+	0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
+	0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
+	0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
+	0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
+	0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
+	0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
+	0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
+	0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
+	0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
+	0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
+	0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
+	0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
+	0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
+	0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
+	0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
+	0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
+	0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
+	0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
+	0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
+	0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
+	0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
+	0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
+	0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
+	0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
+}; 
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API XnStatus xnOSStrPrefix(const XnChar* cpPrefixString, XnChar* cpDestString, const XnUInt32 nDestLength)
+{
+	// Local function variables
+	XnChar* cpTempBuffer = NULL;
+	XnUInt32 nOutStringLength = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpPrefixString);
+	XN_VALIDATE_INPUT_PTR(cpDestString);
+
+	// Calculate the final string length
+	nOutStringLength = strlen(cpPrefixString) + strlen(cpDestString);
+
+	// Make sure the destination string can hold the required information
+	if (nOutStringLength >= nDestLength)
+	{
+		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
+	}
+
+	// Allocate the temp buffer
+	XN_VALIDATE_CALLOC(cpTempBuffer, XnChar, nOutStringLength + sizeof(XnChar));
+
+	// Prefix the string
+	strncat (cpTempBuffer, cpPrefixString, nOutStringLength);
+	strncat (cpTempBuffer, cpDestString, nOutStringLength);
+
+	// Copy the temp buffer into the output
+	strncpy (cpDestString, cpTempBuffer, nOutStringLength);
+
+	// Free the temporary buffer
+	XN_FREE_AND_NULL(cpTempBuffer);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSStrAppend(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nDestLength)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpSrcString);
+	XN_VALIDATE_INPUT_PTR(cpDestString);
+
+	// Make sure the destination string can hold the required information
+	if (strlen(cpSrcString) + strlen(cpDestString) >= nDestLength)
+	{
+		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
+	}
+
+	// Prefix the string
+	strncat (cpDestString, cpSrcString, nDestLength - strlen(cpDestString));
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSStrCopy(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nDestLength)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpSrcString);
+	XN_VALIDATE_INPUT_PTR(cpDestString);
+
+	// Make sure the destination string can hold the required information
+	if (strlen(cpSrcString) >= nDestLength)
+	{
+		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
+	}
+
+	// Copy the string
+	strncpy (cpDestString, cpSrcString, nDestLength);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnUInt32 xnOSStrLen(const XnChar* cpString)
+{
+	XN_VALIDATE_PTR(cpString, 0);
+	return strlen(cpString);
+}
+
+XN_C_API XnStatus xnOSStrNCopy(XnChar* cpDestString, const XnChar* cpSrcString, const XnUInt32 nCopyLength, const XnUInt32 nDestLength)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpSrcString);
+	XN_VALIDATE_INPUT_PTR(cpDestString);
+
+	// Make sure the destination string can hold the required information
+	if (nCopyLength > nDestLength)
+	{
+		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
+	}
+
+	// Copy the string
+	strncpy(cpDestString, cpSrcString, nCopyLength);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSStrCRC32(const XnChar* cpString, XnUInt32* nCRC32)
+{
+	// Local function variables
+	XnUInt32 nTempCRC32 = 0xffffffff;
+	XnUInt32 nStrLen = 0;
+	XnUInt32 nIdx = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpString);
+	XN_VALIDATE_OUTPUT_PTR(nCRC32);
+
+	*nCRC32 = 0;
+
+	nStrLen = strlen(cpString);
+
+	for (nIdx = 0; nIdx < nStrLen; nIdx++)
+	{
+		nTempCRC32 = (nTempCRC32 >> 8) ^ xnOSStrCRC32Table[(nTempCRC32 & 0xFF) ^ *cpString++];
+	}
+
+	*nCRC32 = nTempCRC32 ^ 0xffffffff; 
+
+	// All is good...
+	return (XN_STATUS_OK);
+
+}
+
+XN_C_API XnStatus xnOSStrNCRC32(XnUChar* cpBuffer, XnUInt32 nBufferSize, XnUInt32* nCRC32)
+{
+	// Local function variables
+	XnUInt32 nTempCRC32 = 0xffffffff;
+	XnUInt32 nStrLen = 0;
+	XnUInt32 nIdx = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpBuffer);
+	XN_VALIDATE_OUTPUT_PTR(nCRC32);
+
+	*nCRC32 = 0;
+
+	for (nIdx = 0; nIdx < nBufferSize; nIdx++)
+	{
+		nTempCRC32 = (nTempCRC32 >> 8) ^ xnOSStrCRC32Table[(nTempCRC32 & 0xFF) ^ *cpBuffer++];
+	}
+
+	*nCRC32 = nTempCRC32 ^ 0xffffffff; 
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSStrFormatV(XnChar* cpDestString, const XnUInt32 nDestLength, XnUInt32* pnBytesWritten, const XnChar* cpFormat, va_list args)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpDestString);
+	XN_VALIDATE_INPUT_PTR(cpFormat);
+	XN_VALIDATE_OUTPUT_PTR(pnBytesWritten);
+
+	*pnBytesWritten = 0;
+
+	XnInt32 nRes = vsnprintf(cpDestString, nDestLength, cpFormat, args);
+
+	// nRes is the number of bytes written, not including NULL termination
+
+	if ((nRes == -1) ||	// string was truncated
+		(nRes == nDestLength && cpDestString[nRes] != '\0')) // no space for the NULL termination
+	{
+		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
+	}
+
+	// return byte count (string length)
+	*pnBytesWritten = nRes;
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API void xnOSItoA(XnInt32 nValue, XnChar* cpStr, XnInt32 nBase)
+{
+	static XnChar cNum[] = "0123456789abcdefghijklmnopqrstuvwxyz";
+	XnChar* cpWStr = cpStr;
+	XnInt32 nSign;
+
+	// Validate base
+	if (nBase < 2 || nBase > 35)
+	{
+		*cpWStr = '\0';
+		return;
+	}
+
+	// Take care of sign
+	if ((nSign = nValue) < 0)
+	{
+		nValue = -nValue;
+	}
+
+	// Conversion. Number is reversed.
+	do *cpWStr++ = cNum[nValue % nBase]; while(nValue /= nBase);
+
+	if(nSign<0) *cpWStr++='-';
+
+	*cpWStr='\0';
+
+	// Reverse string
+	XnChar cAux;
+	XnChar* cpBegin = cpStr;
+	XnChar* cpEnd = cpWStr-1;
+
+	while(cpEnd > cpBegin)
+	{
+		cAux=*cpEnd;
+		*cpEnd--=*cpBegin;
+		*cpBegin++=cAux;
+	}
+}
+
+XN_C_API XnInt32 xnOSStrCmp(const XnChar* cpFirstString, const XnChar* cpSecondString)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpFirstString);
+	XN_VALIDATE_INPUT_PTR(cpSecondString);
+
+	return strcmp(cpFirstString, cpSecondString);
+}
+
+XN_C_API XnInt32 xnOSStrCaseCmp(const XnChar* cpFirstString, const XnChar* cpSecondString)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpFirstString);
+	XN_VALIDATE_INPUT_PTR(cpSecondString);
+
+	return strcasecmp(cpFirstString, cpSecondString);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSGetEnvironmentVariable(const XnChar* strEnv, XnChar* strDest, XnUInt32 nDestSize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XN_VALIDATE_INPUT_PTR(strEnv);
+	XN_VALIDATE_INPUT_PTR(strDest);
+
+	char* strRes = getenv(strEnv);
+	if (strRes == NULL)
+	{
+		return (XN_STATUS_OS_ENV_VAR_NOT_FOUND);
+	}
+	
+	nRetVal = xnOSStrCopy(strDest, strRes, nDestSize);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	return (XN_STATUS_OK);
+}
+
+
+
+
diff --git a/Source/OpenNI/Linux/LinuxSysVNamedEvents.cpp b/Source/OpenNI/Linux/LinuxSysVNamedEvents.cpp
new file mode 100644
index 0000000..87c5a50
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxSysVNamedEvents.cpp
@@ -0,0 +1,266 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "LinuxSysVNamedEvents.h"
+
+#ifndef XN_PLATFORM_LINUX_NO_SYSV
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+enum _XN_EVENT_SEM_TYPE
+{
+	XN_EVENT_SEM_REF_COUNT = 0,
+	XN_EVENT_SEM_SIGNALED,
+	XN_EVENT_SEM_MANUAL_RESET,
+	XN_EVENT_NUM_OF_SEMS
+};
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+#ifndef XN_PLATFORM_HAS_BUILTIN_SEMUN
+union semun {
+               int              val;    /* Value for SETVAL */
+               struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
+               unsigned short  *array;  /* Array for GETALL, SETALL */
+               struct seminfo  *__buf;  /* Buffer for IPC_INFO
+                                           (Linux-specific) */
+           };
+#endif
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XnLinuxSysVNamedEvent::XnLinuxSysVNamedEvent(XnBool bManualReset, const XnChar* strName, XnBool bCreate) : XnLinuxNamedEvent(bManualReset, strName, bCreate)
+{
+}
+
+XnStatus XnLinuxSysVNamedEvent::CreateNamed(const XnChar* strName)
+{
+	// translate event name to key file name
+	XnUInt32 nBytesWritten;
+	xnOSStrFormat(m_csSemFileName, XN_FILE_MAX_PATH, &nBytesWritten, "/tmp/XnCore.Event.%s.key", strName);
+
+	// create the file (must exist for ftok)
+	m_hSemFile = open(m_csSemFileName, O_CREAT | O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
+	if (-1 == m_hSemFile)
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_OS_EVENT_CREATION_FAILED, XN_MASK_OS, "Create named event: failed to create key file (%d)", errno);
+	}
+
+	// create the key
+	key_t key = ftok(m_csSemFileName, 1);
+
+	// Try to create the semaphore
+	// Creating two semaphores. First semaphore will be used as reference count, and second for the signaled state
+	m_hSem = semget(key, XN_EVENT_NUM_OF_SEMS, IPC_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+	if (-1 == m_hSem)
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_OS_EVENT_CREATION_FAILED, XN_MASK_OS, "Create named event: failed to create semaphore (%d)", errno);
+	}
+
+	// if no one is using it so far (this is a newly created event), reset it
+	if (0 == semctl(m_hSem, XN_EVENT_SEM_REF_COUNT, GETVAL))
+	{
+		// set it to the non-signaled state
+		semun val;
+		val.val = 0;
+		if (0 != semctl(m_hSem, XN_EVENT_SEM_SIGNALED, SETVAL, val))
+		{
+			xnLogWarning(XN_MASK_OS, "Create named event: semctl for signaled failed (%d)", errno);
+			semctl(m_hSem, 0, IPC_RMID);
+			return XN_STATUS_OS_EVENT_CREATION_FAILED;
+		}
+
+		// set its manual reset value
+		val.val = m_bManualReset;
+		if (0 != semctl(m_hSem, XN_EVENT_SEM_MANUAL_RESET, SETVAL, val))
+		{
+			xnLogWarning(XN_MASK_OS, "Create named event: semctl for manual reset failed (%d)", errno);
+			semctl(m_hSem, 0, IPC_RMID);
+			return XN_STATUS_OS_EVENT_CREATION_FAILED;
+		}
+	}
+
+	// adding 1 to reference count
+	struct sembuf op;
+	op.sem_op = 1;
+	op.sem_num = XN_EVENT_SEM_REF_COUNT;
+	op.sem_flg = SEM_UNDO;
+	semop(m_hSem, &op, 1);
+
+	m_bManualReset = semctl(m_hSem, XN_EVENT_SEM_MANUAL_RESET, GETVAL);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus XnLinuxSysVNamedEvent::OpenNamed(const XnChar* strName)
+{
+	// translate event name to key file name
+	XnUInt32 nBytesWritten;
+	xnOSStrFormat(m_csSemFileName, XN_FILE_MAX_PATH, &nBytesWritten, "/tmp/XnCore.Event.%s.key", strName);
+
+	// create the key
+	key_t key = ftok(m_csSemFileName, 1);
+	if (-1 == key)
+	{
+		// event does not exist
+		XN_LOG_WARNING_RETURN(XN_STATUS_OS_EVENT_OPEN_FAILED, XN_MASK_OS, "Open named event: failed to open key file (%d) - event might not exist...", errno);
+	}
+
+	// Try to open the semaphore
+	m_hSem = semget(key, XN_EVENT_NUM_OF_SEMS, 0);
+	if (-1 == m_hSem)
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_OS_EVENT_OPEN_FAILED, XN_MASK_OS, "Open named event: failed to get semaphore (%d)", errno);
+	}
+
+	// if ref count is 0, the event does not really exist
+	if (0 == semctl(m_hSem, XN_EVENT_SEM_REF_COUNT, GETVAL))
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_OS_EVENT_OPEN_FAILED, XN_MASK_OS, "Open named event: ref count is zero - event does not exist!", errno);
+	}
+
+	// adding 1 to reference count
+	struct sembuf op;
+	op.sem_op = 1;
+	op.sem_num = XN_EVENT_SEM_REF_COUNT;
+	op.sem_flg = SEM_UNDO;
+	semop(m_hSem, &op, 1);
+
+	m_bManualReset = semctl(m_hSem, XN_EVENT_SEM_MANUAL_RESET, GETVAL);
+	
+	return XN_STATUS_OK;
+}
+
+XnStatus XnLinuxSysVNamedEvent::Destroy()
+{
+	// dec ref count
+	struct sembuf op;
+	op.sem_num = XN_EVENT_SEM_REF_COUNT;
+	op.sem_op = -1;
+	op.sem_flg = IPC_NOWAIT | SEM_UNDO;
+	semop(m_hSem, &op, 1); 
+
+	// check current ref count. If 0, destroy it
+	int val = semctl(m_hSem, 0, GETVAL);
+	if (0 == val)
+	{
+		// destroy the semaphore
+		semctl(m_hSem, 0, IPC_RMID);
+		// and remove file
+		xnOSDeleteFile(m_csSemFileName);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus XnLinuxSysVNamedEvent::Set()
+{
+	struct sembuf op[2];
+
+	// check if it's not signaled (by waiting for 0, with IPC_NOWAIT)
+	op[0].sem_num = XN_EVENT_SEM_SIGNALED;
+	op[0].sem_op = 0;
+	op[0].sem_flg = IPC_NOWAIT;
+
+	// signal (if zero)
+	op[1].sem_num = XN_EVENT_SEM_SIGNALED;
+	op[1].sem_op = 1;
+	op[1].sem_flg = SEM_UNDO;
+
+	semop(m_hSem, op, 2);
+	// no need to check error code. either it succeeded, or the event is already signaled
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus XnLinuxSysVNamedEvent::Reset()
+{
+	// unsignal it, with NOWAIT (that way, if it's not signaled, nothing will happen)
+	struct sembuf op;
+	op.sem_num = XN_EVENT_SEM_SIGNALED;
+	op.sem_op = -1;
+	op.sem_flg = IPC_NOWAIT;
+	semop(m_hSem, &op, 1);
+
+	return XN_STATUS_OK;
+}
+
+XnStatus XnLinuxSysVNamedEvent::Wait(XnUInt32 nMilliseconds)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	struct timespec time = {0};
+	if (nMilliseconds != XN_WAIT_INFINITE)
+	{
+		nRetVal = xnOSGetTimeout(&time, nMilliseconds);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			return XN_STATUS_OS_EVENT_WAIT_FAILED;
+		}
+	}
+
+	struct sembuf op[2];
+
+	// wait for it to be 1
+	op[0].sem_num = XN_EVENT_SEM_SIGNALED;
+	op[0].sem_op = -1;
+	op[0].sem_flg = 0;
+
+	// re set it (if manual reset)
+	op[1].sem_num = XN_EVENT_SEM_SIGNALED;
+	op[1].sem_op = 1;
+	op[1].sem_flg = 0;
+
+	XnInt32 nOpsCount = m_bManualReset ? 2 : 1;
+
+	if (XN_WAIT_INFINITE != nMilliseconds)
+	{
+#if _GNU_SOURCE
+		if (0 != semtimedop(m_hSem, op, nOpsCount, &time))
+#else
+		if (0 != semop(m_hSem, op, nOpsCount))	
+#endif
+		{
+			if(EAGAIN == errno)
+			{
+				return XN_STATUS_OS_EVENT_TIMEOUT;
+			}
+			return XN_STATUS_OS_EVENT_WAIT_FAILED;
+		}
+	}
+	else
+	{
+		if (0 != semop(m_hSem, op, nOpsCount))
+		{
+			return XN_STATUS_OS_EVENT_WAIT_FAILED;
+		}
+	}
+
+	return (XN_STATUS_OK);
+}
+
+#endif // if we have SysV
\ No newline at end of file
diff --git a/Source/OpenNI/Linux/LinuxSysVNamedEvents.h b/Source/OpenNI/Linux/LinuxSysVNamedEvents.h
new file mode 100644
index 0000000..4061ce7
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxSysVNamedEvents.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __LINUX_SYS_V_NAMED_EVENTS_H__
+#define __LINUX_SYS_V_NAMED_EVENTS_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnPlatform.h>
+#include "LinuxEvents.h"
+
+#ifndef XN_PLATFORM_LINUX_NO_SYSV
+#include <sys/sem.h>
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+class XnLinuxSysVNamedEvent : public XnLinuxNamedEvent
+{
+public:
+	XnLinuxSysVNamedEvent(XnBool bManualReset, const XnChar* strName, XnBool bCreate);
+
+	virtual XnStatus CreateNamed(const XnChar* strName);
+	virtual XnStatus OpenNamed(const XnChar* strName);
+	virtual XnStatus Destroy();
+	virtual XnStatus Set();
+	virtual XnStatus Reset();
+	virtual XnStatus Wait(XnUInt32 nTimeout);
+
+private:
+	int m_hSem;
+	XnChar m_csSemFileName[XN_FILE_MAX_PATH];
+	int m_hSemFile;
+};
+
+#endif // if we have SysV
+
+#endif // __LINUX_SYS_V_NAMED_EVENTS_H__
diff --git a/Source/OpenNI/Linux/LinuxThreads.cpp b/Source/OpenNI/Linux/LinuxThreads.cpp
new file mode 100644
index 0000000..3fe6bff
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxThreads.cpp
@@ -0,0 +1,190 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <XnLog.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API XnStatus xnOSCreateThread(XN_THREAD_PROC_PROTO pThreadProc, const XN_THREAD_PARAM pThreadParam, XN_THREAD_HANDLE* pThreadHandle)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pThreadProc);
+	XN_VALIDATE_OUTPUT_PTR(pThreadHandle);
+
+	// allocate thread handle
+	XN_VALIDATE_ALLOC(*pThreadHandle, pthread_t);
+
+	// Create a thread via the OS
+	int rc = pthread_create(*pThreadHandle, NULL, pThreadProc, pThreadParam);
+	if (rc != 0)
+	{
+		XN_FREE_AND_NULL(*pThreadHandle);
+		return (XN_STATUS_OS_THREAD_CREATION_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSTerminateThread(XN_THREAD_HANDLE* pThreadHandle)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pThreadHandle);
+
+	// Make sure the actual thread handle isn't NULL
+	XN_RET_IF_NULL(*pThreadHandle, XN_STATUS_OS_INVALID_THREAD);
+	
+	XN_THREAD_HANDLE handle = *pThreadHandle;
+
+#ifndef XN_PLATFORM_LINUX_NO_PTHREAD_CANCEL
+	if (0 != pthread_cancel(*handle))
+#else
+	// send the KILL signal to the thread
+	if (0 != pthread_kill(*handle, SIGUSR1))
+#endif
+	{
+		return (XN_STATUS_OS_THREAD_TERMINATION_FAILED);
+	}
+	
+	// Close the handle
+	XnStatus nRetVal = xnOSCloseThread(pThreadHandle);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSCloseThread(XN_THREAD_HANDLE* pThreadHandle)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pThreadHandle);
+
+	// Make sure the actual thread handle isn't NULL
+	XN_RET_IF_NULL(*pThreadHandle, XN_STATUS_OS_INVALID_THREAD);
+
+	// free handle
+	XN_FREE_AND_NULL(*pThreadHandle);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSWaitForThreadExit(XN_THREAD_HANDLE ThreadHandle, XnUInt32 nMilliseconds)
+{
+	int rc = 0;
+	
+	// Make sure the actual thread handle isn't NULL
+	XN_RET_IF_NULL(ThreadHandle, XN_STATUS_OS_INVALID_THREAD);
+	
+	if (nMilliseconds == XN_WAIT_INFINITE)
+	{
+		// join via the OS
+		void* pReturnValue;
+		rc = pthread_join(*ThreadHandle, &pReturnValue);
+	}
+	else
+	{
+		// calculate timeout absolute time. First we take current time
+		struct timespec time;
+		XnStatus nRetVal = xnOSGetAbsTimeout(&time, nMilliseconds);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			return XN_STATUS_OS_THREAD_TERMINATION_FAILED;
+		}
+		
+		// join via the OS
+		void* pReturnValue;
+#ifndef XN_PLATFORM_HAS_NO_TIMED_OPS
+		rc = pthread_timedjoin_np(*ThreadHandle, &pReturnValue, &time);
+#else
+		rc = pthread_join(*ThreadHandle, &pReturnValue);
+#endif
+	}
+
+	// check for failures
+	if (rc == ETIMEDOUT)
+	{
+		return (XN_STATUS_OS_THREAD_TIMEOUT);
+	}
+	else if (rc != 0)
+	{
+		return (XN_STATUS_OS_THREAD_TERMINATION_FAILED);
+	}
+	
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSetThreadPriority(XN_THREAD_HANDLE ThreadHandle, XnThreadPriority nPriority)
+{
+	// Make sure the actual thread handle isn't NULL
+	XN_RET_IF_NULL(ThreadHandle, XN_STATUS_OS_INVALID_THREAD);
+
+	int nPolicy = 0;
+	sched_param param;
+	int rc = 0;
+	
+	if (nPriority == XN_PRIORITY_CRITICAL)
+	{
+		memset(&param, 0, sizeof(param));
+	
+#ifndef XN_PLATFORM_HAS_NO_SCHED_PARAM
+		param.__sched_priority = 5;
+#endif
+		nPolicy = SCHED_RR;
+	}
+	else
+	{
+		return (XN_STATUS_OS_THREAD_UNSUPPORTED_PRIORITY);
+	}
+	
+	rc = pthread_setschedparam(*ThreadHandle, nPolicy, &param);
+	if (rc != 0)
+	{
+		xnLogWarning(XN_MASK_OS, "Failed to set thread priority (%d)", errno);
+		return (XN_STATUS_OS_THREAD_SET_PRIORITY_FAILED);
+	}
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetCurrentThreadID(XN_THREAD_ID* pThreadID)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_OUTPUT_PTR(pThreadID);
+
+	// Get the current thread id
+	*pThreadID = pthread_self();
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
diff --git a/Source/OpenNI/Linux/LinuxTime.cpp b/Source/OpenNI/Linux/LinuxTime.cpp
new file mode 100644
index 0000000..e0f7e72
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxTime.cpp
@@ -0,0 +1,189 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+
+//---------------------------------------------------------------------------
+// Global Variables
+//---------------------------------------------------------------------------
+XnOSTimer g_xnOSHighResGlobalTimer;
+
+//---------------------------------------------------------------------------
+// Macros
+//---------------------------------------------------------------------------
+/* Translates from struct timespec to microseconds. */
+#define TIMESPEC_TO_MICRO_SECS(ts)	(ts.tv_sec * 1000000 + ts.tv_nsec / 1000)
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API XnStatus xnOSGetEpochTime(XnUInt32* nEpochTime)
+{
+	// Local function variables
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	*nEpochTime = (XnUInt32)time(NULL);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetTimeStamp(XnUInt64* nTimeStamp)
+{
+	// Local function variables
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// Get the high resolution global timer value
+	nRetVal = xnOSGetHighResTimeStamp(nTimeStamp);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// Convert from microseconds to milliseconds
+	*nTimeStamp /= 1000;
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetHighResTimeStamp(XnUInt64* nTimeStamp)
+{
+	// Local function variables
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// TODO: Check if the core subsystem is initialized
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_OUTPUT_PTR(nTimeStamp);
+
+	// Get the high resolution global timer value
+	nRetVal = xnOSQueryTimer(g_xnOSHighResGlobalTimer, nTimeStamp);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSSleep(XnUInt32 nMilliseconds)
+{
+	// Sleep via the OS (function needs time in microseconds)
+	usleep(nMilliseconds*1000);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSStartTimer(XnOSTimer* pTimer)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pTimer);
+	
+	if (XN_STATUS_OK != xnOSGetMonoTime(&pTimer->tStartTime))
+	{
+		return XN_STATUS_OS_TIMER_QUERY_FAILED;
+	}
+	
+	pTimer->bHighRes = false;
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnOSStartHighResTimer(XnOSTimer* pTimer)
+{
+	// start a normal timer
+	XnStatus nRetVal = xnOSStartTimer(pTimer);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	// now make it high-res
+	pTimer->bHighRes = true;
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnOSQueryTimer(XnOSTimer Timer, XnUInt64* pnTimeSinceStart)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_OUTPUT_PTR(pnTimeSinceStart);
+
+	struct timespec now;
+	
+	if (XN_STATUS_OK != xnOSGetMonoTime(&now))
+	{
+		return XN_STATUS_OS_TIMER_QUERY_FAILED;
+	}
+	
+	*pnTimeSinceStart = ((now.tv_sec - Timer.tStartTime.tv_sec) * 1E6 + (now.tv_nsec - Timer.tStartTime.tv_nsec) / 1E3);
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnOSStopTimer(XnOSTimer* pTimer)
+{
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(pTimer);
+
+	memset(pTimer, 0, sizeof(XnOSTimer));
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetMonoTime(struct timespec* pTime)
+{
+#ifndef XN_PLATFORM_HAS_NO_CLOCK_GETTIME
+	if (0 != clock_gettime(CLOCK_REALTIME, pTime))
+	{
+		return (XN_STATUS_OS_EVENT_WAIT_FAILED);
+	}
+#else
+	struct timeval tv;
+	gettimeofday(&tv, NULL);
+	pTime->tv_sec = tv.tv_sec;
+	pTime->tv_nsec = tv.tv_usec * 1000;  
+#endif
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetTimeout(struct timespec* pTime, XnUInt32 nMilliseconds)
+{
+	pTime->tv_sec = (nMilliseconds / 1000);
+	pTime->tv_nsec = ((nMilliseconds % 1000) * 1000000);
+
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnOSGetAbsTimeout(struct timespec* pTime, XnUInt32 nMilliseconds)
+{
+	XnStatus nRetVal = xnOSGetMonoTime(pTime);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	pTime->tv_sec += (nMilliseconds / 1000);
+	pTime->tv_nsec += ((nMilliseconds % 1000) * 1000000);
+
+	if (pTime->tv_nsec >= 1000000000)
+	{
+		pTime->tv_nsec -= 1000000000;
+		pTime->tv_sec++;
+	}
+	
+	return XN_STATUS_OK;
+}
diff --git a/Source/OpenNI/Linux/LinuxUSBDevice.cpp b/Source/OpenNI/Linux/LinuxUSBDevice.cpp
new file mode 100644
index 0000000..a9da2ee
--- /dev/null
+++ b/Source/OpenNI/Linux/LinuxUSBDevice.cpp
@@ -0,0 +1,1012 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnPlatform.h>
+
+#if (XN_PLATFORM == XN_PLATFORM_LINUX_ARM)
+
+#include <XnUSBDevice.h>
+#include <linux/usb/gadgetfs.h>
+#include <asm/byteorder.h>
+#include <poll.h>
+#include <errno.h>
+#include <XnLog.h>
+#include <XnOSCpp.h>
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define GADGET_DEVICE_DIR "/dev/gadget/"
+#define GADGET_DEVICE_FILE_NAME "musb_hdrc"
+#define GADGET_DEVICE_FILE_PATH GADGET_DEVICE_DIR GADGET_DEVICE_FILE_NAME
+#define USB_LANGUAGE_ENGLISH_US 0x0409
+#define XN_USB_DEVICE_ENDPOINT_MAX_COUNT 16
+#define XN_USB_CONTROL_TIMEOUT 5000
+#define XN_USB_WRITE_DATA_TIMEOUT 2000
+
+//---------------------------------------------------------------------------
+// Macros
+//---------------------------------------------------------------------------
+#define WRITE_TO_BUF(buf, data, size)	\
+	memcpy(buf, data, size);			\
+	buf += size;
+
+#define WRITE_OBJ_TO_BUF(buf, obj)		\
+	WRITE_TO_BUF(buf, &obj, sizeof(obj));
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+typedef enum
+{
+	/** Control is idle **/
+	DEVICE_CONTROL_CLEAR,
+	/** Control request was received **/
+	DEVICE_CONTROL_REQUEST_RECEIVED,
+	/** Control request was read by device, no reply yet **/
+	DEVICE_CONTROL_REQUEST_READ,
+	/** Control reply received, waiting for host in-request **/
+	DEVICE_CONTROL_REPLY_READY,
+} DeviceControlState;
+
+typedef enum
+{
+	/** Control is idle **/
+	HOST_CONTROL_CLEAR,
+	/** Control request was received **/
+	HOST_CONTROL_REQUEST_RECEIVED,
+	/** Control in-request was received, waiting for device to have reply **/
+	HOST_CONTROL_WAITING_FOR_REPLY,
+} HostControlState;
+
+struct XnUSBDevice
+{
+	const XnUSBDeviceDescriptorHolder* pDescriptors;
+	int deviceFD;
+	XnBool bShutdown;
+	XN_THREAD_HANDLE hThread;
+	XN_CRITICAL_SECTION_HANDLE hLock;
+	XN_EVENT_HANDLE hReplyEvent;
+	XnBool bConnected;
+	enum usb_device_speed speed;
+	XnUInt32 nControlMessageMaxSize;
+	XnUInt8 nConfigID;
+	XnUInt8 nInterfaceID;
+	XnUInt8 nAltInterfaceID;
+	int endpointsFDs[XN_USB_DEVICE_ENDPOINT_MAX_COUNT];
+
+	// all control members should be accessed with a lock. They can be modified either from the user thread
+	// or the ep0 thread.
+	DeviceControlState eDeviceControlState;
+	HostControlState eHostControlState;
+	XnUChar* pControlBuffer;
+	XnUInt32 nControlSize;
+	XnUSBDeviceNewControlRequestCallback pNewControlRequestCallback;
+	void* pNewControlRequestCallbackCookie;
+};
+
+//---------------------------------------------------------------------------
+// Configuring GadgetFS Device
+//---------------------------------------------------------------------------
+static XnStatus buildGadgetFSInterfaceDescriptor(const XnUSBInterfaceDescriptorHolder* pInterface, XnChar*& buf)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// write interface descriptor
+	WRITE_OBJ_TO_BUF(buf, pInterface->descriptor);
+	
+	// now write each endpoint
+	for (__u8 iEP = 0; iEP < pInterface->descriptor.bNumEndpoints; ++iEP)
+	{
+		WRITE_TO_BUF(buf, pInterface->aEndpoints[iEP], USB_DT_ENDPOINT_SIZE);
+	}
+	
+	return XN_STATUS_OK;	
+}
+
+static XnStatus buildGadgetFSConfigDescriptor(const XnUSBConfigDescriptorHolder* pConfig, XnChar*& buf)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	struct usb_config_descriptor* pTarget = (struct usb_config_descriptor*)buf;
+
+	// write configuration descriptor
+	WRITE_OBJ_TO_BUF(buf, pConfig->descriptor);
+	
+	// for now, gadget FS supports a single interface
+	if (pConfig->descriptor.bNumInterfaces > 1)
+	{
+		xnLogError(XN_MASK_OS, "GadgetFS does not support more than 1 interface!");
+		return XN_STATUS_INVALID_OPERATION;
+	}
+
+	// now write the interface
+	buildGadgetFSInterfaceDescriptor(pConfig->aInterfaces[0], buf);
+	
+	pTarget->wTotalLength = buf - (XnChar*)pTarget;
+	
+	return XN_STATUS_OK;	
+}
+
+static XnStatus buildGadgetFSDescriptors(const XnUSBDeviceDescriptorHolder* pDescriptors, XnChar*& buf)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// write format ID
+	XnUInt32 nFormatID = 0;
+	WRITE_OBJ_TO_BUF(buf, nFormatID);
+	
+	// for now, gadget FS supports a single configuration
+	if (pDescriptors->descriptor.bNumConfigurations > 1)
+	{
+		xnLogError(XN_MASK_OS, "GadgetFS does not support more than 1 configuration!");
+		return XN_STATUS_INVALID_OPERATION;
+	}
+	
+	XN_VALIDATE_INPUT_PTR(pDescriptors->aConfigurations);
+	XN_VALIDATE_INPUT_PTR(pDescriptors->aConfigurations[0]);
+	
+	// we first write the full-speed one (backwards compatibility) and then the high-speed one
+	buildGadgetFSConfigDescriptor(pDescriptors->aConfigurations[0], buf);
+	buildGadgetFSConfigDescriptor(pDescriptors->aConfigurations[0], buf);
+	
+	// write device
+	WRITE_OBJ_TO_BUF(buf, pDescriptors->descriptor);
+}
+
+//---------------------------------------------------------------------------
+// Configuring GadgetFS Endpoints
+//---------------------------------------------------------------------------
+static int openEndpointFile(struct usb_endpoint_descriptor* pDesc)
+{
+	// build file name
+	XnChar fileName[255];
+	bool bIn = (pDesc->bEndpointAddress & 0x80) != 0;
+	sprintf(fileName, "%s%s%d%s", GADGET_DEVICE_DIR, "ep", pDesc->bEndpointAddress & 0xF, bIn ? "in" : "out");
+	
+	// open it
+	int fd = open(fileName, O_RDWR);
+	
+	// config it
+	XnUChar bufConfig[1024];
+	XnUChar* buf = bufConfig;
+	
+	XnUInt32 nFormatID = 1;
+	WRITE_OBJ_TO_BUF(buf, nFormatID);
+	
+	// now we should write the full-speed descriptor. Take high-speed one and reduce speed
+	struct usb_endpoint_descriptor* pFSDesc = (struct usb_endpoint_descriptor*)buf;
+	WRITE_TO_BUF(buf, pDesc, USB_DT_ENDPOINT_SIZE);
+	
+	// now write the real one (high-speed)
+	WRITE_TO_BUF(buf, pDesc, USB_DT_ENDPOINT_SIZE);
+	
+	int status = write(fd, bufConfig, buf - bufConfig);
+	if (status < 0)
+	{
+		xnLogError(XN_MASK_OS, "Failed to write endpoint descriptors (%d - %s)\n", errno, strerror(errno));
+		close (fd);
+		return -1;
+	}
+	
+	return fd;
+}
+
+static XnBool configureEndpoints(XnUSBDevice* pDevice, int nConfigID)
+{
+	// first of all, we need to close all previous open endpoints
+	for (int i = 0; i < XN_USB_DEVICE_ENDPOINT_MAX_COUNT; ++i)
+	{
+		if (pDevice->endpointsFDs[i] != -1)
+		{
+			close(pDevice->endpointsFDs[i]);
+			pDevice->endpointsFDs[i] = -1;
+		}
+	}
+	
+	if (nConfigID == 0)
+	{
+		// device is unconfigured
+		return TRUE;
+	}
+
+	// open endpoint files
+	XnUSBInterfaceDescriptorHolder* pInterface = pDevice->pDescriptors->aConfigurations[0]->aInterfaces[0];
+	for (int i = 0; i < pInterface->descriptor.bNumEndpoints; ++i)
+	{
+		__u8 nAddress = pInterface->aEndpoints[i]->bEndpointAddress & 0xF;
+		pDevice->endpointsFDs[nAddress] = openEndpointFile(pInterface->aEndpoints[i]);
+		if (pDevice->endpointsFDs[nAddress] == -1)
+		{
+			return FALSE;
+		}
+	}
+	
+	return TRUE;
+}
+
+//---------------------------------------------------------------------------
+// EP0 Handling
+//---------------------------------------------------------------------------
+static XnBool handleVendorControl(XnUSBDevice* pDevice, struct usb_ctrlrequest *setup);
+
+static inline void put_unaligned_le16(__u16 val, __u16 *cp)
+{
+	__u8	*p = (__u8 *)cp;
+
+	*p++ = (__u8) val;
+	*p++ = (__u8) (val >> 8);
+}
+
+static int utf8_to_utf16le(const char *s, __u16 *cp, unsigned len)
+{
+	int	count = 0;
+	__u8	c;
+	__u16	uchar;
+
+	/* this insists on correct encodings, though not minimal ones.
+	 * BUT it currently rejects legit 4-byte UTF-8 code points,
+	 * which need surrogate pairs.  (Unicode 3.1 can use them.)
+	 */
+	while (len != 0 && (c = (__u8) *s++) != 0) {
+		if (c & 0x80) {
+			// 2-byte sequence:
+			// 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx
+			if ((c & 0xe0) == 0xc0) {
+				uchar = (c & 0x1f) << 6;
+
+				c = (__u8) *s++;
+				if ((c & 0xc0) != 0xc0)
+					goto fail;
+				c &= 0x3f;
+				uchar |= c;
+
+			// 3-byte sequence (most CJKV characters):
+			// zzzzyyyyyyxxxxxx = 1110zzzz 10yyyyyy 10xxxxxx
+			} else if ((c & 0xf0) == 0xe0) {
+				uchar = (c & 0x0f) << 12;
+
+				c = (__u8) *s++;
+				if ((c & 0xc0) != 0xc0)
+					goto fail;
+				c &= 0x3f;
+				uchar |= c << 6;
+
+				c = (__u8) *s++;
+				if ((c & 0xc0) != 0xc0)
+					goto fail;
+				c &= 0x3f;
+				uchar |= c;
+
+				/* no bogus surrogates */
+				if (0xd800 <= uchar && uchar <= 0xdfff)
+					goto fail;
+
+			// 4-byte sequence (surrogate pairs, currently rare):
+			// 11101110wwwwzzzzyy + 110111yyyyxxxxxx
+			//     = 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx
+			// (uuuuu = wwww + 1)
+			// FIXME accept the surrogate code points (only)
+
+			} else
+				goto fail;
+		} else
+			uchar = c;
+		put_unaligned_le16 (uchar, cp++);
+		count++;
+		len--;
+	}
+	return count;
+fail:
+	return -1;
+}
+
+static XnBool handleGetStringDescriptor(XnUSBDevice* pDevice, __u16 nMaxLength, __u16 lang, __u8 nIndex)
+{
+	if (nIndex != 0 && lang != USB_LANGUAGE_ENGLISH_US)
+	{
+		return FALSE;
+	}
+	
+	XnUChar buf[256];
+	
+	// descriptor 0 has the language id
+	if (nIndex == 0)
+	{
+		buf [0] = 4;
+		buf [1] = USB_DT_STRING;
+		*(__u16*)&buf[2] = __cpu_to_le16(USB_LANGUAGE_ENGLISH_US);
+	}
+	else
+	{
+		// look for index
+		const XnChar* strString = NULL;
+		
+		for (__u8 i = 0; i < pDevice->pDescriptors->nStrings; ++i)
+		{
+			if (pDevice->pDescriptors->aStrings[i].nID == nIndex)
+			{
+				strString = pDevice->pDescriptors->aStrings[i].strString;
+				break;
+			}
+		}
+		
+		if (strString == NULL)
+		{
+			return FALSE;
+		}
+		
+		int len = strlen(strString);
+		len = XN_MIN(len, 126);
+		
+		// zero all bytes
+		memset(buf+2, 0, 2*len);
+		len = utf8_to_utf16le(strString, (__u16 *)&buf[2], len);
+		if (len < 0)
+		{
+			return FALSE;
+		}
+		buf [0] = (len + 1) * 2;
+		buf [1] = USB_DT_STRING;
+	}
+	
+	XnUInt32 nReplySize = XN_MIN(buf[0], nMaxLength);
+	int status = write(pDevice->deviceFD, buf, nReplySize);
+	if (status < 0)
+	{
+		if (errno == EIDRM)
+			fprintf (stderr, "string timeout\n");
+		else
+			perror ("write string data");
+	}
+	else if (status != nReplySize)
+	{
+		fprintf (stderr, "short string write, %d\n", status);
+	}
+
+	return TRUE;
+}
+
+static XnBool handleChapter9Requests(XnUSBDevice* pDevice, struct usb_ctrlrequest *setup)
+{
+	__u16 value = __le16_to_cpu(setup->wValue);
+	__u16 index = __le16_to_cpu(setup->wIndex);
+	__u16 length = __le16_to_cpu(setup->wLength);
+	
+	switch (setup->bRequest)
+	{
+	case USB_REQ_GET_DESCRIPTOR:
+		{
+			if (setup->bRequestType != USB_DIR_IN)
+			{
+				return FALSE;
+			}
+
+			if ((value >> 8) != USB_DT_STRING)
+			{
+				return FALSE;
+			}
+			
+			// index is language index and string index is last byte
+			return handleGetStringDescriptor(pDevice, length, index, value & 0xFF);
+		}
+		break;
+	case USB_REQ_SET_CONFIGURATION:
+		{
+			if (setup->bRequestType != USB_DIR_OUT)
+			{
+				return FALSE;
+			}
+			
+			__u8 nConfigID = value;
+
+			// make sure this is the only supported configuration
+			if (nConfigID != 0 && nConfigID != pDevice->pDescriptors->aConfigurations[0]->descriptor.bConfigurationValue)
+			{
+				return FALSE;
+			}
+
+			if (!configureEndpoints(pDevice, value))
+			{
+				return FALSE;	
+			}
+			
+			pDevice->nConfigID = value;
+			
+			// send ACK
+			int status = read (pDevice->deviceFD, &status, 0);
+			if (status)
+				perror ("ack SET_CONFIGURATION");
+		}
+		break;
+	case USB_REQ_GET_INTERFACE:
+		{
+			if (setup->bRequestType != (USB_DIR_IN | USB_RECIP_INTERFACE) ||
+				index != pDevice->nInterfaceID ||
+				length > 1)
+			{
+				return FALSE;
+			}
+			
+			__u8 nAlt = pDevice->nAltInterfaceID;
+			int status = write(pDevice->deviceFD, &nAlt, 1);
+			if (status < 0)
+			{
+				if (errno == EIDRM)
+					fprintf (stderr, "GET_INTERFACE timeout\n");
+				else
+					perror ("write GET_INTERFACE data");
+			}
+			else if (status != length)
+			{
+				fprintf (stderr, "short GET_INTERFACE write, %d\n",
+					status);
+			}
+		}
+		break;
+	case USB_REQ_SET_INTERFACE:
+		{
+			__u16 nInt = index;
+			__u16 nAlt = value;
+			
+			if (setup->bRequestType != USB_RECIP_INTERFACE)
+			{
+				return FALSE;
+			}
+
+			// make sure this is the only interface
+			if (nInt != 0 || nAlt != 0)
+			{
+				return FALSE;
+			}
+		}
+		break;
+	default:
+		return FALSE;
+	}
+	
+	return TRUE;
+}
+
+static XnBool handleControl(XnUSBDevice* pDevice, struct usb_ctrlrequest *setup)
+{
+	if ((setup->bRequestType & USB_TYPE_MASK) == USB_TYPE_VENDOR)
+	{
+		return handleVendorControl(pDevice, setup);
+	}
+	else
+	{
+		// usb 2.0 spec ch9 requests
+		return handleChapter9Requests(pDevice, setup);
+	}
+}
+
+XN_THREAD_PROC xnUSBDeviceEndPoint0Handler(XN_THREAD_PARAM pThreadParam)
+{
+	XnUSBDevice* pDevice = (XnUSBDevice*)pThreadParam;
+
+	int status;
+
+	struct pollfd ep0_poll;
+	ep0_poll.fd = pDevice->deviceFD;
+	ep0_poll.events = POLLIN | POLLOUT | POLLHUP;
+	
+	while (!pDevice->bShutdown)
+	{
+		status = poll(&ep0_poll, 1, -1);
+		if (status < 0)
+		{
+			xnLogError(XN_MASK_OS, "Failed polling device file! (%d)", errno);
+			sleep(1);
+			continue;
+		}
+		
+		struct usb_gadgetfs_event event;
+		status = read(pDevice->deviceFD, &event, sizeof(event));
+		if (status < 0)
+		{
+			if (errno == EL2HLT)
+			{
+				// after previous disconnect
+				xnLogWarning(XN_MASK_OS, "Device was in level-2-halt. Continuing anyway...");
+				continue;
+			}
+			else if (errno != EAGAIN)
+			{
+				xnLogError(XN_MASK_OS, "Failed reading from device file! (%d)", errno);
+			}
+			
+			sleep (1);
+			continue;
+		}
+		
+		switch (event.type)
+		{
+		case GADGETFS_NOP:
+			break;
+		case GADGETFS_CONNECT:
+			pDevice->speed = event.u.speed;
+			pDevice->bConnected = TRUE;
+			break;
+		case GADGETFS_DISCONNECT:
+			pDevice->speed = USB_SPEED_UNKNOWN;
+			pDevice->bConnected = FALSE;
+			break;
+		case GADGETFS_SUSPEND:
+			break;
+		case GADGETFS_SETUP:
+			// setup stage
+			if (!handleControl(pDevice, &event.u.setup))
+			{
+				// stall is done by reading/writing in the wrong direction
+				if ((event.u.setup.bRequestType & USB_DIR_IN) != 0)
+					status = read (pDevice->deviceFD, &status, 0);
+				else
+					status = write (pDevice->deviceFD, &status, 0);
+					
+				if (status != -1)
+				{
+					//fprintf (stderr, "can't stall ep0 for %02x.%02x\n",
+					//	setup->bRequestType, setup->bRequest);
+				}
+				else if (errno != EL2HLT)
+				{
+					//perror ("ep0 stall");
+				}
+			}
+			break;
+		default:
+			xnLogWarning(XN_MASK_OS, "Got unknown gadgetfs event: %d", event.type);
+		}
+	}
+	
+	XN_THREAD_PROC_RETURN(XN_STATUS_OK);
+}
+
+//---------------------------------------------------------------------------
+// Init & Shutdown
+//---------------------------------------------------------------------------
+XN_C_API XnStatus XN_C_DECL xnUSBDeviceInit(const XnUSBDeviceDescriptorHolder* pDescriptors, XnUInt32 nControlMessageMaxSize, XnUSBDevice** ppDevice)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XN_VALIDATE_INPUT_PTR(pDescriptors);
+	XN_VALIDATE_OUTPUT_PTR(ppDevice);
+	
+	// open device file
+	int device_fd = open (GADGET_DEVICE_FILE_PATH, O_RDWR);
+	if (device_fd < 0)
+	{
+		xnLogWarning(XN_MASK_OS, "Failed opening %s (%d)", GADGET_DEVICE_FILE_PATH, errno);
+		return XN_STATUS_ERROR;
+	}
+	
+	// build descriptors buffer
+	XnChar bufDescriptors[4096];
+	XnUInt32 nBufSize = 4096;
+	XnChar* buf = bufDescriptors;
+	nRetVal = buildGadgetFSDescriptors(pDescriptors, buf);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	int status = write(device_fd, bufDescriptors, buf - bufDescriptors);
+	if (status < 0)
+	{
+		xnLogWarning(XN_MASK_OS, "Failed writing descriptor to device file (%d)", errno);
+		close (device_fd);
+		return XN_STATUS_ERROR;
+	}
+	else if (status != (buf - bufDescriptors))
+	{
+		xnLogWarning(XN_MASK_OS, "Failed writing descriptors to device file. Write %d, expected %d.", status, buf - bufDescriptors);
+		close (device_fd);
+		return XN_STATUS_ERROR;
+	}
+	
+	XnUSBDevice* pDevice = (XnUSBDevice*)xnOSCalloc(1, sizeof(XnUSBDevice));
+	if (pDevice == NULL)
+	{
+		xnLogError(XN_MASK_OS, "Failed to allocate USB Device");
+		close(device_fd);
+		return XN_STATUS_ALLOC_FAILED;
+	}
+
+	pDevice->deviceFD = device_fd;
+	for (int i = 0; i < XN_USB_DEVICE_ENDPOINT_MAX_COUNT; ++i)
+	{
+		pDevice->endpointsFDs[i] = -1;
+	}
+	pDevice->nControlMessageMaxSize = nControlMessageMaxSize;
+	pDevice->pDescriptors = pDescriptors;
+	pDevice->pControlBuffer = (XnUChar*)xnOSMallocAligned(nControlMessageMaxSize, XN_DEFAULT_MEM_ALIGN);
+
+	if (pDevice->pControlBuffer == NULL)
+	{
+		xnLogError(XN_MASK_OS, "Failed to allocate control buffer");
+		xnUSBDeviceShutdown(pDevice);
+		return XN_STATUS_ALLOC_FAILED;
+	}
+
+	nRetVal = xnOSCreateCriticalSection(&pDevice->hLock);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnLogError(XN_MASK_OS, "Failed to create device critical section: %s", xnGetStatusString(nRetVal));
+		xnUSBDeviceShutdown(pDevice);
+		return (nRetVal);
+	}
+	
+	nRetVal = xnOSCreateEvent(&pDevice->hReplyEvent, FALSE);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnLogError(XN_MASK_OS, "Failed to create device event: %s", xnGetStatusString(nRetVal));
+		xnUSBDeviceShutdown(pDevice);
+		return (nRetVal);
+	}
+	
+	nRetVal = xnOSCreateThread(xnUSBDeviceEndPoint0Handler, pDevice, &pDevice->hThread);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnLogError(XN_MASK_OS, "Failed to create endpoint handler thread: %s", xnGetStatusString(nRetVal));
+		xnUSBDeviceShutdown(pDevice);
+		return (nRetVal);
+	}
+	
+	*ppDevice = pDevice;
+	return XN_STATUS_OK;
+}
+
+XN_C_API void XN_C_DECL xnUSBDeviceShutdown(XnUSBDevice* pDevice)
+{
+	XN_ASSERT(pDevice != NULL);
+	
+	pDevice->bShutdown = TRUE;
+	
+	if (pDevice->hThread != NULL)
+	{
+		xnOSWaitAndTerminateThread(&pDevice->hThread, 10000);
+		pDevice->hThread = NULL;
+	}
+
+	if (pDevice->hLock != NULL)
+	{
+		xnOSCloseCriticalSection(&pDevice->hLock);
+		pDevice->hLock = NULL;
+	}
+
+	if (pDevice->hReplyEvent != NULL)
+	{
+		xnOSCloseEvent(&pDevice->hReplyEvent);
+		pDevice->hReplyEvent = NULL;
+	}
+
+	if (pDevice->pControlBuffer != NULL)
+	{
+		xnOSFreeAligned(pDevice->pControlBuffer);
+		pDevice->pControlBuffer = NULL;
+	}
+	
+	if (pDevice->deviceFD != -1)
+	{
+		close(pDevice->deviceFD);
+		pDevice->deviceFD = -1;
+	}
+
+	xnOSFree(pDevice);
+}
+
+//---------------------------------------------------------------------------
+// Handling Vendor Controls
+//---------------------------------------------------------------------------
+XN_C_API XnBool XN_C_DECL xnUSBDeviceIsControlRequestPending(XnUSBDevice* pDevice)
+{
+	XN_ASSERT(pDevice != NULL);
+	if (pDevice == NULL)
+		return FALSE;
+
+	XnAutoCSLocker locker(pDevice->hLock);
+	return (pDevice->eDeviceControlState == DEVICE_CONTROL_REQUEST_RECEIVED);
+}
+
+XN_C_API XnStatus XN_C_DECL xnUSBDeviceReceiveControlRequest(XnUSBDevice* pDevice, XnUChar* pBuffer, XnUInt32* pnRequestSize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XN_VALIDATE_INPUT_PTR(pDevice);
+	XN_VALIDATE_INPUT_PTR(pBuffer);
+	XN_VALIDATE_OUTPUT_PTR(pnRequestSize);
+	
+	XnAutoCSLocker locker(pDevice->hLock);
+	
+	if (pDevice->eDeviceControlState != DEVICE_CONTROL_REQUEST_RECEIVED)
+	{
+		return XN_STATUS_USB_NO_REQUEST_PENDING;
+	}
+
+	if (pDevice->nControlSize > *pnRequestSize)
+	{
+		return XN_STATUS_OUTPUT_BUFFER_OVERFLOW;
+	}
+
+	xnOSMemCopy(pBuffer, pDevice->pControlBuffer, pDevice->nControlSize);
+	*pnRequestSize = pDevice->nControlSize;
+	pDevice->eDeviceControlState = DEVICE_CONTROL_REQUEST_READ;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus XN_C_DECL xnUSBDeviceSendControlReply(XnUSBDevice* pDevice, const XnUChar* pBuffer, XnUInt32 nReplySize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XN_VALIDATE_INPUT_PTR(pDevice);
+	XN_VALIDATE_INPUT_PTR(pBuffer);
+	
+	XnAutoCSLocker locker(pDevice->hLock);
+	
+	if (pDevice->eDeviceControlState != DEVICE_CONTROL_REQUEST_READ)
+	{
+		xnLogError(XN_MASK_OS, "Device requested to send reply, but no request was received!");
+		return XN_STATUS_USB_NO_REQUEST_PENDING;
+	}
+	
+	switch (pDevice->eHostControlState)
+	{
+	case HOST_CONTROL_WAITING_FOR_REPLY:
+		{
+			// already got in control. we can write reply directly to USB
+			int status = write(pDevice->deviceFD, pBuffer, nReplySize);
+			if (status < 0)
+			{
+				xnLogError(XN_MASK_OS, "failed to send control reply (%d)!", errno);
+				return XN_STATUS_USB_CONTROL_SEND_FAILED;
+			}
+
+			pDevice->eDeviceControlState = DEVICE_CONTROL_CLEAR;
+			pDevice->eHostControlState = HOST_CONTROL_CLEAR;
+			
+			nRetVal = xnOSSetEvent(pDevice->hReplyEvent);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnLogWarning(XN_MASK_OS, "Failed to set control event: %s", xnGetStatusString(nRetVal));
+				// reply was sent, so no need to return an error
+			}
+
+			break;
+		}
+	case HOST_CONTROL_REQUEST_RECEIVED:
+		{
+			// no in control yet. keep the reply for later
+			xnOSMemCopy(pDevice->pControlBuffer, pBuffer, nReplySize);
+			pDevice->nControlSize = nReplySize;
+			pDevice->eDeviceControlState = DEVICE_CONTROL_REPLY_READY;
+			break;
+		}
+	default:
+		xnLogError(XN_MASK_OS, "Bad host state: %d", pDevice->eHostControlState);
+		return XN_STATUS_USB_NO_REQUEST_PENDING;
+	}
+
+	return (XN_STATUS_OK);
+}
+
+static XnBool handleVendorControl(XnUSBDevice* pDevice, struct usb_ctrlrequest *setup)
+{
+	__u16 length = __le16_to_cpu(setup->wLength);
+
+	XnBool bHostRequest = (setup->bRequestType & USB_DIR_IN) ? 0 : 1;
+
+	if (bHostRequest)
+	{
+		// read data stage
+		if (length == 0)
+		{
+			xnLogError(XN_MASK_OS, "Got a control message with size 0!");
+			return FALSE;
+		}
+
+		if (length > pDevice->nControlMessageMaxSize)
+		{
+			xnLogError(XN_MASK_OS, "Got a control message bigger than max allowed size!");
+			return FALSE;
+		}
+
+		XnAutoCSLocker locker(pDevice->hLock);
+		if (pDevice->eDeviceControlState != DEVICE_CONTROL_CLEAR)
+		{
+			xnLogError(XN_MASK_OS, "Got a control request before previous one was replied!");
+			return FALSE;
+		}
+
+		// read the data
+		int status = read(pDevice->deviceFD, pDevice->pControlBuffer, length);
+		if (status < 0)
+		{
+			if (errno == EIDRM)
+			{
+				xnLogWarning(XN_MASK_OS, "control request was aborted. Ignoring it...");
+				return TRUE;
+			}
+			else if (errno == ECANCELED)
+			{
+				xnLogWarning(XN_MASK_OS, "control request was canceled. Ignoring it...");
+				return TRUE;
+			}
+			else
+			{
+				xnLogError(XN_MASK_OS, "Got a control request but failed to read its data (length was %u, errorcode is %d)!", length, errno);
+				return FALSE;
+			}
+		}
+		
+		pDevice->nControlSize = length;
+		pDevice->eDeviceControlState = DEVICE_CONTROL_REQUEST_RECEIVED;
+		pDevice->eHostControlState = HOST_CONTROL_REQUEST_RECEIVED;
+
+		// raise callback
+		if (pDevice->pNewControlRequestCallback != NULL)
+		{
+			pDevice->pNewControlRequestCallback(pDevice, pDevice->pNewControlRequestCallbackCookie);
+		}
+	}
+	else
+	{
+		// host requests to read.
+		XnAutoCSLocker locker(pDevice->hLock);
+		
+		if (pDevice->eHostControlState != HOST_CONTROL_REQUEST_RECEIVED)
+		{
+			xnLogError(XN_MASK_OS, "Host asks for reply, but no request was received!");
+			return FALSE;
+		}
+		
+		switch (pDevice->eDeviceControlState)
+		{
+		case DEVICE_CONTROL_REPLY_READY:
+			{
+				// reply is waiting to be send. send it now
+				int status = write(pDevice->deviceFD, pDevice->pControlBuffer, pDevice->nControlSize);
+				if (status < 0)
+				{
+					return FALSE;
+				}
+				pDevice->eDeviceControlState = DEVICE_CONTROL_CLEAR;
+				pDevice->eHostControlState = HOST_CONTROL_CLEAR;
+				break;
+			}
+		case DEVICE_CONTROL_REQUEST_RECEIVED:
+		case DEVICE_CONTROL_REQUEST_READ:
+			{
+				// no reply yet. mark that we got the in control
+				pDevice->eHostControlState = HOST_CONTROL_WAITING_FOR_REPLY;
+
+				// we must not read any more events until a reply is made. Wait.
+				locker.Unlock();
+				if (xnOSWaitEvent(pDevice->hReplyEvent, XN_USB_CONTROL_TIMEOUT) == XN_STATUS_OS_EVENT_TIMEOUT)
+				{
+					xnLogError(XN_MASK_OS, "control command did not finish in %u milliseconds!", XN_USB_CONTROL_TIMEOUT);
+					// clear request (it was timed out)
+					pDevice->eHostControlState = HOST_CONTROL_CLEAR;
+					pDevice->eDeviceControlState = DEVICE_CONTROL_CLEAR;
+					return FALSE;
+				}
+
+				break;
+			}
+		default:
+			// bad state
+			xnLogError(XN_MASK_OS, "Bad device state: %d", pDevice->eDeviceControlState);
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
+
+XN_C_API XnStatus XN_C_DECL xnUSBDeviceSetNewControlRequestCallback(XnUSBDevice* pDevice, XnUSBDeviceNewControlRequestCallback pFunc, void* pCookie)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XN_VALIDATE_INPUT_PTR(pDevice);
+	
+	XnAutoCSLocker locker(pDevice->hLock);
+	
+	pDevice->pNewControlRequestCallback = pFunc;
+	pDevice->pNewControlRequestCallbackCookie = pCookie;
+	
+	return XN_STATUS_OK;
+}
+
+//---------------------------------------------------------------------------
+// Writing Data
+//---------------------------------------------------------------------------
+
+#include <aio.h>
+
+XN_C_API XnStatus XN_C_DECL xnUSBDeviceWriteEndpoint(XnUSBDevice* pDevice, XnUInt8 nEndpointID, const XnUChar* pData, XnUInt32 nDataSize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XN_VALIDATE_INPUT_PTR(pDevice);
+	XN_VALIDATE_INPUT_PTR(pData);
+	
+	if ((nEndpointID & 0x7F) >= XN_USB_DEVICE_ENDPOINT_MAX_COUNT)
+	{
+		xnLogError(XN_MASK_OS, "Got bad endpoint ID: 0x%X", nEndpointID);
+		XN_ASSERT(FALSE);
+		return XN_STATUS_BAD_PARAM;
+	}
+
+	__u8 nIndex = nEndpointID & 0x0F;
+	
+	// Do the write in asynch IO (otherwise if no client is reading, it will block forever)
+	struct aiocb cb;
+	xnOSMemSet(&cb, 0, sizeof(cb));
+	cb.aio_fildes = pDevice->endpointsFDs[nIndex];
+	cb.aio_buf = (void*)pData;
+	cb.aio_nbytes = nDataSize;
+	
+	int status = aio_write(&cb);
+	if (status < 0)
+	{
+		xnLogWarning(XN_MASK_OS, "Failed to start asynch write! (%d)", errno);
+		return XN_STATUS_USB_ENDPOINT_WRITE_FAILED;
+	}
+	
+	XnUInt64 nStart;
+	XnUInt64 nNow;
+	xnOSGetHighResTimeStamp(&nStart);
+	
+	while (TRUE)
+	{
+		status = aio_error(&cb);
+		if (status == EINPROGRESS)
+		{
+			xnOSGetHighResTimeStamp(&nNow);
+			if ((nNow - nStart) > XN_USB_WRITE_DATA_TIMEOUT*1000)
+			{
+				xnLogWarning(XN_MASK_OS, "Timeout sending data (client not reading?)", errno);
+				// try to cancel write
+				aio_cancel(pDevice->endpointsFDs[nIndex], &cb);
+				return XN_STATUS_USB_ENDPOINT_WRITE_FAILED;
+			}
+			else
+			{
+				// sleep some time and try again
+				xnOSSleep(1);
+			}
+		}
+		else if (status == 0)
+		{
+			return XN_STATUS_OK;
+		}
+		else
+		{
+			xnLogWarning(XN_MASK_OS, "Failed to write data! (%d)", errno);
+			return XN_STATUS_USB_ENDPOINT_WRITE_FAILED;
+		}
+	}
+	
+	return XN_STATUS_OK;
+}
+
+#endif // XN_PLATFORM == XN_PLATFORM_LINUX_ARM
diff --git a/Source/OpenNI/Linux/XnUSBLinux.cpp b/Source/OpenNI/Linux/XnUSBLinux.cpp
new file mode 100644
index 0000000..025b57b
--- /dev/null
+++ b/Source/OpenNI/Linux/XnUSBLinux.cpp
@@ -0,0 +1,1332 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnUSB.h>
+
+#if (XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
+#include <libusb.h>
+#else
+#include <libusb-1.0/libusb.h>
+#endif
+
+#include "XnUSBLinux.h"
+#include "../XnUSBInternal.h"
+#include <XnOS.h>
+#include <XnLog.h>
+#include <XnOSCpp.h>
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define MAX_DEVPATH_LENGTH 256
+#define USB_TYPE_STANDARD		(0x00 << 5)
+#define USB_TYPE_CLASS			(0x01 << 5)
+#define USB_TYPE_VENDOR			(0x02 << 5)
+#define USB_ENDPOINT_IN			0x80
+
+#define XN_MASK_USB "xnUSB"
+
+#define XN_USB_HANDLE_EVENTS_TIMEOUT 1000
+
+#define XN_VALIDATE_DEVICE_HANDLE(x)					\
+	if (x == NULL)									\
+		return (XN_STATUS_USB_DEVICE_NOT_VALID);
+		
+#define XN_VALIDATE_EP_HANDLE(x)						\
+	if (x == NULL)									\
+		return (XN_STATUS_USB_ENDPOINT_NOT_VALID);
+
+struct xnUSBInitData
+{
+	libusb_context* pContext;
+	XN_THREAD_HANDLE hThread;
+	XnBool bShouldThreadRun;
+	XnUInt32 nThreads;
+	XN_CRITICAL_SECTION_HANDLE hLock;
+} g_InitData = {NULL, NULL, FALSE, 0, NULL};
+
+XnStatus xnUSBPlatformSpecificShutdown();
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_THREAD_PROC xnUSBHandleEventsThread(XN_THREAD_PARAM pThreadParam)
+{
+	// init timeout
+	struct timeval timeout;
+	timeout.tv_sec = XN_USB_HANDLE_EVENTS_TIMEOUT / 1000;
+	timeout.tv_usec = XN_USB_HANDLE_EVENTS_TIMEOUT % 1000;
+	
+	while (g_InitData.bShouldThreadRun)
+	{
+		// let libusb process its asynchronous events
+		libusb_handle_events_timeout(g_InitData.pContext, &timeout);
+	}
+	
+	XN_THREAD_PROC_RETURN(XN_STATUS_OK);
+}
+
+XnStatus xnUSBPlatformSpecificInit()
+{
+	xnLogVerbose(XN_MASK_USB, "Initializing USB...");
+
+	// initialize the library
+	int rc = libusb_init(&g_InitData.pContext);
+	if (rc != 0)
+	{
+		return (XN_STATUS_USB_INIT_FAILED);
+	}
+
+	XnStatus nRetVal = xnOSCreateCriticalSection(&g_InitData.hLock);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	//libusb_set_debug(g_InitData.pContext, 3);
+	
+	xnLogInfo(XN_MASK_USB, "USB is initialized.");
+	return (XN_STATUS_OK);	
+}
+
+XnStatus xnUSBAsynchThreadAddRef()
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnAutoCSLocker locker(g_InitData.hLock);
+
+	++g_InitData.nThreads;
+	
+	if (g_InitData.hThread == NULL)
+	{
+		xnLogVerbose(XN_MASK_USB, "Starting libusb asynch thread...");
+		
+		// mark thread should run
+		g_InitData.bShouldThreadRun = TRUE;
+		
+		// and start thread
+		nRetVal = xnOSCreateThread(xnUSBHandleEventsThread, NULL, &g_InitData.hThread);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			// clean-up
+			xnUSBPlatformSpecificShutdown();
+			return nRetVal;
+		}
+
+		// set thread priority to critical
+		nRetVal = xnOSSetThreadPriority(g_InitData.hThread, XN_PRIORITY_CRITICAL);
+		if (nRetVal != 0)
+		{
+			xnLogWarning(XN_MASK_USB, "USB events thread: Failed to set thread priority to critical. This might cause loss of data...");
+			printf("Warning: USB events thread - failed to set priority. This might cause loss of data...\n");
+		}
+	}
+	
+	return (XN_STATUS_OK);	
+}
+
+void xnUSBAsynchThreadStop()
+{
+	if (g_InitData.hThread != NULL)
+	{
+		// mark for thread to exit
+		g_InitData.bShouldThreadRun = FALSE;
+		
+		// wait for it to exit
+		XnStatus nRetVal = xnOSWaitForThreadExit(g_InitData.hThread, XN_USB_HANDLE_EVENTS_TIMEOUT);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnOSTerminateThread(&g_InitData.hThread);
+		}
+		else
+		{
+			xnOSCloseThread(&g_InitData.hThread);
+		}
+		
+		g_InitData.hThread = NULL;
+	}
+}
+
+void xnUSBAsynchThreadRelease()
+{
+	XnAutoCSLocker locker(g_InitData.hLock);
+
+	--g_InitData.nThreads;
+
+	if (g_InitData.nThreads == 0)
+	{
+		xnUSBAsynchThreadStop();
+	}
+}
+
+XnStatus xnUSBPlatformSpecificShutdown()
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	xnUSBAsynchThreadStop();
+
+	if (g_InitData.hLock != NULL)
+	{
+		xnOSCloseCriticalSection(&g_InitData.hLock);
+		g_InitData.hLock = NULL;
+	}
+	
+	if (g_InitData.pContext != NULL)
+	{
+		// close the library
+		libusb_exit(g_InitData.pContext);
+		g_InitData.pContext = NULL;
+	}
+	
+	return (XN_STATUS_OK);
+}
+
+/*
+* Finds a USB device.
+* the returned device must be unreferenced when it is no longer needed using libusb_unref_device.
+*/
+XnStatus FindDevice(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, libusb_device** ppDevice)
+{
+	*ppDevice = NULL;
+
+	// get device list
+	libusb_device** ppDevices;
+	ssize_t nDeviceCount = libusb_get_device_list(g_InitData.pContext, &ppDevices);
+	
+	// check for error
+	if (nDeviceCount < 0)
+	{
+		return (XN_STATUS_USB_ENUMERATE_FAILED);
+	}
+	
+	// enumerate over the devices
+	for (ssize_t i = 0; i < nDeviceCount; ++i)
+	{
+		libusb_device* pDevice = ppDevices[i];
+		
+		// get device descriptor
+		libusb_device_descriptor desc;
+		int rc = libusb_get_device_descriptor(pDevice, &desc);
+		if (rc != 0)
+		{
+			return (XN_STATUS_USB_ENUMERATE_FAILED);
+		}
+		
+		// check if this is the requested device
+		if (desc.idVendor == nVendorID && desc.idProduct == nProductID)
+		{
+			// add a reference to the device (so it won't be destroyed when list is freed)
+			libusb_ref_device(pDevice);
+			*ppDevice = pDevice;
+			break;
+		}
+	}
+	
+	// free the list (also dereference each device)
+	libusb_free_device_list(ppDevices, 1);
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBIsDevicePresent(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, XnBool* pbDevicePresent)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// make sure library was initialized
+	XN_VALIDATE_USB_INIT();
+	
+	// Validate parameters
+	XN_VALIDATE_OUTPUT_PTR(pbDevicePresent);
+
+	*pbDevicePresent = FALSE;
+	
+	libusb_device* pDevice;
+	nRetVal = FindDevice(nVendorID, nProductID, pExtraParam, &pDevice);
+	XN_IS_STATUS_OK(nRetVal);
+		
+	if (pDevice != NULL)
+	{
+		*pbDevicePresent = TRUE;
+		
+		// unref device
+		libusb_unref_device(pDevice);
+	}
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBEnumerateDevices(XnUInt16 nVendorID, XnUInt16 nProductID, const XnUSBConnectionString** pastrDevicePaths, XnUInt32* pnCount)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// get device list
+	libusb_device** ppDevices;
+	ssize_t nDeviceCount = libusb_get_device_list(g_InitData.pContext, &ppDevices);
+	
+	// first enumeration - count
+	XnUInt32 nCount = 0;
+	
+	for (ssize_t i = 0; i < nDeviceCount; ++i)
+	{
+		libusb_device* pDevice = ppDevices[i];
+		
+		// get device descriptor
+		libusb_device_descriptor desc;
+		int rc = libusb_get_device_descriptor(pDevice, &desc);
+		if (rc != 0)
+		{
+			libusb_free_device_list(ppDevices, 1);
+			return (XN_STATUS_USB_ENUMERATE_FAILED);
+		}
+		
+		// check if this is the requested device
+		if (desc.idVendor == nVendorID && desc.idProduct == nProductID)
+		{
+			++nCount;
+		}
+	}
+	
+	// allocate array
+	XnUSBConnectionString* aResult = (XnUSBConnectionString*)xnOSCalloc(nCount, sizeof(XnUSBConnectionString));
+	if (aResult == NULL)
+	{
+		libusb_free_device_list(ppDevices, 1);
+		return XN_STATUS_ALLOC_FAILED;
+	}
+	
+	// second enumeration - fill
+	XnUInt32 nCurrent = 0;
+	for (ssize_t i = 0; i < nDeviceCount; ++i)
+	{
+		libusb_device* pDevice = ppDevices[i];
+		
+		// get device descriptor
+		libusb_device_descriptor desc;
+		int rc = libusb_get_device_descriptor(pDevice, &desc);
+		if (rc != 0)
+		{
+			libusb_free_device_list(ppDevices, 1);
+			return (XN_STATUS_USB_ENUMERATE_FAILED);
+		}
+		
+		// check if this is the requested device
+		if (desc.idVendor == nVendorID && desc.idProduct == nProductID)
+		{
+			sprintf(aResult[nCurrent], "%04hx/%04hx@%hhu/%hhu", nVendorID, nProductID, libusb_get_bus_number(pDevice), libusb_get_device_address(pDevice));
+			nCurrent++;
+		}
+	}
+	
+	*pastrDevicePaths = aResult;
+	*pnCount = nCount;
+		
+	// free the list (also dereference each device)
+	libusb_free_device_list(ppDevices, 1);
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API void xnUSBFreeDevicesList(const XnUSBConnectionString* astrDevicePaths)
+{
+	xnOSFree(astrDevicePaths);
+}
+
+XN_C_API XnStatus xnUSBOpenDeviceImpl(libusb_device* pDevice, XN_USB_DEV_HANDLE* pDevHandlePtr)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	if (pDevice == NULL)
+	{
+		return (XN_STATUS_USB_DEVICE_NOT_FOUND);
+	}
+
+	// allocate device handle
+	libusb_device_handle* handle;
+	
+	// open device
+	int rc = libusb_open(pDevice, &handle);
+	
+	// in any case, unref the device (we don't need it anymore)
+	libusb_unref_device(pDevice);
+	pDevice = NULL;
+	
+	// now check if open failed
+	if (rc != 0)
+	{
+		return (XN_STATUS_USB_DEVICE_OPEN_FAILED);
+	}
+	
+/*	
+	// set for the first (and only) configuration (this will perform a light-weight reset)
+	rc = libusb_set_configuration(handle, 1);
+	if (rc != 0)
+	{
+		libusb_close(handle);
+		return (XN_STATUS_USB_SET_CONFIG_FAILED);
+	}
+*/	
+	// claim the interface (you cannot open any end point before claiming the interface)
+	rc = libusb_claim_interface(handle, 0);
+	if (rc != 0)
+	{
+		libusb_close(handle);
+		return (XN_STATUS_USB_SET_INTERFACE_FAILED);
+	}
+	
+/*	
+	// set the alternate setting to default
+	rc = libusb_set_interface_alt_setting(handle, 0, 0);
+	if (rc != 0)
+	{
+		libusb_close(handle);
+		return (XN_STATUS_USB_SET_INTERFACE_FAILED);
+	}
+*/	
+	XN_VALIDATE_ALLOC(*pDevHandlePtr, XnUSBDeviceHandle);
+	XN_USB_DEV_HANDLE pDevHandle = *pDevHandlePtr;
+	pDevHandle->hDevice = handle;
+	pDevHandle->nInterface = 0;
+	pDevHandle->nAltSetting = 0;
+	
+	// mark the device is of high-speed
+	pDevHandle->nDevSpeed = XN_USB_DEVICE_HIGH_SPEED;
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBOpenDevice(XnUInt16 nVendorID, XnUInt16 nProductID, void* pExtraParam, void* pExtraParam2, XN_USB_DEV_HANDLE* pDevHandlePtr)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+		
+	// make sure library was initialized
+	XN_VALIDATE_USB_INIT();
+	
+	// Validate parameters
+	XN_VALIDATE_OUTPUT_PTR(pDevHandlePtr);
+
+	libusb_device* pDevice;
+	nRetVal = FindDevice(nVendorID, nProductID, pExtraParam, &pDevice);
+	XN_IS_STATUS_OK(nRetVal);
+		
+	nRetVal = xnUSBOpenDeviceImpl(pDevice, pDevHandlePtr);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBOpenDeviceByPath(const XnUSBConnectionString strDevicePath, XN_USB_DEV_HANDLE* pDevHandlePtr)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// parse connection string
+	XnUInt16 nVendorID = 0;
+	XnUInt16 nProductID = 0;
+	XnUInt8 nBus = 0;
+	XnUInt8 nAddress = 0;
+	sscanf(strDevicePath, "%hx/%hx@%hhu/%hhu", &nVendorID, &nProductID, &nBus, &nAddress);
+	
+	if (nVendorID == 0 || nProductID == 0 || nBus == 0 || nAddress == 0)
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_USB_DEVICE_OPEN_FAILED, "Invalid connection string: %s", strDevicePath);
+	}
+
+	// find device	
+	libusb_device** ppDevices;
+	ssize_t nDeviceCount = libusb_get_device_list(g_InitData.pContext, &ppDevices);
+	
+	libusb_device* pRequestedDevice = NULL;
+	
+	for (ssize_t i = 0; i < nDeviceCount; ++i)
+	{
+		libusb_device* pDevice = ppDevices[i];
+		
+		// get device descriptor
+		libusb_device_descriptor desc;
+		int rc = libusb_get_device_descriptor(pDevice, &desc);
+		if (rc != 0)
+		{
+			libusb_free_device_list(ppDevices, 1);
+			return (XN_STATUS_USB_ENUMERATE_FAILED);
+		}
+		
+		// check if this is the requested device
+		if (desc.idVendor == nVendorID && desc.idProduct == nProductID && libusb_get_bus_number(pDevice) == nBus && libusb_get_device_address(pDevice) == nAddress)
+		{
+			// add a reference to the device (so it won't be destroyed when list is freed)
+			libusb_ref_device(pDevice);
+			pRequestedDevice = pDevice;
+			break;	
+		}
+	}
+
+	libusb_free_device_list(ppDevices, 1);
+	
+	nRetVal = xnUSBOpenDeviceImpl(pRequestedDevice, pDevHandlePtr);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBCloseDevice(XN_USB_DEV_HANDLE pDevHandle)
+{
+	// validate parameters
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
+
+	int rc = libusb_release_interface(pDevHandle->hDevice, pDevHandle->nInterface);
+	if (0 != rc)
+	{
+		return (XN_STATUS_USB_DEVICE_CLOSE_FAILED);
+	}
+
+	libusb_close(pDevHandle->hDevice);
+
+	XN_FREE_AND_NULL(pDevHandle);
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBGetDeviceSpeed(XN_USB_DEV_HANDLE pDevHandle, XnUSBDeviceSpeed* pDevSpeed)
+{
+	// validate parameters
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
+	XN_VALIDATE_OUTPUT_PTR(pDevSpeed);
+
+	*pDevSpeed = pDevHandle->nDevSpeed;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBSetConfig(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 nConfig)
+{
+	return (XN_STATUS_OS_UNSUPPORTED_FUNCTION);
+}
+
+XN_C_API XnStatus xnUSBGetConfig(XN_USB_DEV_HANDLE pDevHandle, XnUInt8* pnConfig)
+{
+	return (XN_STATUS_OS_UNSUPPORTED_FUNCTION);
+}
+
+XN_C_API XnStatus xnUSBSetInterface(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 nInterface, XnUInt8 nAltInterface)
+{
+	// validate parameters
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
+	
+	int rc = libusb_set_interface_alt_setting(pDevHandle->hDevice, nInterface, nAltInterface);
+	if (rc != 0)
+	{
+		return (XN_STATUS_USB_SET_INTERFACE_FAILED);
+	}
+	
+	pDevHandle->nInterface = nInterface;
+	pDevHandle->nAltSetting = nAltInterface;
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBGetInterface(XN_USB_DEV_HANDLE pDevHandle, XnUInt8* pnInterface, XnUInt8* pnAltInterface)
+{
+	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
+}
+
+XN_C_API XnStatus xnUSBOpenEndPoint(XN_USB_DEV_HANDLE pDevHandle, XnUInt16 nEndPointID, XnUSBEndPointType nEPType, XnUSBDirectionType nDirType, XN_USB_EP_HANDLE* pEPHandlePtr)
+{
+	// validate parameters
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
+	XN_VALIDATE_OUTPUT_PTR(pEPHandlePtr);
+
+	// get the device from the handle
+	libusb_device* pDevice = libusb_get_device(pDevHandle->hDevice);
+	
+	// get the configuration descriptor
+	libusb_config_descriptor* pConfig;
+	int rc = libusb_get_active_config_descriptor(pDevice, &pConfig);
+	if (rc != 0)
+	{
+		return (XN_STATUS_USB_CONFIG_QUERY_FAILED);
+	}
+	
+	// make sure configuration contains the interface we need
+	if (pConfig->bNumInterfaces <= pDevHandle->nInterface)
+	{
+		libusb_free_config_descriptor(pConfig);
+		return (XN_STATUS_USB_INTERFACE_QUERY_FAILED);
+	}
+	
+	// take that interface
+	const libusb_interface* pInterface = &pConfig->interface[pDevHandle->nInterface];
+	
+	// make sure interface contains the alternate setting we work with
+	if (pInterface->num_altsetting <= pDevHandle->nAltSetting)
+	{
+		libusb_free_config_descriptor(pConfig);
+		return (XN_STATUS_USB_INTERFACE_QUERY_FAILED);
+	}
+	
+	// take that setting
+	const libusb_interface_descriptor* pInterfaceDesc = &pInterface->altsetting[pDevHandle->nAltSetting];
+	
+	// search for the requested endpoint
+	const libusb_endpoint_descriptor* pEndpointDesc = NULL;
+	
+	for (uint8_t i = 0; i < pInterfaceDesc->bNumEndpoints; ++i)
+	{
+		if (pInterfaceDesc->endpoint[i].bEndpointAddress == nEndPointID)
+		{
+			pEndpointDesc = &pInterfaceDesc->endpoint[i];
+			break;
+		}
+	}
+	
+	if (pEndpointDesc == NULL)
+	{
+		libusb_free_config_descriptor(pConfig);
+		return (XN_STATUS_USB_ENDPOINT_NOT_FOUND);
+	}
+	
+	libusb_transfer_type transfer_type = (libusb_transfer_type)(pEndpointDesc->bmAttributes & 0x3); // lower 2-bits
+
+    // calculate max packet size
+	// NOTE: we do not use libusb functions (libusb_get_max_packet_size/libusb_get_max_iso_packet_size) because
+	// they hace a bug and does not consider alternative interface
+    XnUInt32 nMaxPacketSize = 0;
+	
+	if (transfer_type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS)
+	{
+		XnUInt32 wMaxPacketSize = pEndpointDesc->wMaxPacketSize;
+		// bits 11 and 12 mark the number of additional transactions, bits 0-10 mark the size
+		XnUInt32 nAdditionalTransactions = wMaxPacketSize >> 11;
+		XnUInt32 nPacketSize = wMaxPacketSize & 0x7FF;
+		nMaxPacketSize = (nAdditionalTransactions + 1) * (nPacketSize);
+	}
+	else
+	{
+		nMaxPacketSize = pEndpointDesc->wMaxPacketSize;
+	}
+
+	// free the configuration descriptor. no need of it anymore
+	libusb_free_config_descriptor(pConfig);
+	pConfig = NULL;
+	
+	// Make sure the endpoint matches the required endpoint type
+	if (nEPType == XN_USB_EP_BULK)
+	{
+		if (transfer_type != LIBUSB_TRANSFER_TYPE_BULK)
+		{
+			return (XN_STATUS_USB_WRONG_ENDPOINT_TYPE);
+		}
+	}
+	else if (nEPType == XN_USB_EP_INTERRUPT)
+	{
+		if (transfer_type != LIBUSB_TRANSFER_TYPE_INTERRUPT)
+		{
+			return (XN_STATUS_USB_WRONG_ENDPOINT_TYPE);
+		}
+	}
+	else if (nEPType == XN_USB_EP_ISOCHRONOUS)
+	{
+		if (transfer_type != LIBUSB_TRANSFER_TYPE_ISOCHRONOUS)
+		{
+			return (XN_STATUS_USB_WRONG_ENDPOINT_TYPE);
+		}
+	}
+	else
+	{
+		return (XN_STATUS_USB_UNKNOWN_ENDPOINT_TYPE);
+	}
+
+	// Make sure the endpoint matches the required direction
+	libusb_endpoint_direction direction = (libusb_endpoint_direction)(nEndPointID & 0x80); // 8th bit
+	if (nDirType == XN_USB_DIRECTION_IN)
+	{
+		if (direction != LIBUSB_ENDPOINT_IN)
+		{
+			return (XN_STATUS_USB_WRONG_ENDPOINT_DIRECTION);
+		}
+	}
+	else if (nDirType == XN_USB_DIRECTION_OUT)
+	{
+		if (direction != LIBUSB_ENDPOINT_OUT)
+		{
+			return (XN_STATUS_USB_WRONG_ENDPOINT_DIRECTION);
+		}
+	}
+	else
+	{
+		return (XN_STATUS_USB_UNKNOWN_ENDPOINT_DIRECTION);
+	}
+	
+	// allocate handle
+	XN_VALIDATE_ALIGNED_CALLOC(*pEPHandlePtr, XnUSBEPHandle, 1, XN_DEFAULT_MEM_ALIGN);
+	XN_USB_EP_HANDLE pHandle = *pEPHandlePtr;
+	pHandle->hDevice = pDevHandle->hDevice;
+	pHandle->nAddress = nEndPointID;
+	pHandle->nType = nEPType;
+	pHandle->nDirection = nDirType;
+	pHandle->nMaxPacketSize = nMaxPacketSize;
+
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnUSBCloseEndPoint(XN_USB_EP_HANDLE pEPHandle)
+{
+	// validate parameters
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_EP_HANDLE(pEPHandle);
+	
+	XN_ALIGNED_FREE_AND_NULL(pEPHandle);
+	
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnUSBGetEndPointMaxPacketSize(XN_USB_EP_HANDLE pEPHandle, XnUInt32* pnMaxPacketSize)
+{
+	// Validate xnUSB
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_EP_HANDLE(pEPHandle);
+
+	// Validate the input/output pointers
+	XN_VALIDATE_INPUT_PTR(pEPHandle);
+	XN_VALIDATE_OUTPUT_PTR(pnMaxPacketSize);
+
+	*pnMaxPacketSize = pEPHandle->nMaxPacketSize;
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBAbortEndPoint(XN_USB_EP_HANDLE pEPHandle)
+{
+	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
+}
+
+XN_C_API XnStatus xnUSBFlushEndPoint(XN_USB_EP_HANDLE pEPHandle)
+{
+	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
+}
+
+XN_C_API XnStatus xnUSBResetEndPoint(XN_USB_EP_HANDLE pEPHandle)
+{
+	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
+}
+
+XN_C_API XnStatus xnUSBSendControl(XN_USB_DEV_HANDLE pDevHandle, XnUSBControlType nType, XnUInt8 nRequest, XnUInt16 nValue, XnUInt16 nIndex, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut)
+{
+	// validate parameters
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
+	
+	if (nBufferSize != 0)
+	{
+		XN_VALIDATE_INPUT_PTR(pBuffer);
+	}
+	
+	uint8_t bmRequestType;
+	
+	if (nType == XN_USB_CONTROL_TYPE_VENDOR )
+	{
+		bmRequestType = LIBUSB_REQUEST_TYPE_VENDOR;
+	}
+	else if (nType == XN_USB_CONTROL_TYPE_CLASS)
+	{
+		bmRequestType = LIBUSB_REQUEST_TYPE_CLASS;
+	}
+	else if (nType == XN_USB_CONTROL_TYPE_STANDARD)
+	{
+		bmRequestType = LIBUSB_REQUEST_TYPE_STANDARD;
+	}
+	else
+	{
+		return (XN_STATUS_USB_WRONG_CONTROL_TYPE);
+	}
+	
+	bmRequestType |= LIBUSB_ENDPOINT_OUT;
+	
+	// send	
+	int nBytesSent = libusb_control_transfer(pDevHandle->hDevice, bmRequestType, nRequest, nValue, nIndex, pBuffer, nBufferSize, nTimeOut);
+	
+	// check everything went OK
+	if (nBytesSent == LIBUSB_ERROR_TIMEOUT)
+	{
+		return (XN_STATUS_USB_TRANSFER_TIMEOUT);
+	}
+	else if (nBytesSent < 0)
+	{
+		return (XN_STATUS_USB_CONTROL_SEND_FAILED);
+	}
+	
+	if (nBytesSent != nBufferSize)
+	{
+		return (XN_STATUS_USB_GOT_UNEXPECTED_BYTES);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBReceiveControl(XN_USB_DEV_HANDLE pDevHandle, XnUSBControlType nType, XnUInt8 nRequest, XnUInt16 nValue, XnUInt16 nIndex, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut)
+{
+	// validate parameters
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_DEVICE_HANDLE(pDevHandle);
+	XN_VALIDATE_OUTPUT_PTR(pBuffer);
+	XN_VALIDATE_OUTPUT_PTR(pnBytesReceived);
+	
+	if (nBufferSize == 0)
+	{
+		return (XN_STATUS_USB_BUFFER_TOO_SMALL);
+	}
+	
+	*pnBytesReceived = 0;
+
+	uint8_t bmRequestType;
+	
+	if (nType == XN_USB_CONTROL_TYPE_VENDOR )
+	{
+		bmRequestType = LIBUSB_REQUEST_TYPE_VENDOR;
+	}
+	else if (nType == XN_USB_CONTROL_TYPE_CLASS)
+	{
+		bmRequestType = LIBUSB_REQUEST_TYPE_CLASS;
+	}
+	else if (nType == XN_USB_CONTROL_TYPE_STANDARD)
+	{
+		bmRequestType = LIBUSB_REQUEST_TYPE_STANDARD;
+	}
+	else
+	{
+		return (XN_STATUS_USB_WRONG_CONTROL_TYPE);
+	}
+	
+	bmRequestType |= LIBUSB_ENDPOINT_IN;
+	
+	// send	
+	int nBytesReceived = libusb_control_transfer(pDevHandle->hDevice, bmRequestType, nRequest, nValue, nIndex, pBuffer, nBufferSize, nTimeOut);
+	
+	// check everything went OK
+	if (nBytesReceived == LIBUSB_ERROR_TIMEOUT)
+	{
+		return (XN_STATUS_USB_TRANSFER_TIMEOUT);
+	}
+	else if (nBytesReceived < 0) // error
+	{
+		xnLogWarning(XN_MASK_USB, "Failed to receive from USB control endpoint (%d)", nBytesReceived);
+		return (XN_STATUS_USB_CONTROL_RECV_FAILED);
+	}
+	else if (nBytesReceived == 0) // nothing received
+	{
+		// received empty message
+		return (XN_STATUS_USB_NOT_ENOUGH_DATA);
+	}
+	else if (nBytesReceived > nBufferSize) // too much
+	{
+		xnLogWarning(XN_MASK_USB, "Too many bytes!!!");
+		return (XN_STATUS_USB_TOO_MUCH_DATA);
+	}
+	
+	// return number of bytes received
+	*pnBytesReceived = nBytesReceived;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBWriteEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut)
+{
+	// validate parameters
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_EP_HANDLE(pEPHandle);
+	XN_VALIDATE_INPUT_PTR(pBuffer);
+
+	if (pEPHandle->nDirection != XN_USB_DIRECTION_OUT)
+	{
+		return (XN_STATUS_USB_WRONG_ENDPOINT_DIRECTION);
+	}
+	
+	if (nBufferSize == 0)
+	{
+		return (XN_STATUS_USB_BUFFER_TOO_SMALL);
+	}
+
+	// send (according to EP type)
+	int nBytesSent = 0;
+	int rc = 0;
+	
+	if (pEPHandle->nType == XN_USB_EP_BULK)
+	{
+		rc = libusb_bulk_transfer(pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, &nBytesSent, nTimeOut);
+	}
+	else if (pEPHandle->nType == XN_USB_EP_INTERRUPT)
+	{
+		rc = libusb_interrupt_transfer(pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, &nBytesSent, nTimeOut);
+	}
+	else
+	{
+		return (XN_STATUS_USB_UNSUPPORTED_ENDPOINT_TYPE);
+	}
+	
+	// check result
+	if (rc == LIBUSB_ERROR_TIMEOUT)
+	{
+		return (XN_STATUS_USB_TRANSFER_TIMEOUT);
+	}
+	else if (rc != 0)
+	{
+		return (XN_STATUS_USB_ENDPOINT_WRITE_FAILED);
+	}
+	
+	if (nBytesSent != nBufferSize)
+	{
+		return (XN_STATUS_USB_GOT_UNEXPECTED_BYTES);
+	}
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut)
+{
+	// validate parameters
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_EP_HANDLE(pEPHandle);
+	XN_VALIDATE_OUTPUT_PTR(pBuffer);
+	XN_VALIDATE_OUTPUT_PTR(pnBytesReceived);
+
+	if (pEPHandle->nDirection != XN_USB_DIRECTION_IN)
+	{
+		return (XN_STATUS_USB_WRONG_ENDPOINT_DIRECTION);
+	}
+
+	if (nBufferSize == 0)
+	{
+		return (XN_STATUS_USB_BUFFER_TOO_SMALL);
+	}
+	
+	// receive (according to EP type)
+	*pnBytesReceived = 0;
+
+	int nBytesReceived = 0;
+	int rc = 0;
+	
+	if (pEPHandle->nType == XN_USB_EP_BULK)
+	{
+		rc = libusb_bulk_transfer(pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, &nBytesReceived, nTimeOut);
+	}
+	else if (pEPHandle->nType == XN_USB_EP_INTERRUPT)
+	{
+		rc = libusb_interrupt_transfer(pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, &nBytesReceived, nTimeOut);
+	}
+	else
+	{
+		return (XN_STATUS_USB_UNSUPPORTED_ENDPOINT_TYPE);
+	}
+	
+	// check result
+	if (rc == LIBUSB_ERROR_TIMEOUT)
+	{
+		return (XN_STATUS_USB_TRANSFER_TIMEOUT);
+	}
+	else if (rc != 0)
+	{
+		return (XN_STATUS_USB_ENDPOINT_WRITE_FAILED);
+	}
+	
+	if (nBytesReceived == 0)
+	{
+		return (XN_STATUS_USB_NOT_ENOUGH_DATA);
+	}
+
+	*pnBytesReceived = nBytesReceived;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBQueueReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer, XnUInt32 nBufferSize, XnUInt32 nTimeOut)
+{
+	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
+}
+
+XN_C_API XnStatus xnUSBFinishReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUInt32* pnBytesReceived, XnUInt32 nTimeOut)
+{	
+	return XN_STATUS_OS_UNSUPPORTED_FUNCTION;
+}
+
+void xnCleanupThreadData(XnUSBReadThreadData* pThreadData)
+{
+	for (XnUInt32 i = 0; i < pThreadData->nNumBuffers; ++i)
+	{
+		if (pThreadData->pBuffersInfo[i].transfer != NULL)
+		{
+			XN_ALIGNED_FREE_AND_NULL(pThreadData->pBuffersInfo[i].transfer->buffer);
+			libusb_free_transfer(pThreadData->pBuffersInfo[i].transfer);
+			pThreadData->pBuffersInfo[i].transfer = NULL;
+			xnOSCloseEvent(&pThreadData->pBuffersInfo[i].hEvent);
+		}
+	}
+	
+	XN_ALIGNED_FREE_AND_NULL(pThreadData->pBuffersInfo);
+
+	xnUSBAsynchThreadRelease();
+}
+
+/** Checks if any transfer of the thread is queued. */
+XnBool xnIsAnyTransferQueued(XnUSBReadThreadData* pThreadData)
+{
+	for (XnUInt32 i = 0; i < pThreadData->nNumBuffers; ++i)
+	{
+		if (pThreadData->pBuffersInfo[i].bIsQueued)
+			return (TRUE);
+	}
+	
+	return (FALSE);
+}
+
+XN_THREAD_PROC xnUSBReadThreadMain(XN_THREAD_PARAM pThreadParam)
+{
+	XnUSBReadThreadData* pThreadData = (XnUSBReadThreadData*)pThreadParam;
+
+	// set thread priority to critical
+	XnStatus nRetVal = xnOSSetThreadPriority(pThreadData->hReadThread, XN_PRIORITY_CRITICAL);
+	if (nRetVal != 0)
+	{
+		xnLogWarning(XN_MASK_USB, "Failed to set thread priority to critical. This might cause loss of data...");
+	}
+	
+	// first of all, submit all transfers
+	for (XnUInt32 i = 0; i < pThreadData->nNumBuffers; ++i)
+	{
+		XnUSBBuffersInfo* pBufferInfo = &pThreadData->pBuffersInfo[i];
+		libusb_transfer* pTransfer = pBufferInfo->transfer;
+		
+		// submit request
+		pBufferInfo->bIsQueued = TRUE;
+		int rc = libusb_submit_transfer(pTransfer);
+		if (rc != 0)
+		{
+			xnLogError(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Failed to submit asynch I/O transfer (err=%d)!", pTransfer->endpoint, pBufferInfo->nBufferID, rc);
+		}
+	}
+	
+	// now let libusb process asynchornous I/O
+	
+	while (TRUE)
+	{
+		for (XnUInt32 i = 0; i < pThreadData->nNumBuffers; ++i)
+		{
+			// check if thread can exit (only after kill was requested, and all transfers returned)
+			if (pThreadData->bKillReadThread && !xnIsAnyTransferQueued(pThreadData))
+			{
+				XN_THREAD_PROC_RETURN(XN_STATUS_OK);
+			}
+
+			XnUSBBuffersInfo* pBufferInfo = &pThreadData->pBuffersInfo[i];
+			libusb_transfer* pTransfer = pBufferInfo->transfer;
+
+			// wait for the next transfer to be completed, and process it
+			nRetVal = xnOSWaitEvent(pBufferInfo->hEvent, pThreadData->bKillReadThread ? 0 : pThreadData->nTimeOut);
+			if (nRetVal == XN_STATUS_OS_EVENT_TIMEOUT)
+			{
+//				xnLogWarning(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: timeout. cancelling transfer...", pTransfer->endpoint, pBufferInfo->nBufferID);
+				
+				// cancel it
+				int rc = libusb_cancel_transfer(pBufferInfo->transfer);
+				if (rc != 0)
+				{
+					xnLogError(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Failed to cancel asynch I/O transfer (err=%d)!", pTransfer->endpoint, pBufferInfo->nBufferID, rc);
+				}
+			
+				// wait for it to cancel	
+				nRetVal = xnOSWaitEvent(pBufferInfo->hEvent, XN_WAIT_INFINITE);
+			}
+			
+			if (nRetVal != XN_STATUS_OK)
+			{
+				// not much we can do
+				xnLogWarning(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Failed waiting on asynch transfer event: %s", pTransfer->endpoint, pBufferInfo->nBufferID, xnGetStatusString(nRetVal));
+			}
+			
+			// check the result of the transfer
+			if (pBufferInfo->bIsQueued)
+			{
+				xnLogWarning(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Transfer is still queued though event was raised!", pTransfer->endpoint, pBufferInfo->nBufferID);
+				// TODO: cancel it?
+			}
+			else // transfer done
+			{
+				if (pBufferInfo->nLastStatus == LIBUSB_TRANSFER_COMPLETED || // read succeeded
+					pBufferInfo->nLastStatus == LIBUSB_TRANSFER_CANCELLED)   // cancelled, but maybe some data arrived
+				{
+					if (pTransfer->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS)
+					{
+						XnUInt32 nTotalBytes = 0;
+						
+						// some packets may return empty, so we need to remove spaces, and make the buffer sequential
+						for (XnUInt32 i = 0; i < pTransfer->num_iso_packets; ++i)
+						{
+							struct libusb_iso_packet_descriptor* pPacket = &pTransfer->iso_packet_desc[i];
+							if (pPacket->status == LIBUSB_TRANSFER_COMPLETED && pPacket->actual_length != 0)
+							{
+								XnUChar* pBuffer = libusb_get_iso_packet_buffer_simple(pTransfer, i);
+								// if buffer is not at same offset, move it
+								if (pTransfer->buffer + nTotalBytes != pBuffer)
+								{
+//									printf("buffer %d has %d bytes. Moving to offset %d...\n", i, pPacket->actual_length, nTotalBytes);
+									memmove(pTransfer->buffer + nTotalBytes, pBuffer, pPacket->actual_length);
+								}
+								nTotalBytes += pPacket->actual_length;
+							}
+							else if (pPacket->status != LIBUSB_TRANSFER_COMPLETED)
+							{
+								xnLogWarning(XN_MASK_USB, "Endpoint 0x%x, Buffer %d, packet %d Asynch transfer failed (status: %d)", pTransfer->endpoint, pBufferInfo->nBufferID, i, pPacket->status);
+							}
+						}
+						
+						if (nTotalBytes != 0)
+						{
+							// call callback method
+							pBufferInfo->pThreadData->pCallbackFunction(pTransfer->buffer, nTotalBytes, pBufferInfo->pThreadData->pCallbackData);
+						}
+					}
+					else
+					{
+						// call callback method
+						pBufferInfo->pThreadData->pCallbackFunction(pTransfer->buffer, pTransfer->actual_length, pBufferInfo->pThreadData->pCallbackData);
+					}
+				}
+				else if (pBufferInfo->nLastStatus == LIBUSB_TRANSFER_TIMED_OUT)
+				{
+					// no need to do anything.
+				}
+				else
+				{
+					xnLogWarning(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Asynch transfer failed (status: %d)", pTransfer->endpoint, pBufferInfo->nBufferID, pTransfer->status);
+				}
+
+				// as long as running should continue, resubmit transfer
+				if (!pBufferInfo->pThreadData->bKillReadThread)
+				{
+					pBufferInfo->bIsQueued = TRUE;
+					int rc = libusb_submit_transfer(pTransfer);
+					if (rc != 0)
+					{
+						xnLogError(XN_MASK_USB, "Endpoint 0x%x, Buffer %d: Failed to re-submit asynch I/O transfer (err=%d)!", pTransfer->endpoint, pBufferInfo->nBufferID, rc);
+					}
+				}
+			}
+		}
+	}
+	
+	XN_THREAD_PROC_RETURN(XN_STATUS_OK);
+}
+
+/* This function is called whenever transfer is done (successfully or with an error). */
+void xnTransferCallback(libusb_transfer *pTransfer)
+{
+	XnUSBBuffersInfo* pBufferInfo = (XnUSBBuffersInfo*)pTransfer->user_data;
+	
+	// mark that buffer is done
+	pBufferInfo->bIsQueued = FALSE;
+	
+	// keep the status (according to libusb documentation, this field is invalid outside the callback method)
+	pBufferInfo->nLastStatus = pTransfer->status;
+	
+	// notify endpoint thread this buffer is done
+	XnStatus nRetVal = xnOSSetEvent(pBufferInfo->hEvent);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		// we don't have much to do if set event failed, log a warning
+		xnLogWarning(XN_MASK_USB, "Failed to set event for buffer: %s", xnGetStatusString(nRetVal));
+	}
+}
+
+XN_C_API XnStatus xnUSBInitReadThread(XN_USB_EP_HANDLE pEPHandle, XnUInt32 nBufferSize, XnUInt32 nNumBuffers, XnUInt32 nTimeOut, XnUSBReadCallbackFunctionPtr pCallbackFunction, void* pCallbackData)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// validate parameters
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_EP_HANDLE(pEPHandle);
+	XN_VALIDATE_INPUT_PTR(pCallbackFunction);
+	
+	nRetVal = xnUSBAsynchThreadAddRef();
+	XN_IS_STATUS_OK(nRetVal);
+	
+	xnLogVerbose(XN_MASK_USB, "Starting a USB read thread...");
+
+	XnUSBReadThreadData* pThreadData = &pEPHandle->ThreadData;
+
+	if (pThreadData->bIsRunning == TRUE)
+	{
+		xnUSBAsynchThreadRelease();
+		return (XN_STATUS_USB_READTHREAD_ALREADY_INIT);
+	}
+
+	memset(pThreadData, 0, sizeof(XnUSBReadThreadData));
+	pThreadData->nNumBuffers = nNumBuffers;
+	pThreadData->pCallbackFunction = pCallbackFunction;
+	pThreadData->pCallbackData = pCallbackData;
+	pThreadData->bKillReadThread = FALSE;
+	pThreadData->nTimeOut = nTimeOut;
+
+	// allocate buffers
+	pThreadData->pBuffersInfo = (XnUSBBuffersInfo*)xnOSCallocAligned(nNumBuffers, sizeof(XnUSBBuffersInfo), XN_DEFAULT_MEM_ALIGN);
+	if (pThreadData->pBuffersInfo == NULL)
+	{
+		xnCleanupThreadData(pThreadData);
+		return XN_STATUS_ALLOC_FAILED;
+	}
+	
+	int nNumIsoPackets = 0;
+	int nMaxPacketSize = 0;
+	
+	if (pEPHandle->nType == XN_USB_EP_ISOCHRONOUS)
+	{
+		// calculate how many packets can be set in this buffer
+		nMaxPacketSize = pEPHandle->nMaxPacketSize;
+		nNumIsoPackets = nBufferSize / nMaxPacketSize;
+	}
+
+	for (XnUInt32 i = 0; i < nNumBuffers; i++)
+	{
+		XnUSBBuffersInfo* pBufferInfo = &pThreadData->pBuffersInfo[i];
+		pBufferInfo->nBufferID = i;
+		pBufferInfo->pThreadData = pThreadData;
+		
+		// allocate transfer
+		pBufferInfo->transfer = libusb_alloc_transfer(nNumIsoPackets);
+		
+		libusb_transfer* pTransfer = pBufferInfo->transfer;
+
+		if (pTransfer == NULL)
+		{
+			xnCleanupThreadData(pThreadData);
+			return (XN_STATUS_ALLOC_FAILED);
+		}
+
+		// allocate buffer
+		XnUChar* pBuffer = (unsigned char*)xnOSCallocAligned(nBufferSize, sizeof(XnUChar), XN_DEFAULT_MEM_ALIGN);
+		if (pBuffer == NULL)
+		{
+			xnCleanupThreadData(pThreadData);
+			return (XN_STATUS_ALLOC_FAILED);
+		}
+
+		// fill transfer params
+		if (pEPHandle->nType == XN_USB_EP_BULK)
+		{
+			libusb_fill_bulk_transfer(pTransfer, pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, xnTransferCallback, pBufferInfo, 0);
+		}
+		else if (pEPHandle->nType == XN_USB_EP_INTERRUPT)
+		{
+			libusb_fill_interrupt_transfer(pTransfer, pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, xnTransferCallback, pBufferInfo, 0);
+		}
+		else if (pEPHandle->nType == XN_USB_EP_ISOCHRONOUS)
+		{
+			libusb_fill_iso_transfer(pTransfer, pEPHandle->hDevice, pEPHandle->nAddress, pBuffer, nBufferSize, nNumIsoPackets, xnTransferCallback, pBufferInfo, 0);
+			libusb_set_iso_packet_lengths(pTransfer, nMaxPacketSize);
+		}
+		else
+		{
+			return (XN_STATUS_USB_UNSUPPORTED_ENDPOINT_TYPE);
+		}
+
+		// create event
+		nRetVal = xnOSCreateEvent(&pBufferInfo->hEvent,FALSE);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnCleanupThreadData(pThreadData);
+			return (nRetVal);
+		}
+	}
+
+	// create a thread to perform the asynchronous read operations
+	nRetVal = xnOSCreateThread(xnUSBReadThreadMain, &pEPHandle->ThreadData, &pThreadData->hReadThread);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnCleanupThreadData(pThreadData);
+		return (nRetVal);
+	}
+
+	pThreadData->bIsRunning = TRUE;
+	
+	xnLogInfo(XN_MASK_USB, "USB read thread was started.");
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBShutdownReadThread(XN_USB_EP_HANDLE pEPHandle)
+{
+	XN_VALIDATE_USB_INIT();
+	XN_VALIDATE_EP_HANDLE(pEPHandle);
+
+	XnUSBReadThreadData* pThreadData = &pEPHandle->ThreadData;
+
+	if (pThreadData->bIsRunning == FALSE)
+	{
+		return (XN_STATUS_USB_READTHREAD_NOT_INIT);
+	}
+
+	if (pThreadData->hReadThread != NULL)
+	{
+		// mark thread should be killed
+		pThreadData->bKillReadThread = TRUE;
+
+		// PATCH: we don't cancel the requests, because there is a bug causing segmentation fault.
+		// instead, we will just wait for all of them to return.
+
+/*		// cancel all pending requests
+		for (XnUInt32 i = 0; i < pThreadData->nNumBuffers; ++i)
+		{
+			if (pThreadData->pBuffersInfo[i].bIsQueued)
+			{
+				printf("cancelling %d\n", i);
+				int rc = libusb_cancel_transfer(pThreadData->pBuffersInfo[i].transfer);
+				if (rc != 0)
+				{
+					xnLogWarning(XN_MASK_USB, "Failed to cancel asynchronous I/O operation (err = %d)! Will wait for it to complete...", rc);
+				}
+			}
+		}
+*/
+
+		// now wait for thread to exit (we wait the timeout of all buffers + an extra second)
+		XnStatus nRetVal = xnOSWaitForThreadExit(pThreadData->hReadThread, pThreadData->nTimeOut * pThreadData->nNumBuffers + 1000);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnOSTerminateThread(&pThreadData->hReadThread);
+		}
+		else
+		{
+			xnOSCloseThread(&pThreadData->hReadThread);
+		}
+	}
+	
+	xnCleanupThreadData(pThreadData);
+
+	pThreadData->bIsRunning = FALSE;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnUSBSetCallbackHandler(XnUInt16 nVendorID, XnUInt16 /*nProductID*/, void* pExtraParam, XnUSBEventCallbackFunctionPtr pCallbackFunction, void* pCallbackData)
+{
+	return (XN_STATUS_OS_UNSUPPORTED_FUNCTION);
+}
diff --git a/Source/OpenNI/Linux/XnUSBLinux.h b/Source/OpenNI/Linux/XnUSBLinux.h
new file mode 100644
index 0000000..9c00190
--- /dev/null
+++ b/Source/OpenNI/Linux/XnUSBLinux.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef _XN_USBLINUX_X86_H_
+#define _XN_USBLINUX_X86_H_
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define XN_USB_DEFAULT_EP_TIMEOUT 1000
+#define XN_USB_READ_THREAD_KILL_TIMEOUT 10000
+
+//---------------------------------------------------------------------------
+// Structures & Enums
+//---------------------------------------------------------------------------
+typedef struct XnUSBDeviceHandle
+{
+//	XnBool bValid;
+	libusb_device_handle* hDevice;
+	XnUSBDeviceSpeed nDevSpeed;
+	XnUInt8 nInterface;
+	XnUInt8 nAltSetting;
+} XnUSBDevHandle;
+
+struct XnUSBReadThreadData; // Forward declaration
+
+typedef struct XnUSBBuffersInfo
+{
+	/* A pointer back to the thread data. */
+	XnUSBReadThreadData* pThreadData;
+	/* transfer object (through which asynch operations take place). */
+	libusb_transfer* transfer;
+	/* TRUE when transfer is queued. */
+	XnBool bIsQueued;
+	/* An event to notify when buffer is ready. */
+	XN_EVENT_HANDLE hEvent;
+	XnUInt32 nBufferID;
+	/* Holds the last status received. */
+	libusb_transfer_status nLastStatus;
+} XnUSBBuffersInfo;
+
+/* Information about a thread reading from an endpoint. */
+typedef struct XnUSBReadThreadData
+{
+	/* TRUE when thread is running. */
+	XnBool bIsRunning;
+	/* Number of buffers allocated. */
+	XnUInt32 nNumBuffers;
+	/* Array of buffers. */
+	XnUSBBuffersInfo* pBuffersInfo;
+	/* Size of each buffer. */
+	XnUInt32 nBufferSize;
+	/* Timeout value. */
+	XnUInt32 nTimeOut;
+	/* User callback function. */
+	XnUSBReadCallbackFunctionPtr pCallbackFunction;
+	/* User callback data. */
+	void* pCallbackData;
+	/* Handle to the read thread. */
+	XN_THREAD_HANDLE hReadThread;
+	/* When TRUE, signals the thread to exit. */
+	XnBool bKillReadThread;
+} XnUSBReadThreadData;
+
+typedef struct XnUSBEndPointHandle
+{
+	libusb_device_handle* hDevice;
+	unsigned char nAddress;
+	XnUSBEndPointType  nType;
+	XnUSBDirectionType nDirection;
+	XnUSBReadThreadData ThreadData;
+	XnUInt32 nMaxPacketSize;
+} XnUSBEPHandle;
+
+#endif //_XN_USBLINUX_X86_H_
diff --git a/Source/OpenNI/Win32/Win32CriticalSections.cpp b/Source/OpenNI/Win32/Win32CriticalSections.cpp
index dd66f7d..5dae534 100644
--- a/Source/OpenNI/Win32/Win32CriticalSections.cpp
+++ b/Source/OpenNI/Win32/Win32CriticalSections.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Win32/Win32Debug.cpp b/Source/OpenNI/Win32/Win32Debug.cpp
index b5c4312..eb346db 100644
--- a/Source/OpenNI/Win32/Win32Debug.cpp
+++ b/Source/OpenNI/Win32/Win32Debug.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Win32/Win32Events.cpp b/Source/OpenNI/Win32/Win32Events.cpp
index cc04c93..426745e 100644
--- a/Source/OpenNI/Win32/Win32Events.cpp
+++ b/Source/OpenNI/Win32/Win32Events.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -24,16 +24,22 @@
 //---------------------------------------------------------------------------
 #include <XnOS.h>
 #include <XnLog.h>
+#include "XnOSWin32Internal.h"
 
 //---------------------------------------------------------------------------
 // Code
 //---------------------------------------------------------------------------
-XN_C_API XnStatus xnOSCreateEvent(XN_EVENT_HANDLE* pEventHandle, XnBool bManualReset)
+XN_C_API XnStatus XN_C_DECL xnOSCreateEvent(XN_EVENT_HANDLE* pEventHandle, XnBool bManualReset)
 {
 	return (xnOSCreateNamedEvent(pEventHandle, NULL, bManualReset));
 }
 
-XN_C_API XnStatus xnOSCreateNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset)
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset)
+{
+	return xnOSCreateNamedEventEx(pEventHandle, cpEventName, bManualReset, FALSE);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedEventEx(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bManualReset, XnBool bAllowOtherUsers)
 {
 	// Local function variables
 	XnStatus nRetVal = XN_STATUS_OK;
@@ -41,8 +47,29 @@ XN_C_API XnStatus xnOSCreateNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnCh
 	// Validate the input/output pointers (to make sure none of them is NULL)
 	XN_VALIDATE_OUTPUT_PTR(pEventHandle);
 
+	XnChar strEventOSName[MAX_PATH];
+	XnChar* pEventOSName = NULL;
+	SECURITY_ATTRIBUTES* pSecurityAttributes = NULL;
+
+	if (cpEventName != NULL)
+	{
+		nRetVal = XnWin32CreateKernelObjectName(strEventOSName, MAX_PATH, cpEventName, bAllowOtherUsers);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			return XN_STATUS_OS_EVENT_CREATION_FAILED;
+		}
+
+		pEventOSName = strEventOSName;
+
+		nRetVal = XnWin32GetSecurityAttributes(bAllowOtherUsers, &pSecurityAttributes);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			return XN_STATUS_OS_MUTEX_CREATION_FAILED;
+		}
+	}
+
 	// Create a named event via the OS
-	*pEventHandle = CreateEvent(NULL, bManualReset, FALSE, cpEventName);
+	*pEventHandle = CreateEvent(pSecurityAttributes, bManualReset, FALSE, pEventOSName);
 
 	// Make sure it succeeded (return value is not null)
 	if (*pEventHandle == NULL)
@@ -55,13 +82,25 @@ XN_C_API XnStatus xnOSCreateNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnCh
 	return (XN_STATUS_OK);
 }
 
-XN_C_API XnStatus xnOSOpenNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName)
+XN_C_API XnStatus XN_C_DECL xnOSOpenNamedEvent(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName)
+{
+	return xnOSOpenNamedEventEx(pEventHandle, cpEventName, FALSE);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSOpenNamedEventEx(XN_EVENT_HANDLE* pEventHandle, const XnChar* cpEventName, XnBool bAllowOtherUsers)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 	XN_VALIDATE_INPUT_PTR(cpEventName);
 	XN_VALIDATE_OUTPUT_PTR(pEventHandle);
 	
-	*pEventHandle = OpenEvent(EVENT_ALL_ACCESS, FALSE, cpEventName);
+	XnChar strEventOSName[MAX_PATH];
+	nRetVal = XnWin32CreateKernelObjectName(strEventOSName, MAX_PATH, cpEventName, bAllowOtherUsers);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		return XN_STATUS_OS_EVENT_CREATION_FAILED;
+	}
+
+	*pEventHandle = OpenEvent(EVENT_MODIFY_STATE | SYNCHRONIZE, FALSE, cpEventName);
 	if (*pEventHandle == NULL)
 	{
 		return XN_STATUS_OS_EVENT_OPEN_FAILED;
diff --git a/Source/OpenNI/Win32/Win32Files.cpp b/Source/OpenNI/Win32/Win32Files.cpp
index 82332ec..7ebf563 100644
--- a/Source/OpenNI/Win32/Win32Files.cpp
+++ b/Source/OpenNI/Win32/Win32Files.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -25,6 +25,7 @@
 #include <XnOS.h>
 #include <cstdlib>
 #include <cerrno>
+#include <shellapi.h>
 
 //---------------------------------------------------------------------------
 // Code
@@ -161,7 +162,7 @@ XN_C_API XnStatus xnOSOpenFile(const XnChar* cpFileName, const XnUInt32 nFlags,
 
 	if ((nFlags & XN_OS_FILE_WRITE) && (nFlags & XN_OS_FILE_APPEND))
 	{
-		nRetVal = xnOSSeekFile(*pFile, XN_OS_SEEK_END, 0);
+		nRetVal = xnOSSeekFile64(*pFile, XN_OS_SEEK_END, 0);
 		XN_IS_STATUS_OK(nRetVal);
 		// ZZZZ Add real error checking?
 	}
@@ -295,8 +296,87 @@ XN_C_API XnStatus xnOSSeekFile(const XN_FILE_HANDLE File, const XnOSSeekType See
 	return (XN_STATUS_OK);
 }
 
+XN_C_API XnStatus xnOSSeekFile64(const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt64 nOffset)
+{
+	// Local function variables
+	DWORD nRealSeekType = 0;
+	LARGE_INTEGER liPos;
+	BOOL bSucceeded = 0;
+
+	// Make sure the actual file handle isn't NULL
+	XN_RET_IF_NULL(File, XN_STATUS_OS_INVALID_FILE);
+
+	// Convert the ni seek type into OS seek type
+	switch (SeekType)
+	{
+		case XN_OS_SEEK_SET:
+			// Absolute seek from the file beginning
+			nRealSeekType = FILE_BEGIN;
+			break;
+		case XN_OS_SEEK_CUR:
+			// Relative seek from the current location
+			nRealSeekType = FILE_CURRENT;
+			break;
+		case XN_OS_SEEK_END:
+			// Absolute seek from the file ending
+			nRealSeekType = FILE_END;
+			break;
+		default:
+			return (XN_STATUS_OS_INVALID_SEEK_TYPE);
+	}
+
+	// Seek a file handle via the OS
+	liPos.QuadPart = nOffset;
+	bSucceeded = SetFilePointerEx(File, liPos, NULL, nRealSeekType);
+
+	// Make sure it succeeded
+	if (! bSucceeded)
+	{
+		return (XN_STATUS_OS_FILE_SEEK_FAILED);
+	}
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
 XN_C_API XnStatus xnOSTellFile(const XN_FILE_HANDLE File, XnUInt32* nFilePos)
 {
+	LARGE_INTEGER liPos;
+	BOOL bSucceeded = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_OUTPUT_PTR(nFilePos);
+
+	// Make sure the actual file handle isn't NULL
+	XN_RET_IF_NULL(File, XN_STATUS_OS_INVALID_FILE);
+
+	// Seek a file handle by 0 bytes in order to read the file position
+	liPos.QuadPart = 0;
+	bSucceeded = SetFilePointerEx(File, liPos, &liPos, FILE_CURRENT);
+
+	// Make sure it succeeded (return value is valid)
+	if (! bSucceeded)
+	{
+		return (XN_STATUS_OS_FILE_TELL_FAILED);
+	}
+
+	// Enforce uint32 limitation
+	if (liPos.HighPart)
+	{
+		return XN_STATUS_INTERNAL_BUFFER_TOO_SMALL;
+	}
+
+	*nFilePos = liPos.LowPart;
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSTellFile64(const XN_FILE_HANDLE File, XnUInt64* nFilePos)
+{
+	LARGE_INTEGER liPos;
+	BOOL bSucceeded = 0;
+
 	// Validate the input/output pointers (to make sure none of them is NULL)
 	XN_VALIDATE_OUTPUT_PTR(nFilePos);
 
@@ -304,14 +384,17 @@ XN_C_API XnStatus xnOSTellFile(const XN_FILE_HANDLE File, XnUInt32* nFilePos)
 	XN_RET_IF_NULL(File, XN_STATUS_OS_INVALID_FILE);
 
 	// Seek a file handle by 0 bytes in order to read the file position
-	*nFilePos = SetFilePointer(File, 0, NULL, FILE_CURRENT);
+	liPos.QuadPart = 0;
+	bSucceeded = SetFilePointerEx(File, liPos, &liPos, FILE_CURRENT);
 
 	// Make sure it succeeded (return value is valid)
-	if (*nFilePos == INVALID_SET_FILE_POINTER)
+	if (! bSucceeded)
 	{
 		return (XN_STATUS_OS_FILE_TELL_FAILED);
 	}
 
+	*nFilePos = liPos.QuadPart;
+
 	// All is good...
 	return (XN_STATUS_OK);
 }
@@ -335,9 +418,6 @@ XN_C_API XnStatus xnOSFlushFile(const XN_FILE_HANDLE File)
 
 XN_C_API XnStatus xnOSDeleteFile(const XnChar* cpFileName)
 {
-	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	// Validate the input/output pointers (to make sure none of them is NULL)
 	XN_VALIDATE_INPUT_PTR(cpFileName);
 
@@ -370,8 +450,6 @@ XN_C_API XnStatus xnOSDoesFileExist(const XnChar* cpFileName, XnBool* bResult)
 
 XN_C_API XnStatus xnOSDoesDirecotyExist(const XnChar* cpDirName, XnBool* pbResult)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-	
 	// Validate the input/output pointers (to make sure none of them is NULL)
 	XN_VALIDATE_INPUT_PTR(cpDirName);
 	XN_VALIDATE_OUTPUT_PTR(pbResult);
@@ -393,6 +471,8 @@ XN_C_API XnStatus xnOSGetFileSize(const XnChar* cpFileName, XnUInt32* pnFileSize
 	// Local function variables
 	XN_FILE_HANDLE FileHandle;
 	XnStatus nRetVal = XN_STATUS_OK;
+	LARGE_INTEGER liSize;
+	BOOL bSucceeded = 0;
 
 	// Validate the input/output pointers (to make sure none of them is NULL)
 	XN_VALIDATE_INPUT_PTR(cpFileName);
@@ -401,7 +481,44 @@ XN_C_API XnStatus xnOSGetFileSize(const XnChar* cpFileName, XnUInt32* pnFileSize
 	nRetVal = xnOSOpenFile(cpFileName, XN_OS_FILE_READ, &FileHandle);
 	XN_IS_STATUS_OK(nRetVal);
 
-	*pnFileSize = GetFileSize(FileHandle,  NULL);
+	bSucceeded = GetFileSizeEx(FileHandle, &liSize);
+	if (!bSucceeded)
+		return XN_STATUS_OS_FILE_GET_SIZE_FAILED;
+
+	// Enforce uint32 limitation
+	if (liSize.HighPart)
+	{
+		return XN_STATUS_INTERNAL_BUFFER_TOO_SMALL;
+	}
+
+	*pnFileSize = liSize.LowPart;
+
+	nRetVal = xnOSCloseFile(&FileHandle);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// All is good...
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnOSGetFileSize64(const XnChar* cpFileName, XnUInt64* pnFileSize)
+{
+	// Local function variables
+	XN_FILE_HANDLE FileHandle;
+	XnStatus nRetVal = XN_STATUS_OK;
+	LARGE_INTEGER liSize;
+	BOOL bSucceeded = 0;
+
+	// Validate the input/output pointers (to make sure none of them is NULL)
+	XN_VALIDATE_INPUT_PTR(cpFileName);
+	XN_VALIDATE_OUTPUT_PTR(pnFileSize);
+
+	nRetVal = xnOSOpenFile(cpFileName, XN_OS_FILE_READ, &FileHandle);
+	XN_IS_STATUS_OK(nRetVal);
+
+	bSucceeded = GetFileSizeEx(FileHandle, &liSize);
+	if (!bSucceeded)
+		return XN_STATUS_OS_FILE_GET_SIZE_FAILED;
+	*pnFileSize = liSize.QuadPart;
 
 	nRetVal = xnOSCloseFile(&FileHandle);
 	XN_IS_STATUS_OK(nRetVal);
@@ -428,6 +545,50 @@ XN_C_API XnStatus xnOSCreateDirectory(const XnChar* cpDirName)
 	return (XN_STATUS_OK);
 }
 
+XN_C_API XnStatus XN_C_DECL xnOSDeleteEmptyDirectory(const XnChar* strDirName)
+{
+	XN_VALIDATE_INPUT_PTR(strDirName);
+	
+	XnBool bRetVal = RemoveDirectory(strDirName);
+	if (!bRetVal)
+	{
+		return XN_STATUS_OS_FAILED_TO_DELETE_DIR;
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSDeleteDirectoryTree(const XnChar* strDirName)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XN_VALIDATE_INPUT_PTR(strDirName);
+
+	// file name must be double-null terminated
+	XnChar strDirNameDoubleNull[MAX_PATH+1];
+	xnOSMemSet(strDirNameDoubleNull, 0, sizeof(strDirNameDoubleNull));
+	nRetVal = xnOSStrCopy(strDirNameDoubleNull, strDirName, MAX_PATH);
+	XN_IS_STATUS_OK(nRetVal);
+
+	SHFILEOPSTRUCT shOp;
+	shOp.hwnd = NULL;
+	shOp.wFunc = FO_DELETE;
+	shOp.pFrom = strDirNameDoubleNull;
+	shOp.pTo = NULL;
+	shOp.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT;
+	shOp.fAnyOperationsAborted = 0;
+	shOp.hNameMappings = NULL;
+	shOp.lpszProgressTitle = NULL;
+
+	int ret = SHFileOperation(&shOp);
+	if (ret != 0)
+	{
+		return XN_STATUS_OS_FAILED_TO_DELETE_DIR;
+	}
+
+	return (XN_STATUS_OK);
+}
+
 XN_C_API XnStatus xnOSGetCurrentDir(XnChar* cpDirName, const XnUInt32 nBufferSize)
 {
 	// check needed length
diff --git a/Source/OpenNI/Win32/Win32INI.cpp b/Source/OpenNI/Win32/Win32INI.cpp
index e4f27e8..cb74de1 100644
--- a/Source/OpenNI/Win32/Win32INI.cpp
+++ b/Source/OpenNI/Win32/Win32INI.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Win32/Win32Keyboard.cpp b/Source/OpenNI/Win32/Win32Keyboard.cpp
index e066519..b0b51df 100644
--- a/Source/OpenNI/Win32/Win32Keyboard.cpp
+++ b/Source/OpenNI/Win32/Win32Keyboard.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Win32/Win32Memory.cpp b/Source/OpenNI/Win32/Win32Memory.cpp
index b058f07..d5bdae6 100644
--- a/Source/OpenNI/Win32/Win32Memory.cpp
+++ b/Source/OpenNI/Win32/Win32Memory.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Win32/Win32Mutex.cpp b/Source/OpenNI/Win32/Win32Mutex.cpp
index d9fbf10..dcbbda5 100644
--- a/Source/OpenNI/Win32/Win32Mutex.cpp
+++ b/Source/OpenNI/Win32/Win32Mutex.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -24,6 +24,7 @@
 //---------------------------------------------------------------------------
 #include <XnOS.h>
 #include <XnLog.h>
+#include "XnOSWin32Internal.h"
 
 //---------------------------------------------------------------------------
 // Code
@@ -35,18 +36,46 @@ XN_C_API XnStatus xnOSCreateMutex(XN_MUTEX_HANDLE* pMutexHandle)
 
 XN_C_API XnStatus xnOSCreateNamedMutex(XN_MUTEX_HANDLE* pMutexHandle, const XnChar* cpMutexName)
 {
+	return xnOSCreateNamedMutexEx(pMutexHandle, cpMutexName, FALSE);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSCreateNamedMutexEx(XN_MUTEX_HANDLE* pMutexHandle, const XnChar* cpMutexName, XnBool bAllowOtherUsers)
+{
 	// Local function variables
 	XnStatus nRetVal = XN_STATUS_OK;
-	XnBool bRetVal = FALSE;
 
 	// Validate the input/output pointers (to make sure none of them is NULL)
 	XN_VALIDATE_INPUT_PTR(pMutexHandle);
 
+	XnChar strMutexOSName[MAX_PATH];
+	XnChar* pMutexOSName = NULL;
+	SECURITY_ATTRIBUTES* pSecurityAttributes = NULL;
+
+	if (cpMutexName != NULL)
+	{
+		nRetVal = XnWin32CreateKernelObjectName(strMutexOSName, MAX_PATH, cpMutexName, bAllowOtherUsers);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			return XN_STATUS_OS_MUTEX_CREATION_FAILED;
+		}
+
+		pMutexOSName = strMutexOSName;
+
+		nRetVal = XnWin32GetSecurityAttributes(bAllowOtherUsers, &pSecurityAttributes);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			return XN_STATUS_OS_MUTEX_CREATION_FAILED;
+		}
+	}
+
 	// Create a named mutex via the OS
-	*pMutexHandle = CreateMutex(NULL, FALSE, cpMutexName);
+	*pMutexHandle = CreateMutex(pSecurityAttributes, FALSE, pMutexOSName);
 
 	// Make sure it succeeded (return value is not null)
-	XN_VALIDATE_PTR(*pMutexHandle, XN_STATUS_OS_MUTEX_CREATION_FAILED);
+	if (*pMutexHandle == NULL)
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_OS_MUTEX_CREATION_FAILED, XN_MASK_OS, "Failed to create mutex (%d).", GetLastError());
+	}
 
 	// All is good...
 	return (XN_STATUS_OK);
@@ -55,7 +84,6 @@ XN_C_API XnStatus xnOSCreateNamedMutex(XN_MUTEX_HANDLE* pMutexHandle, const XnCh
 XN_C_API XnStatus xnOSCloseMutex(XN_MUTEX_HANDLE* pMutexHandle)
 {
 	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
 	XnBool bRetVal = FALSE;
 
 	// Validate the input/output pointers (to make sure none of them is NULL)
diff --git a/Source/OpenNI/Win32/Win32Network.cpp b/Source/OpenNI/Win32/Win32Network.cpp
index 900fd81..2459357 100644
--- a/Source/OpenNI/Win32/Win32Network.cpp
+++ b/Source/OpenNI/Win32/Win32Network.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -317,16 +317,17 @@ XN_C_API XnStatus xnOSConnectSocket(XN_SOCKET_HANDLE Socket, XnUInt32 nMillisecs
 
 	xnOSMemCopy(&SocketAddress, &Socket->SocketAddress, sizeof(SocketAddress));
 
-	// Make the socket non-blocking temporarily
-	u_long nNonBlockingSocket = 1;
-	u_long nBlockingSocket = 0;
-	if (ioctlsocket(Socket->Socket, FIONBIO, &nNonBlockingSocket) != 0)
+	// if timeout is XN_SOCKET_DEFAULT_TIMEOUT, leave the socket as a blocking one
+	if (nMillisecsTimeout != XN_SOCKET_DEFAULT_TIMEOUT)
 	{
-		XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED, XN_MASK_OS, "ioctlsocket() failed with error %d", WSAGetLastError());
-		return(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED);
+		// Make the socket non-blocking temporarily
+		u_long nNonBlockingSocket = 1;
+		if (ioctlsocket(Socket->Socket, FIONBIO, &nNonBlockingSocket) != 0)
+		{
+			XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED, XN_MASK_OS, "ioctlsocket() failed with error %d", WSAGetLastError());
+		}
 	}
 
-	//This is a non-blocking connect() call - it doesn't do anything until we call select()
 	nRetVal = connect(Socket->Socket, &SocketAddress, sizeof(SocketAddress));
 	if ((nRetVal == SOCKET_ERROR) && (WSAGetLastError() != WSAEWOULDBLOCK))
 	{
@@ -334,34 +335,39 @@ XN_C_API XnStatus xnOSConnectSocket(XN_SOCKET_HANDLE Socket, XnUInt32 nMillisecs
 		return(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED);
 	}
 
-	FD_ZERO(&fdWriteHandles);
-	FD_SET(Socket->Socket, &fdWriteHandles);
-	FD_ZERO(&fdExceptHandles);
-	FD_SET(Socket->Socket, &fdExceptHandles);
-	nRetVal = select(1 /* ignored */, NULL, &fdWriteHandles, &fdExceptHandles, pTimeout);
-	// in any case, make the socket blocking again before we check select()'s success
-	ioctlsocket(Socket->Socket, FIONBIO, &nBlockingSocket);
-
-	if (nRetVal == 0)
-	{
-		return (XN_STATUS_OS_NETWORK_TIMEOUT);
-	}
-	else if (nRetVal == SOCKET_ERROR)
-	{
-		XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED, XN_MASK_OS, "select() returned WinSock error: %d", WSAGetLastError());
-	}
-	else
+	if (nMillisecsTimeout != XN_SOCKET_DEFAULT_TIMEOUT)
 	{
-		// select returned due to socket state change. Check if an error occurred or everything is OK.
-		if (FD_ISSET(Socket->Socket, &fdExceptHandles))
+		FD_ZERO(&fdWriteHandles);
+		FD_SET(Socket->Socket, &fdWriteHandles);
+		FD_ZERO(&fdExceptHandles);
+		FD_SET(Socket->Socket, &fdExceptHandles);
+		nRetVal = select(1 /* ignored */, NULL, &fdWriteHandles, &fdExceptHandles, pTimeout);
+
+		// in any case, make the socket blocking again before we check select()'s success
+		u_long nBlockingSocket = 0;
+		ioctlsocket(Socket->Socket, FIONBIO, &nBlockingSocket);
+
+		if (nRetVal == 0)
+		{
+			return (XN_STATUS_OS_NETWORK_TIMEOUT);
+		}
+		else if (nRetVal == SOCKET_ERROR)
+		{
+			XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED, XN_MASK_OS, "select() returned WinSock error: %d", WSAGetLastError());
+		}
+		else
 		{
-			XnUInt32 nLastError = 0;
-			XnInt32 nLastErrorSize = sizeof(nLastError);
-			getsockopt(Socket->Socket, SOL_SOCKET, SO_ERROR, (char*)&nLastError, &nLastErrorSize);
-			XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED, XN_MASK_OS, "Connect failed with error: %u", nLastError);
+			// select returned due to socket state change. Check if an error occurred or everything is OK.
+			if (FD_ISSET(Socket->Socket, &fdExceptHandles))
+			{
+				XnUInt32 nLastError = 0;
+				XnInt32 nLastErrorSize = sizeof(nLastError);
+				getsockopt(Socket->Socket, SOL_SOCKET, SO_ERROR, (char*)&nLastError, &nLastErrorSize);
+				XN_LOG_ERROR_RETURN(XN_STATUS_OS_NETWORK_SOCKET_CONNECT_FAILED, XN_MASK_OS, "Connect failed with error: %u", nLastError);
+			}
+			// else, it means it's in the writable state, which means connect succeeded.
+			XN_ASSERT(FD_ISSET(Socket->Socket, &fdWriteHandles));
 		}
-		// else, it means it's in the writable state, which means connect succeeded.
-		XN_ASSERT(FD_ISSET(Socket->Socket, &fdWriteHandles));
 	}
 
 	// All is good...
@@ -410,9 +416,9 @@ XN_C_API XnStatus xnOSSendNetworkBuffer(XN_SOCKET_HANDLE Socket, const XnChar* c
 	// Make sure the actual socket handle isn't NULL
 	XN_RET_IF_NULL(Socket->Socket, XN_STATUS_OS_INVALID_SOCKET);
 
-	// Send the data over our UDP socket to the server and make sure the wanted number of bytes were actually sent
+	// Send the data over our socket to the server and make sure the wanted number of bytes were actually sent
 	nRetVal = send(Socket->Socket, cpBuffer, nBufferSize, 0);
-	if (nRetVal != nBufferSize)
+	if (nRetVal != (int)nBufferSize)
 	{
 		return (XN_STATUS_OS_NETWORK_SEND_FAILED);
 	}
@@ -436,7 +442,7 @@ XN_C_API XnStatus xnOSSendToNetworkBuffer(XN_SOCKET_HANDLE Socket, const XnChar*
 
 	// Send the data over our UDP socket to the server and make sure the wanted number of bytes were actually sent
 	nRetVal = sendto(Socket->Socket, cpBuffer, nBufferSize, 0, (SOCKADDR*)&SocketTo->SocketAddress, sizeof(SOCKADDR));
-	if (nRetVal != nBufferSize)
+	if (nRetVal != (int)nBufferSize)
 	{
 		return (XN_STATUS_OS_NETWORK_SEND_FAILED);
 	}
@@ -492,7 +498,6 @@ XN_C_API XnStatus xnOSReceiveNetworkBuffer(XN_SOCKET_HANDLE Socket, XnChar* cpBu
 XN_C_API XnStatus xnOSReceiveFromNetworkBuffer(XN_SOCKET_HANDLE Socket, XnChar* cpBuffer, XnUInt32* pnBufferSize, XN_SOCKET_HANDLE* SocketFrom)
 {
 	// Local function variables
-	XnInt32 nRetVal = 0;
 	XnInt32 nLen = sizeof(SOCKADDR);	
 
 	// Validate the input/output pointers (to make sure none of them is NULL)
diff --git a/Source/OpenNI/Win32/Win32Processes.cpp b/Source/OpenNI/Win32/Win32Processes.cpp
index e1d4250..68f5438 100644
--- a/Source/OpenNI/Win32/Win32Processes.cpp
+++ b/Source/OpenNI/Win32/Win32Processes.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Win32/Win32Semaphore.cpp b/Source/OpenNI/Win32/Win32Semaphore.cpp
index 8362877..c2cc164 100644
--- a/Source/OpenNI/Win32/Win32Semaphore.cpp
+++ b/Source/OpenNI/Win32/Win32Semaphore.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -44,7 +44,7 @@ XN_C_API XnStatus xnOSCreateSemaphore(XN_SEMAPHORE_HANDLE* pSemaphoreHandle, XnU
 
 XN_C_API XnStatus xnOSLockSemaphore(XN_SEMAPHORE_HANDLE hSemaphore, XnUInt32 nMilliseconds)
 {
-	XN_RET_IF_NULL(hSemaphore, XN_STATUS_OS_INVALID_MUTEX);
+	XN_RET_IF_NULL(hSemaphore, XN_STATUS_OS_INVALID_SEMAPHORE);
 	DWORD nRetVal = WaitForSingleObject(hSemaphore, nMilliseconds);
 
 	switch (nRetVal)
@@ -64,7 +64,7 @@ XN_C_API XnStatus xnOSLockSemaphore(XN_SEMAPHORE_HANDLE hSemaphore, XnUInt32 nMi
 
 XN_C_API XnStatus xnOSUnlockSemaphore(XN_SEMAPHORE_HANDLE hSemaphore)
 {
-	XN_RET_IF_NULL(hSemaphore, XN_STATUS_OS_INVALID_MUTEX);
+	XN_RET_IF_NULL(hSemaphore, XN_STATUS_OS_INVALID_SEMAPHORE);
 	if (!ReleaseSemaphore(hSemaphore, 1, NULL))
 	{
 		xnLogError(XN_MASK_OS, "Failed to release semaphore. Last error was %u.", GetLastError());
@@ -77,7 +77,7 @@ XN_C_API XnStatus xnOSUnlockSemaphore(XN_SEMAPHORE_HANDLE hSemaphore)
 XN_C_API XnStatus xnOSCloseSemaphore(XN_SEMAPHORE_HANDLE* pSemaphoreHandle)
 {
 	XN_VALIDATE_INPUT_PTR(pSemaphoreHandle);
-	XN_RET_IF_NULL(*pSemaphoreHandle, XN_STATUS_OS_INVALID_MUTEX);
+	XN_RET_IF_NULL(*pSemaphoreHandle, XN_STATUS_OS_INVALID_SEMAPHORE);
 	if (!CloseHandle(*pSemaphoreHandle))
 	{
 		xnLogError(XN_MASK_OS, "Failed to release semaphore. Last error was %u.", GetLastError());
diff --git a/Source/OpenNI/Win32/Win32SharedLibs.cpp b/Source/OpenNI/Win32/Win32SharedLibs.cpp
index 12fa07a..f15dda2 100644
--- a/Source/OpenNI/Win32/Win32SharedLibs.cpp
+++ b/Source/OpenNI/Win32/Win32SharedLibs.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Win32/Win32SharedMemory.cpp b/Source/OpenNI/Win32/Win32SharedMemory.cpp
index 8f1b001..1e1ff21 100644
--- a/Source/OpenNI/Win32/Win32SharedMemory.cpp
+++ b/Source/OpenNI/Win32/Win32SharedMemory.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -24,6 +24,7 @@
 //---------------------------------------------------------------------------
 #include <XnOS.h>
 #include <XnLog.h>
+#include "XnOSWin32Internal.h"
 
 //---------------------------------------------------------------------------
 // Types
@@ -81,19 +82,12 @@ static XnStatus AccessFlagsToWin32ViewFlags(XnUInt32 nAccessFlags, DWORD* pFlags
 	return (XN_STATUS_OK);
 }
 
-static XnStatus NameToWin32Name(const XnChar* strName, XnChar* strWin32Name)
+XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem)
 {
-	int i = 0;
-	for (; strName[i] != '\0'; ++i)
-	{
-		// replace all backslashes (not allowed)
-		strWin32Name[i] = strName[i] == '\\' ? '/' : strName[i];
-	}
-	strWin32Name[i] = '\0';
-	return (XN_STATUS_OK);
+	return xnOSCreateSharedMemoryEx(strName, nSize, nAccessFlags, FALSE, phSharedMem);
 }
 
-XN_C_API XnStatus xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem)
+XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemoryEx(const XnChar* strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE* phSharedMem)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 	
@@ -109,8 +103,18 @@ XN_C_API XnStatus xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize,
 	XN_IS_STATUS_OK(nRetVal);
 
 	XnChar strWinName[XN_FILE_MAX_PATH];
-	nRetVal = NameToWin32Name(strName, strWinName);
-	XN_IS_STATUS_OK(nRetVal);
+	nRetVal = XnWin32CreateKernelObjectName(strWinName, MAX_PATH, strName, bAllowOtherUsers);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		return XN_STATUS_OS_EVENT_CREATION_FAILED;
+	}
+
+	SECURITY_ATTRIBUTES* pSecurityAttributes = NULL;
+	nRetVal = XnWin32GetSecurityAttributes(bAllowOtherUsers, &pSecurityAttributes);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		return XN_STATUS_OS_EVENT_CREATION_FAILED;
+	}
 
 	// allocate handle
 	XnOSSharedMemory* pHandle;
@@ -119,7 +123,7 @@ XN_C_API XnStatus xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize,
 	// create file mapping
 	pHandle->hMapFile = CreateFileMapping(
 		INVALID_HANDLE_VALUE,    // use paging file
-		NULL,                    // default security 
+		pSecurityAttributes,     // security 
 		mapflags,		         // read/write access
 		0,                       // max. object size 
 		nSize,                   // buffer size  
@@ -150,6 +154,11 @@ XN_C_API XnStatus xnOSCreateSharedMemory(const XnChar* strName, XnUInt32 nSize,
 
 XN_C_API XnStatus xnOSOpenSharedMemory(const XnChar* strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE* phSharedMem)
 {
+	return xnOSOpenSharedMemoryEx(strName, nAccessFlags, FALSE, phSharedMem);
+}
+
+XN_C_API XnStatus XN_C_DECL xnOSOpenSharedMemoryEx(const XnChar* strName, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE* phSharedMem)
+{
 	XnStatus nRetVal = XN_STATUS_OK;
 
 	XN_VALIDATE_INPUT_PTR(strName);
@@ -160,8 +169,11 @@ XN_C_API XnStatus xnOSOpenSharedMemory(const XnChar* strName, XnUInt32 nAccessFl
 	XN_IS_STATUS_OK(nRetVal);
 
 	XnChar strWinName[XN_FILE_MAX_PATH];
-	nRetVal = NameToWin32Name(strName, strWinName);
-	XN_IS_STATUS_OK(nRetVal);
+	nRetVal = XnWin32CreateKernelObjectName(strWinName, MAX_PATH, strName, bAllowOtherUsers);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		return XN_STATUS_OS_FAILED_TO_OPEN_SHARED_MEMORY;
+	}
 
 	// allocate handle
 	XnOSSharedMemory* pHandle;
@@ -198,8 +210,6 @@ XN_C_API XnStatus xnOSOpenSharedMemory(const XnChar* strName, XnUInt32 nAccessFl
 
 XN_C_API XnStatus xnOSCloseSharedMemory(XN_SHARED_MEMORY_HANDLE hSharedMem)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-	
 	XN_VALIDATE_INPUT_PTR(hSharedMem);
 
 	if (!UnmapViewOfFile(hSharedMem->pAddress))
@@ -219,8 +229,6 @@ XN_C_API XnStatus xnOSCloseSharedMemory(XN_SHARED_MEMORY_HANDLE hSharedMem)
 
 XN_C_API XnStatus xnOSSharedMemoryGetAddress(XN_SHARED_MEMORY_HANDLE hSharedMem, void** ppAddress)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-	
 	XN_VALIDATE_INPUT_PTR(hSharedMem);
 	XN_VALIDATE_OUTPUT_PTR(ppAddress);
 
diff --git a/Source/OpenNI/Win32/Win32Strings.cpp b/Source/OpenNI/Win32/Win32Strings.cpp
index a241b1e..258d97d 100644
--- a/Source/OpenNI/Win32/Win32Strings.cpp
+++ b/Source/OpenNI/Win32/Win32Strings.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -23,6 +23,7 @@
 // Includes
 //---------------------------------------------------------------------------
 #include <XnOS.h>
+#include <XnLog.h>
 
 //---------------------------------------------------------------------------
 // Globals
@@ -228,7 +229,6 @@ XN_C_API XnStatus xnOSStrNCRC32(XnUChar* cpBuffer, XnUInt32 nBufferSize, XnUInt3
 {
 	// Local function variables
 	XnUInt32 nTempCRC32 = 0xffffffff;
-	XnUInt32 nStrLen = 0;
 	XnUInt32 nIdx = 0;
 
 	// Validate the input/output pointers (to make sure none of them is NULL)
@@ -262,7 +262,7 @@ XN_C_API XnStatus xnOSStrFormatV(XnChar* cpDestString, const XnUInt32 nDestLengt
 	// nRes is the number of bytes written, not including NULL termination
 
 	if ((nRes == -1) ||	// string was truncated
-		(nRes == nDestLength && cpDestString[nRes] != '\0')) // no space for the NULL termination
+		(nRes == (XnInt32)nDestLength && cpDestString[nRes] != '\0')) // no space for the NULL termination
 	{
 		return (XN_STATUS_INTERNAL_BUFFER_TOO_SMALL);
 	}
@@ -279,14 +279,53 @@ XN_C_API void xnOSItoA(XnInt32 nValue, XnChar* cpStr, XnInt32 nBase)
 	_itoa(nValue, cpStr, nBase);
 }
 
-XN_C_API XnStatus xnOSExpandEnvironmentStrings(const XnChar* strSrc, XnChar* strDest, XnUInt32 nDestSize)
+XN_C_API XnStatus XN_C_DECL xnOSGetEnvironmentVariable(const XnChar* strEnv, XnChar* strDest, XnUInt32 nDestSize)
 {
-	if (0 == ::ExpandEnvironmentStrings(strSrc, strDest, nDestSize))
+	XN_VALIDATE_INPUT_PTR(strEnv);
+	XN_VALIDATE_INPUT_PTR(strDest);
+	
+	DWORD ret = ::GetEnvironmentVariable(strEnv, strDest, nDestSize);
+	if (ret > nDestSize)
 	{
 		return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW);
 	}
+	else if (ret == 0)
+	{
+		if (ERROR_ENVVAR_NOT_FOUND == GetLastError())
+		{
+			return (XN_STATUS_OS_ENV_VAR_NOT_FOUND);
+		}
+		else
+		{
+			xnLogWarning(XN_MASK_OS, "Could not get environment variable (%d)", GetLastError());
+			return (XN_STATUS_ERROR);
+		}
+	}
+	else
+	{
+		return (XN_STATUS_OK);
+	}
+}
 
-	return (XN_STATUS_OK);
+XN_C_API XnStatus xnOSExpandEnvironmentStrings(const XnChar* strSrc, XnChar* strDest, XnUInt32 nDestSize)
+{
+	XN_VALIDATE_INPUT_PTR(strSrc);
+	XN_VALIDATE_INPUT_PTR(strDest);
+	
+	DWORD ret = ::ExpandEnvironmentStrings(strSrc, strDest, nDestSize);
+	if (ret > nDestSize)
+	{
+		return (XN_STATUS_OUTPUT_BUFFER_OVERFLOW);
+	}
+	else if (ret == 0)
+	{
+		xnLogWarning(XN_MASK_OS, "Could not expand environment variables (%d)", GetLastError());
+		return (XN_STATUS_ERROR);
+	}
+	else
+	{
+		return (XN_STATUS_OK);
+	}
 }
 
 XN_C_API XnInt32 xnOSStrCmp(const XnChar* cpFirstString, const XnChar* cpSecondString)
diff --git a/Source/OpenNI/Win32/Win32Threads.cpp b/Source/OpenNI/Win32/Win32Threads.cpp
index 208af5b..cfd1c47 100644
--- a/Source/OpenNI/Win32/Win32Threads.cpp
+++ b/Source/OpenNI/Win32/Win32Threads.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Win32/Win32Time.cpp b/Source/OpenNI/Win32/Win32Time.cpp
index 98df439..6d06186 100644
--- a/Source/OpenNI/Win32/Win32Time.cpp
+++ b/Source/OpenNI/Win32/Win32Time.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -35,8 +35,6 @@ XnOSTimer g_xnOSHighResGlobalTimer;
 XN_C_API XnStatus xnOSGetEpochTime(XnUInt32* nEpochTime)
 {
 	// Local function variables
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	*nEpochTime = (XnUInt32)time(NULL);
 
 	// All is good...
diff --git a/Source/OpenNI/Win32/XnOSWin32.cpp b/Source/OpenNI/Win32/XnOSWin32.cpp
index e7aadb4..01dc1b3 100644
--- a/Source/OpenNI/Win32/XnOSWin32.cpp
+++ b/Source/OpenNI/Win32/XnOSWin32.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -145,7 +145,7 @@ static void GetCPUName(XnChar* csName)
 		return;
 
 	// else, we need to build the name ourselves
-	xnOSMemSet(CPUInfo, -1, sizeof(CPUInfo));
+	xnOSMemSet(CPUInfo, 0xFF, sizeof(CPUInfo));
 
 	__cpuid(CPUInfo, 0);
 	int nIds = CPUInfo[0];
@@ -160,10 +160,10 @@ static void GetCPUName(XnChar* csName)
         int nSteppingID = CPUInfo[0] & 0xf;
         int nModel = (CPUInfo[0] >> 4) & 0xf;
         int nFamily = (CPUInfo[0] >> 8) & 0xf;
-        int nProcessorType = (CPUInfo[0] >> 12) & 0x3;
-        int nExtendedmodel = (CPUInfo[0] >> 16) & 0xf;
-        int nExtendedfamily = (CPUInfo[0] >> 20) & 0xff;
-        int nBrandIndex = CPUInfo[1] & 0xff;
+        //int nProcessorType = (CPUInfo[0] >> 12) & 0x3;
+        //int nExtendedmodel = (CPUInfo[0] >> 16) & 0xf;
+        //int nExtendedfamily = (CPUInfo[0] >> 20) & 0xff;
+        //int nBrandIndex = CPUInfo[1] & 0xff;
 
 		sprintf(csName+strlen(csName), " Model: %d Family: %d Stepping: %d", nModel, nFamily, nSteppingID);
 	}
@@ -171,8 +171,6 @@ static void GetCPUName(XnChar* csName)
 
 XN_C_API XnStatus xnOSGetInfo(xnOSInfo* pOSInfo)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	// Validate input/output arguments
 	XN_VALIDATE_OUTPUT_PTR(pOSInfo);
 
@@ -214,3 +212,71 @@ XN_C_API XnStatus xnOSGetInfo(xnOSInfo* pOSInfo)
 
 	return (XN_STATUS_OK);
 }
+
+XnStatus XnWin32CreateKernelObjectName(XnChar* strDest, const XnUInt32 nDestLength, const XnChar* strSource, XnBool bAllowOtherUsers)
+{
+	XnChar* pDest = strDest;
+	XnChar* pDestEnd = strDest + nDestLength;
+
+	if (bAllowOtherUsers)
+	{
+		static const XnChar strGlobal[] = "Global\\";
+		strcpy(strDest, strGlobal);
+		pDest = strDest + sizeof(strGlobal) - 1;
+	}
+
+	const XnChar* pSource = strSource;
+
+	while (pDest < pDestEnd && *pSource != '\0')
+	{
+		*pDest = *pSource == '\\' ? '_' : *pSource;
+		++pDest;
+		++pSource;
+	}
+
+	if (pDest == pDestEnd)
+	{
+		xnLogWarning(XN_MASK_OS, "Event name is too long!");
+		return XN_STATUS_ERROR;
+	}
+
+	*pDest = '\0';
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus XnWin32GetSecurityAttributes(XnBool bAllowOtherUsers, SECURITY_ATTRIBUTES** ppSecurityAttributes)
+{
+	*ppSecurityAttributes = NULL;
+
+	static SECURITY_DESCRIPTOR securityDesc;
+	static SECURITY_ATTRIBUTES securityAttributes;
+	static SECURITY_ATTRIBUTES* pSecurityAttributes = NULL;
+
+	if (pSecurityAttributes == NULL)
+	{
+		// initialize it now
+		if (FALSE == InitializeSecurityDescriptor(&securityDesc, SECURITY_DESCRIPTOR_REVISION))
+		{
+			xnLogError(XN_MASK_OS, "Failed to initialize security descriptor (%d)", GetLastError());
+			return XN_STATUS_ERROR;
+		}
+
+		if (FALSE == SetSecurityDescriptorDacl(&securityDesc, TRUE, NULL, FALSE))
+		{
+			xnLogError(XN_MASK_OS, "Failed to set security descriptor DACL (%d)", GetLastError());
+			return XN_STATUS_ERROR;
+		}
+
+		securityAttributes.nLength = sizeof(SECURITY_ATTRIBUTES);
+		securityAttributes.lpSecurityDescriptor = &securityDesc;
+		securityAttributes.bInheritHandle = FALSE;
+
+		// initialization complete. Store a pointer
+		pSecurityAttributes = &securityAttributes;
+	}
+
+	*ppSecurityAttributes = bAllowOtherUsers ? pSecurityAttributes : NULL;
+
+	return (XN_STATUS_OK);
+}
diff --git a/Source/OpenNI/Win32/XnOSWin32Internal.h b/Source/OpenNI/Win32/XnOSWin32Internal.h
new file mode 100644
index 0000000..6aec318
--- /dev/null
+++ b/Source/OpenNI/Win32/XnOSWin32Internal.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __XNOSWIN32INTERNAL_H__
+#define __XNOSWIN32INTERNAL_H__ 
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnOS.h>
+
+//---------------------------------------------------------------------------
+// Functions
+//---------------------------------------------------------------------------
+XnStatus XnWin32CreateKernelObjectName(XnChar* strDest, const XnUInt32 nDestLength, const XnChar* strSource, XnBool bAllowOtherUsers);
+XnStatus XnWin32GetSecurityAttributes(XnBool bAllowOtherUsers, SECURITY_ATTRIBUTES** ppSecurityAttributes);
+
+#endif // __XNOSWIN32INTERNAL_H__
\ No newline at end of file
diff --git a/Source/OpenNI/Win32/XnUSBWin32.cpp b/Source/OpenNI/Win32/XnUSBWin32.cpp
index df9a30f..7724dd4 100644
--- a/Source/OpenNI/Win32/XnUSBWin32.cpp
+++ b/Source/OpenNI/Win32/XnUSBWin32.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -314,9 +314,6 @@ XN_C_API XnStatus xnUSBIsDevicePresent(XnUInt16 /*nVendorID*/, XnUInt16 /*nProdu
 
 XN_C_API XnStatus xnUSBEnumerateDevices(XnUInt16 nVendorID, XnUInt16 nProductID, const XnUSBConnectionString** pastrDevicePaths, XnUInt32* pnCount)
 {
-	// Local variables
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	// support up to 30 devices
 	XnUSBConnectionString cpUSBID;
 	XnUSBConnectionString cpUSBPathCmp;
@@ -588,7 +585,7 @@ XnStatus xnUSBOpenDeviceImpl(const XnChar* strDevicePath, XN_USB_DEV_HANDLE* pDe
 	return (XN_STATUS_OK);
 }
 
-XN_C_API XnStatus xnUSBOpenDevice(XnUInt16 /*nVendorID*/, XnUInt16 /*nProductID*/, void* pExtraParam, void* pExtraParam2, XN_USB_DEV_HANDLE* pDevHandlePtr)
+XN_C_API XnStatus xnUSBOpenDevice(XnUInt16 /*nVendorID*/, XnUInt16 /*nProductID*/, void* /*pExtraParam*/, void* pExtraParam2, XN_USB_DEV_HANDLE* pDevHandlePtr)
 {
 	return xnUSBOpenDeviceImpl((const XnChar*)pExtraParam2, pDevHandlePtr);
 }
@@ -630,17 +627,17 @@ XN_C_API XnStatus xnUSBGetDeviceSpeed(XN_USB_DEV_HANDLE pDevHandle, XnUSBDeviceS
 	return (XN_STATUS_OK);
 }
 
-XN_C_API XnStatus xnUSBSetConfig(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 nConfig)
+XN_C_API XnStatus xnUSBSetConfig(XN_USB_DEV_HANDLE /*pDevHandle*/, XnUInt8 /*nConfig*/)
 {
 	return (XN_STATUS_OS_UNSUPPORTED_FUNCTION);
 }
 
-XN_C_API XnStatus xnUSBGetConfig(XN_USB_DEV_HANDLE pDevHandle, XnUInt8* pnConfig)
+XN_C_API XnStatus xnUSBGetConfig(XN_USB_DEV_HANDLE /*pDevHandle*/, XnUInt8* /*pnConfig*/)
 {
 	return (XN_STATUS_OS_UNSUPPORTED_FUNCTION);
 }
 
-XN_C_API XnStatus xnUSBSetInterface(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 nInterface, XnUInt8 nAltInterface)
+XN_C_API XnStatus xnUSBSetInterface(XN_USB_DEV_HANDLE pDevHandle, XnUInt8 /*nInterface*/, XnUInt8 nAltInterface)
 {
 	// Local variables
 	XnBool bResult = FALSE;
@@ -709,7 +706,7 @@ XN_C_API XnStatus xnUSBOpenEndPoint(XN_USB_DEV_HANDLE pDevHandle, XnUInt16 nEndP
 	PUSB_INTERFACE_DESCRIPTOR pUSBInterfaceDesc = NULL;
 	PUSB_ENDPOINT_DESCRIPTOR pUSBEndPointDesc = NULL;
 	XnUInt32 nIFIdx = 0;
-	XnUInt32 nEPIdx = 0;
+	UCHAR nEPIdx = 0;
 	XnUInt32 nUBBEPType = 0;
 	XN_USB_EP_HANDLE pEPHandle = NULL;	
 	XnChar cpPipeID[3];
@@ -945,7 +942,7 @@ XN_C_API XnStatus xnUSBAbortEndPoint(XN_USB_EP_HANDLE pEPHandle)
 	return (XN_STATUS_OK);
 }
 
-XN_C_API XnStatus xnUSBFlushEndPoint(XN_USB_EP_HANDLE pEPHandle)
+XN_C_API XnStatus xnUSBFlushEndPoint(XN_USB_EP_HANDLE /*pEPHandle*/)
 {
 	return (XN_STATUS_OS_UNSUPPORTED_FUNCTION);
 }
@@ -985,7 +982,7 @@ XN_C_API XnStatus xnUSBSendControl(XN_USB_DEV_HANDLE pDevHandle, XnUSBControlTyp
 
 	// Init the control transfer structure
 	ControlTransfer.cDirection = RequestHostToDevice;
-	ControlTransfer.cRequestType = nType;
+	ControlTransfer.cRequestType = (UCHAR)nType; // cast is safe. enum was defined exactly according to standard
 	ControlTransfer.cRequest = nRequest;
 	ControlTransfer.nValue = nValue;
 	ControlTransfer.nIndex = nIndex;
@@ -1041,7 +1038,7 @@ XN_C_API XnStatus xnUSBReceiveControl(XN_USB_DEV_HANDLE pDevHandle, XnUSBControl
 
 	// Init the control transfer structure
 	ControlTransfer.cDirection = RequestDeviceToHost;
-	ControlTransfer.cRequestType = nType;
+	ControlTransfer.cRequestType = (UCHAR)nType; // cast is safe. enum was defined exactly according to standard
 	ControlTransfer.cRequest = nRequest;
 	ControlTransfer.nValue = nValue;
 	ControlTransfer.nIndex = nIndex;
@@ -1119,8 +1116,11 @@ XN_C_API XnStatus xnUSBReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffer
 	}
 
 	// Reset the endpoint
-	nRetVal = xnUSBResetEndPoint(pEPHandle);
-	XN_IS_STATUS_OK(nRetVal);
+	if (pEPHandle->nEPType == XN_USB_EP_ISOCHRONOUS)
+	{
+		nRetVal = xnUSBResetEndPoint(pEPHandle);
+		XN_IS_STATUS_OK(nRetVal);
+	}
 
 	// Read from the EP
 	bResult = ReadFile(pEPHandle->hEPHandle, pBuffer, nBufferSize, (PULONG)pnBytesReceived, NULL);
@@ -1186,8 +1186,11 @@ XN_C_API XnStatus xnUSBWriteEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pBuffe
 	}
 
 	// Reset the endpoint
-	nRetVal = xnUSBResetEndPoint(pEPHandle);
-	XN_IS_STATUS_OK(nRetVal);
+	if (pEPHandle->nEPType == XN_USB_EP_ISOCHRONOUS)
+	{
+		nRetVal = xnUSBResetEndPoint(pEPHandle);
+		XN_IS_STATUS_OK(nRetVal);
+	}
 
 	// Write into the EP
 	bResult = WriteFile(pEPHandle->hEPHandle, pBuffer, nBufferSize,  (PULONG) &nBytesSent, NULL);
@@ -1253,8 +1256,11 @@ XN_C_API XnStatus xnUSBQueueReadEndPoint(XN_USB_EP_HANDLE pEPHandle, XnUChar* pB
 	}
 
 	// Reset the endpoint
-	nRetVal = xnUSBResetEndPoint(pEPHandle);
-	XN_IS_STATUS_OK(nRetVal);
+	if (pEPHandle->nEPType == XN_USB_EP_ISOCHRONOUS)
+	{
+		nRetVal = xnUSBResetEndPoint(pEPHandle);
+		XN_IS_STATUS_OK(nRetVal);
+	}
 
 	// Queue the read via overlapped I/O
 	bResult = ReadFile(pEPHandle->hEPHandleOvlp, pBuffer, nBufferSize, (PULONG)&nBytesRcvd, &pEPHandle->ovlpIO);
@@ -1315,7 +1321,6 @@ XN_THREAD_PROC xnUSBReadThreadMain(XN_THREAD_PARAM pThreadParam)
 	xnUSBReadThreadData* pThreadData = (xnUSBReadThreadData*)pThreadParam;
 	XnUInt32 nBufIdx = 0;
 	XnBool bResult = FALSE;
-	DWORD nLastErr = 0;
 	ULONG nBytesRead = 0;
 	HANDLE hCompletionPort = NULL;
 	HANDLE hEPOvlp = NULL;
@@ -1501,7 +1506,6 @@ XN_C_API XnStatus xnUSBShutdownReadThread(XN_USB_EP_HANDLE pEPHandle)
 	XnStatus nRetVal = XN_STATUS_OK;
 	xnUSBReadThreadData* pThreadData = NULL;
 	XnUInt32 nBufIdx = 0;
-	BOOL bResult = FALSE;
 
 	// Validate xnUSB
 	XN_VALIDATE_USB_INIT();
diff --git a/Source/OpenNI/Win32/XnUSBWin32.h b/Source/OpenNI/Win32/XnUSBWin32.h
index a6b4a73..2c22bc6 100644
--- a/Source/OpenNI/Win32/XnUSBWin32.h
+++ b/Source/OpenNI/Win32/XnUSBWin32.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/Win32/devioctl.h b/Source/OpenNI/Win32/devioctl.h
index 81d150d..bcb458c 100644
--- a/Source/OpenNI/Win32/devioctl.h
+++ b/Source/OpenNI/Win32/devioctl.h
@@ -1,24 +1,3 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
 /*++ BUILD Version: 0004    // Increment this if a change has global effects
 
 Copyright (c) 1992-1999  Microsoft Corporation
diff --git a/Source/OpenNI/Win32/usb.h b/Source/OpenNI/Win32/usb.h
index 09b419b..4dd2a34 100644
--- a/Source/OpenNI/Win32/usb.h
+++ b/Source/OpenNI/Win32/usb.h
@@ -1,24 +1,3 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
 /*++
 
 Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/Source/OpenNI/Win32/usb100.h b/Source/OpenNI/Win32/usb100.h
index a6cf5c8..e6a9010 100644
--- a/Source/OpenNI/Win32/usb100.h
+++ b/Source/OpenNI/Win32/usb100.h
@@ -1,24 +1,3 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
 #ifndef   __USB100_H__
 #define   __USB100_H__
 
diff --git a/Source/OpenNI/Win32/usb200.h b/Source/OpenNI/Win32/usb200.h
index 072934a..c166b1b 100644
--- a/Source/OpenNI/Win32/usb200.h
+++ b/Source/OpenNI/Win32/usb200.h
@@ -1,24 +1,3 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
 #ifndef   __USB200_H__
 #define   __USB200_H__
 
diff --git a/Source/OpenNI/XnBaseNode.cpp b/Source/OpenNI/XnBaseNode.cpp
index 2ac0445..7214c85 100644
--- a/Source/OpenNI/XnBaseNode.cpp
+++ b/Source/OpenNI/XnBaseNode.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/XnDump.cpp b/Source/OpenNI/XnDump.cpp
new file mode 100644
index 0000000..739c3e3
--- /dev/null
+++ b/Source/OpenNI/XnDump.cpp
@@ -0,0 +1,379 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnDump.h>
+#include <XnDumpWriters.h>
+#include <XnStringsHash.h>
+#include <XnLogTypes.h>
+#include <XnLog.h>
+#include <XnList.h>
+#include <XnArray.h>
+#include "XnDumpFileWriter.h"
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define XN_DUMP_MAX_FORMATTED_STRING_LENGTH	(8*1024)
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+XN_DECLARE_LIST(XnDumpWriter*, XnDumpWriters);
+XN_DECLARE_STRINGS_HASH(XnBool, XnDumpsHash);
+
+class DumpData
+{
+public:
+	DumpData() : bDefaultState(FALSE) {}
+
+	~DumpData() {}
+
+	XnDumpWriters writers;
+	XnDumpsHash dumpsState;
+	XnBool bDefaultState;
+
+	XnDumpFileWriter fileWriter;
+};
+
+typedef struct XnDumpWriterFile
+{
+	XnDumpWriter* pWriter;
+	XnDumpWriterFileHandle hFile;
+} XnDumpWriterFile;
+
+typedef struct XnDumpFile
+{
+	XnArray<XnDumpWriterFile> m_writersFiles;
+} XnDumpFile;
+
+//---------------------------------------------------------------------------
+// Globals
+//---------------------------------------------------------------------------
+static DumpData* g_pDumpData = new DumpData();
+static XnStatus _g_registerStatus = g_pDumpData->fileWriter.Register();
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_C_API XnStatus xnDumpSetMaskState(const XnChar* csMask, XnBool bEnabled)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	if (strcmp(csMask, XN_LOG_MASK_ALL) == 0)
+	{
+		// change default (for future dumps)
+		g_pDumpData->bDefaultState = bEnabled;
+
+		// and set all existing ones
+		for (XnDumpsHash::Iterator it = g_pDumpData->dumpsState.begin(); it != g_pDumpData->dumpsState.end(); ++it)
+		{
+			it.Value() = bEnabled;
+		}
+	}
+	else
+	{
+		nRetVal = g_pDumpData->dumpsState.Set(csMask, bEnabled);
+		XN_IS_STATUS_OK(nRetVal);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnBool XN_C_DECL xnLogIsDumpMaskEnabled(const XnChar* strDumpMask)
+{
+	XN_VALIDATE_INPUT_PTR(strDumpMask);
+
+	XnBool bEnabled = FALSE;
+	g_pDumpData->dumpsState.Get(strDumpMask, bEnabled);
+	return bEnabled;
+}
+
+XN_C_API XnStatus XN_C_DECL xnDumpRegisterWriter(XnDumpWriter* pWriter)
+{
+	return g_pDumpData->writers.AddLast(pWriter);
+}
+
+XN_C_API void XN_C_DECL xnDumpUnregisterWriter(XnDumpWriter* pWriter)
+{
+	g_pDumpData->writers.Remove(pWriter);
+}
+
+XN_C_API XnStatus XN_C_DECL xnDumpSetFilesOutput(XnBool bOn)
+{
+	if (bOn)
+	{
+		return g_pDumpData->fileWriter.Register();
+	}
+	else
+	{
+		g_pDumpData->fileWriter.Unregister();
+	}
+
+	return XN_STATUS_OK;
+}
+
+XnDumpFile* xnDumpFileOpenImpl(const XnChar* strDumpName, XnBool bForce, XnBool bSessionDump, const XnChar* strNameFormat, va_list args)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// check if there are writers
+	if (g_pDumpData->writers.IsEmpty())
+	{
+		return NULL;
+	}
+
+	if (!bForce)
+	{
+		if (!xnLogIsDumpMaskEnabled(strDumpName))
+		{
+			return NULL;
+		}
+	}
+
+	// format file name
+	XnChar strFileName[XN_FILE_MAX_PATH];
+	XnUInt32 nChars;
+	nRetVal = xnOSStrFormatV(strFileName, XN_FILE_MAX_PATH, &nChars, strNameFormat, args);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		XN_ASSERT(FALSE);
+		return NULL;
+	}
+
+	// create a handle that will hold all handles to all writers
+	XnDumpFile* pFile = XN_NEW(XnDumpFile);
+
+	// try to add writers
+	for (XnDumpWriters::Iterator it = g_pDumpData->writers.begin(); it != g_pDumpData->writers.end(); ++it)
+	{
+		XnDumpWriterFile writerFile;
+		writerFile.pWriter = *it;
+		writerFile.hFile = writerFile.pWriter->OpenFile(writerFile.pWriter->pCookie, strDumpName, bSessionDump, strFileName);
+		XN_ASSERT(writerFile.hFile.pInternal != NULL);
+		if (writerFile.hFile.pInternal != NULL)
+		{
+			nRetVal = pFile->m_writersFiles.AddLast(writerFile);
+			XN_ASSERT(nRetVal == XN_STATUS_OK);
+		}
+	}
+
+	// check if any writer succeeded
+	if (pFile->m_writersFiles.IsEmpty())
+	{
+		// no file. Release memory
+		XN_DELETE(pFile);
+		return NULL;
+	}
+
+	// return the file pointer
+	return pFile;
+}
+
+XN_C_API XnDumpFile* XN_C_DECL xnDumpFileOpen(const XnChar* strDumpName, const XnChar* strNameFormat, ...)
+{
+	if (strDumpName == NULL || strNameFormat == NULL)
+	{
+		XN_ASSERT(FALSE);
+		return NULL;
+	}
+
+	va_list args;
+	va_start(args, strNameFormat);
+	XnDumpFile* pFile = xnDumpFileOpenImpl(strDumpName, FALSE, TRUE, strNameFormat, args);
+	va_end(args);
+
+	return pFile;
+}
+
+XN_C_API XnDumpFile* XN_C_DECL xnDumpFileOpenEx(const XnChar* strDumpName, XnBool bForce, XnBool bSessionDump, const XnChar* strNameFormat, ...)
+{
+	if (strNameFormat == NULL)
+	{
+		XN_ASSERT(FALSE);
+		return NULL;
+	}
+
+	va_list args;
+	va_start(args, strNameFormat);
+	XnDumpFile* pFile = xnDumpFileOpenImpl(strDumpName, bForce, bSessionDump, strNameFormat, args);
+	va_end(args);
+
+	return pFile;
+}
+
+XN_C_API void XN_C_DECL _xnDumpFileWriteBuffer(XnDumpFile* pFile, const void* pBuffer, XnUInt32 nBufferSize)
+{
+	if (pFile == NULL)
+	{
+		return;
+	}
+
+	// write to each writer
+	for (XnUInt32 i = 0; i < pFile->m_writersFiles.GetSize(); ++i)
+	{
+		XnDumpWriter* pWriter = pFile->m_writersFiles[i].pWriter;
+		XnDumpWriterFileHandle hWriterFile = pFile->m_writersFiles[i].hFile;
+
+		pWriter->Write(pWriter->pCookie, hWriterFile, pBuffer, nBufferSize);
+	}
+}
+
+XN_C_API void XN_C_DECL _xnDumpFileWriteString(XnDumpFile* pFile, const XnChar* strFormat, ...)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	if (pFile == NULL)
+	{
+		return;
+	}
+
+	// format string
+	XnChar strBuffer[XN_DUMP_MAX_FORMATTED_STRING_LENGTH];
+	XnUInt32 nCharsWritten;
+	va_list args;
+	va_start(args, strFormat);
+	nRetVal = xnOSStrFormatV(strBuffer, sizeof(strBuffer), &nCharsWritten, strFormat, args);
+	XN_ASSERT(nRetVal == XN_STATUS_OK);
+	va_end(args);
+
+	_xnDumpFileWriteBuffer(pFile, (const XnUInt8*)strBuffer, nCharsWritten);
+}
+
+XN_C_API void XN_C_DECL _xnDumpFileClose(XnDumpFile* pFile)
+{
+	if (pFile == NULL)
+	{
+		return;
+	}
+
+	// Notify each writer
+	for (XnUInt32 i = 0; i < pFile->m_writersFiles.GetSize(); ++i)
+	{
+		XnDumpWriter* pWriter = pFile->m_writersFiles[i].pWriter;
+		XnDumpWriterFileHandle hWriterFile = pFile->m_writersFiles[i].hFile;
+
+		pWriter->CloseFile(pWriter->pCookie, hWriterFile);
+	}
+}
+
+//---------------------------------------------------------------------------
+// Backwards Compatibility Stuff
+//---------------------------------------------------------------------------
+#ifndef __XN_NO_BC__
+
+XnStatus xnDumpCreate(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, va_list args)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnChar strFileName[XN_FILE_MAX_PATH];
+	XnUInt32 nChars;
+	nRetVal = xnOSStrFormatV(strFileName, XN_FILE_MAX_PATH, &nChars, csFileNameFormat, args);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnLogCreateFile(strFileName, &pDump->hFile);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		// we don't have much to do if files can't be open. Dump will not be written
+		xnLogWarning(XN_MASK_LOG, "Couldn't create dump file %s! Dump will not be written", strFileName);
+		pDump->hFile = XN_INVALID_FILE_HANDLE;
+		return nRetVal;
+	}
+
+	if (csHeader != NULL)
+	{
+		xnOSWriteFile(pDump->hFile, csHeader, (XnUInt32)strlen(csHeader));
+	}
+
+	return XN_STATUS_OK;
+}
+
+XN_C_API void xnDumpInit(XnDump* pDump, const XnChar* csDumpMask, const XnChar* csHeader, const XnChar* csFileNameFormat, ...)
+{
+	if (pDump->hFile == XN_INVALID_FILE_HANDLE && xnLogIsDumpMaskEnabled(csDumpMask))
+	{
+		va_list args;
+		va_start(args, csFileNameFormat);
+		xnDumpCreate(pDump, csHeader, csFileNameFormat, args);
+		va_end(args);
+	}
+}
+
+XN_C_API void xnDumpForceInit(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, ...)
+{
+	if (pDump->hFile == XN_INVALID_FILE_HANDLE)
+	{
+		va_list args;
+		va_start(args, csFileNameFormat);
+		xnDumpCreate(pDump, csHeader, csFileNameFormat, args);
+		va_end(args);
+	}
+}
+
+XN_C_API void xnDumpClose(XnDump* pDump)
+{
+	if (pDump->hFile != XN_INVALID_FILE_HANDLE)
+	{
+		xnOSCloseFile(&pDump->hFile);
+		*pDump = XN_DUMP_CLOSED;
+	}
+}
+
+XN_C_API void xnDumpWriteBufferImpl(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize)
+{
+	if (dump.hFile != XN_INVALID_FILE_HANDLE) 
+	{
+		xnOSWriteFile(dump.hFile, pBuffer, nBufferSize);
+	}
+}
+
+XN_C_API void xnDumpWriteStringImpl(XnDump dump, const XnChar* csFormat, ...)
+{
+	if (dump.hFile != XN_INVALID_FILE_HANDLE)
+	{
+		const XnUInt32 nStringLength = 1024;
+		XnChar csString[1024];
+
+		va_list args;
+		va_start(args, csFormat);
+
+		// format message
+		XnUInt32 nChars;
+		xnOSStrFormatV(csString, nStringLength, &nChars, csFormat, args);
+
+		// and write it to file
+		xnOSWriteFile(dump.hFile, csString, nChars);
+
+		va_end(args);
+	}
+}
+
+XN_C_API void xnDumpFlush(XnDump dump)
+{
+	if (dump.hFile != XN_INVALID_FILE_HANDLE)
+	{
+		xnOSFlushFile(dump.hFile);
+	}
+}
+
+#endif // #ifndef __XN_NO_BC__
\ No newline at end of file
diff --git a/Source/OpenNI/XnDumpFileWriter.cpp b/Source/OpenNI/XnDumpFileWriter.cpp
new file mode 100644
index 0000000..f91db9c
--- /dev/null
+++ b/Source/OpenNI/XnDumpFileWriter.cpp
@@ -0,0 +1,47 @@
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnDumpFileWriter.h"
+#include <XnLog.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XnDumpWriterFileHandle XnDumpFileWriter::OpenFile(const XnChar* /*strDumpName*/, XnBool bSessionDump, const XnChar* strFileName)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XnDumpWriterFileHandle result = { NULL };
+
+	XN_FILE_HANDLE* phFile = (XN_FILE_HANDLE*)xnOSMalloc(sizeof(XN_FILE_HANDLE));
+	if (phFile == NULL)
+	{
+		return result;
+	}
+	
+	nRetVal = xnLogCreateFileEx(strFileName, bSessionDump, phFile);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		// we don't have much to do if files can't be open. Dump will not be written
+		xnLogWarning(XN_MASK_LOG, "Couldn't create dump file %s! Dump will not be written", strFileName);
+	}
+	else
+	{
+		result.pInternal = phFile;
+	}
+
+	return result;
+}
+
+void XnDumpFileWriter::Write(XnDumpWriterFileHandle hFile, const void* pBuffer, XnUInt32 nBufferSize)
+{
+	XN_FILE_HANDLE* phFileOS = (XN_FILE_HANDLE*)hFile.pInternal;
+	xnOSWriteFile(*phFileOS, pBuffer, nBufferSize);
+}
+
+void XnDumpFileWriter::CloseFile(XnDumpWriterFileHandle hFile)
+{
+	XN_FILE_HANDLE* phFileOS = (XN_FILE_HANDLE*)hFile.pInternal;
+	xnOSCloseFile(phFileOS);
+	xnOSFree(phFileOS);
+}
diff --git a/Source/OpenNI/XnDumpFileWriter.h b/Source/OpenNI/XnDumpFileWriter.h
new file mode 100644
index 0000000..30c66d0
--- /dev/null
+++ b/Source/OpenNI/XnDumpFileWriter.h
@@ -0,0 +1,20 @@
+#ifndef __XN_DUMP_FILE_WRITER_H__
+#define __XN_DUMP_FILE_WRITER_H__ 
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnDumpWriters.h>
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+class XnDumpFileWriter : public XnDumpWriterBase
+{
+public:
+	virtual XnDumpWriterFileHandle OpenFile(const XnChar* strDumpName, XnBool bSessionDump, const XnChar* strFileName);
+	virtual void Write(XnDumpWriterFileHandle hFile, const void* pBuffer, XnUInt32 nBufferSize);
+	virtual void CloseFile(XnDumpWriterFileHandle hFile);
+};
+
+#endif // __XN_DUMP_FILE_WRITER_H__
\ No newline at end of file
diff --git a/Source/OpenNI/XnEnum.h b/Source/OpenNI/XnEnum.h
index 128d557..b3d31b3 100644
--- a/Source/OpenNI/XnEnum.h
+++ b/Source/OpenNI/XnEnum.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/XnEnumerationErrors.cpp b/Source/OpenNI/XnEnumerationErrors.cpp
index 6ef1471..e76e043 100644
--- a/Source/OpenNI/XnEnumerationErrors.cpp
+++ b/Source/OpenNI/XnEnumerationErrors.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -47,8 +47,6 @@ struct XnEnumerationErrors
 
 XN_C_API XnStatus xnEnumerationErrorsAllocate(XnEnumerationErrors** ppError)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-	
 	XN_VALIDATE_OUTPUT_PTR(ppError);
 
 	XN_VALIDATE_CALLOC(*ppError, XnEnumerationErrors, 1);
diff --git a/Source/OpenNI/XnExportedNodes.cpp b/Source/OpenNI/XnExportedNodes.cpp
new file mode 100644
index 0000000..96d31a8
--- /dev/null
+++ b/Source/OpenNI/XnExportedNodes.cpp
@@ -0,0 +1,47 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnXmlScriptNodeExporter.h"
+#include <XnModuleCppRegistratration.h>
+#include "xnInternalFuncs.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XN_EXPORT_MODULE(xn::Module);
+XN_EXPORT_NODE(XnXmlScriptNodeExporter, XN_NODE_TYPE_SCRIPT);
+
+XnOpenNIModuleInterface* GetOpenNIModuleInterface()
+{
+	static XnOpenNIModuleInterface moduleInterface = 
+	{
+		XN_MODULE_LOAD,
+		XN_MODULE_UNLOAD,
+		XN_MODULE_GET_EXPORTED_NODES_COUNT,
+		XN_MODULE_GET_EXPORTED_NODES_ENTRY_POINTS,
+		XN_MODULE_GET_OPEN_NI_VERSION
+	};
+
+	return &moduleInterface;
+}
diff --git a/Source/OpenNI/XnFPSCalculator.cpp b/Source/OpenNI/XnFPSCalculator.cpp
index 7f1bb40..2d8c277 100644
--- a/Source/OpenNI/XnFPSCalculator.cpp
+++ b/Source/OpenNI/XnFPSCalculator.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/XnInternalTypes.h b/Source/OpenNI/XnInternalTypes.h
index 9140a2c..2af9b77 100644
--- a/Source/OpenNI/XnInternalTypes.h
+++ b/Source/OpenNI/XnInternalTypes.h
@@ -1,220 +1,300 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-#ifndef __XN_INTERNAL_TYPES_H__
-#define __XN_INTERNAL_TYPES_H__
-
-#include <XnPlatform.h>
-#include <XnHash.h>
-#include <XnEvent.h>
-#include <XnTypes.h>
-#include <XnStringsHash.h>
-#include <XnFPSCalculator.h>
-#include <XnBitSet.h>
-
-#define XN_OPEN_NI_XML_ROOT_NAME	"OpenNI"
-
-struct XnModuleInstance;
-typedef struct XnModuleInstance ModuleInstance;
-struct XnNodeInfo;
-typedef struct XnNodeInfo XnNodeInfo;
-
-typedef struct XnNeededNodeData
-{
-	XnUInt64 nLastReadTimestamp;
-} XnNeededNodeData;
-
-XN_DECLARE_DEFAULT_HASH(XnNodeHandle, XnNeededNodeData*, XnNeededNodesDataHash)
-
-typedef struct XnLockData
-{
-	XnUInt32 nCurrentLock;
-	XN_THREAD_ID nCurrentThread;
-	XnCallbackHandle hLockChangedCallback;
-} XnLockData;
-
-namespace xn
-{
-	class NodePrivateData
-	{
-	public:
-		virtual ~NodePrivateData() {}
-		virtual void BeforeNodeDestroy() = 0;
-	};
-
-	class DepthPrivateData : public NodePrivateData
-	{
-	public:
-		DepthPrivateData();
-		virtual ~DepthPrivateData();
-		virtual void BeforeNodeDestroy();
-
-		XnStatus Init(XnNodeHandle hDepth);
-
-		inline XnDouble GetRealWorldXtoZ() { return m_fRealWorldXtoZ; }
-		inline XnDouble GetRealWorldYtoZ() { return m_fRealWorldYtoZ; }
-
-	private:
-		void OnFieldOfViewChanged();
-		static void XN_CALLBACK_TYPE FieldOfViewChangedCallback(XnNodeHandle hNode, void* pCookie);
-
-		XnDouble m_fRealWorldXtoZ;
-		XnDouble m_fRealWorldYtoZ;
-		XnNodeHandle m_hNode;
-		XnCallbackHandle m_hFOVCallbackHandle;
-	};
-}
-
-struct XnModuleStateCookie; // Forward Declaration
-XN_DECLARE_DEFAULT_HASH(XnModuleStateCookie*, XnModuleStateCookie*, XnModuleStateCookieHash);
-
-struct XnInternalNodeData
-{
-	XnBitSet typeHierarchy;
-	XnModuleInstance* pModuleInstance;
-	XnNodeInfo* pNodeInfo;
-	XnUInt32 nRefCount;
-	XnContext* pContext;
-	XnBool bIsNewData;
-	XnCallbackHandle hNewDataCallback;
-	XnNeededNodesDataHash* pNeededNodesDataHash; // holds data specific for this edge.
-	XnModuleStateCookieHash* pRegistrationCookiesHash;
-	XnLockData LockData;
-	XnCallbackHandle hErrorStateCallback;
-	XnNodeHandle hFrameSyncedWith;
-	XnCallbackHandle hFrameSyncCallback;
-	XnFPSData genFPS;
-	XnFPSData readFPS;
-	union
-	{
-		XnDepthMetaData* Depth;
-		XnImageMetaData* Image;
-		XnIRMetaData* IR;
-		XnAudioMetaData* Audio;
-		XnSceneMetaData* Scene;
-		void* General;
-	} pMetaData;
-	XnBool* pbMetaDataIsNewFlag;
-	xn::NodePrivateData* pPrivateData;
-	XnBool bWasDataRead; // Changes to TRUE on the first UpdateData() called.
-};
-
-struct XnGestureRecognizedParams
-{
-	XnGestureRecognizedParams(const XnChar *strGesture, const XnPoint3D &idPosition, const XnPoint3D &endPosition) :
-		m_idPosition(idPosition),
-		m_endPosition(endPosition)
-	{
-		xnOSStrNCopy(m_strGesture, strGesture, sizeof(m_strGesture)-1, sizeof(m_strGesture));
-	}
-	XnChar m_strGesture[XN_MAX_NAME_LENGTH];
-	XnPoint3D m_idPosition;
-	XnPoint3D m_endPosition;
-};
-
-struct XnGestureProgressParams
-{
-	XnGestureProgressParams(const XnChar *strGesture, const XnPoint3D &position, XnFloat fProgress) :
-		m_position(position), m_fProgress(fProgress) 
-	{
-		xnOSStrNCopy(m_strGesture, strGesture, sizeof(m_strGesture)-1, sizeof(m_strGesture));
-	}
-	XnChar m_strGesture[XN_MAX_NAME_LENGTH]; 
-	XnPoint3D m_position;
-	XnFloat m_fProgress;
-};
-
-//////////////////////////////////////////////////////////////////////////////////////////
-/** Declared licenses list. */
-XN_DECLARE_LIST(XnLicense, XnLicenseList)
-
-XN_DECLARE_STRINGS_HASH(XnInternalNodeData*, XnNodesMap)
-
-XN_DECLARE_DEFAULT_HASH(const XnNodeInfo*, XnValue, XnProductionNodesSet)
-
-XN_DECLARE_EVENT_1ARG(XnErrorStateChangedEvent, IXnErrorStateChangedEvent, XnStatus, errorState)
-
-class XnModuleLoader;
-
-/** NI Context. */
-struct XnContext
-{
-	XnLicenseList* pLicenses;
-	XnModuleLoader* pModuleLoader;
-	XnNodesMap* pNodesMap;
-	XnBool bGlobalMirrorSet;
-	XnBool bGlobalMirror;
-	XnStatus globalErrorState;
-	XnErrorStateChangedEvent* pGlobalErrorChangeEvent;
-	XN_EVENT_HANDLE hNewDataEvent;
-	XnUInt32 nLastLockID;
-	XnFPSData readFPS;
-};
-
-struct XnNodeInfo
-{
-	/** Description of this generator. */
-	XnProductionNodeDescription Description;
-
-	/** The name of the instance. */
-	XnChar strInstanceName[XN_MAX_NAME_LENGTH];
-
-	/** Additional creation info (this can contain S/N, etc.) */
-	XnChar strCreationInfo[XN_MAX_CREATION_INFO_LENGTH];
-
-	/** 
-	 * A handle that can be used for production nodes functions. A value of NULL signifies an
-	 * option that currently does not exist in the context.
-	 */
-	XnNodeHandle hNode;
-
-	/** A list of needed nodes for this instance to work. */
-	XnNodeInfoList* pNeededTrees;
-
-	/** Ref count */
-	XnUInt32 nRefCount;
-
-	/** additional data */
-	const void* pAdditionalData;
-
-	/** Callback function to be called before freeing the object. */
-	XnFreeHandler pAdditionalDataFreeFunc;
-};
-
-struct XnNodeInfoListNode
-{
-	/** Current node information. */
-	XnNodeInfo* pCurrent;
-
-	/** A pointer to the previous node in the list. */
-	XnNodeInfoListNode* pPrev;
-
-	/** A pointer to the next node in the list. */
-	XnNodeInfoListNode* pNext;
-};
-
-struct XnNodeInfoList
-{
-	XnNodeInfoListNode* pFirst;
-	XnNodeInfoListNode* pLast;
-};
-
-#endif //__XN_INTERNAL_TYPES_H__
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __XN_INTERNAL_TYPES_H__
+#define __XN_INTERNAL_TYPES_H__
+
+#include <XnPlatform.h>
+#include <XnHash.h>
+#include <XnEvent.h>
+#include <XnTypes.h>
+#include <XnStringsHash.h>
+#include <XnFPSCalculator.h>
+#include <XnBitSet.h>
+#include <XnDump.h>
+
+#define XN_OPEN_NI_XML_ROOT_NAME	"OpenNI"
+
+struct XnModuleInstance;
+typedef struct XnModuleInstance ModuleInstance;
+struct XnNodeInfo;
+typedef struct XnNodeInfo XnNodeInfo;
+
+typedef struct XnNeededNodeData
+{
+	XnUInt64 nLastReadTimestamp;
+} XnNeededNodeData;
+
+XN_DECLARE_DEFAULT_HASH(XnNodeHandle, XnNeededNodeData*, XnNeededNodesDataHash)
+
+typedef struct XnLockData
+{
+	XnUInt32 nCurrentLock;
+	XN_THREAD_ID nCurrentThread;
+	XnCallbackHandle hLockChangedCallback;
+} XnLockData;
+
+namespace xn
+{
+	class NodePrivateData
+	{
+	public:
+		virtual ~NodePrivateData() {}
+		virtual void BeforeNodeDestroy() = 0;
+	};
+
+	class DepthPrivateData : public NodePrivateData
+	{
+	public:
+		DepthPrivateData();
+		virtual ~DepthPrivateData();
+		virtual void BeforeNodeDestroy();
+
+		XnStatus Init(XnNodeHandle hDepth);
+
+		inline XnDouble GetRealWorldXtoZ() { return m_fRealWorldXtoZ; }
+		inline XnDouble GetRealWorldYtoZ() { return m_fRealWorldYtoZ; }
+
+	private:
+		void OnFieldOfViewChanged();
+		static void XN_CALLBACK_TYPE FieldOfViewChangedCallback(XnNodeHandle hNode, void* pCookie);
+
+		XnDouble m_fRealWorldXtoZ;
+		XnDouble m_fRealWorldYtoZ;
+		XnNodeHandle m_hNode;
+		XnCallbackHandle m_hFOVCallbackHandle;
+	};
+
+    /// @brief Internal class used to translate pose detection callbacks to an in frame status.
+    class PosePrivateData : public NodePrivateData
+    {
+    public:
+        PosePrivateData(); ///< constructor
+        virtual ~PosePrivateData(); ///< destructor
+        virtual void BeforeNodeDestroy(); ///< cleans the internals. 
+        /// @brief Initializes the class.
+        /// 
+        /// @param hUserGenerator The user generator node which holds the pose detection capability.
+        /// @return The success status.
+        XnStatus Init(XnNodeHandle hUserGenerator); 
+        /// @brief Gets the current pose status
+        /// 
+        /// @param userID The user whose pose status we are interested in.
+        /// @param poseName The pose we want to get a status on.
+        /// @param poseTime The time stamp in which the user entered into the pose (0 if not in pose). 
+        /// @param eStatus The status of the user's pose, i.e. the progress error for getting into 
+        ///                pose (XnPoseDetectionStatus, the same as received from the in progress
+        ///                callback. See @ref xnRegisterToPoseDetectionInProgress).
+        /// @param eState  The state of the user pose (i.e. in pose, out of pose).
+        /// @return The success status. The data is invalid if failed.
+        XnStatus GetPoseStatus(XnUserID userID, const XnChar* poseName, XnUInt64& poseTime, XnPoseDetectionStatus& eStatus, XnPoseDetectionState& eState);
+    private:
+        /// @brief Internal structure to hold the info for a single pose of a single user
+        struct PoseData
+        {
+            XnUInt64 m_lastTimeInPose; ///< @brief The time stamp when we last entered pose (0 if not in pose)
+            XnPoseDetectionStatus m_lastStatus; ///< @brief The last status message from in progress.
+            XnPoseDetectionState m_lastState;  ///< @brief The last state (in/out of pose). Determined by pose detected and out of pose callbacks!
+            PoseData() { Reset(); };
+            /// @brief Resets the struct to the default state which is being out of pose, with a 
+            /// general error and time 0.
+            void Reset() 
+            { 
+                m_lastState=XN_POSE_DETECTION_STATE_OUT_OF_POSE; 
+                m_lastStatus=XN_POSE_DETECTION_STATUS_ERROR;
+                m_lastTimeInPose=0;
+            }
+        };
+        /// @brief Hash to hold the pose data for users for a single pose
+        XN_DECLARE_DEFAULT_HASH(XnUserID,PoseData,UsersPoseDataHash);
+        /// @brief Structure to hold the data of a single pose
+        struct UsersPoseData
+        {
+            UsersPoseDataHash m_usersHash; ///< @brief The users data
+            XnChar *m_poseName;             ///< @brief The pose name.
+        };
+
+        UsersPoseData *m_usersPoseDataPerPose; ///< @brief An array which holds the status for each pose
+        XnUInt32 m_numPoses;        ///< @brief The size of the m_usersPoseDataPerPose array.
+
+        XnCallbackHandle m_userCallbacksHandle; ///< @brief Callback handle to unregister from user callbacks
+        XnCallbackHandle m_poseDetectHandle; ///< @brief Callback handle to unregister from user detection callbacks
+        XnCallbackHandle m_outOfPoseHandle; ///< @brief Callback handle to unregister from out of pose callbacks
+        XnCallbackHandle m_inProgressHandle; ///< @brief Callback handle to unregister from pose in progress callbacks
+        XnNodeHandle m_hUserGenerator; ///< @brief The user generator everything relates to.
+
+        /// @brief callback function
+        static void XN_CALLBACK_TYPE XnNewUserCallback(XnNodeHandle hNode, XnUserID nUserId, void* pCookie);
+        /// @brief callback function
+        static void XN_CALLBACK_TYPE XnLostUserCallback(XnNodeHandle hNode, XnUserID nUserId, void* pCookie);
+        /// @brief callback function
+        static void XN_CALLBACK_TYPE XnPoseInProgressCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID nUserId, XnPoseDetectionStatus ePoseError, void* pCookie);
+        /// @brief callback function
+        static void XN_CALLBACK_TYPE XnPoseDetectedCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID nUserId, void* pCookie);
+        /// @brief callback function
+        static void XN_CALLBACK_TYPE XnOutOfPoseDetectedCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID nUserId, void* pCookie);
+    };
+}
+
+struct XnModuleStateCookie; // Forward Declaration
+XN_DECLARE_DEFAULT_HASH(XnModuleStateCookie*, XnModuleStateCookie*, XnModuleStateCookieHash);
+
+struct XnInternalNodeData
+{
+	XnBitSet* pTypeHierarchy;
+	XnModuleInstance* pModuleInstance;
+	XnNodeInfo* pNodeInfo;
+	XnUInt32 nRefCount;
+	XnContext* pContext;
+	XnBool bIsNewData;
+	XnCallbackHandle hNewDataCallback;
+	XnNeededNodesDataHash* pNeededNodesDataHash; // holds data specific for this edge.
+	XnModuleStateCookieHash* pRegistrationCookiesHash;
+	XnLockData LockData;
+	XnCallbackHandle hErrorStateCallback;
+	XnNodeHandle hFrameSyncedWith;
+	XnCallbackHandle hFrameSyncCallback;
+	XnFPSData genFPS;
+	XnFPSData readFPS;
+	union
+	{
+		XnDepthMetaData* Depth;
+		XnImageMetaData* Image;
+		XnIRMetaData* IR;
+		XnAudioMetaData* Audio;
+		XnSceneMetaData* Scene;
+		void* General;
+	} pMetaData;
+	XnBool* pbMetaDataIsNewFlag;
+	xn::NodePrivateData* pPrivateData;
+	XnBool bWasDataRead; // Changes to TRUE on the first UpdateData() called.
+	XN_CRITICAL_SECTION_HANDLE hLock;
+	XnBool bIsOwnedByContext;
+};
+
+struct XnGestureRecognizedParams
+{
+	XnGestureRecognizedParams(const XnChar *strGesture, const XnPoint3D &idPosition, const XnPoint3D &endPosition) :
+		m_idPosition(idPosition),
+		m_endPosition(endPosition)
+	{
+		xnOSStrNCopy(m_strGesture, strGesture, sizeof(m_strGesture)-1, sizeof(m_strGesture));
+	}
+	XnChar m_strGesture[XN_MAX_NAME_LENGTH];
+	XnPoint3D m_idPosition;
+	XnPoint3D m_endPosition;
+};
+
+struct XnGestureProgressParams
+{
+	XnGestureProgressParams(const XnChar *strGesture, const XnPoint3D &position, XnFloat fProgress) :
+		m_position(position), m_fProgress(fProgress) 
+	{
+		xnOSStrNCopy(m_strGesture, strGesture, sizeof(m_strGesture)-1, sizeof(m_strGesture));
+	}
+	XnChar m_strGesture[XN_MAX_NAME_LENGTH]; 
+	XnPoint3D m_position;
+	XnFloat m_fProgress;
+};
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/** Declared licenses list. */
+XN_DECLARE_LIST(XnLicense, XnLicenseList)
+
+XN_DECLARE_STRINGS_HASH(XnInternalNodeData*, XnNodesMap)
+
+XN_DECLARE_DEFAULT_HASH(const XnNodeInfo*, XnValue, XnProductionNodesSet)
+
+XN_DECLARE_EVENT_1ARG(XnErrorStateChangedEvent, IXnErrorStateChangedEvent, XnStatus, errorState)
+XN_DECLARE_EVENT_1ARG(XnContextShuttingDownEvent, IXnContextShuttingDownEvent, XnContext*, pContext);
+
+class XnModuleLoader;
+
+/** NI Context. */
+struct XnContext
+{
+	XnLicenseList* pLicenses;
+	XnModuleLoader* pModuleLoader;
+	XnNodesMap* pNodesMap;
+	XnBool bGlobalMirrorSet;
+	XnBool bGlobalMirror;
+	XnStatus globalErrorState;
+	XnErrorStateChangedEvent* pGlobalErrorChangeEvent;
+	XN_EVENT_HANDLE hNewDataEvent;
+	XnUInt32 nLastLockID;
+	XnFPSData readFPS;
+	XnUInt32 nRefCount;
+	XN_CRITICAL_SECTION_HANDLE hLock;
+	XnNodeInfoList* pOwnedNodes;
+	XnDumpFile* pDumpRefCount;
+	XnDumpFile* pDumpDataFlow;
+	XnContextShuttingDownEvent* pShutdownEvent;
+};
+
+struct XnNodeInfo
+{
+	/** Description of this generator. */
+	XnProductionNodeDescription Description;
+
+	/** The name of the instance. */
+	XnChar strInstanceName[XN_MAX_NAME_LENGTH];
+
+	/** Additional creation info (this can contain S/N, etc.) */
+	XnChar strCreationInfo[XN_MAX_CREATION_INFO_LENGTH];
+
+	/** 
+	 * A handle that can be used for production nodes functions. A value of NULL signifies an
+	 * option that currently does not exist in the context.
+	 */
+	XnNodeHandle hNode;
+
+	/** A list of needed nodes for this instance to work. */
+	XnNodeInfoList* pNeededTrees;
+
+	/** Ref count */
+	XnUInt32 nRefCount;
+
+	/** additional data */
+	const void* pAdditionalData;
+
+	/** Callback function to be called before freeing the object. */
+	XnFreeHandler pAdditionalDataFreeFunc;
+};
+
+struct XnNodeInfoListNode
+{
+	/** Current node information. */
+	XnNodeInfo* pCurrent;
+
+	/** A pointer to the previous node in the list. */
+	XnNodeInfoListNode* pPrev;
+
+	/** A pointer to the next node in the list. */
+	XnNodeInfoListNode* pNext;
+};
+
+struct XnNodeInfoList
+{
+	XnNodeInfoListNode* pFirst;
+	XnNodeInfoListNode* pLast;
+};
+
+#endif //__XN_INTERNAL_TYPES_H__
diff --git a/Source/OpenNI/XnLicensing.cpp b/Source/OpenNI/XnLicensing.cpp
index 9e4be0f..6ff7979 100644
--- a/Source/OpenNI/XnLicensing.cpp
+++ b/Source/OpenNI/XnLicensing.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -24,6 +24,7 @@
 //---------------------------------------------------------------------------
 #include "XnLicensing.h"
 #include "XnInternalTypes.h"
+#include "xnInternalFuncs.h"
 #include "XnXml.h"
 
 //---------------------------------------------------------------------------
@@ -72,10 +73,10 @@ public:
 		nRetVal = xnXmlReadStringAttribute(pElement, XN_XML_LICENSE_KEY, &strKey);
 		XN_IS_STATUS_OK(nRetVal);
 
-		nRetVal = xnOSStrNCopy(this->strVendor, strVendor, strlen(strVendor) + 1, sizeof(this->strVendor));
+		nRetVal = xnOSStrNCopy(this->strVendor, strVendor, xnOSStrLen(strVendor) + 1, sizeof(this->strVendor));
 		XN_IS_STATUS_OK(nRetVal);
 
-		nRetVal = xnOSStrNCopy(this->strKey, strKey, strlen(strKey) + 1, sizeof(this->strKey));
+		nRetVal = xnOSStrNCopy(this->strKey, strKey, xnOSStrLen(strKey) + 1, sizeof(this->strKey));
 		XN_IS_STATUS_OK(nRetVal);
 		
 		return (XN_STATUS_OK);
@@ -129,24 +130,11 @@ XnStatus resolveLicensesFile(XnChar* strFileName, XnUInt32 nBufSize)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
-#if (XN_PLATFORM == XN_PLATFORM_WIN32)
-	#ifdef _M_X64
-		nRetVal = xnOSExpandEnvironmentStrings("%OPEN_NI_INSTALL_PATH64%\\Data\\licenses.xml", strFileName, nBufSize);
-		XN_IS_STATUS_OK(nRetVal);
-	#else
-		nRetVal = xnOSExpandEnvironmentStrings("%OPEN_NI_INSTALL_PATH%\\Data\\licenses.xml", strFileName, nBufSize);
-		XN_IS_STATUS_OK(nRetVal);
-	#endif
-#elif (CE4100)
-	nRetVal = xnOSStrCopy(strFileName, "/usr/etc/ni/licenses.xml", nBufSize);
-	XN_IS_STATUS_OK(nRetVal);
-#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX)
-	nRetVal = xnOSStrCopy(strFileName, "/var/lib/ni/licenses.xml", nBufSize);
+	nRetVal = xnGetOpenNIConfFilesPath(strFileName, nBufSize);
 	XN_IS_STATUS_OK(nRetVal);
-#else
-	nRetVal = xnOSStrCopy(strFileName, "licenses.xml", nBufSize);
+
+	nRetVal = xnOSStrAppend(strFileName, "licenses.xml", nBufSize);
 	XN_IS_STATUS_OK(nRetVal);
-#endif
 
 	return (XN_STATUS_OK);
 }
@@ -363,8 +351,6 @@ XN_C_API XnStatus xnAddLicense(XnContext* pContext, const XnLicense* pLicense)
 
 XN_C_API XnStatus xnEnumerateLicenses(XnContext* pContext, XnLicense** paLicenses, XnUInt32* pnCount)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	XN_VALIDATE_INPUT_PTR(pContext);
 	XN_VALIDATE_OUTPUT_PTR(paLicenses);
 	XN_VALIDATE_OUTPUT_PTR(pnCount);
diff --git a/Source/OpenNI/XnLicensingInternal.h b/Source/OpenNI/XnLicensingInternal.h
index 86cbfab..675d108 100644
--- a/Source/OpenNI/XnLicensingInternal.h
+++ b/Source/OpenNI/XnLicensingInternal.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/XnLog.cpp b/Source/OpenNI/XnLog.cpp
index 7398a29..fc37654 100644
--- a/Source/OpenNI/XnLog.cpp
+++ b/Source/OpenNI/XnLog.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -22,105 +22,186 @@
 //---------------------------------------------------------------------------
 // Includes
 //---------------------------------------------------------------------------
-#include <XnOS.h>
+#include <XnLog.h>
 #include <XnStringsHash.h>
 #include <XnVersion.h>
 #include <stdarg.h>
 #include "XnXml.h"
+#include <XnList.h>
+#include <XnArray.h>
 
-#define XN_LOG_IMPL
-#include <XnLog.h>
+#include "XnLogConsoleWriter.h"
+#include "XnLogFileWriter.h"
 
 //---------------------------------------------------------------------------
 // Defines
 //---------------------------------------------------------------------------
-#define XN_LOG_MASKS_DELIM	";"
+#define XN_LOG_MASKS_DELIM			";"
+#define XN_LOG_MAX_MESSAGE_LENGTH	2048
 
 //---------------------------------------------------------------------------
 // Types
 //---------------------------------------------------------------------------
-class XnLoggerData
+XN_DECLARE_LIST(const XnLogWriter*, XnLogWritersList);
+
+XN_DECLARE_STRINGS_HASH(XnLogger, XnLogMasksHash);
+
+class XnBufferedLogEntry : public XnLogEntry
+{
+public:
+	XnBufferedLogEntry()
+	{
+		this->strMessage = m_strBuffer;
+	}
+
+	XnChar* Buffer() { return m_strBuffer; }
+	XnUInt32 MaxBufferSize() const { return XN_LOG_MAX_MESSAGE_LENGTH; }
+
+private:
+	XnChar m_strBuffer[XN_LOG_MAX_MESSAGE_LENGTH];
+};
+
+class LogData
 {
 public:
-	XnLoggerData() : m_fLogFile(XN_INVALID_FILE_HANDLE)
+	static LogData& GetInstance()
+	{
+		static LogData data;
+		return data;
+	}
+
+	~LogData()
 	{
+		// This is important. During process shutdown all static objects are destroyed, including log objects
+		// (like writers list). But the order can't be controlled, so some objects might be destroyed *after*
+		// log has. Those objects might write down to the log during destruction which will cause access violation.
+		// So, when the log is destroyed, we're turning it off, so that no writing will take place.
 		Reset();
 	}
 
 	void Reset()
 	{
-		CloseFile();
-		m_csLogDir[0] = '\0';
-		m_nLogFilteringType = XN_LOG_WRITE_NONE;
-		m_bWriteLineInfo = TRUE;
-		m_nDumpFilteringType = XN_LOG_WRITE_NONE;
+		SetMinSeverityGlobally(XN_LOG_SEVERITY_NONE);
+		this->strLogDir[0] = '\0';
+		this->strSessionTimestamp[0] = '\0';
 	}
 
-	void CloseFile()
+	void SetMinSeverityGlobally(XnLogSeverity severity)
 	{
-		m_bBannerPrinted = FALSE;
-		if (m_fLogFile != XN_INVALID_FILE_HANDLE)
+		this->defaultMinSeverity = severity;
+		for (XnLogMasksHash::Iterator it = this->pMasksHash->begin(); it != this->pMasksHash->end(); ++it)
 		{
-			xnOSCloseFile(&m_fLogFile);
-			m_fLogFile = XN_INVALID_FILE_HANDLE; 
+			it.Value().nMinSeverity = severity;
 		}
-		m_csTime[0] = '\0';
 	}
 
-	XnStringsHash m_LogMasks;
-	XN_FILE_HANDLE m_fLogFile;
-	XnChar m_csLogDir[XN_FILE_MAX_PATH];
-	XnChar m_csTime[25];
-	XnLogFilteringType m_nLogFilteringType;
-	XnLogSeverity m_nFilterSeverity;
-	XnBool m_bWriteLineInfo;
-	XnBool m_bWriteToConsole;
-	XnBool m_bWriteToFile;
+	XnChar strLogDir[XN_FILE_MAX_PATH];
+	XnLogMasksHash* pMasksHash;
+	XnLogSeverity defaultMinSeverity;
+	XnLogWritersList writers;
+	XnChar strSessionTimestamp[25];
 
-	XnLogFilteringType m_nDumpFilteringType;
-	XnStringsHash m_DumpMasks;
+	// Writers
+	XnLogConsoleWriter consoleWriter;
+	XnLogFileWriter fileWriter;
 
-	XnBool m_bBannerPrinted;
+private:
+	LogData()
+	{
+		// NOTE: as our log implementation returns a pointer directly into this hash, we can't
+		// free this memory in our dtor (static objects dtors are called in unknown order. modules
+		// might still access this memory after our dtor is called).
+		// As in any case, this is a static object which will only be destroyed when the process goes 
+		// down - we can allow this.
+		this->pMasksHash = XN_NEW(XnLogMasksHash);
+		Reset();
+	}
 };
 
-static XnLoggerData g_xnLoggerData;
+//---------------------------------------------------------------------------
+// Globals
+//---------------------------------------------------------------------------
+XnLogger* XN_LOGGER_RETVAL_CHECKS = xnLoggerOpen(XN_MASK_RETVAL_CHECKS);
+
+//---------------------------------------------------------------------------
+// Forward-Declaration
+//---------------------------------------------------------------------------
+static XnStatus xnLogBCSetMaskState(const XnChar* strMask, XnBool bEnabled);
+static XnStatus xnLogBCSetSeverityFilter(XnLogSeverity nMinSeverity);
 
 //---------------------------------------------------------------------------
 // Code
 //---------------------------------------------------------------------------
+static const XnChar* xnLogGetSeverityString(XnLogSeverity nSeverity)
+{
+	switch (nSeverity)
+	{
+	case XN_LOG_VERBOSE:
+		return "VERBOSE";
+	case XN_LOG_INFO:
+		return "INFO";
+	case XN_LOG_WARNING:
+		return "WARNING";
+	case XN_LOG_ERROR:
+		return "ERROR";
+	case XN_LOG_SEVERITY_NONE:
+		return "NONE";
+	default:
+		return "UNKNOWN";
+	}
+}
 
-const XnChar* xnLogGetSeverityString(XnLogSeverity nSeverity);
-void xnLogWriteImplV(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, va_list args);
+static void xnLogCreateEntryV(XnBufferedLogEntry* pEntry, const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, va_list args)
+{
+	// format message
+	XnUInt32 nChars;
+	xnOSStrFormatV(pEntry->Buffer(), pEntry->MaxBufferSize(), &nChars, csFormat, args);
 
-void xnLogGetMasksString(XnChar* csString)
+	// create log entry
+	xnOSGetHighResTimeStamp(&pEntry->nTimestamp);
+	pEntry->nSeverity = nSeverity;
+	pEntry->strSeverity = xnLogGetSeverityString(nSeverity);
+	pEntry->strMask = csLogMask;
+	pEntry->strFile = csFile;
+	pEntry->nLine = nLine;
+}
+
+static void xnLogCreateEntry(XnBufferedLogEntry* pEntry, const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...)
 {
-	switch (g_xnLoggerData.m_nLogFilteringType)
-	{
-	case XN_LOG_WRITE_NONE:
-		xnOSStrCopy(csString, "NONE", XN_LOG_MASKS_STRING_LEN);
-		return;
-	case XN_LOG_WRITE_ALL:
-		xnOSStrCopy(csString, "ALL", XN_LOG_MASKS_STRING_LEN);
-		return;
-	case XN_LOG_WRITE_MASKS:
-		{
-			csString[0] = '\0';
+	va_list args;
+	va_start(args, csFormat);
+	xnLogCreateEntryV(pEntry, csLogMask, nSeverity, csFile, nLine, csFormat, args);
+	va_end(args);
+}
 
-			for (XnStringsHash::Iterator it = g_xnLoggerData.m_LogMasks.begin(); it != g_xnLoggerData.m_LogMasks.end(); ++it)
-			{
-				xnOSStrAppend(csString, it.Key(), XN_LOG_MASKS_STRING_LEN);
-				xnOSStrAppend(csString, ";", XN_LOG_MASKS_STRING_LEN);
-			}
+static void xnLogWriteEntry(XnLogEntry* pEntry)
+{
+	LogData& logData = LogData::GetInstance();
+	for (XnLogWritersList::ConstIterator it = logData.writers.begin(); it != logData.writers.end(); ++it)
+	{
+		const XnLogWriter* pWriter = *it;
+		pWriter->WriteEntry(pEntry, pWriter->pCookie);
+	}
+}
 
-			return;
-		}
-	default:
-		xnOSStrCopy(csString, "UNKNOWN", XN_LOG_MASKS_STRING_LEN);
+static void xnLogWriteImplV(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, va_list args)
+{
+	// check if there are any writers registered
+	LogData& logData = LogData::GetInstance();
+	if (logData.writers.IsEmpty())
+	{
+		// don't waste time formatting anything.
 		return;
 	}
+
+	XnBufferedLogEntry entry;
+	xnLogCreateEntryV(&entry, csLogMask, nSeverity, csFile, nLine, csFormat, args);
+
+	// write it down
+	xnLogWriteEntry(&entry);
 }
 
-void xnLogWriteImpl(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...)
+static void xnLogWriteImpl(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...)
 {
 	va_list args;
 	va_start(args, csFormat);
@@ -128,49 +209,139 @@ void xnLogWriteImpl(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnCh
 	va_end(args);
 }
 
-XnStatus xnLogCreateFile(const XnChar* csFileName, XN_FILE_HANDLE* phFile)
+XN_C_API XnStatus XN_C_DECL xnLogCreateFileEx(const XnChar* csFileName, XnBool bSessionBased, XN_FILE_HANDLE* phFile)
 {
-	// create the log directory (to make sure it exists)
-	xnOSCreateDirectory(g_xnLoggerData.m_csLogDir);
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	LogData& logData = LogData::GetInstance();
+
+	// set log directory
+	if (logData.strLogDir[0] == '\0')
+	{
+		nRetVal = xnLogSetOutputFolder(XN_LOG_DIR_NAME);
+		XN_IS_STATUS_OK(nRetVal);
+	}
+
+	if (logData.strSessionTimestamp[0] == '\0')
+	{
+		time_t currtime;
+		time(&currtime);
+		strftime(logData.strSessionTimestamp, sizeof(logData.strSessionTimestamp)-1, "%Y_%m_%d__%H_%M_%S", localtime(&currtime)); 
+	}
+
+	XN_PROCESS_ID nProcID = 0;
+	xnOSGetCurrentProcessID(&nProcID);
+
+	// create full path file name - add process start time and process ID
+	XnChar strFilePath[XN_FILE_MAX_PATH];
+	XnUInt32 nPathSize = 0;
+	XnUInt32 nCharsWritten = 0;
+	nRetVal = xnOSStrFormat(strFilePath, XN_FILE_MAX_PATH - nPathSize, &nCharsWritten, "%s", logData.strLogDir);
+	XN_IS_STATUS_OK(nRetVal);
+	nPathSize += nCharsWritten;
+
+	if (bSessionBased)
+	{
+		nRetVal = xnOSStrFormat(strFilePath + nPathSize, XN_FILE_MAX_PATH - nPathSize, &nCharsWritten, "%s_%u.", logData.strSessionTimestamp, nProcID);
+		XN_IS_STATUS_OK(nRetVal);
+		nPathSize += nCharsWritten;
+	}
+
+	nRetVal = xnOSStrFormat(strFilePath + nPathSize, XN_FILE_MAX_PATH - nPathSize, &nCharsWritten, "%s", csFileName);
+	XN_IS_STATUS_OK(nRetVal);
+	nPathSize += nCharsWritten;
 
-	// now open the file
-	return xnOSOpenFile(csFileName, XN_OS_FILE_WRITE | XN_OS_FILE_TRUNCATE, phFile);
+	// and open the file
+	nRetVal = xnOSOpenFile(strFilePath, XN_OS_FILE_WRITE | XN_OS_FILE_TRUNCATE, phFile);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
 }
 
-void xnLogConfigurationChanged()
+XN_C_API XnStatus xnLogCreateFile(const XnChar* csFileName, XN_FILE_HANDLE* phFile)
 {
-	// if new configuration requires a log file, and we don't have one opened
-	if (g_xnLoggerData.m_nLogFilteringType != XN_LOG_WRITE_NONE && g_xnLoggerData.m_bWriteToFile && g_xnLoggerData.m_fLogFile == XN_INVALID_FILE_HANDLE)
+	return xnLogCreateFileEx(csFileName, TRUE, phFile);
+}
+
+static void xnLogCreateFilterChangedMessage(XnBufferedLogEntry* pEntry)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	LogData& logData = LogData::GetInstance();
+
+	XnChar strConfigMessage[XN_LOG_MAX_MESSAGE_LENGTH];
+	XnUInt32 nCharsWritten = 0;
+	XnUInt32 nMessageLength = 0;
+	nRetVal = xnOSStrFormat(strConfigMessage, XN_LOG_MAX_MESSAGE_LENGTH, &nCharsWritten, "--- Filter Info --- Minimum Severity: %s", xnLogGetSeverityString(logData.defaultMinSeverity));
+	XN_ASSERT(nRetVal == XN_STATUS_OK);
+	nMessageLength += nCharsWritten;
+
+	XnBool bOverrides = FALSE;
+
+	// go over masks, and see if there are any overrides
+	for (XnLogMasksHash::ConstIterator it = logData.pMasksHash->begin(); it != logData.pMasksHash->end(); ++it)
 	{
-		XN_PROCESS_ID nProcID = 0;
-		xnOSGetCurrentProcessID(&nProcID);
-		XnChar strFileName[XN_FILE_MAX_PATH];
-		sprintf(strFileName, "%s%s_%u.log", g_xnLoggerData.m_csLogDir, g_xnLoggerData.m_csTime, nProcID);
-		XnStatus nRetVal = xnLogCreateFile(strFileName, &g_xnLoggerData.m_fLogFile);
-		if (nRetVal != XN_STATUS_OK)
+		XnLogSeverity maskSeverity = it.Value().nMinSeverity;
+		if (maskSeverity != logData.defaultMinSeverity)
 		{
-			// we don't have much to do if files can't be open. Logs will not be written to file
-			printf("Couldn't create log file %s! Logs will not be written (error: %s)\n", strFileName, xnGetStatusString(nRetVal));
-			g_xnLoggerData.m_fLogFile = XN_INVALID_FILE_HANDLE;
-			g_xnLoggerData.m_bWriteToFile = FALSE;
+			if (!bOverrides)
+			{
+				nRetVal = xnOSStrFormat(strConfigMessage + nMessageLength, sizeof(strConfigMessage) - nMessageLength, &nCharsWritten, ". Overriding Masks - ");
+				XN_ASSERT(nRetVal == XN_STATUS_OK);
+				bOverrides = TRUE;
+				nMessageLength += nCharsWritten;
+			}
+			else
+			{
+				nRetVal = xnOSStrFormat(strConfigMessage + nMessageLength, sizeof(strConfigMessage) - nMessageLength, &nCharsWritten, ", ");
+				XN_ASSERT(nRetVal == XN_STATUS_OK);
+				nMessageLength += nCharsWritten;
+			}
+
+			nRetVal = xnOSStrFormat(strConfigMessage + nMessageLength, sizeof(strConfigMessage) - nMessageLength, &nCharsWritten, "'%s': %s", it.Key(), xnLogGetSeverityString(maskSeverity));
+			XN_ASSERT(nRetVal == XN_STATUS_OK);
+			nMessageLength += nCharsWritten;
 		}
 	}
 
-	if (!g_xnLoggerData.m_bBannerPrinted && xnLogIsEnabled(XN_MASK_LOG, XN_LOG_INFO))
-	{
-		xnLogInfo(XN_MASK_LOG, "OpenNI version is %s", XN_VERSION_STRING);
-		g_xnLoggerData.m_bBannerPrinted = TRUE;
-	}
+	xnLogCreateEntry(pEntry, XN_MASK_LOG, XN_LOG_INFO, __FILE__, __LINE__, "%s", strConfigMessage);
+}
+
+static void xnLogFilterChanged()
+{
+	XnBufferedLogEntry entry;
+	xnLogCreateFilterChangedMessage(&entry);
+	xnLogWriteEntry(&entry);
 
-	if (g_xnLoggerData.m_fLogFile != XN_INVALID_FILE_HANDLE)
+	LogData& logData = LogData::GetInstance();
+	for (XnLogWritersList::ConstIterator it = logData.writers.begin(); it != logData.writers.end(); ++it)
 	{
-		XnChar csMasks[XN_LOG_MASKS_STRING_LEN];
-		xnLogGetMasksString(csMasks);
-		xnLogWriteImpl(XN_MASK_LOG, XN_LOG_INFO, __FILE__, __LINE__, "Log system initialized. Console: %d, File: %d, Severity: %s, Masks: %s",
-			g_xnLoggerData.m_bWriteToConsole, g_xnLoggerData.m_bWriteToFile, xnLogGetSeverityString(g_xnLoggerData.m_nFilterSeverity), csMasks);
+		const XnLogWriter* pWriter = *it;
+		pWriter->OnConfigurationChanged(pWriter->pCookie);
 	}
 }
 
+XN_C_API void xnLogWriteBanner(const XnLogWriter* pWriter)
+{
+	XnBufferedLogEntry entry;
+
+	// write system time
+	time_t currtime;
+	time(&currtime);
+	XnChar strTime[200];
+	strftime(strTime, sizeof(strTime) - 1, "%Y-%m-%d %H:%M:%S", localtime(&currtime)); 
+	xnLogCreateEntry(&entry, XN_MASK_LOG, XN_LOG_INFO, __FILE__, __LINE__, "New log started on %s", strTime);
+	pWriter->WriteEntry(&entry, pWriter->pCookie);
+
+	// write version
+	xnLogCreateEntry(&entry, XN_MASK_LOG, XN_LOG_INFO, __FILE__, __LINE__, "OpenNI version is %s", XN_VERSION_STRING);
+	pWriter->WriteEntry(&entry, pWriter->pCookie);
+
+	// write filters
+	xnLogCreateFilterChangedMessage(&entry);
+	pWriter->WriteEntry(&entry, pWriter->pCookie);
+}
+
 XN_C_API XnStatus xnLogInitSystem()
 {
 	// make sure xnOS is initialized (we need timers)
@@ -180,57 +351,44 @@ XN_C_API XnStatus xnLogInitSystem()
 		return (nRetVal);
 	}
 
-	if (g_xnLoggerData.m_csLogDir[0] == '\0')
-	{
-		XnChar csCurDir[XN_FILE_MAX_PATH];
-		xnOSGetCurrentDir(csCurDir, XN_FILE_MAX_PATH);
-		XnUInt32 nBytesWritten;
-		xnOSStrFormat(g_xnLoggerData.m_csLogDir, XN_FILE_MAX_PATH, &nBytesWritten, "%s%s%s%s", csCurDir, XN_FILE_DIR_SEP, XN_LOG_DIR_NAME, XN_FILE_DIR_SEP);
-	}
-
-	if (g_xnLoggerData.m_csTime[0] == '\0')
-	{
-		time_t currtime;
-		time(&currtime);
-		strftime(g_xnLoggerData.m_csTime, sizeof(g_xnLoggerData.m_csTime)-1, "%Y_%m_%d__%H_%M_%S", localtime(&currtime)); 
-	}
-
-	xnLogConfigurationChanged();
-
 	return (XN_STATUS_OK);
 }
 
-void xnLogSetMasks(XnChar* csMasks, XnStringsHash* pMasksHash)
+typedef XnStatus (*XnSetMaskFunc)(const XnChar* csMask, XnBool bEnabled);
+
+static XnStatus xnLogSetMasks(XnChar* csMasks, XnSetMaskFunc pSetMaskFunc)
 {
-	pMasksHash->Clear();
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	nRetVal = xnLogBCSetMaskState(XN_LOG_MASK_ALL, FALSE);
+	XN_IS_STATUS_OK(nRetVal);
 
 	XnChar* pMask = strtok(csMasks, XN_LOG_MASKS_DELIM);
 	while (pMask != NULL)
 	{
-		pMasksHash->Set(pMask, NULL);
+		nRetVal = pSetMaskFunc(pMask, TRUE);
+		XN_IS_STATUS_OK(nRetVal);
+
+		// get next
 		pMask = strtok(NULL, XN_LOG_MASKS_DELIM);
 	}
+
+	return (XN_STATUS_OK);
 }
 
-void xnLogReadMasksFromINI(const XnChar* cpINIFileName, const XnChar* cpSectionName, const XnChar* cpKey, XnLogFilteringType* pFilteringType, XnStringsHash* pMasksHash)
+static XnStatus xnLogReadMasksFromINI(const XnChar* cpINIFileName, const XnChar* cpSectionName, const XnChar* cpKey, XnSetMaskFunc pSetMaskFunc)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 	XnChar csTemp[XN_INI_MAX_LEN] = "";
 
-	*pFilteringType = XN_LOG_WRITE_NONE;
-
 	nRetVal = xnOSReadStringFromINI(cpINIFileName, cpSectionName, cpKey, csTemp, XN_INI_MAX_LEN);
 	if (nRetVal == XN_STATUS_OK)
 	{
-		if (strcmp(csTemp, XN_LOG_MASK_ALL) == 0)
-			*pFilteringType = XN_LOG_WRITE_ALL;
-		else if (csTemp[0] == '\0')	// empty
-			*pFilteringType = XN_LOG_WRITE_NONE;
-		else
-			*pFilteringType = XN_LOG_WRITE_MASKS;
+		nRetVal = xnLogSetMasks(csTemp, pSetMaskFunc);
+		XN_IS_STATUS_OK(nRetVal);
 	}
 
-	xnLogSetMasks(csTemp, pMasksHash);
+	return (XN_STATUS_OK);
 }
 
 XN_C_API XnStatus xnLogInitFromINIFile(const XnChar* cpINIFileName, const XnChar* cpSectionName)
@@ -238,30 +396,45 @@ XN_C_API XnStatus xnLogInitFromINIFile(const XnChar* cpINIFileName, const XnChar
 	XnStatus nRetVal = XN_STATUS_OK;
 	XnUInt32 nTemp;
 
-	xnLogReadMasksFromINI(cpINIFileName, cpSectionName, "LogMasks", &g_xnLoggerData.m_nLogFilteringType, &g_xnLoggerData.m_LogMasks);
-	xnLogReadMasksFromINI(cpINIFileName, cpSectionName, "DumpMasks", &g_xnLoggerData.m_nDumpFilteringType, &g_xnLoggerData.m_DumpMasks);
+	nRetVal = xnLogInitSystem();
+	XN_IS_STATUS_OK(nRetVal);
+
+	// read filters
+	xnLogReadMasksFromINI(cpINIFileName, cpSectionName, "LogMasks", xnLogBCSetMaskState);
+	xnLogReadMasksFromINI(cpINIFileName, cpSectionName, "DumpMasks", xnDumpSetMaskState);
+
+	LogData::GetInstance().SetMinSeverityGlobally(XN_LOG_SEVERITY_NONE);
 
-	g_xnLoggerData.m_nFilterSeverity = XN_LOG_ERROR;
 	nRetVal = xnOSReadIntFromINI(cpINIFileName, cpSectionName, "LogLevel", &nTemp);
 	if (nRetVal == XN_STATUS_OK)
-		g_xnLoggerData.m_nFilterSeverity = (XnLogSeverity)nTemp;
+	{
+		nRetVal = xnLogBCSetSeverityFilter((XnLogSeverity)nTemp);
+		XN_IS_STATUS_OK(nRetVal);
+	}
 
-	g_xnLoggerData.m_bWriteToConsole = FALSE;
+	// configure writers
 	nRetVal = xnOSReadIntFromINI(cpINIFileName, cpSectionName, "LogWriteToConsole", &nTemp);
 	if (nRetVal == XN_STATUS_OK)
-		g_xnLoggerData.m_bWriteToConsole = nTemp;
+	{
+		nRetVal = xnLogSetConsoleOutput(nTemp);
+		XN_IS_STATUS_OK(nRetVal);
+	}
 
-	g_xnLoggerData.m_bWriteToFile = TRUE;
 	nRetVal = xnOSReadIntFromINI(cpINIFileName, cpSectionName, "LogWriteToFile", &nTemp);
 	if (nRetVal == XN_STATUS_OK)
-		g_xnLoggerData.m_bWriteToFile = nTemp;
+	{
+		nRetVal = xnLogSetFileOutput(nTemp);
+		XN_IS_STATUS_OK(nRetVal);
+	}
 
-	g_xnLoggerData.m_bWriteLineInfo = TRUE;
 	nRetVal = xnOSReadIntFromINI(cpINIFileName, cpSectionName, "LogWriteLineInfo", &nTemp);
 	if (nRetVal == XN_STATUS_OK)
-		g_xnLoggerData.m_bWriteLineInfo = nTemp;
+	{
+		nRetVal = xnLogSetLineInfo(nTemp);
+		XN_IS_STATUS_OK(nRetVal);
+	}
 
-	return xnLogInitSystem();
+	return XN_STATUS_OK;
 }
 
 XN_C_API XnStatus xnLogInitFromXmlFile(const XnChar* strFileName)
@@ -281,35 +454,9 @@ XN_C_API XnStatus xnLogInitFromXmlFile(const XnChar* strFileName)
 		TiXmlElement* pLog = pRootElem->FirstChildElement("Log");
 		if (pLog != NULL)
 		{
-			// configure
 			XnBool bOn;
 
-			if (pLog->Attribute("writeToConsole"))
-			{
-				nRetVal = xnXmlReadBoolAttribute(pLog, "writeToConsole", &bOn);
-				XN_IS_STATUS_OK(nRetVal);
-
-				nRetVal = xnLogSetConsoleOutput(bOn);
-				XN_IS_STATUS_OK(nRetVal);
-			}
-
-			if (pLog->Attribute("writeToFile"))
-			{
-				nRetVal = xnXmlReadBoolAttribute(pLog, "writeToFile", &bOn);
-				XN_IS_STATUS_OK(nRetVal);
-
-				nRetVal = xnLogSetFileOutput(bOn);
-				XN_IS_STATUS_OK(nRetVal);
-			}
-
-			if (pLog->Attribute("writeLineInfo"))
-			{
-				nRetVal = xnXmlReadBoolAttribute(pLog, "writeLineInfo", &bOn);
-				XN_IS_STATUS_OK(nRetVal);
-
-				nRetVal = xnLogSetLineInfo(bOn);
-				XN_IS_STATUS_OK(nRetVal);
-			}
+			// configure filters
 			TiXmlElement* pLogLevel = pLog->FirstChildElement("LogLevel");
 			if (pLogLevel != NULL)
 			{
@@ -317,7 +464,7 @@ XN_C_API XnStatus xnLogInitFromXmlFile(const XnChar* strFileName)
 				nRetVal = xnXmlReadIntAttribute(pLogLevel, "value", &nValue);
 				XN_IS_STATUS_OK(nRetVal);
 
-				nRetVal = xnLogSetSeverityFilter((XnLogSeverity)nValue);
+				nRetVal = xnLogBCSetSeverityFilter((XnLogSeverity)nValue);
 				XN_IS_STATUS_OK(nRetVal);
 			}
 
@@ -334,13 +481,41 @@ XN_C_API XnStatus xnLogInitFromXmlFile(const XnChar* strFileName)
 					nRetVal = xnXmlReadBoolAttribute(pMask, "on", &bOn);
 					XN_IS_STATUS_OK(nRetVal);
 
-					nRetVal = xnLogSetMaskState(strName, bOn);
+					nRetVal = xnLogBCSetMaskState(strName, bOn);
 					XN_IS_STATUS_OK(nRetVal);
 
 					pMask = pMask->NextSiblingElement("Mask");
 				}
 			}
 
+			// configure writers
+			if (pLog->Attribute("writeToConsole"))
+			{
+				nRetVal = xnXmlReadBoolAttribute(pLog, "writeToConsole", &bOn);
+				XN_IS_STATUS_OK(nRetVal);
+
+				nRetVal = xnLogSetConsoleOutput(bOn);
+				XN_IS_STATUS_OK(nRetVal);
+			}
+
+			if (pLog->Attribute("writeToFile"))
+			{
+				nRetVal = xnXmlReadBoolAttribute(pLog, "writeToFile", &bOn);
+				XN_IS_STATUS_OK(nRetVal);
+
+				nRetVal = xnLogSetFileOutput(bOn);
+				XN_IS_STATUS_OK(nRetVal);
+			}
+
+			if (pLog->Attribute("writeLineInfo"))
+			{
+				nRetVal = xnXmlReadBoolAttribute(pLog, "writeLineInfo", &bOn);
+				XN_IS_STATUS_OK(nRetVal);
+
+				nRetVal = xnLogSetLineInfo(bOn);
+				XN_IS_STATUS_OK(nRetVal);
+			}
+
 			// Dumps
 			TiXmlElement* pDumps = pLog->FirstChildElement("Dumps");
 			if (pDumps != NULL)
@@ -367,228 +542,398 @@ XN_C_API XnStatus xnLogInitFromXmlFile(const XnChar* strFileName)
 	return (XN_STATUS_OK);
 }
 
+XN_C_API XnStatus xnLogRegisterLogWriter(const XnLogWriter* pWriter)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	LogData& logData = LogData::GetInstance();
+	nRetVal = logData.writers.AddLast(pWriter);
+	XN_IS_STATUS_OK(nRetVal);
+
+	xnLogWriteBanner(pWriter);
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API void xnLogUnregisterLogWriter(const XnLogWriter* pWriter)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	LogData& logData = LogData::GetInstance();
+	nRetVal = logData.writers.Remove(pWriter);
+	XN_ASSERT(nRetVal == XN_STATUS_OK);
+}
+
 XN_C_API XnStatus xnLogStartNewFile()
 {
-	g_xnLoggerData.CloseFile();
-	return xnLogInitSystem();
+	LogData& logData = LogData::GetInstance();
+	if (!logData.fileWriter.IsRegistered())
+	{
+		return XN_STATUS_INVALID_OPERATION;
+	}
+
+	logData.fileWriter.Unregister();
+	return logData.fileWriter.Register();
 }
 
 XN_C_API XnStatus xnLogClose()
 {
-	g_xnLoggerData.Reset();
+	// notify all writers (while allowing them to unregister themselves)
+	LogData& logData = LogData::GetInstance();
+	XnLogWritersList::ConstIterator it = logData.writers.begin();
+	while (it != logData.writers.end())
+	{
+		XnLogWritersList::ConstIterator curr = it;
+		++it;
+
+		const XnLogWriter* pWriter = *curr;
+		pWriter->OnClosing(pWriter->pCookie);
+	}
+
+	logData.strLogDir[0] = '\0';
+	logData.strSessionTimestamp[0] = '\0';
+	logData.pMasksHash->Clear();
+	logData.defaultMinSeverity = XN_LOG_SEVERITY_NONE;
+
+	// turn off all dumps
+	xnDumpSetMaskState(XN_LOG_MASK_ALL, FALSE);
 
 	return XN_STATUS_OK;
 }
 
-XN_C_API XnStatus xnLogSetMaskState(const XnChar* csMask, XnBool bEnabled)
+XN_C_API XnStatus xnLogSetConsoleOutput(XnBool bConsoleOutput)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
-	if (strcmp(csMask, XN_LOG_MASK_ALL) == 0)
+	LogData& logData = LogData::GetInstance();
+	if (bConsoleOutput)
 	{
-		g_xnLoggerData.m_nLogFilteringType = bEnabled ? XN_LOG_WRITE_ALL : XN_LOG_WRITE_NONE;
-		xnLogConfigurationChanged();
+		nRetVal = logData.consoleWriter.Register();
+		XN_IS_STATUS_OK(nRetVal);
 	}
 	else
 	{
-		g_xnLoggerData.m_nLogFilteringType = XN_LOG_WRITE_MASKS;
+		logData.consoleWriter.Unregister();
+	}
 
-		if (bEnabled)
-		{
-			nRetVal = g_xnLoggerData.m_LogMasks.Set(csMask, NULL);
-			XN_IS_STATUS_OK(nRetVal);
-		}
-		else
-		{
-			XnValue val = NULL;
-			nRetVal = g_xnLoggerData.m_LogMasks.Remove(csMask, val);
-			if (nRetVal != XN_STATUS_OK && nRetVal != XN_STATUS_NO_MATCH)
-			{
-				return (XN_STATUS_OK);
-			}
-		}
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnLogSetFileOutput(XnBool bFileOutput)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	LogData& logData = LogData::GetInstance();
+	if (bFileOutput)
+	{
+		nRetVal = logData.fileWriter.Register();
+		XN_IS_STATUS_OK(nRetVal);
+	}
+	else
+	{
+		logData.fileWriter.Unregister();
 	}
 
+	return XN_STATUS_OK;
+}
+
+XN_C_API XnStatus xnLogSetLineInfo(XnBool bLineInfo)
+{
+	LogData& logData = LogData::GetInstance();
+	logData.fileWriter.SetLineInfo(bLineInfo);
 	return (XN_STATUS_OK);
 }
 
-XN_C_API XnStatus xnDumpSetMaskState(const XnChar* csMask, XnBool bEnabled)
+XN_C_API XnStatus xnLogSetOutputFolder(const XnChar* strOutputFolder)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
+	
+	// check if folder exists
+	XnBool bDirExists = FALSE;
+	nRetVal = xnOSDoesDirecotyExist(strOutputFolder, &bDirExists);
+	XN_IS_STATUS_OK(nRetVal);
 
-	if (strcmp(csMask, XN_LOG_MASK_ALL) == 0)
+	if (!bDirExists)
 	{
-		g_xnLoggerData.m_nDumpFilteringType = bEnabled ? XN_LOG_WRITE_ALL : XN_LOG_WRITE_NONE;
+		// create it
+		nRetVal = xnOSCreateDirectory(strOutputFolder);
+		XN_IS_STATUS_OK(nRetVal);
 	}
-	else
+	
+	// place it in a temp buffer, just to make sure everything succeeds
+	XnChar strDirName[XN_FILE_MAX_PATH];
+	nRetVal = xnOSGetFullPathName(strOutputFolder, strDirName, XN_FILE_MAX_PATH);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnOSStrAppend(strDirName, XN_FILE_DIR_SEP, XN_FILE_MAX_PATH);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// OK. replace
+	LogData& logData = LogData::GetInstance();
+	xnOSStrCopy(logData.strLogDir, strDirName, XN_FILE_MAX_PATH);
+
+	// restart file writer
+	xnLogStartNewFile();
+
+	return (XN_STATUS_OK);
+}
+
+XnLogger* xnLogGetLoggerForMask(const XnChar* csLogMask, XnBool bCreate)
+{
+	XnLogger* pLogger = NULL;
+	LogData& logData = LogData::GetInstance();
+	if (XN_STATUS_OK == logData.pMasksHash->Get(csLogMask, pLogger))
+	{
+		return pLogger;
+	}
+	else if (bCreate)
 	{
-		g_xnLoggerData.m_nDumpFilteringType = XN_LOG_WRITE_MASKS;
+		XnLogger logger;
+		logger.nMinSeverity = logData.defaultMinSeverity;
 
-		if (bEnabled)
+		// first of all, add it to the map
+		if (XN_STATUS_OK != logData.pMasksHash->Set(csLogMask, logger))
 		{
-			nRetVal = g_xnLoggerData.m_DumpMasks.Set(csMask, NULL);
-			XN_IS_STATUS_OK(nRetVal);
+			// failed to add it to the map
+			XN_ASSERT(FALSE);
+			return NULL;
 		}
-		else
+
+		// now find it in the map
+		XnLogMasksHash::Iterator it = logData.pMasksHash->end();
+		if (XN_STATUS_OK != logData.pMasksHash->Find(csLogMask, it))
 		{
-			XnValue val = NULL;
-			nRetVal = g_xnLoggerData.m_DumpMasks.Remove(csMask, val);
-			if (nRetVal != XN_STATUS_OK && nRetVal != XN_STATUS_NO_MATCH)
-			{
-				return (XN_STATUS_OK);
-			}
+			XN_ASSERT(FALSE);
+			return NULL;
 		}
+
+		it.Value().pInternal = (void*)it.Key();
+
+		return &it.Value();
+	}
+	else
+	{
+		return NULL;
 	}
+}
 
-	return (XN_STATUS_OK);
+void xnLogWriteNoEntryImplV(const XnChar* csFormat, va_list args)
+{
+	const XnUInt32 nMaxMessageSize = 1024;
+	XnChar csMessage[nMaxMessageSize+1];
+	XnUInt32 nChars;
+	xnOSStrFormatV(csMessage, nMaxMessageSize, &nChars, csFormat, args);
+
+	LogData& logData = LogData::GetInstance();
+	for (XnLogWritersList::ConstIterator it = logData.writers.begin(); it != logData.writers.end(); ++it)
+	{
+		const XnLogWriter* pWriter = *it;
+		pWriter->WriteUnformatted(csMessage, pWriter->pCookie);
+	}
 }
 
-XN_C_API XnStatus xnLogSetSeverityFilter(XnLogSeverity nMinSeverity)
+void xnLogWriteBinaryDataImplV(const XnChar* strMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* csFormat, va_list args)
 {
-	g_xnLoggerData.m_nFilterSeverity = nMinSeverity;
-	return (XN_STATUS_OK);
+	// first write preceding message:
+	xnLogWriteImplV(strMask, nSeverity, csFile, nLine, csFormat, args);
+
+	// now write binary data (in lines of 16 bytes)
+	XnChar csLine[256];
+	XnUInt32 pos = 0;
+
+	for (XnUInt32 i = 0; i < nDataSize; ++i)
+	{
+		if ((i % 16) == 0) // first byte in line
+		{
+			// start a new line
+			pos = sprintf(csLine, "%6u: ", i);
+		}
+
+		pos += sprintf(csLine + pos, "%02x ", pBinData[i]);
+
+		if ((i % 16) == 15 || (i == nDataSize-1)) // last byte in line
+		{
+			xnLogWriteImpl(strMask, nSeverity, csFile, nLine, "%s", csLine);
+		}
+	}
 }
 
-XN_C_API XnStatus xnLogSetConsoleOutput(XnBool bConsoleOutput)
+XN_C_API XnStatus XN_C_DECL xnLogSetMaskMinSeverity(const XnChar* strMask, XnLogSeverity minSeverity)
 {
-	g_xnLoggerData.m_bWriteToConsole = bConsoleOutput;
+	LogData& logData = LogData::GetInstance();
+	if (strcmp(strMask, XN_LOG_MASK_ALL) == 0)
+	{
+		logData.SetMinSeverityGlobally(minSeverity);
+	}
+	else
+	{
+		XnLogger* pLogger = xnLogGetLoggerForMask(strMask, TRUE);
+		if (pLogger == NULL)
+		{
+			XN_ASSERT(FALSE);
+			return XN_STATUS_ERROR;
+		}
+
+		pLogger->nMinSeverity = minSeverity;
+	}
+
 	return (XN_STATUS_OK);
 }
 
-XN_C_API XnStatus xnLogSetFileOutput(XnBool bFileOutput)
+XN_C_API XnLogSeverity XN_C_DECL xnLogGetMaskMinSeverity(const XnChar* strMask)
 {
-	g_xnLoggerData.m_bWriteToFile = bFileOutput;
-	xnLogConfigurationChanged();
-	return (XN_STATUS_OK);
+	XnLogger* pLogger = xnLogGetLoggerForMask(strMask, FALSE);
+	if (pLogger == NULL)
+	{
+		LogData& logData = LogData::GetInstance();
+		return logData.defaultMinSeverity;
+	}
+	else
+	{
+		return pLogger->nMinSeverity;
+	}
 }
 
-XN_C_API XnStatus xnLogSetLineInfo(XnBool bLineInfo)
+XN_C_API XnLogger* XN_C_DECL xnLoggerOpen(const XnChar* strMask)
 {
-	g_xnLoggerData.m_bWriteLineInfo = bLineInfo;
-	xnLogConfigurationChanged();
-	return (XN_STATUS_OK);
+	return xnLogGetLoggerForMask(strMask, TRUE);
 }
 
-XN_C_API XnStatus xnLogSetOutputFolder(const XnChar* strOutputFolder)
+XN_C_API void XN_C_DECL xnLoggerWrite(XnLogger* pLogger, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...)
 {
-	g_xnLoggerData.CloseFile();
-	sprintf(g_xnLoggerData.m_csLogDir, "%s%s", strOutputFolder, XN_FILE_DIR_SEP);
-	xnLogInitSystem();
-	return (XN_STATUS_OK);
+	if (!xnLoggerIsEnabled(pLogger, nSeverity))
+		return;
+
+	const XnChar* strMask = (const XnChar*)pLogger->pInternal;
+
+	// write message
+	va_list args;
+	va_start(args, csFormat);
+	xnLogWriteImplV(strMask, nSeverity, csFile, nLine, csFormat, args);
+	va_end(args);
 }
 
-XnBool xnLogIsMaskEnabledImpl(const XnChar* csLogMask)
+XN_C_API void XN_C_DECL xnLoggerWriteNoEntry(XnLogger* pLogger, XnLogSeverity nSeverity, const XnChar* csFormat, ...)
 {
-	XN_VALIDATE_INPUT_PTR(csLogMask);
+	if (!xnLoggerIsEnabled(pLogger, nSeverity))
+		return;
 
-	switch (g_xnLoggerData.m_nLogFilteringType)
-	{
-	case XN_LOG_WRITE_ALL:
-		return TRUE;
-	case XN_LOG_WRITE_NONE:
-		return FALSE;
-	case XN_LOG_WRITE_MASKS:
-		{
-			XnStringsHash::Iterator it = g_xnLoggerData.m_LogMasks.end();
-			return (XN_STATUS_OK == g_xnLoggerData.m_LogMasks.Find(csLogMask, it));
-		}
-	default:
-		printf("Log: Unknown filter type: %d", g_xnLoggerData.m_nLogFilteringType);
-		return FALSE;
-	}
+	va_list args;
+	va_start(args, csFormat);
+	xnLogWriteNoEntryImplV(csFormat, args);
+	va_end(args);
 }
 
-XN_C_API XnBool xnLogIsEnabled(const XnChar* csLogMask, XnLogSeverity nSeverity)
+XN_C_API void XN_C_DECL xnLoggerWriteBinaryData(XnLogger* pLogger, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* csFormat, ...)
 {
-	// check severity
-	if (nSeverity < g_xnLoggerData.m_nFilterSeverity)
-		return FALSE;
+	if (!xnLoggerIsEnabled(pLogger, nSeverity))
+		return;
 
-	// check filtering policy
-	if (!xnLogIsMaskEnabledImpl(csLogMask))
-		return FALSE;
+	const XnChar* strMask = (const XnChar*)pLogger->pInternal;
 
-	return TRUE;
+	va_list args;
+	va_start(args, csFormat);
+	xnLogWriteBinaryDataImplV(strMask, nSeverity, csFile, nLine, pBinData, nDataSize, csFormat, args);
+	va_end(args);
 }
 
-const XnChar* xnLogGetSeverityString(XnLogSeverity nSeverity)
+XN_C_API void XN_C_DECL _xnLoggerClose(XnLogger* pLogger)
 {
-	switch (nSeverity)
+	if (pLogger == NULL)
 	{
-	case XN_LOG_VERBOSE:
-		return "VERBOSE";
-	case XN_LOG_INFO:
-		return "INFO";
-	case XN_LOG_WARNING:
-		return "WARNING";
-	case XN_LOG_ERROR:
-		return "ERROR";
-	default:
-		return "UNKNOWN";
+		return;
 	}
+
+	const XnChar* strMask = (const XnChar*)pLogger->pInternal;
+	LogData& logData = LogData::GetInstance();
+	logData.pMasksHash->Remove(strMask);
 }
 
-void xnLogWriteImplV(const XnChar* /*csLogMask*/, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, va_list args)
+XN_C_API XnBool XN_C_DECL xnLoggerIsEnabled(XnLogger* pLogger, XnLogSeverity severity)
 {
-	if (!g_xnLoggerData.m_bWriteToFile && !g_xnLoggerData.m_bWriteToConsole)
+	if (pLogger == NULL)
 	{
-		//Nothing to do - don't waste time formatting anything.
-		return;
+		return FALSE;
 	}
+	else
+	{
+		return (severity >= pLogger->nMinSeverity);
+	}
+}
 
-	// take time
-	XnUInt64 nNow;
-	xnOSGetHighResTimeStamp(&nNow);
-
-	// write timestamp and severity
-	const XnChar* csSeverity = xnLogGetSeverityString(nSeverity);
+#ifndef __XN_NO_BC__
 
-	const XnUInt32 nMaxMessageSize = 2047;
-	XnChar csMessage[nMaxMessageSize+1];
-	XnUInt32 nChars = 0;
-	XnUInt32 nMessageLen = 0;
+//---------------------------------------------------------------------------
+// Backwards-Compatibility Code
+//---------------------------------------------------------------------------
 
-	// write timestamp
-	xnOSStrFormat(csMessage + nMessageLen, nMaxMessageSize - nMessageLen, &nChars, "%8llu\t[%s]\t", nNow, csSeverity);
-	nMessageLen += nChars;
+// Note: in old log implementation, you could first set global min severity, and
+// then turn on/off masks. To achieve the same behavior, a BC "turned-off" mask
+// will have the MSB turned on, so that it has a very high min severity, and nothing
+// will be output.
+#define XN_LOG_BC_MASK_OFF_FLAG		(1 << 30)
 
-	XnUInt32 nLineInfoBegin = nMessageLen;
+static XnLogSeverity xnLogBCCalcSeverityByState(XnLogSeverity severity, XnBool bEnabled)
+{
+	if (bEnabled)
+	{
+		return XnLogSeverity(severity & ~XN_LOG_BC_MASK_OFF_FLAG);
+	}
+	else
+	{
+		return XnLogSeverity(severity | XN_LOG_BC_MASK_OFF_FLAG);
+	}
+}
 
-	if (g_xnLoggerData.m_bWriteLineInfo)
+static XnStatus xnLogBCSetMaskState(const XnChar* strMask, XnBool bEnabled)
+{
+	LogData& logData = LogData::GetInstance();
+	if (strcmp(strMask, XN_LOG_MASK_ALL) == 0)
 	{
-		// write line info
-		XnChar fileName[XN_FILE_MAX_PATH];
-		XnStatus nRetVal = xnOSGetFileName(csFile, fileName, sizeof(fileName));
-		if (nRetVal == XN_STATUS_OK)
+		XnLogSeverity newGlobalSeverity = xnLogBCCalcSeverityByState(logData.defaultMinSeverity, bEnabled);
+		logData.SetMinSeverityGlobally(newGlobalSeverity);
+	}
+	else
+	{
+		XnLogger* pLogger = xnLogGetLoggerForMask(strMask, TRUE);
+		if (pLogger == NULL)
 		{
-			xnOSStrFormat(csMessage + nMessageLen, nMaxMessageSize - nMessageLen, &nChars, "%s\t%d\t", fileName, nLine);
-			nMessageLen += nChars;
+			XN_ASSERT(FALSE);
+			return XN_STATUS_ERROR;
 		}
+
+		pLogger->nMinSeverity = xnLogBCCalcSeverityByState(pLogger->nMinSeverity, bEnabled);
 	}
 
-	XnUInt32 nLineInfoEnd = nMessageLen;
+	return (XN_STATUS_OK);
+}
 
-	// write message
-	xnOSStrFormatV(csMessage + nMessageLen, nMaxMessageSize - nMessageLen, &nChars, csFormat, args);
-	nMessageLen += nChars;
-	XnUInt32 nUserMsgLen = nChars;
+static XnStatus xnLogBCSetSeverityFilter(XnLogSeverity nMinSeverity)
+{
+	LogData& logData = LogData::GetInstance();
+	if ((logData.defaultMinSeverity & XN_LOG_BC_MASK_OFF_FLAG) != 0)
+	{
+		nMinSeverity = XnLogSeverity(nMinSeverity | XN_LOG_BC_MASK_OFF_FLAG);
+	}
 
-	// write end-of-line
-	xnOSStrFormat(csMessage + nMessageLen, nMaxMessageSize - nMessageLen, &nChars, XN_NEW_LINE_SEP);
-	nMessageLen += nChars;
+	logData.SetMinSeverityGlobally(nMinSeverity);
+	xnLogFilterChanged();
+	return (XN_STATUS_OK);
+}
 
-	if (g_xnLoggerData.m_bWriteToFile)
+XN_C_API XnBool xnLogIsEnabled(const XnChar* csLogMask, XnLogSeverity nSeverity)
+{
+	XnLogger* pLogger = xnLogGetLoggerForMask(csLogMask, FALSE);
+	if (pLogger == NULL)
 	{
-		xnOSWriteFile(g_xnLoggerData.m_fLogFile, csMessage, nMessageLen);
+		// no such logger exists. Mask uses default severity
+		LogData& logData = LogData::GetInstance();
+		return (nSeverity >= logData.defaultMinSeverity);
 	}
-
-	if (g_xnLoggerData.m_bWriteToConsole)
+	else
 	{
-		//Write to console without line info
-		//'%.*s' causes the first (nLineInfoBegin) characters of csMessage to be printed.
-		printf("%.*s%s", nLineInfoBegin, csMessage, csMessage + nLineInfoEnd);
+		return (nSeverity >= pLogger->nMinSeverity);
 	}
-
 }
 
 XN_C_API void xnLogWrite(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, const XnChar* csFormat, ...)
@@ -608,27 +953,21 @@ XN_C_API void xnLogWriteNoEntry(const XnChar* csLogMask, XnLogSeverity nSeverity
 	if (!xnLogIsEnabled(csLogMask, nSeverity))
 		return;
 
-	if (g_xnLoggerData.m_bWriteToFile)
-	{
-		va_list args;
-		va_start(args, csFormat);
-
-		const XnUInt32 nMaxMessageSize = 1024;
-		XnChar csMessage[nMaxMessageSize+1];
-		XnUInt32 nChars;
-		xnOSStrFormatV(csMessage, nMaxMessageSize, &nChars, csFormat, args);
+	va_list args;
+	va_start(args, csFormat);
 
-		va_end(args);
+	const XnUInt32 nMaxMessageSize = 1024;
+	XnChar csMessage[nMaxMessageSize+1];
+	XnUInt32 nChars;
+	xnOSStrFormatV(csMessage, nMaxMessageSize, &nChars, csFormat, args);
 
-		xnOSWriteFile(g_xnLoggerData.m_fLogFile, csMessage, nChars);
-	}
+	va_end(args);
 
-	if (g_xnLoggerData.m_bWriteToConsole)
+	LogData& logData = LogData::GetInstance();
+	for (XnLogWritersList::ConstIterator it = logData.writers.begin(); it != logData.writers.end(); ++it)
 	{
-		va_list args;
-		va_start(args, csFormat);
-		vprintf(csFormat, args);
-		va_end(args);
+		const XnLogWriter* pWriter = *it;
+		pWriter->WriteUnformatted(csMessage, pWriter->pCookie);
 	}
 }
 
@@ -664,120 +1003,14 @@ XN_C_API void xnLogWriteBinaryData(const XnChar* csLogMask, XnLogSeverity nSever
 	}
 }
 
-XnBool xnLogIsDumpMaskEnabled(const XnChar* csDumpMask)
-{
-	XN_VALIDATE_INPUT_PTR(csDumpMask);
-
-	switch (g_xnLoggerData.m_nDumpFilteringType)
-	{
-	case XN_LOG_WRITE_ALL:
-		return TRUE;
-	case XN_LOG_WRITE_NONE:
-		return FALSE;
-	case XN_LOG_WRITE_MASKS:
-		{
-			XnStringsHash::Iterator it = g_xnLoggerData.m_DumpMasks.end();
-			return (XN_STATUS_OK == g_xnLoggerData.m_DumpMasks.Find(csDumpMask, it));
-		}
-	default:
-		printf("Log: Unknown filter type: %d", g_xnLoggerData.m_nDumpFilteringType);
-		return FALSE;
-	}
-}
-
-void xnDumpCreateFileNameImpl(XnChar* csFullFileName, const XnChar* csFileNameFormat, va_list args)
-{
-	XnChar csFileName[XN_FILE_MAX_PATH];
-	vsprintf(csFileName, csFileNameFormat, args);
-
-	XN_PROCESS_ID nProcID = 0;
-	xnOSGetCurrentProcessID(&nProcID);
-
-	XnUInt32 nBytesWritten;
-	xnOSStrFormat(csFullFileName, XN_FILE_MAX_PATH, &nBytesWritten, "%s%s_%d.%s", g_xnLoggerData.m_csLogDir, g_xnLoggerData.m_csTime, nProcID, csFileName);
-}
-
-void xnDumpCreate(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, va_list args)
-{
-	XnChar strFileName[XN_FILE_MAX_PATH];
-	xnDumpCreateFileNameImpl(strFileName, csFileNameFormat, args);
-
-	if (XN_STATUS_OK != xnLogCreateFile(strFileName, &pDump->hFile))
-	{
-		// we don't have much to do if files can't be open. Dump will not be written
-		xnLogWarning(XN_MASK_LOG, "Couldn't create dump file %s! Dump will not be written", strFileName);
-	}
-
-	if (csHeader != NULL)
-	{
-		xnDumpWriteStringImpl(*pDump, csHeader);
-	}
-}
-
-XN_C_API void xnDumpInit(XnDump* pDump, const XnChar* csDumpMask, const XnChar* csHeader, const XnChar* csFileNameFormat, ...)
-{
-	if (pDump->hFile == XN_INVALID_FILE_HANDLE && xnLogIsDumpMaskEnabled(csDumpMask))
-	{
-		va_list args;
-		va_start(args, csFileNameFormat);
-		xnDumpCreate(pDump, csHeader, csFileNameFormat, args);
-		va_end(args);
-	}
-}
-
-XN_C_API void xnDumpForceInit(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, ...)
-{
-	if (pDump->hFile == XN_INVALID_FILE_HANDLE)
-	{
-		va_list args;
-		va_start(args, csFileNameFormat);
-		xnDumpCreate(pDump, csHeader, csFileNameFormat, args);
-		va_end(args);
-	}
-}
-
-XN_C_API void xnDumpClose(XnDump* pDump)
+XN_C_API XnStatus xnLogSetMaskState(const XnChar* csMask, XnBool bEnabled)
 {
-	if (pDump->hFile != XN_INVALID_FILE_HANDLE)
-	{
-		xnOSCloseFile(&pDump->hFile);
-		*pDump = XN_DUMP_CLOSED;
-	}
+	return xnLogBCSetMaskState(csMask, bEnabled);
 }
 
-XN_C_API void xnDumpWriteBufferImpl(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize)
-{
-	if (dump.hFile != XN_INVALID_FILE_HANDLE) 
-	{
-		xnOSWriteFile(dump.hFile, pBuffer, nBufferSize);
-	}
-}
-
-XN_C_API void xnDumpWriteStringImpl(XnDump dump, const XnChar* csFormat, ...)
+XN_C_API XnStatus xnLogSetSeverityFilter(XnLogSeverity nMinSeverity)
 {
-	if (dump.hFile != XN_INVALID_FILE_HANDLE)
-	{
-		const XnUInt32 nStringLength = 1024;
-		XnChar csString[1024];
-
-		va_list args;
-		va_start(args, csFormat);
-
-		// format message
-		XnUInt32 nChars;
-		xnOSStrFormatV(csString, nStringLength, &nChars, csFormat, args);
-
-		// and write it to file
-		xnOSWriteFile(dump.hFile, csString, nChars);
-
-		va_end(args);
-	}
+	return xnLogBCSetSeverityFilter(nMinSeverity);
 }
 
-XN_C_API void xnDumpFlush(XnDump dump)
-{
-	if (dump.hFile != XN_INVALID_FILE_HANDLE)
-	{
-		xnOSFlushFile(dump.hFile);
-	}
-}
+#endif // #ifndef __XN_NO_BC__
\ No newline at end of file
diff --git a/Source/OpenNI/XnLogConsoleWriter.cpp b/Source/OpenNI/XnLogConsoleWriter.cpp
new file mode 100644
index 0000000..faf314e
--- /dev/null
+++ b/Source/OpenNI/XnLogConsoleWriter.cpp
@@ -0,0 +1,38 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnLogConsoleWriter.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+void XnLogConsoleWriter::WriteEntry(const XnLogEntry* pEntry)
+{
+	printf("%9llu %-10s %s\n", pEntry->nTimestamp, pEntry->strSeverity, pEntry->strMessage);
+}
+
+void XnLogConsoleWriter::WriteUnformatted(const XnChar* strMessage)
+{
+	printf("%s\n", strMessage);
+}
diff --git a/Source/OpenNI/XnLogConsoleWriter.h b/Source/OpenNI/XnLogConsoleWriter.h
new file mode 100644
index 0000000..766db26
--- /dev/null
+++ b/Source/OpenNI/XnLogConsoleWriter.h
@@ -0,0 +1,37 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __XN_LOG_CONSOLE_WRITER_H__
+#define __XN_LOG_CONSOLE_WRITER_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnLogWriterBase.h>
+
+class XnLogConsoleWriter : public XnLogWriterBase
+{
+public:
+	virtual void WriteEntry(const XnLogEntry* pEntry);
+	virtual void WriteUnformatted(const XnChar* strMessage);
+};
+
+#endif // __XN_LOG_CONSOLE_WRITER_H__
\ No newline at end of file
diff --git a/Source/OpenNI/XnLogFileWriter.cpp b/Source/OpenNI/XnLogFileWriter.cpp
new file mode 100644
index 0000000..86d3e28
--- /dev/null
+++ b/Source/OpenNI/XnLogFileWriter.cpp
@@ -0,0 +1,120 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnLogFileWriter.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XnLogFileWriter::XnLogFileWriter() : 
+	m_fLogFile(XN_INVALID_FILE_HANDLE),
+	m_bWriteLineInfo(TRUE)
+{}
+
+XnLogFileWriter::~XnLogFileWriter()
+{
+	CloseFile();
+}
+
+void XnLogFileWriter::WriteEntry(const XnLogEntry* pEntry)
+{
+	// make sure file is open
+	if (m_fLogFile == XN_INVALID_FILE_HANDLE)
+	{
+		return;
+	}
+
+	// write timestamp and severity
+	const XnUInt32 nMaxMessageSize = 2047;
+	XnChar strBuffer[nMaxMessageSize + 1];
+
+	XnUInt32 nMessageLen = 0;
+	XnUInt32 nChars = 0;
+	xnOSStrFormat(strBuffer + nMessageLen, nMaxMessageSize - nMessageLen, &nChars, "%9llu\t%-10s\t%s\t", pEntry->nTimestamp, pEntry->strSeverity, pEntry->strMask);
+	nMessageLen += nChars;
+
+	if (m_bWriteLineInfo)
+	{
+		// write line info
+		XnChar fileName[XN_FILE_MAX_PATH];
+		XnStatus nRetVal = xnOSGetFileName(pEntry->strFile, fileName, sizeof(fileName));
+		if (nRetVal == XN_STATUS_OK)
+		{
+			xnOSStrFormat(strBuffer + nMessageLen, nMaxMessageSize - nMessageLen, &nChars, "%s\t%d\t", fileName, pEntry->nLine);
+			nMessageLen += nChars;
+		}
+	}
+
+	xnOSStrFormat(strBuffer + nMessageLen, nMaxMessageSize - nMessageLen, &nChars, "%s\n", pEntry->strMessage);
+	nMessageLen += nChars;
+
+	xnOSWriteFile(m_fLogFile, strBuffer, nMessageLen);
+}
+
+void XnLogFileWriter::WriteUnformatted(const XnChar* strMessage)
+{
+	xnOSWriteFile(m_fLogFile, strMessage, xnOSStrLen(strMessage) + 1);
+}
+
+XnStatus XnLogFileWriter::OpenFile()
+{
+	if (m_fLogFile == XN_INVALID_FILE_HANDLE)
+	{
+		// open file
+		XnStatus nRetVal = xnLogCreateFile("log", &m_fLogFile);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			// we don't have much to do if files can't be open. Logs will not be written to file
+			printf("Couldn't create log file! Logs will not be written (error: %s)\n", xnGetStatusString(nRetVal));
+			m_fLogFile = XN_INVALID_FILE_HANDLE;
+			return nRetVal;
+		}
+	}
+
+	return XN_STATUS_OK;
+}
+
+void XnLogFileWriter::CloseFile()
+{
+	if (m_fLogFile != XN_INVALID_FILE_HANDLE)
+	{
+		xnOSCloseFile(&m_fLogFile);
+		m_fLogFile = XN_INVALID_FILE_HANDLE;
+	}
+}
+
+void XnLogFileWriter::SetLineInfo(XnBool bLineInfo)
+{
+	m_bWriteLineInfo = bLineInfo;
+}
+
+void XnLogFileWriter::OnRegister()
+{
+	OpenFile();
+}
+
+void XnLogFileWriter::OnUnregister()
+{
+	CloseFile();
+}
\ No newline at end of file
diff --git a/Source/OpenNI/XnLogFileWriter.h b/Source/OpenNI/XnLogFileWriter.h
new file mode 100644
index 0000000..be75187
--- /dev/null
+++ b/Source/OpenNI/XnLogFileWriter.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __XN_LOG_FILE_WRITER_H__
+#define __XN_LOG_FILE_WRITER_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnLogWriterBase.h>
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+class XnLogFileWriter : public XnLogWriterBase
+{
+public:
+	XnLogFileWriter();
+	~XnLogFileWriter();
+
+	virtual void WriteEntry(const XnLogEntry* pEntry);
+	virtual void WriteUnformatted(const XnChar* strMessage);
+
+	XnStatus OpenFile();
+	void CloseFile();
+
+	void SetLineInfo(XnBool bLineInfo);
+
+protected:
+	virtual void OnRegister();
+	virtual void OnUnregister();
+
+private:
+	XN_FILE_HANDLE m_fLogFile;
+	XnBool m_bWriteLineInfo;
+};
+
+#endif // __XN_LOG_FILE_WRITER_H__
\ No newline at end of file
diff --git a/Source/OpenNI/XnMockNotifier.cpp b/Source/OpenNI/XnMockNotifier.cpp
index 8c3917d..3ae4ca6 100644
--- a/Source/OpenNI/XnMockNotifier.cpp
+++ b/Source/OpenNI/XnMockNotifier.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -44,44 +44,44 @@ MockNotifier& MockNotifier::GetInstance()
 	return _instance;
 }
 
-XnStatus MockNotifier::OnNodeAddedImpl(void* pCookie, const XnChar* strNodeName, XnProductionNodeType type, XnCodecID compression)
+XnStatus MockNotifier::OnNodeAddedImpl(void* /*pCookie*/, const XnChar* /*strNodeName*/, XnProductionNodeType /*type*/, XnCodecID /*compression*/)
 {
 	XN_ASSERT(FALSE);
 	return XN_STATUS_NOT_IMPLEMENTED;
 }
 
-XnStatus MockNotifier::OnNodeRemovedImpl(void* pCookie, const XnChar* strNodeName)
+XnStatus MockNotifier::OnNodeRemovedImpl(void* /*pCookie*/, const XnChar* /*strNodeName*/)
 {
 	XN_ASSERT(FALSE);
 	return XN_STATUS_NOT_IMPLEMENTED;
 }
 
-XnStatus MockNotifier::OnNodeIntPropChangedImpl(void* pCookie, const XnChar* strNodeName, const XnChar* strPropName, XnUInt64 nValue)
+XnStatus MockNotifier::OnNodeIntPropChangedImpl(void* pCookie, const XnChar* /*strNodeName*/, const XnChar* strPropName, XnUInt64 nValue)
 {
 	return xnSetIntProperty((XnNodeHandle)pCookie, strPropName, nValue);
 }
 
-XnStatus MockNotifier::OnNodeRealPropChangedImpl(void* pCookie, const XnChar* strNodeName, const XnChar* strPropName, XnDouble dValue)
+XnStatus MockNotifier::OnNodeRealPropChangedImpl(void* pCookie, const XnChar* /*strNodeName*/, const XnChar* strPropName, XnDouble dValue)
 {
 	return xnSetRealProperty((XnNodeHandle)pCookie, strPropName, dValue);
 }
 
-XnStatus MockNotifier::OnNodeStringPropChangedImpl(void* pCookie, const XnChar* strNodeName, const XnChar* strPropName, const XnChar* strValue)
+XnStatus MockNotifier::OnNodeStringPropChangedImpl(void* pCookie, const XnChar* /*strNodeName*/, const XnChar* strPropName, const XnChar* strValue)
 {
 	return xnSetStringProperty((XnNodeHandle)pCookie, strPropName, strValue);
 }
 
-XnStatus MockNotifier::OnNodeGeneralPropChangedImpl(void* pCookie, const XnChar* strNodeName, const XnChar* strPropName, XnUInt32 nBufferSize, const void* pBuffer)
+XnStatus MockNotifier::OnNodeGeneralPropChangedImpl(void* pCookie, const XnChar* /*strNodeName*/, const XnChar* strPropName, XnUInt32 nBufferSize, const void* pBuffer)
 {
 	return xnSetGeneralProperty((XnNodeHandle)pCookie, strPropName, nBufferSize, pBuffer);
 }
 
-XnStatus MockNotifier::OnNodeStateReadyImpl(void* pCookie, const XnChar* strNodeName)
+XnStatus MockNotifier::OnNodeStateReadyImpl(void* pCookie, const XnChar* /*strNodeName*/)
 {
 	return xnSetIntProperty((XnNodeHandle)pCookie, XN_PROP_STATE_READY, 1);
 }
 
-XnStatus MockNotifier::OnNodeNewDataImpl(void* pCookie, const XnChar* strNodeName, XnUInt64 nTimeStamp, XnUInt32 nFrame, const void* pData, XnUInt32 nSize)
+XnStatus MockNotifier::OnNodeNewDataImpl(void* /*pCookie*/, const XnChar* /*strNodeName*/, XnUInt64 /*nTimeStamp*/, XnUInt32 /*nFrame*/, const void* /*pData*/, XnUInt32 /*nSize*/)
 {
 	XN_ASSERT(FALSE);
 	return XN_STATUS_INVALID_OPERATION;
diff --git a/Source/OpenNI/XnMockNotifier.h b/Source/OpenNI/XnMockNotifier.h
index b1593cc..42f9fbc 100644
--- a/Source/OpenNI/XnMockNotifier.h
+++ b/Source/OpenNI/XnMockNotifier.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/XnModuleInterfaceContainers.h b/Source/OpenNI/XnModuleInterfaceContainers.h
index b2792cc..a935e6d 100644
--- a/Source/OpenNI/XnModuleInterfaceContainers.h
+++ b/Source/OpenNI/XnModuleInterfaceContainers.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -245,9 +245,13 @@ public:
 	{
 		xnOSMemSet(&Hands, 0, sizeof(Hands));
 		Hands.pGeneratorInterface = &Generator;
+		xnOSMemSet(&HandTouchingFOVEdge, 0, sizeof(HandTouchingFOVEdge));
+		Hands.pHandTouchingFOVEdgeInterface = &HandTouchingFOVEdge;
 		HierarchyType.Set(XN_NODE_TYPE_HANDS, TRUE);
 	}
 	XnModuleHandsGeneratorInterface Hands;
+
+	XnModuleHandTouchingFOVEdgeCapabilityInterface HandTouchingFOVEdge;
 };
 
 class XnAudioGeneratorInterfaceContainer : public XnGeneratorInterfaceContainer
@@ -278,4 +282,18 @@ public:
 	XnModuleCodecInterface Codec;
 };
 
+class XnScriptNodeInterfaceContainer : public XnProductionNodeInterfaceContainer
+{
+public:
+	XnScriptNodeInterfaceContainer()
+	{
+		xnOSMemSet(&Script, 0, sizeof(Script));
+		Script.pProductionNode = &ProductionNode;
+
+		HierarchyType.Set(XN_NODE_TYPE_SCRIPT, TRUE);
+	}
+
+	XnModuleScriptNodeInterface Script;
+};
+
 #endif // __XN_MODULE_INTERFACE_CONTAINERS_H__
\ No newline at end of file
diff --git a/Source/OpenNI/XnModuleLoader.cpp b/Source/OpenNI/XnModuleLoader.cpp
index e2e8f4e..aa14e2a 100644
--- a/Source/OpenNI/XnModuleLoader.cpp
+++ b/Source/OpenNI/XnModuleLoader.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -30,6 +30,7 @@
 #include "XnTypeManager.h"
 #include <XnArray.h>
 #include <XnAlgorithms.h>
+#include "xnInternalFuncs.h"
 
 #if !XN_PLATFORM_SUPPORTS_DYNAMIC_LIBS
 #include <XnModuleCFunctions.h>
@@ -52,14 +53,13 @@
 	}
 
 #define XN_VALIDATE_CAPABILITY_STRUCT(name, pStruct)	\
-	do													\
 	{													\
 		XnStatus nTempRetVal = ValidateFunctionGroup(	\
 			XN_STRINGIFY(name),							\
 			(void**)pStruct,							\
 			sizeof(*pStruct)/sizeof(void*));			\
 		XN_IS_STATUS_OK(nTempRetVal);					\
-	} while (0)
+	}
 
 #define XN_VALIDATE_CAPABILITY(pInterface, name)												\
 	XN_VALIDATE_CAPABILITY_STRUCT(name, pInterface->p##name##Interface)
@@ -71,24 +71,24 @@ static XnVersion EXTENSIONS_VERSION = { 1, 1, 0, 0 };
 
 typedef const void* (XN_CALLBACK_TYPE* GetDataPrototype)(XnModuleNodeHandle hGenerator);
 
-static const void* XN_CALLBACK_TYPE GetDataNull(XnModuleNodeHandle hGenerator)
+static const void* XN_CALLBACK_TYPE GetDataNull(XnModuleNodeHandle /*hGenerator*/)
 {
 	return NULL;
 }
 
 typedef XnUInt32 (XN_CALLBACK_TYPE* GetBytesPerPixelPrototype)(XnModuleNodeHandle hGenerator);
 
-static XnUInt32 XN_CALLBACK_TYPE GetDepthBytesPerPixel(XnModuleNodeHandle hNode)
+static XnUInt32 XN_CALLBACK_TYPE GetDepthBytesPerPixel(XnModuleNodeHandle /*hNode*/)
 {
 	return sizeof(XnDepthPixel);
 }
 
-static XnUInt32 XN_CALLBACK_TYPE GetIRBytesPerPixel(XnModuleNodeHandle hNode)
+static XnUInt32 XN_CALLBACK_TYPE GetIRBytesPerPixel(XnModuleNodeHandle /*hNode*/)
 {
 	return sizeof(XnIRPixel);
 }
 
-static XnUInt32 XN_CALLBACK_TYPE GetSceneBytesPerPixel(XnModuleNodeHandle hNode)
+static XnUInt32 XN_CALLBACK_TYPE GetSceneBytesPerPixel(XnModuleNodeHandle /*hNode*/)
 {
 	return sizeof(XnLabel);
 }
@@ -141,23 +141,11 @@ XnStatus resolveModulesFile(XnChar* strFileName, XnUInt32 nBufSize)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
-#if (XN_PLATFORM == XN_PLATFORM_WIN32)
-	#ifdef _M_X64
-		nRetVal = xnOSExpandEnvironmentStrings("%OPEN_NI_INSTALL_PATH64%\\Data\\modules.xml", strFileName, nBufSize);
-		XN_IS_STATUS_OK(nRetVal);
-	#else
-		nRetVal = xnOSExpandEnvironmentStrings("%OPEN_NI_INSTALL_PATH%\\Data\\modules.xml", strFileName, nBufSize);
-		XN_IS_STATUS_OK(nRetVal);
-	#endif
-#elif (CE4100)
-	nRetVal = xnOSStrCopy(strFileName, "/usr/etc/ni/modules.xml", nBufSize);
+	nRetVal = xnGetOpenNIConfFilesPath(strFileName, nBufSize);
 	XN_IS_STATUS_OK(nRetVal);
-#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX)
-	nRetVal = xnOSStrCopy(strFileName, "/var/lib/ni/modules.xml", nBufSize);
+
+	nRetVal = xnOSStrAppend(strFileName, "modules.xml", nBufSize);
 	XN_IS_STATUS_OK(nRetVal);
-#elif XN_PLATFORM_SUPPORTS_DYNAMIC_LIBS
-	#error "Module Loader is not supported on this platform!"
-#endif
 
 	return (XN_STATUS_OK);
 }
@@ -253,6 +241,11 @@ XnStatus XnModuleLoader::LoadAllModules()
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
+	// first load OpenNI itself
+	nRetVal = AddOpenNIGenerators();
+	XN_IS_STATUS_OK(nRetVal);
+
+	// now load modules
 	TiXmlDocument doc;
 	nRetVal = loadModulesFile(doc);
 	XN_IS_STATUS_OK(nRetVal);
@@ -358,6 +351,19 @@ XnStatus XnModuleLoader::AddModuleGenerators(const XnChar* strModuleFile, XN_LIB
 	return XN_STATUS_OK;
 }
 
+XnStatus XnModuleLoader::AddOpenNIGenerators()
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnOpenNIModuleInterface* pOpenNIModule = GetOpenNIModuleInterface();
+
+	// add it
+	nRetVal = AddModule(pOpenNIModule, NULL, "OpenNI");
+	XN_IS_STATUS_OK(nRetVal);
+
+	return XN_STATUS_OK;
+}
+
 XnStatus XnModuleLoader::AddModule(XnOpenNIModuleInterface* pInterface, const XnChar* strConfigDir, const XnChar* strName)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
@@ -553,6 +559,11 @@ XnStatus XnModuleLoader::LoadSpecificInterface(XnVersion& moduleOpenNIVersion, X
 		nRetVal = LoadCodec(moduleOpenNIVersion, pExportedInterface, pInterfaceContainer);
 		XN_IS_STATUS_OK(nRetVal);
 	}
+	else if (pHierarchy->IsSet(XN_NODE_TYPE_SCRIPT))
+	{
+		nRetVal = LoadScriptNode(moduleOpenNIVersion, pExportedInterface, pInterfaceContainer);
+		XN_IS_STATUS_OK(nRetVal);
+	}
 
 	// and now, some abstract types
 	else if (pHierarchy->IsSet(XN_NODE_TYPE_MAP_GENERATOR))
@@ -911,6 +922,29 @@ XnStatus XnModuleLoader::LoadCodec(XnVersion& moduleOpenNIVersion, XnModuleExpor
 	return (XN_STATUS_OK);
 }
 
+XnStatus XnModuleLoader::LoadScriptNode(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnScriptNodeInterfaceContainer Interface;
+
+	// fill it up
+	pExportedInterface->GetInterface.Script(&Interface.Script);
+
+	// validate interface
+	nRetVal = ValidateScriptNodeInterface(moduleOpenNIVersion, &Interface.Script);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// everything is OK. Allocate and store it
+	XnScriptNodeInterfaceContainer* pContainer;
+	XN_VALIDATE_NEW(pContainer, XnScriptNodeInterfaceContainer);
+	*pContainer = Interface;
+
+	pInterfaceContainer = pContainer;
+
+	return (XN_STATUS_OK);
+}
+
 XnStatus XnModuleLoader::LoadProductionNode(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
@@ -980,7 +1014,7 @@ XnStatus XnModuleLoader::LoadMapGenerator(XnVersion& moduleOpenNIVersion, XnModu
 	return (XN_STATUS_OK);
 }
 
-XnStatus XnModuleLoader::ValidateProductionNodeInterface(XnVersion& moduleOpenNIVersion, XnModuleProductionNodeInterface* pInterface)
+XnStatus XnModuleLoader::ValidateProductionNodeInterface(XnVersion& /*moduleOpenNIVersion*/, XnModuleProductionNodeInterface* pInterface)
 {
 	XN_VALIDATE_FUNC_NOT_NULL(pInterface, IsCapabilitySupported);
 
@@ -1286,8 +1320,22 @@ XnStatus XnModuleLoader::ValidateCodecInterface(XnVersion& moduleOpenNIVersion,
 	return (XN_STATUS_OK);
 }
 
+XnStatus XnModuleLoader::ValidateScriptNodeInterface(XnVersion& moduleOpenNIVersion, XnModuleScriptNodeInterface* pInterface)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	nRetVal = ValidateProductionNodeInterface(moduleOpenNIVersion, pInterface->pProductionNode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	XN_VALIDATE_FUNC_NOT_NULL(pInterface, GetSupportedFormat);
+	XN_VALIDATE_FUNC_NOT_NULL(pInterface, LoadScriptFromFile);
+	XN_VALIDATE_FUNC_NOT_NULL(pInterface, LoadScriptFromString);
+	XN_VALIDATE_FUNC_NOT_NULL(pInterface, Run);
+
+	return (XN_STATUS_OK);
+}
 
-XnStatus XnModuleLoader::ValidateNodeNotifications(XnVersion& moduleOpenNIVersion, XnNodeNotifications* pNodeNotifications)
+XnStatus XnModuleLoader::ValidateNodeNotifications(XnVersion& /*moduleOpenNIVersion*/, XnNodeNotifications* pNodeNotifications)
 {
 	XN_VALIDATE_FUNC_NOT_NULL(pNodeNotifications, OnNodeAdded);
 	XN_VALIDATE_FUNC_NOT_NULL(pNodeNotifications, OnNodeRemoved);
diff --git a/Source/OpenNI/XnModuleLoader.h b/Source/OpenNI/XnModuleLoader.h
index d2fcf0e..069962b 100644
--- a/Source/OpenNI/XnModuleLoader.h
+++ b/Source/OpenNI/XnModuleLoader.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -76,6 +76,7 @@ private:
 	XnStatus LoadAllModules();
 	XnStatus LoadModule(const XnChar* strFileName, const XnChar* strConfigDir);
 	XnStatus AddModuleGenerators(const XnChar* strModuleFile, XN_LIB_HANDLE hLib, const XnChar* strConfigDir);
+	XnStatus AddOpenNIGenerators();
 	XnStatus LoadSpecificInterface(XnVersion& moduleOpenNIVersion, XnProductionNodeType Type, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer);
 	XnStatus LoadDeviceNode(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer);
 	XnStatus LoadDepthGenerator(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer);
@@ -90,6 +91,7 @@ private:
 	XnStatus LoadPlayer(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer);
 	XnStatus LoadDeprecatedPlayer(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer);
 	XnStatus LoadCodec(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer);
+	XnStatus LoadScriptNode(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer);
 	XnStatus LoadProductionNode(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer);
 	XnStatus LoadGenerator(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer);
 	XnStatus LoadMapGenerator(XnVersion& moduleOpenNIVersion, XnModuleExportedProductionNodeInterface* pExportedInterface, XnProductionNodeInterfaceContainer*& pInterfaceContainer);
@@ -109,6 +111,7 @@ private:
 	XnStatus ValidateRecorderInterface(XnVersion& moduleOpenNIVersion, XnModuleRecorderInterface* pInterface);
 	XnStatus ValidatePlayerInterface(XnVersion& moduleOpenNIVersion, XnModulePlayerInterface* pInterface);
 	XnStatus ValidateCodecInterface(XnVersion& moduleOpenNIVersion, XnModuleCodecInterface* pInterface);
+	XnStatus ValidateScriptNodeInterface(XnVersion& moduleOpenNIVersion, XnModuleScriptNodeInterface* pInterface);
 	XnStatus ValidateNodeNotifications(XnVersion& moduleOpenNIVersion, XnNodeNotifications* pNodeNotifications);
 
 	XnStatus ValidateFunctionGroup(const XnChar* strName, void* aFunctions[], XnUInt32 nSize);
diff --git a/Source/OpenNI/XnNodeManager.cpp b/Source/OpenNI/XnNodeManager.cpp
index 853a164..fb4c2b1 100644
--- a/Source/OpenNI/XnNodeManager.cpp
+++ b/Source/OpenNI/XnNodeManager.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/XnNodeManager.h b/Source/OpenNI/XnNodeManager.h
index f3e46f2..d19f85a 100644
--- a/Source/OpenNI/XnNodeManager.h
+++ b/Source/OpenNI/XnNodeManager.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/XnNodeWatcher.cpp b/Source/OpenNI/XnNodeWatcher.cpp
index bf43001..72f4582 100644
--- a/Source/OpenNI/XnNodeWatcher.cpp
+++ b/Source/OpenNI/XnNodeWatcher.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -150,7 +150,7 @@ XnStatus NodeWatcher::NotifyStateImpl()
 
 	if (bExSerCap)
 	{
-		nRetVal = xnNotifyExState(m_node, &m_notifications, m_pCookie);
+		nRetVal = xnNotifyExState(m_node.GetHandle(), &m_notifications, m_pCookie);
 		XN_IS_STATUS_OK(nRetVal);
 	}
 
@@ -246,7 +246,7 @@ void GeneratorWatcher::Unregister()
 
 	if (m_generator.IsCapabilitySupported(XN_CAPABILITY_EXTENDED_SERIALIZATION))
 	{
-		xnUnregisterExNotifications(m_generator);
+		xnUnregisterExNotifications(m_generator.GetHandle());
 	}
 
 	NodeWatcher::Unregister();
@@ -297,7 +297,7 @@ XnStatus GeneratorWatcher::Watch()
 	XN_IS_STATUS_OK(nRetVal);
 
 	XnUInt64 nCurrentTimeStamp = m_generator.GetTimestamp();
-	if (nCurrentTimeStamp > m_nLastDataTimeStamp)
+	if ((nCurrentTimeStamp > m_nLastDataTimeStamp) || ((nCurrentTimeStamp == 0) && (m_generator.GetFrameID() > 0)))
 	{
 		m_nLastDataTimeStamp = nCurrentTimeStamp;
 		const void* pData = GetCurrentData();
@@ -320,7 +320,7 @@ XnUInt64 GeneratorWatcher::GetTimestamp()
 	return m_generator.GetTimestamp();
 }
 
-void XN_CALLBACK_TYPE GeneratorWatcher::HandleGenerationRunningChange(ProductionNode& node, void* pCookie)
+void XN_CALLBACK_TYPE GeneratorWatcher::HandleGenerationRunningChange(ProductionNode& /*node*/, void* pCookie)
 {
 	GeneratorWatcher *pThis = (GeneratorWatcher*)pCookie;
 	if (pThis == NULL)
@@ -332,7 +332,7 @@ void XN_CALLBACK_TYPE GeneratorWatcher::HandleGenerationRunningChange(Production
 	pThis->NotifyIntPropChanged(XN_PROP_IS_GENERATING, pThis->m_generator.IsGenerating());
 }
 
-void XN_CALLBACK_TYPE GeneratorWatcher::HandleMirrorChange(ProductionNode& node, void* pCookie)
+void XN_CALLBACK_TYPE GeneratorWatcher::HandleMirrorChange(ProductionNode& /*node*/, void* pCookie)
 {
 	GeneratorWatcher *pThis = (GeneratorWatcher*)pCookie;
 	if ((pThis == NULL) || !pThis->m_generator.IsCapabilitySupported(XN_CAPABILITY_MIRROR))
@@ -470,7 +470,7 @@ XnStatus MapWatcher::NotifyCropping()
 	return XN_STATUS_OK;
 }
 
-void XN_CALLBACK_TYPE MapWatcher::HandleMapOutputModeChange(ProductionNode& node, void* pCookie)
+void XN_CALLBACK_TYPE MapWatcher::HandleMapOutputModeChange(ProductionNode& /*node*/, void* pCookie)
 {
 	MapWatcher *pThis = (MapWatcher*)pCookie;
 	if (pThis == NULL)
@@ -486,7 +486,7 @@ void XN_CALLBACK_TYPE MapWatcher::HandleMapOutputModeChange(ProductionNode& node
 	}
 }
 
-void XN_CALLBACK_TYPE MapWatcher::HandleCroppingChange(ProductionNode& node, void* pCookie)
+void XN_CALLBACK_TYPE MapWatcher::HandleCroppingChange(ProductionNode& /*node*/, void* pCookie)
 {
 	MapWatcher *pThis = (MapWatcher*)pCookie;
 	if (pThis == NULL)
@@ -564,7 +564,7 @@ XnStatus ImageWatcher::NotifySupportedPixelFormats()
 	return XN_STATUS_OK;
 }
 
-void XN_CALLBACK_TYPE ImageWatcher::HandlePixelFormatChange(ProductionNode& node, void* pCookie)
+void XN_CALLBACK_TYPE ImageWatcher::HandlePixelFormatChange(ProductionNode& /*node*/, void* pCookie)
 {
 	ImageWatcher *pThis = (ImageWatcher*)pCookie;
 	if (pThis == NULL)
@@ -714,7 +714,7 @@ XnStatus DepthWatcher::NotifyUserPositions()
 	return XN_STATUS_OK;	
 }
 
-void XN_CALLBACK_TYPE DepthWatcher::HandleFieldOfViewChange(ProductionNode& node, void* pCookie)
+void XN_CALLBACK_TYPE DepthWatcher::HandleFieldOfViewChange(ProductionNode& /*node*/, void* pCookie)
 {
 	DepthWatcher *pThis = (DepthWatcher*)pCookie;
 	if (pThis == NULL)
@@ -731,7 +731,7 @@ void XN_CALLBACK_TYPE DepthWatcher::HandleFieldOfViewChange(ProductionNode& node
 	}
 }
 
-void XN_CALLBACK_TYPE DepthWatcher::HandleUserPositionChange(ProductionNode& node, void* pCookie)
+void XN_CALLBACK_TYPE DepthWatcher::HandleUserPositionChange(ProductionNode& /*node*/, void* pCookie)
 {
 	DepthWatcher *pThis = (DepthWatcher*)pCookie;
 	if (pThis == NULL)
@@ -832,7 +832,7 @@ XnStatus AudioWatcher::NotifySupportedOutputModes()
 	return XN_STATUS_OK;	
 }
 
-void XN_CALLBACK_TYPE AudioWatcher::HandleWaveOutputModeChange(ProductionNode& node, void* pCookie)
+void XN_CALLBACK_TYPE AudioWatcher::HandleWaveOutputModeChange(ProductionNode& /*node*/, void* pCookie)
 {
 	AudioWatcher *pThis = (AudioWatcher*)pCookie;
 	if (pThis == NULL)
@@ -882,7 +882,7 @@ XnStatus GestureWatcher::NotifyStateImpl()
 	return XN_STATUS_OK;
 }
 
-void XN_CALLBACK_TYPE GestureWatcher::HandleGestureRecognized(GestureGenerator& generator, 
+void XN_CALLBACK_TYPE GestureWatcher::HandleGestureRecognized(GestureGenerator& /*generator*/, 
 															  const XnChar* strGesture, 
 														  	  const XnPoint3D* pIDPosition, 
 															  const XnPoint3D* pEndPosition, 
@@ -901,7 +901,7 @@ void XN_CALLBACK_TYPE GestureWatcher::HandleGestureRecognized(GestureGenerator&
 		sizeof(gestureRecognizedParams), &gestureRecognizedParams);
 }
 
-void XN_CALLBACK_TYPE GestureWatcher::HandleGestureProgress(GestureGenerator& generator, 
+void XN_CALLBACK_TYPE GestureWatcher::HandleGestureProgress(GestureGenerator& /*generator*/, 
 														    const XnChar* strGesture, 
 														    const XnPoint3D* pPosition, 
 														    XnFloat fProgress, 
diff --git a/Source/OpenNI/XnNodeWatcher.h b/Source/OpenNI/XnNodeWatcher.h
index aad97df..0586733 100644
--- a/Source/OpenNI/XnNodeWatcher.h
+++ b/Source/OpenNI/XnNodeWatcher.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -59,6 +59,9 @@ protected:
 	XnNodeNotifications& m_notifications;
 	void* m_pCookie;
 	ProductionNode m_node;
+
+private:
+	XN_DISABLE_COPY_AND_ASSIGN(NodeWatcher);
 };
 
 class DeviceWatcher : public NodeWatcher
diff --git a/Source/OpenNI/XnOS.cpp b/Source/OpenNI/XnOS.cpp
index 86f2eea..8c4974b 100644
--- a/Source/OpenNI/XnOS.cpp
+++ b/Source/OpenNI/XnOS.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -157,7 +157,6 @@ XN_C_API XnStatus xnOSSaveFile(const XnChar* cpFileName, const void* pBuffer, co
 {
 	// Local function variables
 	XN_FILE_HANDLE FileHandle;
-	XnUInt32 nReadBytes = nBufferSize;
 	XnStatus nRetVal = XN_STATUS_OK;
 
 	// Validate the input/output pointers (to make sure none of them is NULL)
@@ -185,7 +184,6 @@ XN_C_API XnStatus xnOSAppendFile(const XnChar* cpFileName, const void* pBuffer,
 {
 	// Local function variables
 	XN_FILE_HANDLE FileHandle;
-	XnUInt32 nReadBytes = nBufferSize;
 	XnStatus nRetVal = XN_STATUS_OK;
 
 	// Validate the input/output pointers (to make sure none of them is NULL)
diff --git a/Source/OpenNI/XnOSMemoryProfiling.cpp b/Source/OpenNI/XnOSMemoryProfiling.cpp
index 391a4fc..bfd5945 100644
--- a/Source/OpenNI/XnOSMemoryProfiling.cpp
+++ b/Source/OpenNI/XnOSMemoryProfiling.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -68,7 +68,7 @@ typedef struct
 //---------------------------------------------------------------------------
 static XnMemBlockDataLinkedList g_allocatedMemory = {NULL, NULL};
 static XN_CRITICAL_SECTION_HANDLE g_hCS;
-static XnDump m_dump;
+static XnDumpFile* g_dump;
 
 //---------------------------------------------------------------------------
 // Code
@@ -106,14 +106,14 @@ XN_C_API void* xnOSLogMemAlloc(void* pMemBlock, XnAllocationType nAllocType, XnU
 		printf("**  WARNING: Memory Profiling is on!                      **\n");
 		printf("************************************************************\n");
 
-		m_dump = XN_DUMP_CLOSED;
-
 		bReentrent = TRUE;
 		xnOSCreateCriticalSection(&g_hCS);
 
 #ifdef XN_MEMORY_PROFILING_DUMP
-		xnDumpForceInit(&m_dump, "Entry,Address,AllocType,Bytes,Function,File,Line,AdditionalInfo\n", "MemProfiling.log");
+		xnDumpSetMaskState("MemProf", TRUE);
 #endif
+		g_dump = xnDumpFileOpen("MemProf", "MemProfiling.log");
+		xnDumpFileWriteString(g_dump, "Entry,Address,AllocType,Bytes,Function,File,Line,AdditionalInfo\n");
 		bReentrent = FALSE;
 	}
 
@@ -132,7 +132,7 @@ XN_C_API void* xnOSLogMemAlloc(void* pMemBlock, XnAllocationType nAllocType, XnU
 	pNode->Data.nLine = nLine;
 	pNode->Data.csAdditional = csAdditional;
 	pNode->Data.nFrames = XN_MEM_PROF_MAX_FRAMES;
-	xnDumpWriteString(m_dump, "Alloc,0x%x,%s,%u,%s,%s,%u,%s\n", pMemBlock, XnGetAllocTypeString(nAllocType), nBytes, csFunction, csFile, nLine, csAdditional);
+	xnDumpFileWriteString(g_dump, "Alloc,0x%x,%s,%u,%s,%s,%u,%s\n", pMemBlock, XnGetAllocTypeString(nAllocType), nBytes, csFunction, csFile, nLine, csAdditional);
 
 	// try to get call stack (skip 2 frames - this one and the alloc func)
 	XnChar* pstrFrames[XN_MEM_PROF_MAX_FRAMES];
@@ -184,7 +184,7 @@ XN_C_API void xnOSLogMemFree(const void* pMemBlock)
 			if (g_allocatedMemory.pLast == pNode)
 				g_allocatedMemory.pLast = pPrev;
 
-			xnDumpWriteString(m_dump, "Free,0x%x\n", pMemBlock);
+			xnDumpFileWriteString(g_dump, "Free,0x%x\n", pMemBlock);
 
 			// deallocate memory
 			xnOSFree(pNode);
diff --git a/Source/OpenNI/XnOpenNI.cpp b/Source/OpenNI/XnOpenNI.cpp
index 067b0cf..9600580 100644
--- a/Source/OpenNI/XnOpenNI.cpp
+++ b/Source/OpenNI/XnOpenNI.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -52,6 +52,9 @@
 #define XN_FRAME_SYNC_THRESHOLD		3000
 #define XN_NODE_FPS_CALC_SAMPLES	90
 #define XN_MASK_FPS					"FPS"
+#define XN_DUMP_MASK_REF_COUNT		"OpenNIRefCount"
+#define XN_DUMP_MASK_DATA_FLOW		"OpenNIDataFlow"
+#define XN_BASE_NUMBER_OF_GESTURES 2
 
 //---------------------------------------------------------------------------
 // Macros
@@ -67,7 +70,7 @@
 	XN_VALIDATE_FUNC_PTR_RET(ptr, XN_STATUS_INVALID_OPERATION)
 
 #define XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, nodeType, retVal)						\
-	if (!hInstance->typeHierarchy.IsSet(nodeType))	\
+	if (!hInstance->pTypeHierarchy->IsSet(nodeType))	\
 	{																					\
 		return retVal;																	\
 	}
@@ -84,6 +87,7 @@
 //---------------------------------------------------------------------------
 // Forward Declarations
 //---------------------------------------------------------------------------
+static void xnContextDestroy(XnContext* pContext, XnBool bForce = FALSE);
 static XnStatus xnStartGeneratingImpl(XnNodeHandle hInstance);
 static XnStatus xnUpdateDataImpl(XnNodeHandle hInstance);
 static void xnUpdateMetaData(XnNodeHandle hNode);
@@ -98,9 +102,31 @@ static XnStatus xnInitCodec(XnNodeHandle hCodec, XnNodeHandle hInitializerNode);
 static XnBool xnIsFrameSyncedWithImpl(XnNodeHandle hInstance, XnNodeHandle hOther);
 
 //---------------------------------------------------------------------------
+// Static Variables
+//---------------------------------------------------------------------------
+XnLogger* g_logger = xnLoggerOpen(XN_MASK_OPEN_NI);
+
+//---------------------------------------------------------------------------
 // Initialization / Deinitialization
 //---------------------------------------------------------------------------
 
+static void xnDumpRefCount(XnContext* pContext, XnNodeHandle hNode, XnUInt32 nRefCount, const XnChar* strComment)
+{
+	XnUInt64 nNow;
+	xnOSGetHighResTimeStamp(&nNow);
+	const XnChar* strName = "Context";
+	if (hNode != NULL)
+	{
+		strName = hNode->pNodeInfo->strInstanceName;
+	}
+	const XnChar* strActualComment = strComment;
+	if (strActualComment == NULL)
+	{
+		strActualComment = "";
+	}
+	xnDumpFileWriteString(pContext->pDumpRefCount, "%llu,%s,%u,%s\n", nNow, strName, nRefCount, strActualComment);
+}
+
 XN_C_API XnStatus xnInit(XnContext** ppContext)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
@@ -128,21 +154,29 @@ XN_C_API XnStatus xnInit(XnContext** ppContext)
 	pContext->pModuleLoader = XN_NEW(XnModuleLoader, pContext);
 	pContext->pNodesMap = XN_NEW(XnNodesMap);
 	pContext->pGlobalErrorChangeEvent = XN_NEW(XnErrorStateChangedEvent);
+	pContext->pShutdownEvent = XN_NEW(XnContextShuttingDownEvent);
+	pContext->nRefCount = 1;
+	pContext->pDumpRefCount = xnDumpFileOpen(XN_DUMP_MASK_REF_COUNT, "RefCount.csv");
+	pContext->pDumpDataFlow = xnDumpFileOpen(XN_DUMP_MASK_DATA_FLOW, "DataFlow.csv");
+
+	xnDumpFileWriteString(pContext->pDumpRefCount, "Timestamp,Object,RefCount,Comment\n");
+	xnDumpFileWriteString(pContext->pDumpDataFlow, "Timestamp,Action,Object,DataTimestamp\n");
 
 	// validate memory allocations
 	if (pContext->pLicenses == NULL ||
 		pContext->pModuleLoader == NULL ||
 		pContext->pNodesMap == NULL ||
-		pContext->pGlobalErrorChangeEvent == NULL)
+		pContext->pGlobalErrorChangeEvent == NULL ||
+		pContext->pShutdownEvent == NULL)
 	{
-		xnShutdown(pContext);
+		xnContextDestroy(pContext);
 		return (XN_STATUS_ALLOC_FAILED);
 	}
 
 	nRetVal = xnFPSInit(&pContext->readFPS, XN_NODE_FPS_CALC_SAMPLES);
 	if (nRetVal != XN_STATUS_OK)
 	{
-		xnShutdown(pContext);
+		xnContextDestroy(pContext);
 		return (nRetVal);
 	}
 
@@ -150,7 +184,24 @@ XN_C_API XnStatus xnInit(XnContext** ppContext)
 	nRetVal = xnOSCreateEvent(&pContext->hNewDataEvent, FALSE);
 	if (nRetVal != XN_STATUS_OK)
 	{
-		xnShutdown(pContext);
+		xnContextDestroy(pContext);
+		return (nRetVal);
+	}
+
+	// create lock
+	nRetVal = xnOSCreateCriticalSection(&pContext->hLock);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnContextDestroy(pContext);
+		return (nRetVal);
+	}
+
+	// create owned nodes list (nodes that are owned by the context and not by users, for example,
+	// nodes that were created from XML script).
+	nRetVal = xnNodeInfoListAllocate(&pContext->pOwnedNodes);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnContextDestroy(pContext);
 		return (nRetVal);
 	}
 
@@ -158,13 +209,19 @@ XN_C_API XnStatus xnInit(XnContext** ppContext)
 	nRetVal = pContext->pModuleLoader->Init();
 	if (nRetVal != XN_STATUS_OK)
 	{
-		xnShutdown(pContext);
+		xnContextDestroy(pContext);
 		return (nRetVal);
 	}
 
 	// load global licenses
 	nRetVal = xnLoadGlobalLicenses(pContext);
-	XN_IS_STATUS_OK(nRetVal);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnContextDestroy(pContext);
+		return (nRetVal);
+	}
+
+	xnDumpRefCount(pContext, NULL, 1, "Create");
 
 	// return to caller
 	*ppContext = pContext;
@@ -172,14 +229,147 @@ XN_C_API XnStatus xnInit(XnContext** ppContext)
 	return (XN_STATUS_OK);
 }
 
-XN_C_API XnStatus xnInitFromXmlFile(const XnChar* strFileName, XnContext** ppContext, XnEnumerationErrors* pErrors)
+void xnFindValidName(XnContext* pContext, const XnChar* strBaseName, XnChar* strName)
+{
+	XnUInt i = 1;
+
+	XnInternalNodeData* pNode;
+
+	while (TRUE)
+	{
+		sprintf(strName, "%s%u", strBaseName, i);
+
+		// check if name already exists
+		if (pContext->pNodesMap->Get(strName, pNode) != XN_STATUS_OK)
+		{
+			// found it
+			break;
+		}
+
+		++i;
+	}
+}
+
+void xnFindValidNameForType(XnContext* pContext, XnProductionNodeType Type, XnChar* strName)
+{
+	// get type string
+	const XnChar* strTypeName = xnProductionNodeTypeToString(Type);
+	xnFindValidName(pContext, strTypeName, strName);
+}
+
+void xnMarkOwnedNode(XnContext* pContext, XnNodeHandle hNode)
+{
+	hNode->bIsOwnedByContext = TRUE;
+	xnNodeInfoListAddNode(pContext->pOwnedNodes, hNode->pNodeInfo);
+	xnProductionNodeAddRef(hNode);
+}
+
+XN_C_API XnStatus xnContextRunXmlScriptFromFile(XnContext* pContext, const XnChar* strFileName, XnEnumerationErrors* pErrors)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnNodeHandle hScriptNode;
+	nRetVal = xnContextRunXmlScriptFromFileEx(pContext, strFileName, pErrors, &hScriptNode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// take ownership of created node
+	xnMarkOwnedNode(pContext, hScriptNode);
+	xnProductionNodeRelease(hScriptNode);
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnContextRunXmlScriptFromFileEx(XnContext* pContext, const XnChar* strFileName, XnEnumerationErrors* pErrors, XnNodeHandle* phScriptNode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XN_VALIDATE_INPUT_PTR(pContext);
+	XN_VALIDATE_INPUT_PTR(strFileName);
+	XN_VALIDATE_OUTPUT_PTR(phScriptNode);
+
+	*phScriptNode = NULL;
+
+	XnNodeHandle hScriptNode;
+	nRetVal = xnCreateScriptNode(pContext, XN_SCRIPT_FORMAT_XML, &hScriptNode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnLoadScriptFromFile(hScriptNode, strFileName);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnProductionNodeRelease(hScriptNode);
+		return (nRetVal);
+	}
+
+	nRetVal = xnScriptNodeRun(hScriptNode, pErrors);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnProductionNodeRelease(hScriptNode);
+		return (nRetVal);
+	}
+
+	*phScriptNode = hScriptNode;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnContextRunXmlScriptEx(XnContext* pContext, const XnChar* xmlScript, XnEnumerationErrors* pErrors, XnNodeHandle* phScriptNode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XN_VALIDATE_INPUT_PTR(pContext);
+	XN_VALIDATE_INPUT_PTR(xmlScript);
+	XN_VALIDATE_OUTPUT_PTR(phScriptNode);
+
+	*phScriptNode = NULL;
+
+	XnNodeHandle hScriptNode;
+	nRetVal = xnCreateScriptNode(pContext, XN_SCRIPT_FORMAT_XML, &hScriptNode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnLoadScriptFromString(hScriptNode, xmlScript);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnProductionNodeRelease(hScriptNode);
+		return (nRetVal);
+	}
+
+	nRetVal = xnScriptNodeRun(hScriptNode, pErrors);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnProductionNodeRelease(hScriptNode);
+		return (nRetVal);
+	}
+
+	*phScriptNode = hScriptNode;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnContextRunXmlScript(XnContext* pContext, const XnChar* xmlScript, XnEnumerationErrors* pErrors)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnNodeHandle hScriptNode;
+	nRetVal = xnContextRunXmlScriptEx(pContext, xmlScript, pErrors, &hScriptNode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// take ownership of created node
+	xnMarkOwnedNode(pContext, hScriptNode);
+	xnProductionNodeRelease(hScriptNode);
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnInitFromXmlFileEx(const XnChar* strFileName, XnContext** ppContext, XnEnumerationErrors* pErrors, XnNodeHandle* phScriptNode)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 	
 	XN_VALIDATE_INPUT_PTR(strFileName);
 	XN_VALIDATE_OUTPUT_PTR(ppContext);
+	XN_VALIDATE_OUTPUT_PTR(phScriptNode);
 
 	*ppContext = NULL;
+	*phScriptNode = NULL;
 
 	nRetVal = xnLogInitFromXmlFile(strFileName);
 	XN_IS_STATUS_OK(nRetVal);
@@ -188,10 +378,10 @@ XN_C_API XnStatus xnInitFromXmlFile(const XnChar* strFileName, XnContext** ppCon
 	nRetVal = xnInit(&pContext);
 	XN_IS_STATUS_OK(nRetVal);
 
- 	nRetVal = xnContextRunXmlScriptFromFile(pContext, strFileName, pErrors);
+ 	nRetVal = xnContextRunXmlScriptFromFileEx(pContext, strFileName, pErrors, phScriptNode);
 	if (nRetVal != XN_STATUS_OK)
 	{
-		xnShutdown(pContext);
+		xnContextRelease(pContext);
 		return (nRetVal);
 	}
 
@@ -200,6 +390,46 @@ XN_C_API XnStatus xnInitFromXmlFile(const XnChar* strFileName, XnContext** ppCon
 	return (XN_STATUS_OK);
 }
 
+XN_C_API XnStatus xnInitFromXmlFile(const XnChar* strFileName, XnContext** ppContext, XnEnumerationErrors* pErrors)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XnNodeHandle hScriptNode;
+	nRetVal = xnInitFromXmlFileEx(strFileName, ppContext, pErrors, &hScriptNode);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	// take ownership of created nodes
+	xnMarkOwnedNode(*ppContext, hScriptNode);
+	xnProductionNodeRelease(hScriptNode);
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnContextAddRef(XnContext* pContext)
+{
+	XN_VALIDATE_INPUT_PTR(pContext);
+	XnAutoCSLocker lock(pContext->hLock);
+	pContext->nRefCount++;
+	xnDumpRefCount(pContext, NULL, pContext->nRefCount, NULL);
+	return XN_STATUS_OK;
+}
+
+XN_C_API void xnContextRelease(XnContext* pContext)
+{
+	XN_ASSERT(pContext != NULL);
+
+	// decrease ref count in a lock
+	XnAutoCSLocker lock(pContext->hLock);
+	pContext->nRefCount--;
+	xnDumpRefCount(pContext, NULL, pContext->nRefCount, NULL);
+
+	if (pContext->nRefCount == 0)
+	{
+		lock.Unlock();
+		xnContextDestroy(pContext);
+	}
+}
+
 /** Checks if a node is needed by another. */
 static XnBool xnIsNeeded(XnContext* pContext, XnNodeHandle hNode)
 {
@@ -221,10 +451,13 @@ static XnBool xnIsNeeded(XnContext* pContext, XnNodeHandle hNode)
 	return FALSE;
 }
 
-XN_C_API void xnShutdown(XnContext* pContext)
+static void xnContextDestroy(XnContext* pContext, XnBool bForce /* = FALSE */)
 {
 	if (pContext != NULL)
 	{
+		xnDumpRefCount(pContext, NULL, 0, "Destroy");
+		xnDumpFileClose(pContext->pDumpRefCount);
+
 		// we have to destroy nodes from top to bottom. So we'll go over the list, each time removing
 		// nodes that nobody needs, until the list is empty
 		while (!pContext->pNodesMap->IsEmpty())
@@ -239,30 +472,80 @@ XN_C_API void xnShutdown(XnContext* pContext)
 			}
 		}
 
+		if (bForce)
+		{
+			// raise the shutdown event *after* all nodes have been destroyed (some nodes might call the
+			// context or other nodes when destroying)
+			pContext->pShutdownEvent->Raise(pContext);
+		}
+
+		xnLoggerInfo(g_logger, "Destroying context");
+
+		xnNodeInfoListFree(pContext->pOwnedNodes);
+		xnOSCloseCriticalSection(&pContext->hLock);
 		xnOSCloseEvent(&pContext->hNewDataEvent);
 		XN_DELETE(pContext->pNodesMap);
 		XN_DELETE(pContext->pModuleLoader);
 		XN_DELETE(pContext->pLicenses);
 		XN_DELETE(pContext->pGlobalErrorChangeEvent);
+		XN_DELETE(pContext->pShutdownEvent);
 		xnFPSFree(&pContext->readFPS);
 		xnOSFree(pContext);
 
 #ifdef XN_MEM_PROFILING
-#ifdef _WIN32
+	#ifdef _WIN32
 		xnOSWriteMemoryReport("C:\\xnMemProf.txt");
-#else
+	#else
 		//TODO: Something for linux
-#endif
+	#endif
 #endif
 	}
 }
 
-XN_C_API XnStatus xnContextOpenFileRecording(XnContext* pContext, const XnChar* strFileName)
+XN_C_API void xnShutdown(XnContext* pContext)
+{
+	xnForceShutdown(pContext);
+}
+
+XN_C_API void xnForceShutdown(XnContext* pContext)
+{
+	xnContextDestroy(pContext, TRUE);
+}
+
+XN_C_API XnStatus xnContextRegisterForShutdown(XnContext* pContext, XnContextShuttingDownHandler pHandler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INPUT_PTR(pContext);
+	XN_VALIDATE_INPUT_PTR(pHandler);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	return pContext->pShutdownEvent->Register(pHandler, pCookie, phCallback);
+}
+
+XN_C_API void xnContextUnregisterFromShutdown(XnContext* pContext, XnCallbackHandle hCallback)
+{
+	XN_ASSERT(pContext != NULL);
+	XN_ASSERT(hCallback != NULL);
+
+	if (pContext == NULL || hCallback == NULL)
+	{
+		return;
+	}
+
+	XnStatus nRetVal = pContext->pShutdownEvent->Unregister(hCallback);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		XN_ASSERT(FALSE);
+	}
+}
+
+XN_C_API XnStatus xnContextOpenFileRecordingEx(XnContext* pContext, const XnChar* strFileName, XnNodeHandle* phPlayerNode)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
 	XN_VALIDATE_INPUT_PTR(pContext);
 	XN_VALIDATE_INPUT_PTR(strFileName);
+	XN_VALIDATE_OUTPUT_PTR(phPlayerNode);
+
+	*phPlayerNode = NULL;
 
 	const char* strExt = strrchr(strFileName, '.');
 	if (strExt == NULL)
@@ -283,9 +566,28 @@ XN_C_API XnStatus xnContextOpenFileRecording(XnContext* pContext, const XnChar*
 		return (nRetVal);
 	}
 
+	*phPlayerNode = hPlayer;
 	return XN_STATUS_OK;
 }
 
+XN_C_API XnStatus xnContextOpenFileRecording(XnContext* pContext, const XnChar* strFileName)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XnNodeHandle hPlayer;
+	nRetVal = xnContextOpenFileRecordingEx(pContext, strFileName, &hPlayer);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnNodeInfoListAddNode(pContext->pOwnedNodes, hPlayer->pNodeInfo);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnProductionNodeRelease(hPlayer);
+		return (nRetVal);
+	}
+	
+	return (XN_STATUS_OK);
+}
+
 //---------------------------------------------------------------------------
 // Utilities
 //---------------------------------------------------------------------------
@@ -684,8 +986,6 @@ XN_C_API XnStatus xnNodeInfoSetInstanceName(XnNodeInfo* pNodeInfo, const XnChar*
 
 XnStatus xnNodeInfoSetAdditionalData(XnNodeInfo* pNodeInfo, const void* pAdditionalData, XnFreeHandler pFreeHandler)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	XN_VALIDATE_INPUT_PTR(pNodeInfo);
 
 	pNodeInfo->pAdditionalData = pAdditionalData;
@@ -696,26 +996,45 @@ XnStatus xnNodeInfoSetAdditionalData(XnNodeInfo* pNodeInfo, const void* pAdditio
 
 XN_C_API const XnProductionNodeDescription* xnNodeInfoGetDescription(XnNodeInfo* pNodeInfo)
 {
+	XN_VALIDATE_PTR(pNodeInfo, NULL);
 	return &pNodeInfo->Description;
 }
 
 XN_C_API const XnChar* xnNodeInfoGetInstanceName(XnNodeInfo* pNodeInfo)
 {
+	XN_VALIDATE_PTR(pNodeInfo, NULL);
 	return pNodeInfo->strInstanceName;
 }
 
 XN_C_API const XnChar* xnNodeInfoGetCreationInfo(XnNodeInfo* pNodeInfo)
 {
+	XN_VALIDATE_PTR(pNodeInfo, NULL);
 	return pNodeInfo->strCreationInfo;
 }
 
 XN_C_API XnNodeInfoList* xnNodeInfoGetNeededNodes(XnNodeInfo* pNodeInfo)
 {
+	XN_VALIDATE_PTR(pNodeInfo, NULL);
 	return pNodeInfo->pNeededTrees;
 }
 
 XN_C_API XnNodeHandle xnNodeInfoGetHandle(XnNodeInfo* pNodeInfo)
 {
+	XN_VALIDATE_PTR(pNodeInfo, NULL);
+	return pNodeInfo->hNode;
+}
+
+XN_C_API XnNodeHandle xnNodeInfoGetRefHandle(XnNodeInfo* pNodeInfo)
+{
+	XN_VALIDATE_PTR(pNodeInfo, NULL);
+	if (pNodeInfo->hNode != NULL)
+	{
+		XnStatus nRetVal = xnProductionNodeAddRef(pNodeInfo->hNode);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			XN_ASSERT(FALSE);
+	}
+	}
 	return pNodeInfo->hNode;
 }
 
@@ -724,58 +1043,97 @@ XN_C_API const void* xnNodeInfoGetAdditionalData(XnNodeInfo* pNodeInfo)
 	return pNodeInfo->pAdditionalData;
 }
 
-XN_C_API XnStatus xnNodeInfoGetTreeStringRepresentation(XnNodeInfo* pNodeInfo, XnChar* csResult, XnUInt32 nSize)
+XnStatus xnNodeInfoGetTreeStringRepresentationImpl(XnNodeInfo* pNodeInfo, XnChar* csResult, XnUInt32 nSize, XnUInt32 nDepth)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
-	
-	XN_VALIDATE_INPUT_PTR(pNodeInfo);
-	XN_VALIDATE_OUTPUT_PTR(csResult);
+	XnUInt32 nLen = 0;
+	XnUInt32 nWritten = 0;
+
+	XnChar strIndentation[100] = "";
+	if (nDepth >= 100)
+	{
+		XN_ASSERT(FALSE);
+		return XN_STATUS_INTERNAL_BUFFER_TOO_SMALL;
+	}
 
-	nRetVal = xnProductionNodeDescriptionToString(&pNodeInfo->Description, csResult, nSize);
+	for (XnUInt32 i = 0; i < nDepth; ++i)
+	{
+		strIndentation[i] = '\t';
+	}
+
+	nRetVal = xnOSStrCopy(csResult + nLen, strIndentation, nSize - nLen);
 	XN_IS_STATUS_OK(nRetVal);
 
-	if (pNodeInfo->pNeededTrees != NULL)
+	nLen = xnOSStrLen(csResult);
+	
+	nRetVal = xnProductionNodeDescriptionToString(&pNodeInfo->Description, csResult + nLen, nSize - nLen);
+	XN_IS_STATUS_OK(nRetVal);
+
+	if (pNodeInfo->strInstanceName[0] != '\0')
 	{
-		// add list of needed nodes
-		nRetVal = xnOSStrAppend(csResult, " -> ( ", nSize);
+		nLen = xnOSStrLen(csResult);
+		nRetVal = xnOSStrFormat(csResult + nLen, nSize - nLen, &nWritten, "[\"%s\"]", pNodeInfo->strInstanceName);
 		XN_IS_STATUS_OK(nRetVal);
+	}
+
+	if (pNodeInfo->strCreationInfo[0] != '\0')
+	{
+		nLen = xnOSStrLen(csResult);
+		nRetVal = xnOSStrFormat(csResult + nLen, nSize - nLen, &nWritten, "(%s)", pNodeInfo->strCreationInfo);
+		XN_IS_STATUS_OK(nRetVal);
+	}
 
+	if (pNodeInfo->pNeededTrees != NULL)
+	{
+		// add list of needed nodes
 		XnBool bFirst = TRUE;
-		XnSizeT nLen;
 
 		for (XnNodeInfoListIterator it = xnNodeInfoListGetFirst(pNodeInfo->pNeededTrees); 
 			xnNodeInfoListIteratorIsValid(it);
 			it = xnNodeInfoListGetNext(it))
 		{
-			if (!bFirst)
+			nLen = xnOSStrLen(csResult);
+
+			if (bFirst)
 			{
-				nRetVal = xnOSStrAppend(csResult, " and ", nSize);
+				nRetVal = xnOSStrFormat(csResult + nLen, nSize - nLen, &nWritten, " ->\n", strIndentation);
 				XN_IS_STATUS_OK(nRetVal);
 			}
 
-			nLen = strlen(csResult);
+			nLen = xnOSStrLen(csResult);
 
-			nRetVal = xnNodeInfoGetTreeStringRepresentation(pNodeInfo, csResult + nLen, nSize - nLen);
+			nRetVal = xnNodeInfoGetTreeStringRepresentationImpl(xnNodeInfoListGetCurrent(it), csResult + nLen, nSize - nLen, nDepth + 1);
 			XN_IS_STATUS_OK(nRetVal);
 
 			bFirst = FALSE;
 		}
 
-		nRetVal = xnOSStrAppend(csResult, ")", nSize);
-		XN_IS_STATUS_OK(nRetVal);
+		if (bFirst)
+		{
+			// no needed nodes. add new line ourselves
+			nLen = xnOSStrLen(csResult);
+			nRetVal = xnOSStrFormat(csResult + nLen, nSize - nLen, &nWritten, "\n", strIndentation);
+			XN_IS_STATUS_OK(nRetVal);
+		}
 	}
 	
 	return (XN_STATUS_OK);
 }
 
+XN_C_API XnStatus xnNodeInfoGetTreeStringRepresentation(XnNodeInfo* pNodeInfo, XnChar* csResult, XnUInt32 nSize)
+{
+	XN_VALIDATE_INPUT_PTR(pNodeInfo);
+	XN_VALIDATE_OUTPUT_PTR(csResult);
+
+	return xnNodeInfoGetTreeStringRepresentationImpl(pNodeInfo, csResult, nSize, 0);
+}
+
 //---------------------------------------------------------------------------
 // ProductionNodesList
 //---------------------------------------------------------------------------
 
 XN_C_API XnStatus xnNodeInfoListAllocate(XnNodeInfoList** ppList)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-	
 	XN_VALIDATE_OUTPUT_PTR(ppList);
 
 	XN_VALIDATE_CALLOC(*ppList, XnNodeInfoList, 1);
@@ -794,8 +1152,6 @@ XN_C_API void xnNodeInfoListFree(XnNodeInfoList* pList)
 
 XN_C_API XnStatus xnNodeInfoListAddNode(XnNodeInfoList* pList, XnNodeInfo* pNode)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	// allocate new list node
 	XnNodeInfoListNode* pListNode;
 	XN_VALIDATE_CALLOC(pListNode, XnNodeInfoListNode, 1);
@@ -1053,59 +1409,33 @@ XN_C_API XnStatus xnEnumerateProductionTrees(XnContext* pContext, XnProductionNo
 	return (XN_STATUS_OK);
 }
 
-void xnFindValidNameForType(XnContext* pContext, XnProductionNodeType Type, XnChar* strName)
+XnStatus xnCreateMetaData(XnInternalNodeData* pNodeData)
 {
-	// get type string
-	const XnChar* strTypeName = xnProductionNodeTypeToString(Type);
-
-	XnUInt i = 1;
-
-	XnInternalNodeData* pNode;
-
-	while (TRUE)
-	{
-		sprintf(strName, "%s%u", strTypeName, i);
-
-		// check if name already exists
-		if (pContext->pNodesMap->Get(strName, pNode) != XN_STATUS_OK)
-		{
-			// found it
-			break;
-		}
-
-		++i;
-	}
-}
-
-XnStatus xnCreateMetaData(XnInternalNodeData* pNodeData)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	if (pNodeData->typeHierarchy.IsSet(XN_NODE_TYPE_DEPTH))
+	if (pNodeData->pTypeHierarchy->IsSet(XN_NODE_TYPE_DEPTH))
 	{
 		pNodeData->pMetaData.Depth = xnAllocateDepthMetaData();
 		XN_VALIDATE_ALLOC_PTR(pNodeData->pMetaData.Depth);
 		pNodeData->pbMetaDataIsNewFlag = &pNodeData->pMetaData.Depth->pMap->pOutput->bIsNew;
 	}
-	else if (pNodeData->typeHierarchy.IsSet(XN_NODE_TYPE_IMAGE))
+	else if (pNodeData->pTypeHierarchy->IsSet(XN_NODE_TYPE_IMAGE))
 	{
 		pNodeData->pMetaData.Image = xnAllocateImageMetaData();
 		XN_VALIDATE_ALLOC_PTR(pNodeData->pMetaData.Image);
 		pNodeData->pbMetaDataIsNewFlag = &pNodeData->pMetaData.Image->pMap->pOutput->bIsNew;
 	}
-	else if (pNodeData->typeHierarchy.IsSet(XN_NODE_TYPE_IR))
+	else if (pNodeData->pTypeHierarchy->IsSet(XN_NODE_TYPE_IR))
 	{
 		pNodeData->pMetaData.IR = xnAllocateIRMetaData();
 		XN_VALIDATE_ALLOC_PTR(pNodeData->pMetaData.IR);
 		pNodeData->pbMetaDataIsNewFlag = &pNodeData->pMetaData.IR->pMap->pOutput->bIsNew;
 	}
-	else if (pNodeData->typeHierarchy.IsSet(XN_NODE_TYPE_AUDIO))
+	else if (pNodeData->pTypeHierarchy->IsSet(XN_NODE_TYPE_AUDIO))
 	{
 		pNodeData->pMetaData.Audio = xnAllocateAudioMetaData();
 		XN_VALIDATE_ALLOC_PTR(pNodeData->pMetaData.Audio);
 		pNodeData->pbMetaDataIsNewFlag = &pNodeData->pMetaData.Audio->pOutput->bIsNew;
 	}
-	else if (pNodeData->typeHierarchy.IsSet(XN_NODE_TYPE_SCENE))
+	else if (pNodeData->pTypeHierarchy->IsSet(XN_NODE_TYPE_SCENE))
 	{
 		pNodeData->pMetaData.Scene = xnAllocateSceneMetaData();
 		XN_VALIDATE_ALLOC_PTR(pNodeData->pMetaData.Scene);
@@ -1121,7 +1451,7 @@ XnStatus xnCreatePrivateData(XnInternalNodeData* pNodeData)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
-	if (pNodeData->typeHierarchy.IsSet(XN_NODE_TYPE_RECORDER))
+	if (pNodeData->pTypeHierarchy->IsSet(XN_NODE_TYPE_RECORDER))
 	{
 		xn::RecorderImpl *pRecorderImpl = NULL;
 		XN_VALIDATE_NEW(pRecorderImpl, xn::RecorderImpl);
@@ -1134,7 +1464,7 @@ XnStatus xnCreatePrivateData(XnInternalNodeData* pNodeData)
 
 		pNodeData->pPrivateData = pRecorderImpl;
 	}
-	else if (pNodeData->typeHierarchy.IsSet(XN_NODE_TYPE_PLAYER))
+	else if (pNodeData->pTypeHierarchy->IsSet(XN_NODE_TYPE_PLAYER))
 	{
 		xn::PlayerImpl *pPlayerImpl = NULL;
 		XN_VALIDATE_NEW(pPlayerImpl, xn::PlayerImpl);
@@ -1146,7 +1476,7 @@ XnStatus xnCreatePrivateData(XnInternalNodeData* pNodeData)
 		}
 		pNodeData->pPrivateData = pPlayerImpl;
 	}
-	else if (pNodeData->typeHierarchy.IsSet(XN_NODE_TYPE_DEPTH))
+	else if (pNodeData->pTypeHierarchy->IsSet(XN_NODE_TYPE_DEPTH))
 	{
 		xn::DepthPrivateData* pDepthPrivateData = NULL;
 		XN_VALIDATE_NEW(pDepthPrivateData, xn::DepthPrivateData);
@@ -1158,17 +1488,36 @@ XnStatus xnCreatePrivateData(XnInternalNodeData* pNodeData)
 		}
 		pNodeData->pPrivateData = pDepthPrivateData;
 	}
-
+    else if(pNodeData->pTypeHierarchy->IsSet(XN_NODE_TYPE_USER))
+    {
+        xn::PosePrivateData * pPosePrivateData=NULL;
+
+        if(xnIsCapabilitySupported(pNodeData,XN_CAPABILITY_POSE_DETECTION))
+        {
+            XN_VALIDATE_NEW(pPosePrivateData, xn::PosePrivateData);
+            nRetVal = pPosePrivateData->Init(pNodeData);
+            if (nRetVal != XN_STATUS_OK)
+            {
+                XN_DELETE(pPosePrivateData);
+                return nRetVal;
+            }
+            pNodeData->pPrivateData = pPosePrivateData;
+        }
+
+    }
 	return (XN_STATUS_OK);
 }
 
-void XN_CALLBACK_TYPE xnGeneratorHasNewData(XnNodeHandle hNode, void* pCookie)
+void XN_CALLBACK_TYPE xnGeneratorHasNewData(XnNodeHandle hNode, void* /*pCookie*/)
 {
 	xnMarkFPSFrame(hNode->pContext, &hNode->genFPS);
 	xnOSSetEvent(hNode->pContext->hNewDataEvent);
+	XnUInt64 nNow;
+	xnOSGetHighResTimeStamp(&nNow);
+	xnDumpFileWriteString(hNode->pContext->pDumpDataFlow, "%llu,NewDataAvailable,%s,\n", nNow, hNode->pNodeInfo->strInstanceName);
 }
 
-void XN_CALLBACK_TYPE xnNodeLockChanged(XnNodeHandle hNode, void* pCookie)
+void XN_CALLBACK_TYPE xnNodeLockChanged(XnNodeHandle hNode, void* /*pCookie*/)
 {
 	XnBool bLocked = xnGetLockStateImpl(hNode);
 	// if it's locked, give it a special handle
@@ -1181,11 +1530,11 @@ void xnSetGlobalErrorState(XnContext* pContext, XnStatus errorState)
 	{
 		if (errorState == XN_STATUS_OK)
 		{
-			xnLogInfo(XN_MASK_OPEN_NI, "Context has returned to normal state.");
+			xnLoggerInfo(g_logger, "Context has returned to normal state.");
 		}
 		else
 		{
-			xnLogInfo(XN_MASK_OPEN_NI, "Context has entered error state: %s", xnGetStatusString(errorState));
+			xnLoggerInfo(g_logger, "Context has entered error state: %s", xnGetStatusString(errorState));
 		}
 
 		pContext->globalErrorState = errorState;
@@ -1193,7 +1542,7 @@ void xnSetGlobalErrorState(XnContext* pContext, XnStatus errorState)
 	}
 }
 
-void XN_CALLBACK_TYPE xnNodeErrorStateChanged(XnNodeHandle hNode, void* pCookie)
+void XN_CALLBACK_TYPE xnNodeErrorStateChanged(XnNodeHandle hNode, void* /*pCookie*/)
 {
 	XnContext* pContext = hNode->pContext;
 
@@ -1223,7 +1572,7 @@ void XN_CALLBACK_TYPE xnNodeErrorStateChanged(XnNodeHandle hNode, void* pCookie)
 	xnSetGlobalErrorState(pContext, errorState);
 }
 
-void XN_CALLBACK_TYPE xnNodeFrameSyncChanged(XnNodeHandle hNode, void* pCookie)
+void XN_CALLBACK_TYPE xnNodeFrameSyncChanged(XnNodeHandle hNode, void* /*pCookie*/)
 {
 	XnContext* pContext = hNode->pContext;
 
@@ -1243,9 +1592,11 @@ void XN_CALLBACK_TYPE xnNodeFrameSyncChanged(XnNodeHandle hNode, void* pCookie)
 	hNode->hFrameSyncedWith = hFrameSyncedWith;
 }
 
-static XnStatus xnCreateProductionNodeImpl(XnContext* pContext, XnNodeInfo* pTree)
+static XnStatus xnCreateProductionNodeImpl(XnContext* pContext, XnNodeInfo* pTree, XnNodeHandle* phNode)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
+
+	*phNode = NULL;
 	
 	// first of all, check if name is empty, if so - give it a default name
 	if (pTree->strInstanceName[0] == '\0')
@@ -1255,7 +1606,7 @@ static XnStatus xnCreateProductionNodeImpl(XnContext* pContext, XnNodeInfo* pTre
 
 	XnChar strDescription[500];
 	xnProductionNodeDescriptionToString(&pTree->Description, strDescription, 500);
-	xnLogInfo(XN_MASK_OPEN_NI, "Creating node '%s' of type %s...", pTree->strInstanceName, strDescription);
+	xnLoggerInfo(g_logger, "Creating node '%s' of type %s...", pTree->strInstanceName, strDescription);
 
 	XnModuleInstance* pModuleInstance;
 	nRetVal = pContext->pModuleLoader->CreateRootNode(pTree, &pModuleInstance);
@@ -1264,11 +1615,32 @@ static XnStatus xnCreateProductionNodeImpl(XnContext* pContext, XnNodeInfo* pTre
 	// create handle
 	XnInternalNodeData* pNodeData;
 	XN_VALIDATE_CALLOC(pNodeData, XnInternalNodeData, 1);
-	pNodeData->typeHierarchy = pModuleInstance->pLoaded->pInterface->HierarchyType;
+
+	pNodeData->pTypeHierarchy = XN_NEW(XnBitSet);
+	if (pNodeData->pTypeHierarchy == NULL)
+	{
+		return xnFreeProductionNodeImpl(pNodeData, XN_STATUS_ALLOC_FAILED);
+	}
+
+	*pNodeData->pTypeHierarchy = pModuleInstance->pLoaded->pInterface->HierarchyType;
 	pNodeData->pNodeInfo = pTree;
 	pNodeData->nRefCount = 1;
 	pNodeData->pModuleInstance = pModuleInstance;
+
+	// reference context
+	nRetVal = xnContextAddRef(pContext);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		return xnFreeProductionNodeImpl(pNodeData, nRetVal);
+	}
 	pNodeData->pContext = pContext;
+
+	nRetVal = xnOSCreateCriticalSection(&pNodeData->hLock);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		return xnFreeProductionNodeImpl(pNodeData, nRetVal);
+	}
+
 	pNodeData->pNeededNodesDataHash = XN_NEW(XnNeededNodesDataHash);
 
 	if (pNodeData->pNeededNodesDataHash == NULL)
@@ -1372,21 +1744,30 @@ static XnStatus xnCreateProductionNodeImpl(XnContext* pContext, XnNodeInfo* pTre
 	// increase info ref count (context now holds it)
 	++pTree->nRefCount;
 
+	xnDumpRefCount(pContext, pNodeData, 1, "Create");
+
 	// update handle in node info
 	pTree->hNode = pNodeData;
 
+	// return value
+	*phNode = pNodeData;
+
 	return (XN_STATUS_OK);
 }
 
-static XnStatus xnCreateProductionTreeImpl(XnContext* pContext, XnNodeInfo* pTree)
+static XnStatus xnCreateProductionTreeImpl(XnContext* pContext, XnNodeInfo* pTree, XnNodeHandle* phNode)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
+	XnArray<XnNodeHandle> createdNodes;
+
+	*phNode = NULL;
 	
 	// check stop condition
 	if (pTree->hNode != NULL)
 	{
 		// tree already exists. only increase ref count
 		xnProductionNodeAddRef(pTree->hNode);
+		*phNode = pTree->hNode;
 		return (XN_STATUS_OK);
 	}
 
@@ -1396,44 +1777,69 @@ static XnStatus xnCreateProductionTreeImpl(XnContext* pContext, XnNodeInfo* pTre
 		it = xnNodeInfoListGetNext(it))
 	{
 		XnNodeInfo* pChild = xnNodeInfoListGetCurrent(it);
-		nRetVal = xnCreateProductionTreeImpl(pContext, pChild);
+		XnNodeHandle hNeeded;
+		nRetVal = xnCreateProductionTreeImpl(pContext, pChild, &hNeeded);
 		if (nRetVal != XN_STATUS_OK)
 		{
-			// TODO: free created objects so far if failed.
-			return nRetVal;
+			break;
+		}
+		else
+		{
+			// store created node
+			nRetVal = createdNodes.AddLast(hNeeded);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnProductionNodeRelease(hNeeded);
+				break;
+			}
 		}
 	}
 
 	// now create root
-	nRetVal = xnCreateProductionNodeImpl(pContext, pTree);
-	XN_IS_STATUS_OK(nRetVal);
+	if (nRetVal == XN_STATUS_OK)
+	{
+		nRetVal = xnCreateProductionNodeImpl(pContext, pTree, phNode);
+	}
 
-	return (XN_STATUS_OK);
+	// If something went wrong, release all created objects
+	if (nRetVal != XN_STATUS_OK)
+	{
+		for (XnUInt32 i = 0; i < createdNodes.GetSize(); ++i)
+		{
+			xnProductionNodeRelease(createdNodes[i]);
+		}
+	}
+
+	return (nRetVal);
 }
 
 static XnStatus xnFreeProductionNodeImpl(XnNodeHandle hNode, XnStatus nRetVal /*= XN_STATUS_OK*/)
 {
 	if (hNode != NULL)	
 	{
-		XN_DELETE(hNode->pPrivateData);
+        if (hNode->pPrivateData != NULL)
+        {
+		    XN_DELETE(hNode->pPrivateData);
+            hNode->pPrivateData = NULL;
+        }
 
-		if (hNode->typeHierarchy.IsSet(XN_NODE_TYPE_DEPTH))
+		if (hNode->pTypeHierarchy->IsSet(XN_NODE_TYPE_DEPTH))
 		{
 			xnFreeDepthMetaData(hNode->pMetaData.Depth);
 		}
-		else if (hNode->typeHierarchy.IsSet(XN_NODE_TYPE_IMAGE))
+		else if (hNode->pTypeHierarchy->IsSet(XN_NODE_TYPE_IMAGE))
 		{
 			xnFreeImageMetaData(hNode->pMetaData.Image);
 		}
-		else if (hNode->typeHierarchy.IsSet(XN_NODE_TYPE_IR))
+		else if (hNode->pTypeHierarchy->IsSet(XN_NODE_TYPE_IR))
 		{
 			xnFreeIRMetaData(hNode->pMetaData.IR);
 		}
-		else if (hNode->typeHierarchy.IsSet(XN_NODE_TYPE_AUDIO))
+		else if (hNode->pTypeHierarchy->IsSet(XN_NODE_TYPE_AUDIO))
 		{
 			xnFreeAudioMetaData(hNode->pMetaData.Audio);
 		}
-		else if (hNode->typeHierarchy.IsSet(XN_NODE_TYPE_SCENE))
+		else if (hNode->pTypeHierarchy->IsSet(XN_NODE_TYPE_SCENE))
 		{
 			xnFreeSceneMetaData(hNode->pMetaData.Scene);
 		}
@@ -1444,10 +1850,26 @@ static XnStatus xnFreeProductionNodeImpl(XnNodeHandle hNode, XnStatus nRetVal /*
 			xnOSFree(it.Key());
 		}
 		XN_DELETE(hNode->pRegistrationCookiesHash);
-
 		XN_DELETE(hNode->pNeededNodesDataHash);
+
+		if (hNode->hLock != NULL)
+		{
+			xnOSCloseCriticalSection(&hNode->hLock);
+		}
+
 		xnFPSFree(&hNode->genFPS);
 		xnFPSFree(&hNode->readFPS);
+
+		if (hNode->pContext != NULL)
+		{
+			xnContextRelease(hNode->pContext);
+		}
+
+		if (hNode->pTypeHierarchy != NULL)
+		{
+			XN_DELETE(hNode->pTypeHierarchy);
+		}
+
 		xnOSFree(hNode);
 	}
 	return nRetVal;
@@ -1455,7 +1877,7 @@ static XnStatus xnFreeProductionNodeImpl(XnNodeHandle hNode, XnStatus nRetVal /*
 
 void xnDestroyProductionNodeImpl(XnNodeHandle hNode)
 {
-	xnLogInfo(XN_MASK_OPEN_NI, "Destroying node '%s'", hNode->pNodeInfo->strInstanceName);
+	xnLoggerInfo(g_logger, "Destroying node '%s'", hNode->pNodeInfo->strInstanceName);
 
 	if (hNode->pPrivateData != NULL)
 	{
@@ -1501,6 +1923,8 @@ void xnDestroyProductionNodeImpl(XnNodeHandle hNode)
 	// NULL handle in info object
 	hNode->pNodeInfo->hNode = NULL;
 
+	xnDumpRefCount(hNode->pContext, hNode, 0, "Destroy");
+
 	// dec ref of info object (it was removed from context)
 	xnNodeInfoFree(hNode->pNodeInfo);
 
@@ -1511,7 +1935,15 @@ void xnDestroyProductionNodeImpl(XnNodeHandle hNode)
 XN_C_API XnStatus xnProductionNodeAddRef(XnNodeHandle hNode)
 {
 	XN_VALIDATE_INPUT_PTR(hNode);
+
+	// preform this in a lock
+	XnAutoCSLocker lock(hNode->hLock);
+
+	// now increase the ref count of the node itself
 	++hNode->nRefCount;
+
+	xnDumpRefCount(hNode->pContext, hNode, hNode->nRefCount, NULL);
+
 	return (XN_STATUS_OK);
 }
 
@@ -1522,8 +1954,28 @@ XN_C_API XnStatus xnRefProductionNode(XnNodeHandle hNode)
 
 XN_C_API void xnProductionNodeRelease(XnNodeHandle hNode)
 {
-	if ((hNode != NULL) && (hNode->nRefCount > 0) && (--hNode->nRefCount == 0))
+	XN_ASSERT(hNode != NULL);
+
+	// preform this in a lock
+	XnAutoCSLocker lock(hNode->hLock);
+
+	// perform some checks
+	XN_ASSERT(hNode->nRefCount > 0);
+	if (hNode == NULL || hNode->nRefCount == 0)
+		return;
+
+	// and dec ref
+	--hNode->nRefCount;
+
+	xnDumpRefCount(hNode->pContext, hNode, hNode->nRefCount, NULL);
+
+	// release it if needed
+	if (hNode->nRefCount == 0)
 	{
+		// release lock (the destruction destroys the lock as well)
+		lock.Unlock();
+
+		// destroy it
 		XnNodeInfo* pInfo = hNode->pNodeInfo;
 		XnUInt32 nInfoRefCount = pInfo->nRefCount;
 		xnDestroyProductionNodeImpl(hNode);
@@ -1551,10 +2003,8 @@ XN_C_API XnStatus xnCreateProductionTree(XnContext* pContext, XnNodeInfo* pTree,
 	XN_VALIDATE_OUTPUT_PTR(phNode);
 
 	// create missing instances
-	nRetVal = xnCreateProductionTreeImpl(pContext, pTree);
+	nRetVal = xnCreateProductionTreeImpl(pContext, pTree, phNode);
 	XN_IS_STATUS_OK(nRetVal);
-
-	*phNode = pTree->hNode;
 	
 	return (XN_STATUS_OK);
 }
@@ -1683,7 +2133,7 @@ XN_C_API XnStatus xnCreateMockNodeBasedOn(XnContext* pContext,
 		xnProductionNodeRelease(hMockNode);
 		return nRetVal;
 	}
-	
+
 	*phMockNode = hMockNode;
 
 	return XN_STATUS_OK;
@@ -1725,8 +2175,22 @@ XN_C_API XnBool xnIsTypeDerivedFrom(XnProductionNodeType type, XnProductionNodeT
 
 XN_C_API XnContext* xnGetContextFromNodeHandle(XnNodeHandle hNode)
 {
+	XnContext* pContext = xnGetRefContextFromNodeHandle(hNode);
+	xnContextRelease(pContext);
+	return pContext;
+}
+
+XN_C_API XnContext* xnGetRefContextFromNodeHandle(XnNodeHandle hNode)
+{
 	XN_ASSERT(hNode != NULL);
 	XN_VALIDATE_PTR(hNode, NULL);
+
+	XnStatus nRetVal = xnContextAddRef(hNode->pContext);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		XN_ASSERT(FALSE);
+	}
+
 	return hNode->pContext;
 }
 
@@ -1832,23 +2296,23 @@ void xnUpdateMetaData(XnNodeHandle hNode)
 	XN_ASSERT(hNode != NULL);
 	XN_ASSERT(hNode->pNodeInfo != NULL);
 
-	if (hNode->typeHierarchy.IsSet(XN_NODE_TYPE_DEPTH))
+	if (hNode->pTypeHierarchy->IsSet(XN_NODE_TYPE_DEPTH))
 	{
 		xnUpdateDepthMetaData(hNode);
 	}
-	else if (hNode->typeHierarchy.IsSet(XN_NODE_TYPE_IMAGE))
+	else if (hNode->pTypeHierarchy->IsSet(XN_NODE_TYPE_IMAGE))
 	{
 		xnUpdateImageMetaData(hNode);
 	}
-	else if (hNode->typeHierarchy.IsSet(XN_NODE_TYPE_IR))
+	else if (hNode->pTypeHierarchy->IsSet(XN_NODE_TYPE_IR))
 	{
 		xnUpdateIRMetaData(hNode);
 	}
-	else if (hNode->typeHierarchy.IsSet(XN_NODE_TYPE_AUDIO))
+	else if (hNode->pTypeHierarchy->IsSet(XN_NODE_TYPE_AUDIO))
 	{
 		xnUpdateAudioMetaData(hNode);
 	}
-	else if (hNode->typeHierarchy.IsSet(XN_NODE_TYPE_SCENE))
+	else if (hNode->pTypeHierarchy->IsSet(XN_NODE_TYPE_SCENE))
 	{
 		xnUpdateSceneMetaData(hNode);
 	}
@@ -1904,6 +2368,25 @@ static XnStatus xnUpdateTreeImpl(XnProductionNodesSet* pUpdatedSet, const XnNode
 	return (XN_STATUS_OK);
 }
 
+static XnStatus xnUpdateAll(XnContext* pContext)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	xnResetNewDataFlag(pContext);
+
+	XnProductionNodesSet UpdatedSet;
+
+	// update all the nodes (without waiting)
+	for (XnNodesMap::Iterator it = pContext->pNodesMap->begin(); it != pContext->pNodesMap->end(); ++it)
+	{
+		XnNodeInfo* pNodeInfo = it.Value()->pNodeInfo;
+		nRetVal = xnUpdateTreeImpl(&UpdatedSet, pNodeInfo);
+		XN_IS_STATUS_OK(nRetVal);
+	}
+
+	return (XN_STATUS_OK);
+}
+
 XnBool xnDidNodeAdvanced(XnNodeHandle hNode)
 {
 	XnUInt64 nTimestamp;
@@ -1923,6 +2406,10 @@ XnBool xnDidNodeAdvanced(XnNodeHandle hNode)
 		}
 
 		// check for frame sync 
+		XnUInt64 nNow;
+		xnOSGetHighResTimeStamp(&nNow);
+		xnDumpFileWriteString(hNode->pContext->pDumpDataFlow, "%llu,FrameSyncCheck,%s,%llu\n", nNow, hNode->pNodeInfo->strInstanceName, nTimestamp);
+		xnDumpFileWriteString(hNode->pContext->pDumpDataFlow, "%llu,FrameSyncCheck,%s,%llu\n", nNow, hNode->hFrameSyncedWith->pNodeInfo->strInstanceName, nOtherTimestamp);
 		XnUInt64 nDiff = (nTimestamp >= nOtherTimestamp) ? (nTimestamp - nOtherTimestamp) : (nOtherTimestamp - nTimestamp);
 		return (nDiff <= XN_FRAME_SYNC_THRESHOLD);
 	}
@@ -1949,6 +2436,45 @@ XnBool XN_CALLBACK_TYPE xnDidAllNodesAdvanced(void* pConditionData)
 	return (TRUE);
 }
 
+static XnStatus xnPlayRecording(XnContext* pContext, XnBool bAsynch = FALSE)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// check if we have players in this context
+	// TODO: handle the case in which we have more than one player
+	XnNodeHandle hPlayer = NULL;
+	nRetVal = xnFindExistingRefNodeByType(pContext, XN_NODE_TYPE_PLAYER, &hPlayer);
+	if (nRetVal == XN_STATUS_NO_MATCH)
+	{
+		return (XN_STATUS_OK);
+	}
+	else
+	{
+		XN_IS_STATUS_OK(nRetVal)
+	}
+
+	if (xnIsPlayerAtEOF(hPlayer))
+	{
+		return XN_STATUS_EOF;
+	}
+	else
+	{
+		if (bAsynch)
+		{
+			xn::PlayerImpl *pPlayerImpl = dynamic_cast<xn::PlayerImpl*>(hPlayer->pPrivateData);
+			XN_VALIDATE_PTR(pPlayerImpl, XN_STATUS_ERROR);
+			pPlayerImpl->TriggerPlayback();
+		}
+		else
+		{
+			nRetVal = xnPlayerReadNext(hPlayer);
+			XN_IS_STATUS_OK(nRetVal);
+		}
+	}
+
+	return (XN_STATUS_OK);
+}
+
 XnStatus xnWaitForCondition(XnContext* pContext, XnConditionFunc pConditionFunc, void* pConditionData)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
@@ -2008,12 +2534,16 @@ XN_C_API XnStatus xnWaitAndUpdateAll(XnContext* pContext)
 	
 	XN_VALIDATE_INPUT_PTR(pContext);
 
+	XnUInt64 nNow;
+	xnOSGetHighResTimeStamp(&nNow);
+	xnDumpFileWriteString(pContext->pDumpDataFlow, "%llu,WaitAndUpdateAll,Application,%s,\n", nNow);
+
 	// wait on new data event
 	nRetVal = xnWaitForCondition(pContext, xnDidAllNodesAdvanced, pContext);
 	XN_IS_STATUS_OK(nRetVal);
 
 	// now update entire tree
-	nRetVal = xnWaitNoneUpdateAll(pContext);
+	nRetVal = xnUpdateAll(pContext);
 	XN_IS_STATUS_OK(nRetVal);
 	
 	return (XN_STATUS_OK);
@@ -2031,12 +2561,16 @@ XN_C_API XnStatus xnWaitOneUpdateAll(XnContext* pContext, XnNodeHandle hNode)
 	XN_VALIDATE_INPUT_PTR(pContext);
 	XN_VALIDATE_INPUT_PTR(hNode);
 
+	XnUInt64 nNow;
+	xnOSGetHighResTimeStamp(&nNow);
+	xnDumpFileWriteString(hNode->pContext->pDumpDataFlow, "%llu,WaitOneUpdateAll,Application,%s,\n", nNow, hNode->pNodeInfo->strInstanceName);
+
 	// wait on new data event
 	nRetVal = xnWaitForCondition(pContext, xnDidNodeAdvanced, hNode);
 	XN_IS_STATUS_OK(nRetVal);
 
 	// now update entire tree
-	nRetVal = xnWaitNoneUpdateAll(pContext);
+	nRetVal = xnUpdateAll(pContext);
 	XN_IS_STATUS_OK(nRetVal);
 
 	return (XN_STATUS_OK);
@@ -2048,17 +2582,15 @@ XN_C_API XnStatus xnWaitNoneUpdateAll(XnContext* pContext)
 
 	XN_VALIDATE_INPUT_PTR(pContext);
 
-	xnResetNewDataFlag(pContext);
+	XnUInt64 nNow;
+	xnOSGetHighResTimeStamp(&nNow);
+	xnDumpFileWriteString(pContext->pDumpDataFlow, "%llu,WaitNoneUpdateAll,Application,\n", nNow);
 
-	XnProductionNodesSet UpdatedSet;
+	nRetVal = xnPlayRecording(pContext, TRUE);
+	XN_IS_STATUS_OK(nRetVal);
 
-	// update all the nodes (without waiting)
-	for (XnNodesMap::Iterator it = pContext->pNodesMap->begin(); it != pContext->pNodesMap->end(); ++it)
-	{
-		XnNodeInfo* pNodeInfo = it.Value()->pNodeInfo;
-		nRetVal = xnUpdateTreeImpl(&UpdatedSet, pNodeInfo);
-		XN_IS_STATUS_OK(nRetVal);
-	}
+	nRetVal = xnUpdateAll(pContext);
+	XN_IS_STATUS_OK(nRetVal);
 
 	return (XN_STATUS_OK);
 }
@@ -2084,13 +2616,17 @@ XN_C_API XnStatus xnWaitAnyUpdateAll(XnContext* pContext)
 	XnStatus nRetVal = XN_STATUS_OK;
 
 	XN_VALIDATE_INPUT_PTR(pContext);
+
+	XnUInt64 nNow;
+	xnOSGetHighResTimeStamp(&nNow);
+	xnDumpFileWriteString(pContext->pDumpDataFlow, "%llu,WaitAnyUpdateAll,Application,\n", nNow);
 	
 	// wait on new data event
 	nRetVal = xnWaitForCondition(pContext, xnDidAnyNodeAdvanced, pContext);
 	XN_IS_STATUS_OK(nRetVal);
 
 	// we have new data, now just update all
-	nRetVal = xnWaitNoneUpdateAll(pContext);
+	nRetVal = xnUpdateAll(pContext);
 	XN_IS_STATUS_OK(nRetVal);
 	
 	return (XN_STATUS_OK);
@@ -2102,6 +2638,10 @@ XN_C_API XnStatus xnWaitAndUpdateData(XnNodeHandle hInstance)
 
 	XN_VALIDATE_INPUT_PTR(hInstance);
 
+	XnUInt64 nNow;
+	xnOSGetHighResTimeStamp(&nNow);
+	xnDumpFileWriteString(hInstance->pContext->pDumpDataFlow, "%llu,WaitAndUpdateData,Application,\n", nNow);
+
 	// wait on new data event
 	nRetVal = xnWaitForCondition(hInstance->pContext, xnDidNodeAdvanced, hInstance);
 	XN_IS_STATUS_OK(nRetVal);
@@ -2235,19 +2775,38 @@ XN_C_API XnStatus xnGetNodeHandleByName(XnContext* pContext, const XnChar* strIn
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
+	nRetVal = xnGetRefNodeHandleByName(pContext, strInstanceName, phNode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// backwards compatibility
+	xnProductionNodeRelease(*phNode);
+	
+	return (XN_STATUS_OK);
+}
+
+XN_C_API XnStatus xnGetRefNodeHandleByName(XnContext* pContext, const XnChar* strInstanceName, XnNodeHandle* phNode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
 	XN_VALIDATE_INPUT_PTR(pContext);
 	XN_VALIDATE_INPUT_PTR(strInstanceName);
 	XN_VALIDATE_OUTPUT_PTR(phNode);
 
 	*phNode = NULL;
 
-	nRetVal = pContext->pNodesMap->Get(strInstanceName, *phNode);
+	XnNodeHandle hNode;
+	nRetVal = pContext->pNodesMap->Get(strInstanceName, hNode);
 	if (nRetVal == XN_STATUS_NO_MATCH)
 	{
 		return XN_STATUS_BAD_NODE_NAME;
 	}
 	XN_IS_STATUS_OK(nRetVal);
-	
+
+	nRetVal = xnProductionNodeAddRef(hNode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	*phNode = hNode;
+
 	return (XN_STATUS_OK);
 }
 
@@ -2299,7 +2858,7 @@ XN_C_API XnStatus xnEnumerateExistingNodesByType(XnContext* pContext, XnProducti
 	return xnEnumerateExistingNodesImpl(pContext, ppList, &type);
 }
 
-XN_C_API XnStatus xnFindExistingNodeByType(XnContext* pContext, XnProductionNodeType type, XnNodeHandle* phNode)
+XN_C_API XnStatus xnFindExistingRefNodeByType(XnContext* pContext, XnProductionNodeType type, XnNodeHandle* phNode)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 
@@ -2321,12 +2880,24 @@ XN_C_API XnStatus xnFindExistingNodeByType(XnContext* pContext, XnProductionNode
 	}
 
 	XnNodeInfo* pNodeInfo = xnNodeInfoListGetCurrent(it);
-	*phNode = xnNodeInfoGetHandle(pNodeInfo);
+	*phNode = xnNodeInfoGetRefHandle(pNodeInfo);
 	xnNodeInfoListFree(pList);
 
 	return (XN_STATUS_OK);
 }
 
+XN_C_API XnStatus xnFindExistingNodeByType(XnContext* pContext, XnProductionNodeType type, XnNodeHandle* phNode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	nRetVal = xnFindExistingRefNodeByType(pContext, type, phNode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	xnProductionNodeRelease(*phNode);
+	
+	return (XN_STATUS_OK);
+}
+
 //---------------------------------------------------------------------------
 // State Changes registration translation
 //---------------------------------------------------------------------------
@@ -2742,12 +3313,6 @@ XN_C_API XnStatus xnAddNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNo
 		return XN_STATUS_INVALID_OPERATION;
 	}
 
-	// check if its already needed
-	if (isNodeNeededBy(hInstance->pNodeInfo, hNeededNode->pNodeInfo))
-	{
-		return XN_STATUS_OK;
-	}
-
 	// make sure this does not create a loop dependency
 	if (isNodeNeededBy(hNeededNode->pNodeInfo, hInstance->pNodeInfo))
 	{
@@ -2850,6 +3415,7 @@ XN_C_API XnStatus xnGetSerialNumber(XnNodeHandle hInstance, XnChar* strBuffer, X
 
 static XnStatus xnStartGeneratingImpl(XnNodeHandle hInstance)
 {
+	XN_VALIDATE_CHANGES_ALLOWED(hInstance);
 	XnGeneratorInterfaceContainer* pInterface = (XnGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
 	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
 	return pInterface->Generator.StartGenerating(hModuleNode);
@@ -2858,7 +3424,6 @@ static XnStatus xnStartGeneratingImpl(XnNodeHandle hInstance)
 XN_C_API XnStatus xnStartGenerating(XnNodeHandle hInstance)
 {
 	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_GENERATOR);
-	XN_VALIDATE_CHANGES_ALLOWED(hInstance);
 	return xnStartGeneratingTreeImpl(hInstance->pNodeInfo);
 }
 
@@ -2948,6 +3513,10 @@ static XnStatus xnUpdateDataImpl(XnNodeHandle hInstance)
 	xnMarkFPSFrame(hInstance->pContext, &hInstance->readFPS);
 	xnUpdateMetaData(hInstance);
 
+	XnUInt64 nNow;
+	xnOSGetHighResTimeStamp(&nNow);
+	xnDumpFileWriteString(hInstance->pContext->pDumpDataFlow, "%llu,Update,%s,%llu\n", nNow, hInstance->pNodeInfo->strInstanceName, xnGetTimestamp(hInstance));
+
 	return XN_STATUS_OK;
 }
 
@@ -3026,7 +3595,7 @@ XN_C_API XnStatus xnCreateRecorder(XnContext* pContext, const XnChar* strFormatN
 			nRetVal = xnCreateProductionTree(pContext, pInfo, &hRecorder);
 			if (nRetVal != XN_STATUS_OK)
 			{
-				xnLogWarning(XN_MASK_OPEN_NI, "Failed to create recorder %s of vendor %s to check for its type: %s", pInfo->Description.strName, pInfo->Description.strVendor, xnGetStatusString(nRetVal));
+				xnLoggerWarning(g_logger, "Failed to create recorder %s of vendor %s to check for its type: %s", pInfo->Description.strName, pInfo->Description.strVendor, xnGetStatusString(nRetVal));
 				continue;
 			}
 
@@ -3069,6 +3638,21 @@ XN_C_API XnStatus xnSetRecorderDestination(XnNodeHandle hRecorder, XnRecordMediu
 	return XN_STATUS_OK;	
 }
 
+XN_C_API XnStatus XN_C_DECL xnGetRecorderDestination(XnNodeHandle hRecorder, XnRecordMedium* pDestType, XnChar* strDest, XnUInt32 nBufSize)
+{
+	XN_VALIDATE_INPUT_PTR(hRecorder);
+	XN_VALIDATE_INTERFACE_TYPE(hRecorder, XN_NODE_TYPE_RECORDER);
+	XN_VALIDATE_CHANGES_ALLOWED(hRecorder);
+	XN_VALIDATE_OUTPUT_PTR(pDestType);
+	XN_VALIDATE_OUTPUT_PTR(strDest);
+	//Get recorder object
+	xn::RecorderImpl *pRecorderImpl = dynamic_cast<xn::RecorderImpl*>(hRecorder->pPrivateData);
+	XN_VALIDATE_PTR(pRecorderImpl, XN_STATUS_ERROR);
+	XnStatus nRetVal = pRecorderImpl->GetDestination(*pDestType, strDest, nBufSize);
+	XN_IS_STATUS_OK(nRetVal);
+	return XN_STATUS_OK;	
+}
+
 XN_C_API XnStatus xnAddNodeToRecording(XnNodeHandle hRecorder, XnNodeHandle hNode, XnCodecID compression)
 {
 	XN_VALIDATE_INPUT_PTR(hRecorder);
@@ -3142,7 +3726,7 @@ XN_C_API XnStatus xnRecord(XnNodeHandle hInstance)
 	return XN_STATUS_OK;
 }
 
-XN_C_API const XnChar* xnGetRecorderFormat(XnNodeHandle hInstance)
+XN_C_API const XnChar* xnGetRecorderFormat(XnNodeHandle /*hInstance*/)
 {
 	//TODO: Call module's function
 	return "oni";
@@ -3175,7 +3759,7 @@ XN_C_API XnStatus xnCreatePlayer(XnContext* pContext, const XnChar* strFormatNam
 			nRetVal = xnCreateProductionTree(pContext, pInfo, &hPlayer);
 			if (nRetVal != XN_STATUS_OK)
 			{
-				xnLogWarning(XN_MASK_OPEN_NI, "Failed to create player %s of vendor %s to check for its type: %s", pInfo->Description.strName, pInfo->Description.strVendor, xnGetStatusString(nRetVal));
+				xnLoggerWarning(g_logger, "Failed to create player %s of vendor %s to check for its type: %s", pInfo->Description.strName, pInfo->Description.strVendor, xnGetStatusString(nRetVal));
 				continue;
 			}
 
@@ -3233,9 +3817,12 @@ XN_C_API XnStatus xnPlayerReadNext(XnNodeHandle hPlayer)
 {
 	XN_VALIDATE_INPUT_PTR(hPlayer);
 	XN_VALIDATE_INTERFACE_TYPE(hPlayer, XN_NODE_TYPE_PLAYER);
-	XnPlayerInterfaceContainer* pInterface = (XnPlayerInterfaceContainer*)hPlayer->pModuleInstance->pLoaded->pInterface;
-	XnModuleNodeHandle hModuleNode = hPlayer->pModuleInstance->hNode;
-	return pInterface->Player.ReadNext(hModuleNode);
+
+	xn::PlayerImpl *pPlayerImpl = dynamic_cast<xn::PlayerImpl*>(hPlayer->pPrivateData);
+	XN_VALIDATE_PTR(pPlayerImpl, XN_STATUS_ERROR);
+	XnStatus nRetVal = pPlayerImpl->ReadNext();
+	XN_IS_STATUS_OK(nRetVal);
+	return XN_STATUS_OK;	
 }
 
 XN_C_API XnStatus xnGetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium* pSourceType, XnChar* strSource, XnUInt32 nBufSize)
@@ -3263,21 +3850,7 @@ XN_C_API XnStatus xnSeekPlayerToTimeStamp(XnNodeHandle hPlayer,
 	//Get player impl object
 	xn::PlayerImpl *pPlayerImpl = dynamic_cast<xn::PlayerImpl*>(hPlayer->pPrivateData);
 	XN_VALIDATE_PTR(pPlayerImpl, XN_STATUS_ERROR);
-	XnPlayerInterfaceContainer* pInterface = (XnPlayerInterfaceContainer*)hPlayer->pModuleInstance->pLoaded->pInterface;
-	XnModuleNodeHandle hModuleNode = hPlayer->pModuleInstance->hNode;
-
-	// disable playback speed - so seeking would be immediate
-	XnDouble dPlaybackSpeed = pPlayerImpl->GetPlaybackSpeed();
-	pPlayerImpl->SetPlaybackSpeed(XN_PLAYBACK_SPEED_FASTEST);
-
-	// seek
-	XnStatus nRetVal = pInterface->Player.SeekToTimeStamp(hModuleNode, nTimeOffset, origin);
-
-	// restore playback speed
-	pPlayerImpl->SetPlaybackSpeed(dPlaybackSpeed);
-	pPlayerImpl->ResetTimeReference();
-
-	return (nRetVal);
+	return pPlayerImpl->SeekToTimestamp(nTimeOffset, origin);
 }
 
 XN_C_API XnStatus xnSeekPlayerToFrame(XnNodeHandle hPlayer, 
@@ -3291,21 +3864,7 @@ XN_C_API XnStatus xnSeekPlayerToFrame(XnNodeHandle hPlayer,
 	//Get player impl object
 	xn::PlayerImpl *pPlayerImpl = dynamic_cast<xn::PlayerImpl*>(hPlayer->pPrivateData);
 	XN_VALIDATE_PTR(pPlayerImpl, XN_STATUS_ERROR);
-	XnPlayerInterfaceContainer* pInterface = (XnPlayerInterfaceContainer*)hPlayer->pModuleInstance->pLoaded->pInterface;
-	XnModuleNodeHandle hModuleNode = hPlayer->pModuleInstance->hNode;
-
-	// disable playback speed - so seeking would be immediate
-	XnDouble dPlaybackSpeed = pPlayerImpl->GetPlaybackSpeed();
-	pPlayerImpl->SetPlaybackSpeed(XN_PLAYBACK_SPEED_FASTEST);
-
-	// seek
-	XnStatus nRetVal = pInterface->Player.SeekToFrame(hModuleNode, strNodeName, nFrameOffset, origin);
-
-	// restore playback speed
-	pPlayerImpl->SetPlaybackSpeed(dPlaybackSpeed);
-	pPlayerImpl->ResetTimeReference();
-
-	return (nRetVal);
+	return pPlayerImpl->SeekToFrame(strNodeName, nFrameOffset, origin);
 }
 
 XN_C_API XnStatus xnTellPlayerTimestamp(XnNodeHandle hPlayer, XnUInt64* pnTimestamp)
@@ -3537,7 +4096,7 @@ XN_C_API XnStatus xnFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther)
 	// TODO: support more than one node. Right now, every node can only be synched to one other node.
 	if (hInstance->hFrameSyncedWith != NULL || hOther->hFrameSyncedWith != NULL)
 	{
-		XN_LOG_WARNING_RETURN(XN_STATUS_NOT_IMPLEMENTED, XN_MASK_OPEN_NI, "Currently, a node can be frame synched to one node only.");
+		XN_RETURN_WITH_WARNING_LOG(g_logger, XN_STATUS_NOT_IMPLEMENTED, "Currently, a node can be frame synched to one node only.");
 	}
 
 	XnGeneratorInterfaceContainer* pInterface = (XnGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
@@ -3814,33 +4373,242 @@ void xn::DepthPrivateData::OnFieldOfViewChanged()
 	m_fRealWorldYtoZ = tan(FOV.fVFOV/2)*2;
 }
 
-void XN_CALLBACK_TYPE xn::DepthPrivateData::FieldOfViewChangedCallback(XnNodeHandle hNode, void* pCookie)
+void XN_CALLBACK_TYPE xn::DepthPrivateData::FieldOfViewChangedCallback(XnNodeHandle /*hNode*/, void* pCookie)
 {
 	xn::DepthPrivateData* pThis = (xn::DepthPrivateData*)pCookie;
 	pThis->OnFieldOfViewChanged();
 }
 
-XN_C_API XnStatus xnCreateDepthGenerator(
-	XnContext* pContext,
-	XnNodeHandle* phDepthGenerator,
-	XnNodeQuery* pQuery, 
-	XnEnumerationErrors* pErrors
-	)
+
+
+xn::PosePrivateData::PosePrivateData()
 {
-	return xnCreateAnyProductionTree(pContext, XN_NODE_TYPE_DEPTH, pQuery, phDepthGenerator, pErrors);
+    m_usersPoseDataPerPose = NULL;
+    m_numPoses = 0;
+
+    m_userCallbacksHandle = NULL;
+    m_poseDetectHandle = NULL;
+    m_outOfPoseHandle = NULL;
+    m_inProgressHandle = NULL;
+    m_hUserGenerator = NULL;
 }
 
-XN_C_API XnDepthPixel xnGetDeviceMaxDepth(XnNodeHandle hInstance)
+xn::PosePrivateData::~PosePrivateData()
 {
-	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_DEPTH, -1);
-	XnDepthGeneratorInterfaceContainer* pInterface = (XnDepthGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
-	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
-	return pInterface->Depth.GetDeviceMaxDepth(hModuleNode);
+    XN_ASSERT(m_userCallbacksHandle == NULL);
+    XN_ASSERT(m_poseDetectHandle == NULL);
+    XN_ASSERT(m_outOfPoseHandle == NULL);
+    XN_ASSERT(m_inProgressHandle == NULL);
+    XN_ASSERT(m_usersPoseDataPerPose == NULL);
+    XN_ASSERT(m_hUserGenerator == NULL);
 }
 
-XN_C_API XnStatus xnGetDepthFieldOfView(XnNodeHandle hInstance, XnFieldOfView* pFOV)
+void xn::PosePrivateData::BeforeNodeDestroy()
 {
-	XN_VALIDATE_INPUT_PTR(hInstance);
+    if (m_usersPoseDataPerPose != NULL)
+    {
+        XN_DELETE_ARR(m_usersPoseDataPerPose);
+        m_usersPoseDataPerPose = NULL;
+    }
+    m_numPoses = 0;
+    if (m_userCallbacksHandle != NULL)
+    {
+        xnUnregisterUserCallbacks(m_hUserGenerator, m_userCallbacksHandle);
+        m_userCallbacksHandle = NULL;
+    }
+    if (m_poseDetectHandle != NULL)
+    {
+        xnUnregisterFromPoseDetected(m_hUserGenerator, m_poseDetectHandle);
+        m_poseDetectHandle=NULL;
+    }
+    if (m_outOfPoseHandle != NULL)
+    {
+        xnUnregisterFromOutOfPose(m_hUserGenerator, m_outOfPoseHandle);
+        m_outOfPoseHandle=NULL;
+    }
+    if (m_inProgressHandle != NULL)
+    {
+        xnUnregisterFromPoseDetectionInProgress(m_hUserGenerator, m_inProgressHandle);
+        m_inProgressHandle = NULL;
+    }
+    m_hUserGenerator = NULL;
+}
+
+XnStatus xn::PosePrivateData::Init(XnNodeHandle hUserGenerator)
+{
+    m_hUserGenerator = hUserGenerator;
+    XnStatus nRetVal = xnRegisterUserCallbacks(m_hUserGenerator, XnNewUserCallback, XnLostUserCallback, this, &m_userCallbacksHandle);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnRegisterToPoseDetected(m_hUserGenerator, XnPoseDetectedCallback, this, &m_poseDetectHandle);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnRegisterToOutOfPose(m_hUserGenerator, XnOutOfPoseDetectedCallback, this, &m_outOfPoseHandle);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnRegisterToPoseDetectionInProgress(hUserGenerator, XnPoseInProgressCallback, this, &m_inProgressHandle);
+	XN_IS_STATUS_OK(nRetVal);
+
+    m_numPoses = xnGetNumberOfPoses(hUserGenerator);
+    if (m_numPoses < 1)
+    {
+        return XN_STATUS_OK; // no poses so nothing much to do
+    }
+
+    XnChar** arr = XN_NEW_ARR(XnChar*, m_numPoses);
+    for (XnUInt32 i = 0; i < m_numPoses; i++)
+    {
+        arr[i] = XN_NEW_ARR(XnChar, XN_MAX_NAME_LENGTH);
+    }
+    XnUInt32 numTotal = m_numPoses;
+    nRetVal = xnGetAllAvailablePoses(m_hUserGenerator, arr, XN_MAX_NAME_LENGTH, &m_numPoses);
+    if(nRetVal == XN_STATUS_OK)
+    {
+        m_usersPoseDataPerPose = XN_NEW_ARR(UsersPoseData, m_numPoses);
+        for (XnUInt32 i = 0; i < m_numPoses; i++)
+        {
+            XnUInt32 len = (XnUInt32)strlen(arr[i])+1;
+            m_usersPoseDataPerPose[i].m_poseName = XN_NEW_ARR(XnChar, len);
+            xnOSStrCopy(m_usersPoseDataPerPose[i].m_poseName, arr[i], len);
+        }
+    }
+
+    for (XnUInt32 i = 0; i < numTotal; i++)
+    {
+        XN_DELETE_ARR(arr[i]);
+    }
+
+    XN_DELETE_ARR(arr);
+    return nRetVal;
+}
+XnStatus xn::PosePrivateData::GetPoseStatus(XnUserID userID, const XnChar* poseName, XnUInt64& poseTime, XnPoseDetectionStatus& eStatus, XnPoseDetectionState& eState)
+{
+    for (XnUInt32 i = 0; i < m_numPoses; i++)
+    {
+        if (xnOSStrCmp(poseName, m_usersPoseDataPerPose[i].m_poseName) == 0)
+        {
+            PoseData tmpData;
+            XnStatus nRetVal = m_usersPoseDataPerPose[i].m_usersHash.Get(userID, tmpData);
+			XN_IS_STATUS_OK(nRetVal);
+
+			if (tmpData.m_lastState != XN_POSE_DETECTION_STATE_IN_POSE)
+            {
+                poseTime = 0;
+            }
+            else
+            {
+                poseTime = tmpData.m_lastTimeInPose;
+            }
+            eStatus = tmpData.m_lastStatus;
+            eState = tmpData.m_lastState;
+            return XN_STATUS_OK;
+        }
+    }
+    return XN_STATUS_NO_MATCH;
+}
+
+void XN_CALLBACK_TYPE xn::PosePrivateData::XnNewUserCallback(XnNodeHandle /*hNode*/, XnUserID nUserId, void* pCookie)
+{
+    xn::PosePrivateData* dataPtr = (xn::PosePrivateData*)pCookie;
+    for (XnUInt32 i = 0; i < dataPtr->m_numPoses; i++)
+    {
+        PoseData tmpData;
+        dataPtr->m_usersPoseDataPerPose[i].m_usersHash.Set(nUserId, tmpData);
+    }
+}
+
+void XN_CALLBACK_TYPE xn::PosePrivateData::XnLostUserCallback(XnNodeHandle /*hNode*/, XnUserID nUserId, void* pCookie)
+{
+    xn::PosePrivateData* dataPtr = (xn::PosePrivateData*)pCookie;
+    for (XnUInt32 i = 0; i < dataPtr->m_numPoses; i++)
+    {
+        dataPtr->m_usersPoseDataPerPose[i].m_usersHash.Remove(nUserId);
+    }
+}
+
+void XN_CALLBACK_TYPE xn::PosePrivateData::XnPoseInProgressCallback(XnNodeHandle /*hNode*/, const XnChar* strPose, XnUserID nUserId, XnPoseDetectionStatus ePoseError, void* pCookie)
+{
+    xn::PosePrivateData* dataPtr = (xn::PosePrivateData*)pCookie;
+    for (XnUInt32 i = 0; i < dataPtr->m_numPoses; i++)
+    {
+        if (xnOSStrCmp(dataPtr->m_usersPoseDataPerPose[i].m_poseName, strPose) == 0)
+        {
+            PoseData tmpData;
+            if (dataPtr->m_usersPoseDataPerPose[i].m_usersHash.Get(nUserId, tmpData) != XN_STATUS_OK)
+            {
+                tmpData.Reset();
+            }
+            tmpData.m_lastStatus = ePoseError;
+            dataPtr->m_usersPoseDataPerPose[i].m_usersHash.Set(nUserId, tmpData);
+            break; // we already found the pose.
+        }
+    }
+}
+
+void XN_CALLBACK_TYPE xn::PosePrivateData::XnPoseDetectedCallback(XnNodeHandle /*hNode*/, const XnChar* strPose, XnUserID nUserId, void* pCookie)
+{
+    xn::PosePrivateData* dataPtr = (xn::PosePrivateData*)pCookie;
+    for (XnUInt32 i = 0; i < dataPtr->m_numPoses; i++)
+    {
+        if (xnOSStrCmp(dataPtr->m_usersPoseDataPerPose[i].m_poseName, strPose) == 0)
+        {
+            PoseData tmpData;
+            if (dataPtr->m_usersPoseDataPerPose[i].m_usersHash.Get(nUserId, tmpData) == XN_STATUS_OK)
+            {
+                if (tmpData.m_lastState == XN_POSE_DETECTION_STATE_IN_POSE)
+                {
+                    return; // we don't have anything to fix.
+                }
+            }
+            tmpData.m_lastState = XN_POSE_DETECTION_STATE_IN_POSE;
+            tmpData.m_lastStatus = XN_POSE_DETECTION_STATUS_OK;
+            tmpData.m_lastTimeInPose = xnGetTimestamp(dataPtr->m_hUserGenerator);
+            dataPtr->m_usersPoseDataPerPose[i].m_usersHash.Set(nUserId, tmpData);
+            break; // we already found the pose.
+        }
+    }
+}
+void XN_CALLBACK_TYPE xn::PosePrivateData::XnOutOfPoseDetectedCallback(XnNodeHandle /*hNode*/, const XnChar* strPose, XnUserID nUserId, void* pCookie)
+{
+    xn::PosePrivateData* dataPtr = (xn::PosePrivateData*)pCookie;
+    for (XnUInt32 i = 0; i < dataPtr->m_numPoses; i++)
+    {
+        if (xnOSStrCmp(dataPtr->m_usersPoseDataPerPose[i].m_poseName, strPose) == 0)
+        {
+            PoseData tmpData;
+            if (dataPtr->m_usersPoseDataPerPose[i].m_usersHash.Get(nUserId, tmpData) == XN_STATUS_OK)
+            {
+                tmpData.Reset();
+            }
+            tmpData.m_lastState = XN_POSE_DETECTION_STATE_OUT_OF_POSE;
+            tmpData.m_lastTimeInPose = 0;
+            dataPtr->m_usersPoseDataPerPose[i].m_usersHash.Set(nUserId, tmpData);
+            break; // we already found the pose.
+        }
+    }
+}
+
+XN_C_API XnStatus xnCreateDepthGenerator(
+	XnContext* pContext,
+	XnNodeHandle* phDepthGenerator,
+	XnNodeQuery* pQuery, 
+	XnEnumerationErrors* pErrors
+	)
+{
+	return xnCreateAnyProductionTree(pContext, XN_NODE_TYPE_DEPTH, pQuery, phDepthGenerator, pErrors);
+}
+
+XN_C_API XnDepthPixel xnGetDeviceMaxDepth(XnNodeHandle hInstance)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_DEPTH, (XnDepthPixel)-1);
+	XnDepthGeneratorInterfaceContainer* pInterface = (XnDepthGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+	return pInterface->Depth.GetDeviceMaxDepth(hModuleNode);
+}
+
+XN_C_API XnStatus xnGetDepthFieldOfView(XnNodeHandle hInstance, XnFieldOfView* pFOV)
+{
+	XN_VALIDATE_INPUT_PTR(hInstance);
 	XN_VALIDATE_OUTPUT_PTR(pFOV);
 	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_DEPTH);
 	XnDepthGeneratorInterfaceContainer* pInterface = (XnDepthGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
@@ -4178,6 +4946,54 @@ XN_C_API XnStatus xnEnumerateGestures(XnNodeHandle hInstance, XnChar** pstrGestu
 	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
 	return pInterface->Gesture.EnumerateGestures(hModuleNode, pstrGestures, pnGestures);
 }
+
+
+
+XN_C_API XnUInt16 xnGetNumberOfAvailableGestures(XnNodeHandle hInstance)
+{
+    XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_GESTURE,0);
+    XnGestureGeneratorInterfaceContainer* pInterface = (XnGestureGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+    XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+    XN_VALIDATE_FUNC_PTR_RET(pInterface->Gesture.EnumerateAllGestures,0);
+    XnUInt16 nGesturesAllocated = XN_BASE_NUMBER_OF_GESTURES;
+    XnUInt16 nGesturesFound = 0;
+    XnUInt16 nLastNumGesturesAllocated = 0;
+    XnChar** pstrArr = NULL;
+    XnChar** pstrNewarr = NULL;
+    while(nGesturesFound == nLastNumGesturesAllocated)
+    {
+        pstrNewarr = XN_NEW_ARR(XnChar *, nGesturesAllocated);
+        for(XnUInt32 i = 0; i < nLastNumGesturesAllocated; i++)
+        {
+            pstrNewarr[i] = pstrArr[i];
+        }
+        for(XnUInt32 i = nLastNumGesturesAllocated; i < nGesturesAllocated; i++)
+        {
+            pstrNewarr[i] = XN_NEW_ARR(XnChar, XN_MAX_NAME_LENGTH);
+        }
+        if(pstrArr != NULL)
+        {
+            XN_DELETE_ARR(pstrArr);
+        }
+        pstrArr = pstrNewarr;
+        nLastNumGesturesAllocated = nGesturesAllocated;
+        nGesturesFound = nGesturesAllocated;
+        if(pInterface->Gesture.EnumerateAllGestures(hModuleNode, pstrNewarr, XN_MAX_NAME_LENGTH, &nGesturesFound)!=XN_STATUS_OK)
+        {
+            nGesturesFound = 0;
+            break;
+        }
+        nGesturesAllocated*=2;
+    }
+    for(XnUInt32 i = 0; i < nLastNumGesturesAllocated; i++)
+    {
+        XN_DELETE_ARR(pstrNewarr[i]);
+    }
+    XN_DELETE_ARR(pstrNewarr);
+    return nGesturesFound;
+}
+
+
 XN_C_API XnStatus xnEnumerateAllGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* pnGestures)
 {
 	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_GESTURE);
@@ -4282,6 +5098,153 @@ XN_C_API void xnUnregisterFromGestureChange(XnNodeHandle hInstance, XnCallbackHa
 	xnUnregisterFromModuleStateChange(pInterface->Gesture.UnregisterFromGestureChange, hModuleNode, hCallback);
 }
 
+typedef struct GestureIntermediateStageCompletedCookie
+{
+	XnGestureIntermediateStageCompleted handler;
+	void* pUserCookie;
+	XnCallbackHandle hCallback;
+	XnNodeHandle hNode;
+} GestureIntermediateStageCompletedCookie;
+
+static void XN_CALLBACK_TYPE xnModuleGestureIntermediateStageCompleted(const XnChar* strGesture, const XnPoint3D* pIDPosition, void* pCookie)
+{
+	GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)pCookie;
+	if (pGestureCookie->handler != NULL)
+	{
+		pGestureCookie->handler(pGestureCookie->hNode, strGesture, pIDPosition, pGestureCookie->pUserCookie);
+	}
+}
+
+static void XN_CALLBACK_TYPE xnModuleGestureStateViaProgress(const XnChar* strGesture, const XnPoint3D* pPosition, XnFloat /*fProgress*/, void* pCookie)
+{
+	GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)pCookie;
+	if (pGestureCookie->handler != NULL)
+	{
+		pGestureCookie->handler(pGestureCookie->hNode, strGesture, pPosition, pGestureCookie->pUserCookie);
+	}
+}
+
+XN_C_API XnStatus xnRegisterToGestureIntermediateStageCompleted(XnNodeHandle hInstance, XnGestureIntermediateStageCompleted handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_GESTURE);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnGestureGeneratorInterfaceContainer* pInterface = (XnGestureGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	GestureIntermediateStageCompletedCookie* pRegCookie;
+	XN_VALIDATE_ALLOC(pRegCookie, GestureIntermediateStageCompletedCookie);
+	pRegCookie->handler = handler;
+	pRegCookie->hNode = hInstance;
+	pRegCookie->pUserCookie = pCookie;
+
+	XnStatus nRetVal = XN_STATUS_OK;
+	if (pInterface->Gesture.RegisterToGestureIntermediateStageCompleted != NULL)
+	{
+		nRetVal = pInterface->Gesture.RegisterToGestureIntermediateStageCompleted(hModuleNode, xnModuleGestureIntermediateStageCompleted, pRegCookie, &pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		nRetVal = pInterface->Gesture.RegisterGestureCallbacks(hModuleNode, NULL, xnModuleGestureStateViaProgress, pRegCookie, &pRegCookie->hCallback);
+	}
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pRegCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pRegCookie;
+
+	return XN_STATUS_OK;
+}
+XN_C_API void xnUnregisterFromGestureIntermediateStageCompleted(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_GESTURE, );
+	XnGestureGeneratorInterfaceContainer* pInterface = (XnGestureGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	GestureIntermediateStageCompletedCookie* pRegCookie = (GestureIntermediateStageCompletedCookie*)hCallback;
+	if (pInterface->Gesture.UnregisterFromGestureIntermediateStageCompleted != NULL)
+	{
+		pInterface->Gesture.UnregisterFromGestureIntermediateStageCompleted(hModuleNode, pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		pInterface->Gesture.UnregisterGestureCallbacks(hModuleNode, pRegCookie->hCallback);
+	}
+	xnOSFree(pRegCookie);
+}
+
+typedef struct GestureReadyForNextIntermediateStageCookie
+{
+	XnGestureReadyForNextIntermediateStage handler;
+	void* pUserCookie;
+	XnCallbackHandle hCallback;
+	XnNodeHandle hNode;
+} GestureReadyForNextIntermediateStageCookie;
+
+static void XN_CALLBACK_TYPE xnModuleGestureReadyForNextIntermediateStage(const XnChar* strGesture, const XnPoint3D* pIDPosition, void* pCookie)
+{
+	GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)pCookie;
+	if (pGestureCookie->handler != NULL)
+	{
+		pGestureCookie->handler(pGestureCookie->hNode, strGesture, pIDPosition, pGestureCookie->pUserCookie);
+	}
+}
+
+XN_C_API XnStatus xnRegisterToGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, XnGestureReadyForNextIntermediateStage handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_GESTURE);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnGestureGeneratorInterfaceContainer* pInterface = (XnGestureGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	GestureReadyForNextIntermediateStageCookie* pRegCookie;
+	XN_VALIDATE_ALLOC(pRegCookie, GestureReadyForNextIntermediateStageCookie);
+	pRegCookie->handler = handler;
+	pRegCookie->hNode = hInstance;
+	pRegCookie->pUserCookie = pCookie;
+
+	XnStatus nRetVal = XN_STATUS_OK;
+	if (pInterface->Gesture.RegisterToGestureReadyForNextIntermediateStage != NULL)
+	{
+		nRetVal = pInterface->Gesture.RegisterToGestureReadyForNextIntermediateStage(hModuleNode, xnModuleGestureReadyForNextIntermediateStage, pRegCookie, &pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		nRetVal = pInterface->Gesture.RegisterGestureCallbacks(hModuleNode, NULL, xnModuleGestureStateViaProgress, pRegCookie, &pRegCookie->hCallback);
+	}
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pRegCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pRegCookie;
+
+	return XN_STATUS_OK;
+}
+XN_C_API void xnUnregisterFromGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_GESTURE, );
+	XnGestureGeneratorInterfaceContainer* pInterface = (XnGestureGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	GestureReadyForNextIntermediateStageCookie* pRegCookie = (GestureReadyForNextIntermediateStageCookie*)hCallback;
+	if (pInterface->Gesture.UnregisterFromGestureReadyForNextIntermediateStage != NULL)
+	{
+		pInterface->Gesture.UnregisterFromGestureReadyForNextIntermediateStage(hModuleNode, pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		pInterface->Gesture.UnregisterGestureCallbacks(hModuleNode, pRegCookie->hCallback);
+	}
+	xnOSFree(pRegCookie);
+}
+
 //---------------------------------------------------------------------------
 // Scene Analyzer
 //---------------------------------------------------------------------------
@@ -4424,6 +5387,121 @@ XN_C_API void xnUnregisterUserCallbacks(XnNodeHandle hInstance, XnCallbackHandle
 	xnOSFree(pUserCookie);
 }
 
+typedef struct UserSingleCookie
+{
+	XnUserHandler handler;
+	void* pUserCookie;
+	XnCallbackHandle hCallback;
+	XnNodeHandle hNode;
+} UserSingleCookie;
+
+static void XN_CALLBACK_TYPE xnModuleUserSingle(XnUserID user, void* pCookie)
+{
+	UserSingleCookie* pHandCookie = (UserSingleCookie*)pCookie;
+	if (pHandCookie->handler != NULL)
+	{
+		pHandCookie->handler(pHandCookie->hNode, user, pHandCookie->pUserCookie);
+	}
+}
+
+XN_C_API XnStatus xnRegisterToUserExit(XnNodeHandle hInstance, XnUserHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	UserSingleCookie* pRegCookie;
+	XN_VALIDATE_ALLOC(pRegCookie, UserSingleCookie);
+	pRegCookie->handler = handler;
+	pRegCookie->hNode = hInstance;
+	pRegCookie->pUserCookie = pCookie;
+
+	XnStatus nRetVal = XN_STATUS_OK;
+	if (pInterface->User.RegisterToUserExit != NULL)
+	{
+		nRetVal = pInterface->User.RegisterToUserExit(hModuleNode, xnModuleUserSingle, pRegCookie, &pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		nRetVal = pInterface->User.RegisterUserCallbacks(hModuleNode, NULL, xnModuleUserSingle, pRegCookie, &pRegCookie->hCallback);
+	}
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pRegCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pRegCookie;
+
+	return XN_STATUS_OK;
+}
+XN_C_API void xnUnregisterFromUserExit(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	UserSingleCookie* pRegCookie = (UserSingleCookie*)hCallback;
+	if (pInterface->User.UnregisterFromUserExit != NULL)
+	{
+		pInterface->User.UnregisterFromUserExit(hModuleNode, pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		pInterface->User.UnregisterUserCallbacks(hModuleNode, pRegCookie->hCallback);
+	}
+	xnOSFree(pRegCookie);
+}
+
+XN_C_API XnStatus xnRegisterToUserReEnter(XnNodeHandle hInstance, XnUserHandler handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	// Versions before 1.3.2 didn't have this API. Fabricate it.
+	if (pInterface->User.RegisterToUserReEnter == NULL)
+	{
+
+	}
+
+	UserSingleCookie* pRegCookie;
+	XN_VALIDATE_ALLOC(pRegCookie, UserSingleCookie);
+	pRegCookie->handler = handler;
+	pRegCookie->hNode = hInstance;
+	pRegCookie->pUserCookie = pCookie;
+
+	XnStatus nRetVal = pInterface->User.RegisterToUserReEnter(hModuleNode, xnModuleUserSingle, pRegCookie, &pRegCookie->hCallback);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pRegCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pRegCookie;
+
+	return XN_STATUS_OK;
+}
+XN_C_API void xnUnregisterFromUserReEnter(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	// Versions before 1.3.2 didn't have this API. Fabricate it.
+	if (pInterface->User.UnregisterFromUserReEnter == NULL)
+	{
+
+	}
+
+	UserSingleCookie* pRegCookie = (UserSingleCookie*)hCallback;
+	pInterface->User.UnregisterFromUserReEnter(hModuleNode, pRegCookie->hCallback);
+	xnOSFree(pRegCookie);
+}
 //---------------------------------------------------------------------------
 //  Hands Generator
 //---------------------------------------------------------------------------
@@ -4541,36 +5619,93 @@ XN_C_API XnStatus xnSetTrackingSmoothing(XnNodeHandle hInstance, XnFloat fSmooth
 	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
 	return pInterface->Hands.SetSmoothing(hModuleNode, fSmoothingFactor);
 }
-
 //---------------------------------------------------------------------------
-// Skeleton Capability
+// Hand Touching FOV Edge Capability
 //---------------------------------------------------------------------------
 
-XN_C_API XnBool xnIsJointAvailable(XnNodeHandle hInstance, XnSkeletonJoint eJoint)
+typedef struct HandTouchingFOVEdgeCookie
 {
-	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, FALSE);
-	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
-	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
-	XN_VALIDATE_FUNC_PTR_RET(pInterface->Skeleton.IsJointAvailable, FALSE);
-	return pInterface->Skeleton.IsJointAvailable(hModuleNode, eJoint);
-}
-XN_C_API XnBool xnIsProfileAvailable(XnNodeHandle hInstance, XnSkeletonProfile eProfile)
+	XnHandTouchingFOVEdge handler;
+	void* pUserCookie;
+	XnCallbackHandle hCallback;
+	XnNodeHandle hNode;
+} HandTouchingFOVEdgeCookie;
+
+static void XN_CALLBACK_TYPE xnModuleHandTouchingFOVEdge(XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, XnDirection eDir, void* pCookie)
 {
-	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, FALSE);
-	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
-	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
-	XN_VALIDATE_FUNC_PTR_RET(pInterface->Skeleton.IsProfileAvailable, FALSE);
-	return pInterface->Skeleton.IsProfileAvailable(hModuleNode, eProfile);
+	HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)pCookie;
+	if (pHandCookie->handler != NULL)
+	{
+		pHandCookie->handler(pHandCookie->hNode, user, pPosition, fTime, eDir, pHandCookie->pUserCookie);
+	}
 }
-XN_C_API XnStatus xnSetSkeletonProfile(XnNodeHandle hInstance, XnSkeletonProfile eProfile)
+
+XN_C_API XnStatus xnRegisterToHandTouchingFOVEdge(XnNodeHandle hInstance, XnHandTouchingFOVEdge handler, void* pCookie, XnCallbackHandle* phCallback)
 {
-	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
-	XN_VALIDATE_CHANGES_ALLOWED(hInstance);
-	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_HANDS);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnHandsGeneratorInterfaceContainer* pInterface = (XnHandsGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
 	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
-	XN_VALIDATE_FUNC_PTR(pInterface->Skeleton.SetSkeletonProfile);
-	return pInterface->Skeleton.SetSkeletonProfile(hModuleNode, eProfile);
-}
+	XN_VALIDATE_FUNC_PTR(pInterface->HandTouchingFOVEdge.RegisterToHandTouchingFOVEdge);
+
+	HandTouchingFOVEdgeCookie* pRegCookie;
+	XN_VALIDATE_ALLOC(pRegCookie, HandTouchingFOVEdgeCookie);
+	pRegCookie->handler = handler;
+	pRegCookie->hNode = hInstance;
+	pRegCookie->pUserCookie = pCookie;
+
+	XnStatus nRetVal = pInterface->HandTouchingFOVEdge.RegisterToHandTouchingFOVEdge(hModuleNode, xnModuleHandTouchingFOVEdge, pRegCookie, &pRegCookie->hCallback);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pRegCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pRegCookie;
+
+	return XN_STATUS_OK;
+}
+XN_C_API void xnUnregisterFromHandTouchingFOVEdge(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_HANDS, );
+	XnHandsGeneratorInterfaceContainer* pInterface = (XnHandsGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+	XN_VALIDATE_FUNC_PTR_RET(pInterface->HandTouchingFOVEdge.UnregisterFromHandTouchingFOVEdge, );
+
+	HandTouchingFOVEdgeCookie* pRegCookie = (HandTouchingFOVEdgeCookie*)hCallback;
+	pInterface->HandTouchingFOVEdge.UnregisterFromHandTouchingFOVEdge(hModuleNode, pRegCookie->hCallback);
+	xnOSFree(pRegCookie);
+}
+
+//---------------------------------------------------------------------------
+// Skeleton Capability
+//---------------------------------------------------------------------------
+
+XN_C_API XnBool xnIsJointAvailable(XnNodeHandle hInstance, XnSkeletonJoint eJoint)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, FALSE);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+	XN_VALIDATE_FUNC_PTR_RET(pInterface->Skeleton.IsJointAvailable, FALSE);
+	return pInterface->Skeleton.IsJointAvailable(hModuleNode, eJoint);
+}
+XN_C_API XnBool xnIsProfileAvailable(XnNodeHandle hInstance, XnSkeletonProfile eProfile)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, FALSE);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+	XN_VALIDATE_FUNC_PTR_RET(pInterface->Skeleton.IsProfileAvailable, FALSE);
+	return pInterface->Skeleton.IsProfileAvailable(hModuleNode, eProfile);
+}
+XN_C_API XnStatus xnSetSkeletonProfile(XnNodeHandle hInstance, XnSkeletonProfile eProfile)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+	XN_VALIDATE_CHANGES_ALLOWED(hInstance);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+	XN_VALIDATE_FUNC_PTR(pInterface->Skeleton.SetSkeletonProfile);
+	return pInterface->Skeleton.SetSkeletonProfile(hModuleNode, eProfile);
+}
 XN_C_API XnStatus xnSetJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint, XnBool bState)
 {
 	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
@@ -4792,7 +5927,7 @@ typedef struct SkeletonCookie
 	XnCallbackHandle hCallback;
 } SkeletonCookie;
 
-static void XN_CALLBACK_TYPE xnCalibrationStartCallback(XnUserID user, void* pCookie)
+static void XN_CALLBACK_TYPE xnCalibrationStartBundleCallback(XnUserID user, void* pCookie)
 {
 	SkeletonCookie* pRegCookie = (SkeletonCookie*)pCookie;
 	if (pRegCookie->startHandler != NULL)
@@ -4801,7 +5936,7 @@ static void XN_CALLBACK_TYPE xnCalibrationStartCallback(XnUserID user, void* pCo
 	}
 }
 
-static void XN_CALLBACK_TYPE xnCalibrationEndCallback(XnUserID user, XnBool bSuccess, void* pCookie)
+static void XN_CALLBACK_TYPE xnCalibrationEndBundleCallback(XnUserID user, XnBool bSuccess, void* pCookie)
 {
 	SkeletonCookie* pRegCookie = (SkeletonCookie*)pCookie;
 	if (pRegCookie->endHandler != NULL)
@@ -4810,13 +5945,13 @@ static void XN_CALLBACK_TYPE xnCalibrationEndCallback(XnUserID user, XnBool bSuc
 	}
 }
 
-XN_C_API XnStatus xnRegisterCalibrationCallbacks(XnNodeHandle hInstance, XnCalibrationStart CalibrationStartCB, XnCalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle* phCallback)
+XN_C_API XnStatus XN_API_DEPRECATED("Please use RegisterToCalibrationStart/Complete") xnRegisterCalibrationCallbacks(XnNodeHandle hInstance, XnCalibrationStart CalibrationStartCB, XnCalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle* phCallback)
 {
 	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
 	XN_VALIDATE_OUTPUT_PTR(phCallback);
 	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
 	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
-	XN_VALIDATE_FUNC_PTR_RET(pInterface->Skeleton.RegisterCalibrationCallbacks, 0);
+	XN_VALIDATE_FUNC_PTR(pInterface->Skeleton.RegisterCalibrationCallbacks);
 
 	SkeletonCookie* pSkeletonCookie;
 	XN_VALIDATE_ALLOC(pSkeletonCookie, SkeletonCookie);
@@ -4825,7 +5960,7 @@ XN_C_API XnStatus xnRegisterCalibrationCallbacks(XnNodeHandle hInstance, XnCalib
 	pSkeletonCookie->hNode = hInstance;
 	pSkeletonCookie->pUserCookie = pCookie;
 
-	XnStatus nRetVal = pInterface->Skeleton.RegisterCalibrationCallbacks(hModuleNode, xnCalibrationStartCallback, xnCalibrationEndCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
+	XnStatus nRetVal = pInterface->Skeleton.RegisterCalibrationCallbacks(hModuleNode, xnCalibrationStartBundleCallback, xnCalibrationEndBundleCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
 	if (nRetVal != XN_STATUS_OK)
 	{
 		xnOSFree(pSkeletonCookie);
@@ -4837,7 +5972,7 @@ XN_C_API XnStatus xnRegisterCalibrationCallbacks(XnNodeHandle hInstance, XnCalib
 	return (XN_STATUS_OK);
 }
 
-XN_C_API void xnUnregisterCalibrationCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+XN_C_API void XN_API_DEPRECATED("Please use UnregisterFromCalibrationStart/Complete") xnUnregisterCalibrationCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback)
 {
 	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );
 	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
@@ -4849,6 +5984,235 @@ XN_C_API void xnUnregisterCalibrationCallbacks(XnNodeHandle hInstance, XnCallbac
 	xnOSFree(pSkeletonCookie);
 }
 
+typedef struct CalibrationStartCookie
+{
+	XnCalibrationStart handler;
+	void* pUserCookie;
+	XnNodeHandle hNode;
+	XnCallbackHandle hCallback;
+} CalibrationStartCookie;
+
+static void XN_CALLBACK_TYPE xnCalibrationStartCallback(XnUserID user, void* pCookie)
+{
+	CalibrationStartCookie* pRegCookie = (CalibrationStartCookie*)pCookie;
+	if (pRegCookie->handler != NULL)
+	{
+		pRegCookie->handler(pRegCookie->hNode, user, pRegCookie->pUserCookie);
+	}
+}
+
+XN_C_API XnStatus xnRegisterToCalibrationStart(XnNodeHandle hInstance, XnCalibrationStart handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	CalibrationStartCookie* pCalibrationCookie;
+	XN_VALIDATE_ALLOC(pCalibrationCookie, CalibrationStartCookie);
+	pCalibrationCookie->handler = handler;
+	pCalibrationCookie->hNode = hInstance;
+	pCalibrationCookie->pUserCookie = pCookie;
+
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	if (pInterface->Skeleton.RegisterToCalibrationStart != NULL)
+	{
+		nRetVal = pInterface->Skeleton.RegisterToCalibrationStart(hModuleNode, xnCalibrationStartCallback, pCalibrationCookie, &pCalibrationCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		nRetVal = pInterface->Skeleton.RegisterCalibrationCallbacks(hModuleNode, xnCalibrationStartCallback, NULL, pCalibrationCookie, &pCalibrationCookie->hCallback);
+	}
+
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pCalibrationCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pCalibrationCookie;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API void xnUnregisterFromCalibrationStart(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+	
+	CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)hCallback;
+
+	if (pInterface->Skeleton.UnregisterFromCalibrationStart != NULL)
+	{
+		pInterface->Skeleton.UnregisterFromCalibrationStart(hModuleNode, pCalibrationCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		pInterface->Skeleton.UnregisterCalibrationCallbacks(hModuleNode, pCalibrationCookie->hCallback);
+	}
+	xnOSFree(pCalibrationCookie);
+}
+
+typedef struct CalibrationInProgressCookie
+{
+	XnCalibrationInProgress handler;
+	void* pUserCookie;
+	XnCallbackHandle hCallback;
+	XnNodeHandle hNode;
+} CalibrationInProgressCookie;
+
+static void XN_CALLBACK_TYPE xnModuleCalibrationInProgress(XnUserID user, XnCalibrationStatus calibrationError, void* pCookie)
+{
+	CalibrationInProgressCookie* pCalibrationCookie = (CalibrationInProgressCookie*)pCookie;
+	if (pCalibrationCookie->handler != NULL)
+	{
+		pCalibrationCookie->handler(pCalibrationCookie->hNode, user, calibrationError, pCalibrationCookie->pUserCookie);
+	}
+}
+
+static void XN_CALLBACK_TYPE xnModuleCalibrationInProgressViaStart(XnUserID user, void* pCookie)
+{
+	CalibrationInProgressCookie* pCalibrationCookie = (CalibrationInProgressCookie*)pCookie;
+	if (pCalibrationCookie->handler != NULL)
+	{
+		pCalibrationCookie->handler(pCalibrationCookie->hNode, user, XN_CALIBRATION_STATUS_OK, pCalibrationCookie->pUserCookie);
+	}
+}
+
+XN_C_API XnStatus xnRegisterToCalibrationInProgress(XnNodeHandle hInstance, XnCalibrationInProgress handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	CalibrationInProgressCookie* pRegCookie;
+	XN_VALIDATE_ALLOC(pRegCookie, CalibrationInProgressCookie);
+	pRegCookie->handler = handler;
+	pRegCookie->hNode = hInstance;
+	pRegCookie->pUserCookie = pCookie;
+
+	XnStatus nRetVal = XN_STATUS_OK;
+	if (pInterface->Skeleton.RegisterToCalibrationInProgress != NULL)
+	{
+		pInterface->Skeleton.RegisterToCalibrationInProgress(hModuleNode, xnModuleCalibrationInProgress, pRegCookie, &pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		pInterface->Skeleton.RegisterCalibrationCallbacks(hModuleNode, xnModuleCalibrationInProgressViaStart, NULL, pRegCookie, &pRegCookie->hCallback);
+	}
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pRegCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pRegCookie;
+
+	return XN_STATUS_OK;
+}
+XN_C_API void xnUnregisterFromCalibrationInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	// Versions before 1.3.2 didn't have this API. Fabricate it.
+	if (pInterface->Skeleton.UnregisterFromCalibrationInProgress == NULL)
+	{
+
+	}
+
+	CalibrationInProgressCookie* pRegCookie = (CalibrationInProgressCookie*)hCallback;
+	pInterface->Skeleton.UnregisterFromCalibrationInProgress(hModuleNode, pRegCookie->hCallback);
+	xnOSFree(pRegCookie);
+}
+
+typedef struct CalibrationCompleteCookie
+{
+	XnCalibrationComplete handler;
+	void* pUserCookie;
+	XnCallbackHandle hCallback;
+	XnNodeHandle hNode;
+} CalibrationCompleteCookie;
+
+static void XN_CALLBACK_TYPE xnModuleCalibrationComplete(XnUserID user, XnCalibrationStatus calibrationError, void* pCookie)
+{
+	CalibrationCompleteCookie* pHandCookie = (CalibrationCompleteCookie*)pCookie;
+	if (pHandCookie->handler != NULL)
+	{
+		pHandCookie->handler(pHandCookie->hNode, user, calibrationError, pHandCookie->pUserCookie);
+	}
+}
+
+static void XN_CALLBACK_TYPE xnModuleCalibrationCompleteViaEnd(XnUserID user, XnBool bSuccess, void* pCookie)
+{
+	CalibrationCompleteCookie* pHandCookie = (CalibrationCompleteCookie*)pCookie;
+	if (pHandCookie->handler != NULL)
+	{
+		pHandCookie->handler(pHandCookie->hNode, user, bSuccess?XN_CALIBRATION_STATUS_OK:XN_CALIBRATION_STATUS_POSE, pHandCookie->pUserCookie);
+	}
+}
+
+XN_C_API XnStatus xnRegisterToCalibrationComplete(XnNodeHandle hInstance, XnCalibrationComplete handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	CalibrationCompleteCookie* pRegCookie;
+	XN_VALIDATE_ALLOC(pRegCookie, CalibrationCompleteCookie);
+	pRegCookie->handler = handler;
+	pRegCookie->hNode = hInstance;
+	pRegCookie->pUserCookie = pCookie;
+
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	if (pInterface->Skeleton.RegisterToCalibrationComplete != NULL)
+	{
+		nRetVal = pInterface->Skeleton.RegisterToCalibrationComplete(hModuleNode, xnModuleCalibrationComplete, pRegCookie, &pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		nRetVal = pInterface->Skeleton.RegisterCalibrationCallbacks(hModuleNode, NULL, xnModuleCalibrationCompleteViaEnd, pRegCookie, &pRegCookie->hCallback);
+	}
+
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pRegCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pRegCookie;
+
+	return XN_STATUS_OK;
+}
+XN_C_API void xnUnregisterFromCalibrationComplete(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	CalibrationCompleteCookie* pRegCookie = (CalibrationCompleteCookie*)hCallback;
+	if (pInterface->Skeleton.UnregisterFromCalibrationComplete != NULL)
+	{
+		pInterface->Skeleton.UnregisterFromCalibrationComplete(hModuleNode, pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		pInterface->Skeleton.UnregisterCalibrationCallbacks(hModuleNode, pRegCookie->hCallback);
+	}
+
+	xnOSFree(pRegCookie);
+}
 //---------------------------------------------------------------------------
 // Pose Detection Capability
 //---------------------------------------------------------------------------
@@ -4880,6 +6244,57 @@ XN_C_API XnStatus xnGetAllAvailablePoses(XnNodeHandle hInstance, XnChar** pstrPo
 	XN_VALIDATE_FUNC_PTR(pInterface->PoseDetection.GetAllAvailablePoses);
 	return pInterface->PoseDetection.GetAllAvailablePoses(hModuleNode, pstrPoses, nNameLength, pnPoses);
 }
+
+
+XN_C_API XnStatus xnGetPoseStatus(XnNodeHandle hInstance, XnUserID userID, const XnChar* poseName, XnUInt64* poseTime, XnPoseDetectionStatus* eStatus, XnPoseDetectionState* eState)
+{
+    XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+    XN_VALIDATE_OUTPUT_PTR(poseName);
+    XN_VALIDATE_OUTPUT_PTR(poseTime);
+    XN_VALIDATE_OUTPUT_PTR(eStatus);
+    XN_VALIDATE_OUTPUT_PTR(eState);
+    xn::PosePrivateData *pPosePrivateData = dynamic_cast<xn::PosePrivateData*>(hInstance->pPrivateData);
+    XN_VALIDATE_PTR(pPosePrivateData, XN_STATUS_ERROR);
+
+    return pPosePrivateData->GetPoseStatus(userID, poseName, *poseTime, *eStatus, *eState);
+}
+
+XN_C_API XnBool xnIsPoseSupported(XnNodeHandle hInstance, const XnChar* strPose)
+{
+    XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, FALSE);
+    XN_VALIDATE_PTR(strPose, FALSE);
+
+    XnUInt32 numPoses = xnGetNumberOfPoses(hInstance);
+    if(numPoses == 0)
+    {
+        return FALSE;
+    }
+    XnUInt32 len = (XnUInt32)strlen(strPose) + 1;
+    XnChar** pstrList = XN_NEW_ARR(XnChar*, numPoses);
+    for (XnUInt32 i = 0; i < numPoses; i++)
+    {
+        pstrList[i] = XN_NEW_ARR(XnChar, len);
+    }
+    XnUInt32 origNumPoses = numPoses;
+    XnStatus tmpRes = xnGetAllAvailablePoses(hInstance, pstrList, len, &numPoses);
+    if (tmpRes != XN_STATUS_OK)
+    {
+        numPoses = 0;
+    }
+    XnBool bRes = FALSE;
+    for (XnUInt32 i = 0; i < origNumPoses; i++)
+    {
+        if (i < numPoses && xnOSStrCmp(strPose, pstrList[i]) == 0)
+        {
+            bRes = TRUE;
+            numPoses = 0;
+        }
+        XN_DELETE_ARR(pstrList[i]);
+    }
+    XN_DELETE_ARR(pstrList);
+    return bRes;
+}
+
 XN_C_API XnStatus xnStartPoseDetection(XnNodeHandle hInstance, const XnChar* strPose, XnUserID user)
 {
 	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
@@ -4897,6 +6312,17 @@ XN_C_API XnStatus xnStopPoseDetection(XnNodeHandle hInstance, XnUserID user)
 	XN_VALIDATE_FUNC_PTR(pInterface->PoseDetection.StopPoseDetection);
 	return pInterface->PoseDetection.StopPoseDetection(hModuleNode, user);
 }
+XN_C_API XnStatus xnStopSinglePoseDetection(XnNodeHandle hInstance, XnUserID user, const XnChar* strPose)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+	if (pInterface->PoseDetection.StopSinglePoseDetection == NULL)
+	{
+		return pInterface->PoseDetection.StopPoseDetection(hModuleNode, user);
+	}
+	return pInterface->PoseDetection.StopSinglePoseDetection(hModuleNode, user, strPose);
+}
 
 typedef struct PoseCookie
 {
@@ -4925,13 +6351,13 @@ static void XN_CALLBACK_TYPE xnPoseDetectionEndCallback(const XnChar* strPose, X
 	}
 }
 
-XN_C_API XnStatus xnRegisterToPoseCallbacks(XnNodeHandle hInstance, XnPoseDetectionCallback PoseDetectionStartCB, XnPoseDetectionCallback PoseDetectionEndCB, void* pCookie, XnCallbackHandle* phCallback)
+XN_C_API XnStatus XN_API_DEPRECATED("Please use xnRegisterToPoseDetected/xnRegisterToOutOfPose instead") xnRegisterToPoseCallbacks(XnNodeHandle hInstance, XnPoseDetectionCallback PoseDetectionStartCB, XnPoseDetectionCallback PoseDetectionEndCB, void* pCookie, XnCallbackHandle* phCallback)
 {
 	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
 	XN_VALIDATE_OUTPUT_PTR(phCallback);
 	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
 	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
-	XN_VALIDATE_FUNC_PTR_RET(pInterface->PoseDetection.RegisterToPoseCallbacks, 0);
+	XN_VALIDATE_FUNC_PTR(pInterface->PoseDetection.RegisterToPoseCallbacks);
 
 	PoseCookie* pPoseCookie;
 	XN_VALIDATE_ALLOC(pPoseCookie, PoseCookie);
@@ -4952,7 +6378,7 @@ XN_C_API XnStatus xnRegisterToPoseCallbacks(XnNodeHandle hInstance, XnPoseDetect
 	return (XN_STATUS_OK);
 }
 
-XN_C_API void xnUnregisterFromPoseCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+XN_C_API void XN_API_DEPRECATED("Please use xnUnregisterFromPoseDetected/xnUnregisterFromOutOfPose instead") xnUnregisterFromPoseCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback)
 {
 	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );
 	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
@@ -4964,6 +6390,214 @@ XN_C_API void xnUnregisterFromPoseCallbacks(XnNodeHandle hInstance, XnCallbackHa
 	xnOSFree(pPoseCookie);
 }
 
+typedef struct PoseDetectionCookie
+{
+	XnPoseDetectionCallback handler;
+	void* pPoseCookie;
+	XnNodeHandle hNode;
+	XnCallbackHandle hCallback;
+} PoseDetectionCookie;
+
+static void XN_CALLBACK_TYPE xnPoseDetectionCallback(const XnChar* strPose, XnUserID user, void* pCookie)
+{
+	PoseDetectionCookie* pRegCookie = (PoseDetectionCookie*)pCookie;
+	if (pRegCookie->handler != NULL)
+	{
+		pRegCookie->handler(pRegCookie->hNode, strPose, user, pRegCookie->pPoseCookie);
+	}
+}
+
+XN_C_API XnStatus xnRegisterToPoseDetected(XnNodeHandle hInstance, XnPoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	PoseDetectionCookie* pPoseCookie;
+	XN_VALIDATE_ALLOC(pPoseCookie, PoseDetectionCookie);
+	pPoseCookie->handler = handler;
+	pPoseCookie->hNode = hInstance;
+	pPoseCookie->pPoseCookie = pCookie;
+
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	if (pInterface->PoseDetection.RegisterToPoseDetected != NULL)
+	{
+		nRetVal = pInterface->PoseDetection.RegisterToPoseDetected(hModuleNode, xnPoseDetectionCallback, pPoseCookie, &pPoseCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		nRetVal = pInterface->PoseDetection.RegisterToPoseCallbacks(hModuleNode, xnPoseDetectionCallback, NULL, pPoseCookie, &pPoseCookie->hCallback);
+	}
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pPoseCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pPoseCookie;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API void xnUnregisterFromPoseDetected(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
+
+	if (pInterface->PoseDetection.UnregisterFromPoseDetected != NULL)
+	{
+		pInterface->PoseDetection.UnregisterFromPoseDetected(hModuleNode, pPoseCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		pInterface->PoseDetection.UnregisterFromPoseCallbacks(hModuleNode, pPoseCookie->hCallback);
+	}
+
+	xnOSFree(pPoseCookie);
+}
+
+XN_C_API XnStatus xnRegisterToOutOfPose(XnNodeHandle hInstance, XnPoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+	XN_VALIDATE_FUNC_PTR(pInterface->PoseDetection.RegisterToOutOfPose);
+
+	PoseDetectionCookie* pPoseCookie;
+	XN_VALIDATE_ALLOC(pPoseCookie, PoseDetectionCookie);
+	pPoseCookie->handler = handler;
+	pPoseCookie->hNode = hInstance;
+	pPoseCookie->pPoseCookie = pCookie;
+
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	if (pInterface->PoseDetection.RegisterToOutOfPose != NULL)
+	{
+		nRetVal = pInterface->PoseDetection.RegisterToOutOfPose(hModuleNode, xnPoseDetectionCallback, pPoseCookie, &pPoseCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		nRetVal = pInterface->PoseDetection.RegisterToPoseCallbacks(hModuleNode, NULL, xnPoseDetectionCallback, pPoseCookie, &pPoseCookie->hCallback);
+	}
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pPoseCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pPoseCookie;
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API void xnUnregisterFromOutOfPose(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+	XN_VALIDATE_FUNC_PTR_RET(pInterface->PoseDetection.UnregisterFromOutOfPose, );
+
+	PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
+	if (pInterface->PoseDetection.UnregisterFromOutOfPose != NULL)
+	{
+		pInterface->PoseDetection.UnregisterFromOutOfPose(hModuleNode, pPoseCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		pInterface->PoseDetection.UnregisterFromPoseCallbacks(hModuleNode, pPoseCookie->hCallback);
+	}
+	xnOSFree(pPoseCookie);
+}
+
+
+typedef struct PoseDetectionInProgressCookie
+{
+	XnPoseDetectionInProgress handler;
+	void* pUserCookie;
+	XnCallbackHandle hCallback;
+	XnNodeHandle hNode;
+} PoseDetectionInProgressCookie;
+
+static void XN_CALLBACK_TYPE xnModulePoseDetectionInProgress(const XnChar* strPose, XnUserID user, XnPoseDetectionStatus poseDetectionError, void* pCookie)
+{
+	PoseDetectionInProgressCookie* pHandCookie = (PoseDetectionInProgressCookie*)pCookie;
+	if (pHandCookie->handler != NULL)
+	{
+		pHandCookie->handler(pHandCookie->hNode, strPose, user, poseDetectionError, pHandCookie->pUserCookie);
+	}
+}
+
+static void XN_CALLBACK_TYPE xnModulePoseDetectionInProgressViaStart(const XnChar* strPose, XnUserID user, void* pCookie)
+{
+	PoseDetectionInProgressCookie* pHandCookie = (PoseDetectionInProgressCookie*)pCookie;
+	if (pHandCookie->handler != NULL)
+	{
+		pHandCookie->handler(pHandCookie->hNode, strPose, user, XN_POSE_DETECTION_STATUS_OK, pHandCookie->pUserCookie);
+	}
+}
+
+XN_C_API XnStatus xnRegisterToPoseDetectionInProgress(XnNodeHandle hInstance, XnPoseDetectionInProgress handler, void* pCookie, XnCallbackHandle* phCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
+	XN_VALIDATE_OUTPUT_PTR(phCallback);
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	PoseDetectionInProgressCookie* pRegCookie;
+	XN_VALIDATE_ALLOC(pRegCookie, PoseDetectionInProgressCookie);
+	pRegCookie->handler = handler;
+	pRegCookie->hNode = hInstance;
+	pRegCookie->pUserCookie = pCookie;
+
+	XnStatus nRetVal = XN_STATUS_OK;
+	if (pInterface->PoseDetection.RegisterToPoseDetectionInProgress != NULL)
+	{
+		nRetVal = pInterface->PoseDetection.RegisterToPoseDetectionInProgress(hModuleNode, xnModulePoseDetectionInProgress, pRegCookie, &pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		nRetVal = pInterface->PoseDetection.RegisterToPoseCallbacks(hModuleNode, xnModulePoseDetectionInProgressViaStart, NULL, pRegCookie, &pRegCookie->hCallback);
+	}
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnOSFree(pRegCookie);
+		return (nRetVal);
+	}
+
+	*phCallback = pRegCookie;
+
+	return XN_STATUS_OK;
+}
+XN_C_API void xnUnregisterFromPoseDetectionInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );
+	XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
+
+	PoseDetectionInProgressCookie* pRegCookie = (PoseDetectionInProgressCookie*)hCallback;
+	if (pInterface->PoseDetection.UnregisterFromPoseDetectionInProgress != NULL)
+	{
+		pInterface->PoseDetection.UnregisterFromPoseDetectionInProgress(hModuleNode, pRegCookie->hCallback);
+	}
+	else
+	{
+		// Versions before 1.3.2 didn't have this API. Fabricate it.
+		pInterface->PoseDetection.UnregisterFromPoseCallbacks(hModuleNode, pRegCookie->hCallback);
+	}
+	xnOSFree(pRegCookie);
+}
+
 //---------------------------------------------------------------------------
 // Audio Generator
 //---------------------------------------------------------------------------
@@ -5052,7 +6686,7 @@ XN_C_API XnStatus xnCreateCodec(XnContext* pContext, XnCodecID codecID, XnNodeHa
 	// search for all codecs
 	XnNodeInfoList* pList;
 	nRetVal = xnEnumerateProductionTrees(pContext, XN_NODE_TYPE_CODEC, NULL, &pList, NULL);
-	XN_IS_STATUS_OK(nRetVal);
+	XN_IS_STATUS_OK_LOG_ERROR("Enumerate production trees", nRetVal);
 
 	XnNodeHandle hCodec = NULL;
 
@@ -5069,7 +6703,7 @@ XN_C_API XnStatus xnCreateCodec(XnContext* pContext, XnCodecID codecID, XnNodeHa
 			nRetVal = xnCreateProductionTree(pContext, pInfo, &hCodec);
 			if (nRetVal != XN_STATUS_OK)
 			{
-				xnLogWarning(XN_MASK_OPEN_NI, "Failed to create codec %s of vendor %s to check for its type: %s", pInfo->Description.strName, pInfo->Description.strVendor, xnGetStatusString(nRetVal));
+				xnLoggerWarning(g_logger, "Failed to create codec %s of vendor %s to check for its type: %s", pInfo->Description.strName, pInfo->Description.strVendor, xnGetStatusString(nRetVal));
 				continue;
 			}
 
@@ -5092,6 +6726,7 @@ XN_C_API XnStatus xnCreateCodec(XnContext* pContext, XnCodecID codecID, XnNodeHa
 
 	if (hCodec == NULL)
 	{
+		xnLogError(XN_MASK_OPEN_NI, "Unsupported codec '%.4s'", &codecID);
 		return XN_STATUS_UNSUPPORTED_CODEC;
 	}
 
@@ -5099,7 +6734,8 @@ XN_C_API XnStatus xnCreateCodec(XnContext* pContext, XnCodecID codecID, XnNodeHa
 	nRetVal = xnInitCodec(hCodec, hInitializerNode);
 	if (nRetVal != XN_STATUS_OK)
 	{
-		XN_LOG_ERROR_RETURN(nRetVal, XN_MASK_OPEN_NI, "Failed to init codec using given node: %s", xnGetStatusString(nRetVal));
+		xnProductionNodeRelease(hCodec);
+		XN_RETURN_WITH_ERROR_LOG(g_logger, nRetVal, "Failed to init codec using given node: %s", xnGetStatusString(nRetVal));
 	}
 
 	*phCodec = hCodec;
@@ -5213,3 +6849,179 @@ XN_C_API XnStatus xnMockRawSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, Xn
 	XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_GENERATOR);
 	return xnMockSetData(hInstance, nFrameID, nTimestamp, nDataSize, pData);
 }
+
+XN_C_API XnStatus xnCreateScriptNode(XnContext* pContext, const XnChar* strFormat, XnNodeHandle* phScript)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// for now we only support OpenNI XML format
+	if (strcmp(strFormat, XN_SCRIPT_FORMAT_XML) != 0)
+	{
+		return XN_STATUS_NOT_IMPLEMENTED;
+	}
+
+	XnNodeInfo* pInfo;
+	XnProductionNodeDescription desc;
+	GetOpenNIScriptNodeDescription(&desc);
+
+	nRetVal = xnNodeInfoAllocate(&desc, NULL, NULL, &pInfo);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnCreateProductionTree(pContext, pInfo, phScript);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XN_C_API const XnChar* xnScriptNodeGetSupportedFormat(XnNodeHandle hScript)
+{
+	XN_VALIDATE_INTERFACE_TYPE_RET(hScript, XN_NODE_TYPE_SCRIPT, NULL);
+	XnScriptNodeInterfaceContainer* pInterface = (XnScriptNodeInterfaceContainer*)hScript->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hScript->pModuleInstance->hNode;
+	return pInterface->Script.GetSupportedFormat(hModuleNode);
+}
+
+XN_C_API XnStatus xnLoadScriptFromFile(XnNodeHandle hScript, const XnChar* strFileName)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hScript, XN_NODE_TYPE_SCRIPT);
+	XN_VALIDATE_INPUT_PTR(strFileName);
+	XnScriptNodeInterfaceContainer* pInterface = (XnScriptNodeInterfaceContainer*)hScript->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hScript->pModuleInstance->hNode;
+	return pInterface->Script.LoadScriptFromFile(hModuleNode, strFileName);
+}
+
+XN_C_API XnStatus xnLoadScriptFromString(XnNodeHandle hScript, const XnChar* strScript)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hScript, XN_NODE_TYPE_SCRIPT);
+	XN_VALIDATE_INPUT_PTR(strScript);
+	XnScriptNodeInterfaceContainer* pInterface = (XnScriptNodeInterfaceContainer*)hScript->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hScript->pModuleInstance->hNode;
+	return pInterface->Script.LoadScriptFromString(hModuleNode, strScript);
+}
+
+static XnStatus xnScriptNodeRunImpl(XnNodeHandle hScript, XnNodeInfoList* pCreatedNodes, XnEnumerationErrors* pErrors)
+{
+	XN_VALIDATE_INTERFACE_TYPE(hScript, XN_NODE_TYPE_SCRIPT);
+	XN_VALIDATE_INPUT_PTR(pCreatedNodes);
+	XN_VALIDATE_INPUT_PTR(pErrors);
+	XnScriptNodeInterfaceContainer* pInterface = (XnScriptNodeInterfaceContainer*)hScript->pModuleInstance->pLoaded->pInterface;
+	XnModuleNodeHandle hModuleNode = hScript->pModuleInstance->hNode;
+	return pInterface->Script.Run(hModuleNode, pCreatedNodes, pErrors);
+}
+
+XN_C_API XnStatus xnScriptNodeRun(XnNodeHandle hScript, XnEnumerationErrors* pErrors)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XN_VALIDATE_INTERFACE_TYPE(hScript, XN_NODE_TYPE_SCRIPT);
+
+	XnNodeInfoList* pCreatedNodes = NULL;
+	nRetVal = xnNodeInfoListAllocate(&pCreatedNodes);
+	XN_IS_STATUS_OK(nRetVal);
+
+	XnEnumerationErrors* pActualErrors = pErrors;
+	if (pActualErrors == NULL)
+	{
+		nRetVal = xnEnumerationErrorsAllocate(&pActualErrors);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnNodeInfoListFree(pCreatedNodes);
+			return (nRetVal);
+		}
+	}
+
+	// run the script
+	nRetVal = xnScriptNodeRunImpl(hScript, pCreatedNodes, pActualErrors);
+
+	if (nRetVal == XN_STATUS_OK)
+	{
+		// add all created nodes to the list of dependencies
+		for (XnNodeInfoListIterator it = xnNodeInfoListGetFirst(pCreatedNodes);
+			xnNodeInfoListIteratorIsValid(it);
+			it = xnNodeInfoListGetNext(it))
+		{
+			XnNodeInfo* pInfo = xnNodeInfoListGetCurrent(it);
+			if (pInfo->hNode == NULL)
+			{
+				nRetVal = XN_STATUS_ERROR;
+				break;
+			}
+
+			nRetVal = xnAddNeededNode(hScript, pInfo->hNode);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				break;
+			}
+		}
+	}
+
+	// release all nodes (either we had an error, or they are already added to the list of needed nodes
+	for (XnNodeInfoListIterator it = xnNodeInfoListGetFirst(pCreatedNodes);
+		xnNodeInfoListIteratorIsValid(it);
+		it = xnNodeInfoListGetNext(it))
+	{
+		XnNodeInfo* pInfo = xnNodeInfoListGetCurrent(it);
+		if (pInfo->hNode != NULL)
+		{
+			xnProductionNodeRelease(pInfo->hNode);
+		}
+	}
+
+	// free the list
+	xnNodeInfoListFree(pCreatedNodes);
+
+	// free errors object (if needed)
+	if (pErrors == NULL)
+	{
+		xnEnumerationErrorsFree(pErrors);
+	}
+
+	return (nRetVal);
+}
+
+//---------------------------------------------------------------------------
+// General
+//---------------------------------------------------------------------------
+#if (XN_PLATFORM == XN_PLATFORM_WIN32) && (_M_X64)
+	#define XN_OPEN_NI_INSTALL_PATH_ENV "OPEN_NI_INSTALL_PATH64"
+#else
+	#define XN_OPEN_NI_INSTALL_PATH_ENV "OPEN_NI_INSTALL_PATH"
+#endif
+
+#if (XN_PLATFORM == XN_PLATFORM_WIN32)
+	#define XN_OPEN_NI_FILES_LOCATION "\\Data\\"
+#elif (CE4100)
+	#define XN_OPEN_NI_FILES_LOCATION "/usr/etc/ni/"
+#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX)
+	#define XN_OPEN_NI_FILES_LOCATION "/var/lib/ni/"
+#elif (XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
+	#define XN_OPEN_NI_FILES_LOCATION "/data/ni/"
+#else
+	#error "Unsupported platform!"
+#endif
+
+XnStatus xnGetOpenNIConfFilesPath(XnChar* strDest, XnUInt32 nBufSize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	nRetVal = xnOSGetEnvironmentVariable(XN_OPEN_NI_INSTALL_PATH_ENV, strDest, nBufSize);
+	if (nRetVal == XN_STATUS_OS_ENV_VAR_NOT_FOUND)
+	{
+		#if (XN_PLATFORM == XN_PLATFORM_WIN32)
+			// we don't allow environment variable not to be defined on Windows.
+			return nRetVal;
+		#else
+			// use root FS
+			strDest[0] = '\0';
+		#endif
+	}
+	else
+	{
+		XN_IS_STATUS_OK(nRetVal);
+	}
+
+	nRetVal = xnOSStrAppend(strDest, XN_OPEN_NI_FILES_LOCATION, nBufSize);
+	XN_IS_STATUS_OK(nRetVal);
+	
+	return (XN_STATUS_OK);
+}
diff --git a/Source/OpenNI/XnPlayerImpl.cpp b/Source/OpenNI/XnPlayerImpl.cpp
index 04a8268..5916474 100644
--- a/Source/OpenNI/XnPlayerImpl.cpp
+++ b/Source/OpenNI/XnPlayerImpl.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -39,7 +39,9 @@ XnPlayerInputStreamInterface PlayerImpl::s_fileInputStream =
 	&ReadFile,
 	&SeekFile,
 	&TellFile,
-	&CloseFile
+	&CloseFile,
+	&SeekFile64,
+	&TellFile64
 };
 
 XnNodeNotifications PlayerImpl::s_nodeNotifications =
@@ -56,9 +58,12 @@ XnNodeNotifications PlayerImpl::s_nodeNotifications =
 
 PlayerImpl::PlayerImpl() : 
 	m_hPlayer(NULL), 
-	m_pInFile(NULL),
+	m_bIsFileOpen(FALSE),
 	m_bHasTimeReference(FALSE),
-	m_dPlaybackSpeed(1.0)
+	m_dPlaybackSpeed(1.0),
+	m_hPlaybackThread(NULL),
+	m_hPlaybackEvent(NULL),
+	m_bPlaybackThreadShutdown(FALSE)
 {
 	xnOSMemSet(m_strSource, 0, sizeof(m_strSource));
 }
@@ -86,12 +91,36 @@ XnStatus PlayerImpl::Init(XnNodeHandle hPlayer)
 	nRetVal = ModulePlayer().RegisterToEndOfFileReached(ModuleHandle(), EndOfFileReachedCallback, this, &hDummy);
 	XN_IS_STATUS_OK(nRetVal);
 
+	nRetVal = xnOSCreateCriticalSection(&m_hPlaybackLock);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnOSCreateEvent(&m_hPlaybackEvent, FALSE);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnOSCreateThread(PlaybackThread, this, &m_hPlaybackThread);
+	XN_IS_STATUS_OK(nRetVal);
+
 	return XN_STATUS_OK;
 }
 
 void PlayerImpl::BeforeNodeDestroy()
 {
-	//Do nothing here - we only destroy in the destructor.
+	// we need to close the thread *before* the node is destroyed (as the thread uses it)
+	m_bPlaybackThreadShutdown = TRUE;
+
+	if (m_hPlaybackThread != NULL)
+	{
+		// signal the event, so the thread will wake up
+		xnOSSetEvent(m_hPlaybackEvent);
+		xnOSWaitAndTerminateThread(&m_hPlaybackThread, 1000);
+		m_hPlaybackThread = NULL;
+	}
+
+	if (m_hPlaybackEvent != NULL)
+	{
+		xnOSCloseEvent(&m_hPlaybackEvent);
+		m_hPlaybackEvent = NULL;
+	}
 }
 
 XnStatus PlayerImpl::SetSource(XnRecordMedium sourceType, const XnChar* strSource)
@@ -141,6 +170,21 @@ XnStatus PlayerImpl::GetSource(XnRecordMedium &sourceType, XnChar* strSource, Xn
 void PlayerImpl::Destroy()
 {
 	CloseFileImpl();
+
+	if (m_hPlaybackLock != NULL)
+	{
+		xnOSCloseCriticalSection(&m_hPlaybackLock);
+		m_hPlaybackLock = NULL;
+	}
+
+	for (PlayedNodesHash::Iterator it = m_playedNodes.begin(); it != m_playedNodes.end(); ++it)
+	{
+		PlayedNodeInfo& nodeInfo = it.Value();
+		xnUnlockNodeForChanges(nodeInfo.hNode, nodeInfo.hLock);
+		xnProductionNodeRelease(nodeInfo.hNode);
+	}
+
+	m_playedNodes.Clear();
 }
 
 XnStatus PlayerImpl::EnumerateNodes(XnNodeInfoList** ppList)
@@ -167,6 +211,9 @@ XnStatus PlayerImpl::EnumerateNodes(XnNodeInfoList** ppList)
 
 XnStatus PlayerImpl::SetPlaybackSpeed(XnDouble dSpeed)
 {
+	// do that in a lock (other thread might be in the middle of playback/seek)
+	XnAutoCSLocker locker(m_hPlaybackLock);
+
 	if (dSpeed < 0)
 	{
 		return XN_STATUS_BAD_PARAM;
@@ -198,6 +245,53 @@ XnModuleNodeHandle PlayerImpl::ModuleHandle()
 	return m_hPlayer->pModuleInstance->hNode;
 }
 
+XnStatus PlayerImpl::SeekToTimestamp(XnInt64 nTimeOffset, XnPlayerSeekOrigin origin)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// do the whole thing in a lock (so it wouldn't conflict with other threads playing / seeking)
+	XnAutoCSLocker locker(m_hPlaybackLock);
+
+	// disable playback speed - so seeking would be immediate
+	XnDouble dPlaybackSpeed = GetPlaybackSpeed();
+	SetPlaybackSpeed(XN_PLAYBACK_SPEED_FASTEST);
+
+	nRetVal = ModulePlayer().SeekToTimeStamp(ModuleHandle(), nTimeOffset, origin);
+
+	// restore playback speed
+	SetPlaybackSpeed(dPlaybackSpeed);
+	ResetTimeReference();
+
+	// check if seeking failed
+	XN_IS_STATUS_OK(nRetVal);
+
+	return XN_STATUS_OK;
+}
+
+
+XnStatus PlayerImpl::SeekToFrame(const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// do the whole thing in a lock (so it wouldn't conflict with other threads playing / seeking)
+	XnAutoCSLocker locker(m_hPlaybackLock);
+
+	// disable playback speed - so seeking would be immediate
+	XnDouble dPlaybackSpeed = GetPlaybackSpeed();
+	SetPlaybackSpeed(XN_PLAYBACK_SPEED_FASTEST);
+
+	nRetVal = ModulePlayer().SeekToFrame(ModuleHandle(), strNodeName, nFrameOffset, origin);
+
+	// restore playback speed
+	SetPlaybackSpeed(dPlaybackSpeed);
+	ResetTimeReference();
+
+	// check if seeking failed
+	XN_IS_STATUS_OK(nRetVal);
+
+	return XN_STATUS_OK;
+}
+
 XnStatus XN_CALLBACK_TYPE PlayerImpl::OpenFile(void* pCookie)
 {
 	PlayerImpl* pThis = (PlayerImpl*)pCookie;
@@ -220,6 +314,13 @@ XnStatus XN_CALLBACK_TYPE PlayerImpl::SeekFile(void* pCookie, XnOSSeekType seekT
 	return pThis->SeekFileImpl(seekType, nOffset);
 }
 
+XnStatus XN_CALLBACK_TYPE PlayerImpl::SeekFile64(void* pCookie, XnOSSeekType seekType, const XnInt64 nOffset)
+{
+	PlayerImpl* pThis = (PlayerImpl*)pCookie;
+	XN_VALIDATE_INPUT_PTR(pThis);
+	return pThis->SeekFile64Impl(seekType, nOffset);
+}
+
 XnUInt32 XN_CALLBACK_TYPE PlayerImpl::TellFile(void* pCookie)
 {
 	PlayerImpl* pThis = (PlayerImpl*)pCookie;
@@ -227,6 +328,13 @@ XnUInt32 XN_CALLBACK_TYPE PlayerImpl::TellFile(void* pCookie)
 	return pThis->TellFileImpl();
 }
 
+XnUInt64 XN_CALLBACK_TYPE PlayerImpl::TellFile64(void* pCookie)
+{
+	PlayerImpl* pThis = (PlayerImpl*)pCookie;
+	XN_VALIDATE_PTR(pThis, (XnUInt64)-1);
+	return pThis->TellFile64Impl();
+}
+
 void XN_CALLBACK_TYPE PlayerImpl::CloseFile(void* pCookie)
 {
 	PlayerImpl* pThis = (PlayerImpl*)pCookie;
@@ -240,74 +348,75 @@ void XN_CALLBACK_TYPE PlayerImpl::CloseFile(void* pCookie)
 
 XnStatus PlayerImpl::OpenFileImpl()
 {
-	if (m_pInFile != NULL)
+	if (m_bIsFileOpen)
 	{
 		//Already open
 		return XN_STATUS_OK;
 	}
 	
-	m_pInFile = fopen(m_strSource, "rb");
-	if (m_pInFile == NULL)
+	XnStatus nRetVal = xnOSOpenFile(m_strSource, XN_OS_FILE_READ, &m_hInFile);
+
+	if (nRetVal != XN_STATUS_OK)
 	{
 		xnLogWarning(XN_MASK_OPEN_NI, "Failed to open file '%s' for reading", m_strSource);
-		return XN_STATUS_OS_FILE_NOT_FOUND;
+		return XN_STATUS_OS_FILE_OPEN_FAILED;
 	}
+	m_bIsFileOpen = TRUE;
 
 	return XN_STATUS_OK;
 }
 
 XnStatus PlayerImpl::ReadFileImpl(void* pData, XnUInt32 nSize, XnUInt32 &nBytesRead)
 {
-	XN_VALIDATE_PTR(m_pInFile, XN_STATUS_ERROR);
-	nBytesRead = (XnUInt32)fread(pData, 1, nSize, m_pInFile);
-	if (ferror(m_pInFile))
-	{
-		return XN_STATUS_OS_FILE_READ_FAILED;
-	}
+	XN_IS_BOOL_OK_RET(m_bIsFileOpen, XN_STATUS_ERROR);
+
+	nBytesRead = nSize;
+
+	return xnOSReadFile(m_hInFile, pData, &nBytesRead);
 	//nBytesRead could be smaller than nSize at the end, but that's not an error
-	return XN_STATUS_OK;
 }
 
 XnStatus PlayerImpl::SeekFileImpl(XnOSSeekType seekType, XnInt32 nOffset)
 {
-	XN_VALIDATE_PTR(m_pInFile, XN_STATUS_ERROR);
-	long nOrigin = 0;
-	switch (seekType)
-	{
-		case XN_OS_SEEK_CUR:
-			nOrigin = SEEK_CUR;
-			break;
-		case XN_OS_SEEK_END:
-			nOrigin = SEEK_END;
-			break;
-		case SEEK_SET:
-			nOrigin = SEEK_SET;
-			break;
-		default:
-			XN_ASSERT(FALSE);
-			return XN_STATUS_BAD_PARAM;
-	}
-	
-	if (fseek(m_pInFile, nOffset, nOrigin) != 0)
-	{
-		return XN_STATUS_ERROR;
-	}
+	XN_IS_BOOL_OK_RET(m_bIsFileOpen, XN_STATUS_ERROR);
+	return xnOSSeekFile64(m_hInFile, seekType, nOffset);
+}
 
-	return XN_STATUS_OK;	
+XnStatus PlayerImpl::SeekFile64Impl(XnOSSeekType seekType, XnInt64 nOffset)
+{
+	XN_IS_BOOL_OK_RET(m_bIsFileOpen, XN_STATUS_ERROR);
+	return xnOSSeekFile64(m_hInFile, seekType, nOffset);
 }
 
 XnUInt32 PlayerImpl::TellFileImpl()
 {
-	XN_VALIDATE_PTR(m_pInFile, (XnUInt32)-1);
-	return ftell(m_pInFile);
+	XN_IS_BOOL_OK_RET(m_bIsFileOpen, XN_STATUS_ERROR);
+	XnUInt64 pos;
+	XnStatus nRetVal = xnOSTellFile64(m_hInFile, &pos);
+	XN_IS_STATUS_OK_RET(nRetVal, (XnUInt32) -1);
+	// Enforce uint32 limitation
+	if (pos >> 32)
+		return (XnUInt32) -1;
+
+	return (XnUInt32)pos;
+}
+
+XnUInt64 PlayerImpl::TellFile64Impl()
+{
+	XN_IS_BOOL_OK_RET(m_bIsFileOpen, XN_STATUS_ERROR);
+	XnUInt64 pos;
+	XnStatus nRetVal = xnOSTellFile64(m_hInFile, &pos);
+	XN_IS_STATUS_OK_RET(nRetVal, (XnUInt64) -1);
+
+	return pos;
 }
 
 void PlayerImpl::CloseFileImpl()
 {
-	if (m_pInFile != NULL)	
+	if (m_bIsFileOpen)
 	{
-		fclose(m_pInFile);
-		m_pInFile = NULL;
+		xnOSCloseFile(&m_hInFile);
+		m_bIsFileOpen = FALSE;
 	}
 }
 
@@ -367,7 +476,7 @@ XnStatus XN_CALLBACK_TYPE PlayerImpl::OnNodeNewData(void* pCookie, const XnChar*
 	return pThis->SetNodeNewData(strNodeName, nTimeStamp, nFrame, pData, nSize);
 }
 
-XnStatus PlayerImpl::AddNode(const XnChar* strNodeName, XnProductionNodeType type, XnCodecID compression)
+XnStatus PlayerImpl::AddNode(const XnChar* strNodeName, XnProductionNodeType type, XnCodecID /*compression*/)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
 	
@@ -380,18 +489,35 @@ XnStatus PlayerImpl::AddNode(const XnChar* strNodeName, XnProductionNodeType typ
 	}
 
 	// check if we need to create it (maybe it's a rewind...)
-	if (xnGetNodeHandleByName(m_hPlayer->pContext, strNodeName, &playedNodeInfo.hNode) != XN_STATUS_OK)
+	if (xnGetRefNodeHandleByName(m_hPlayer->pContext, strNodeName, &playedNodeInfo.hNode) != XN_STATUS_OK)
 	{
 		XnStatus nRetVal = xnCreateMockNode(m_hPlayer->pContext, type, strNodeName, &playedNodeInfo.hNode);
 		XN_IS_STATUS_OK(nRetVal);
+
+		// mark this node as needed node. We need this in order to make sure if xnForceShutdown() is called,
+		// the player will be destroyed *before* mock node is (so we can release it).
+		nRetVal = xnAddNeededNode(m_hPlayer, playedNodeInfo.hNode);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnProductionNodeRelease(playedNodeInfo.hNode);
+			return (nRetVal);
+		}
 	}
 
 	// lock it, so no one can change configuration (this is a file recording)
 	nRetVal = xnLockNodeForChanges(playedNodeInfo.hNode, &playedNodeInfo.hLock);
-	XN_IS_STATUS_OK(nRetVal);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnProductionNodeRelease(playedNodeInfo.hNode);
+		return (nRetVal);
+	}
 
 	nRetVal = m_playedNodes.Set(strNodeName, playedNodeInfo);
-	XN_IS_STATUS_OK(nRetVal);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnProductionNodeRelease(playedNodeInfo.hNode);
+		return (nRetVal);
+	}
 
 	return XN_STATUS_OK;
 }
@@ -406,10 +532,15 @@ XnStatus PlayerImpl::RemoveNode(const XnChar* strNodeName)
 	XN_IS_STATUS_OK(nRetVal);
 
 	nRetVal = xnUnlockNodeForChanges(playedNodeInfo.hNode, playedNodeInfo.hLock);
-	XN_IS_STATUS_OK(nRetVal);
-	
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnLogWarning(XN_MASK_OPEN_NI, "Failed to unlock node when removing from playing: %s", xnGetStatusString(nRetVal));
+	}
+
 	nRetVal = m_playedNodes.Remove(strNodeName);
-	XN_IS_STATUS_OK(nRetVal);
+	XN_ASSERT(nRetVal == XN_STATUS_OK);
+
+	xnProductionNodeRelease(playedNodeInfo.hNode);
 
 	return (XN_STATUS_OK);
 }
@@ -619,4 +750,56 @@ void PlayerImpl::EndOfFileReachedCallback(void* pCookie)
 	pThis->OnEndOfFileReached();
 }
 
+void PlayerImpl::PlaybackThread()
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	while (!m_bPlaybackThreadShutdown)
+	{
+		nRetVal = xnOSWaitEvent(m_hPlaybackEvent, XN_WAIT_INFINITE);
+		if (nRetVal != XN_STATUS_OK && nRetVal != XN_STATUS_OS_EVENT_TIMEOUT)
+		{
+			xnLogWarning(XN_MASK_OPEN_NI, "Failed to wait for event: %s", xnGetStatusString(nRetVal));
+			xnOSSleep(1);
+			continue;
+		}
+
+		if (m_bPlaybackThreadShutdown)
+		{
+			return;
+		}
+
+		nRetVal = xnPlayerReadNext(m_hPlayer);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnLogWarning(XN_MASK_OPEN_NI, "Failed to playback: %s", xnGetStatusString(nRetVal));
+			xnOSSleep(1);
+			continue;
+		}
+	}
+}
+
+XN_THREAD_PROC PlayerImpl::PlaybackThread(XN_THREAD_PARAM pThreadParam)
+{
+	PlayerImpl* pThis = (PlayerImpl*)pThreadParam;
+	pThis->PlaybackThread();
+	XN_THREAD_PROC_RETURN(XN_STATUS_OK);
+}
+
+void PlayerImpl::TriggerPlayback()
+{
+	XnStatus nRetVal = xnOSSetEvent(m_hPlaybackEvent);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		xnLogWarning(XN_MASK_OPEN_NI, "Failed to trigger playback: %s", xnGetStatusString(nRetVal));
+	}
+}
+
+XnStatus PlayerImpl::ReadNext()
+{
+	// Always read inside a lock (to make it thread safe)
+	XnAutoCSLocker lock(m_hPlaybackLock);
+	return ModulePlayer().ReadNext(ModuleHandle());
+}
+
 }
diff --git a/Source/OpenNI/XnPlayerImpl.h b/Source/OpenNI/XnPlayerImpl.h
index cde4314..a7fe695 100644
--- a/Source/OpenNI/XnPlayerImpl.h
+++ b/Source/OpenNI/XnPlayerImpl.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -45,22 +45,30 @@ public:
 	XnStatus EnumerateNodes(XnNodeInfoList** ppList);
 	XnStatus SetPlaybackSpeed(XnDouble dSpeed);
 	XnDouble GetPlaybackSpeed();
-	void ResetTimeReference();
+	void TriggerPlayback();
+	XnStatus ReadNext();
+	XnStatus SeekToTimestamp(XnInt64 nTimeOffset, XnPlayerSeekOrigin origin);
+	XnStatus SeekToFrame(const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin);
 
 private:
 	XnModulePlayerInterface& ModulePlayer();
 	XnModuleNodeHandle ModuleHandle();
+	void ResetTimeReference();
 
 	static XnStatus XN_CALLBACK_TYPE OpenFile(void* pCookie);
 	static XnStatus XN_CALLBACK_TYPE ReadFile(void* pCookie, void *pBuffer, XnUInt32 nSize, XnUInt32 *pnBytesRead);
-	static XnStatus XN_CALLBACK_TYPE SeekFile(void* pCookie, XnOSSeekType seekType, const XnInt32 nOffset);
-	static XnUInt32 XN_CALLBACK_TYPE TellFile(void* pCookie);
+	static XnStatus XN_CALLBACK_TYPE SeekFile  (void* pCookie, XnOSSeekType seekType, const XnInt32 nOffset);
+	static XnStatus XN_CALLBACK_TYPE SeekFile64(void* pCookie, XnOSSeekType seekType, const XnInt64 nOffset);
+	static XnUInt32 XN_CALLBACK_TYPE TellFile  (void* pCookie);
+	static XnUInt64 XN_CALLBACK_TYPE TellFile64(void* pCookie);
 	static void XN_CALLBACK_TYPE CloseFile(void *pCookie);
 
 	XnStatus OpenFileImpl();
 	XnStatus ReadFileImpl(void *pData, XnUInt32 nSize, XnUInt32& nBytesRead);
-	XnStatus SeekFileImpl(XnOSSeekType seekType, XnInt32 nOffset);
-	XnUInt32 TellFileImpl();
+	XnStatus SeekFileImpl  (XnOSSeekType seekType, XnInt32 nOffset);
+	XnStatus SeekFile64Impl(XnOSSeekType seekType, XnInt64 nOffset);
+	XnUInt32 TellFileImpl  ();
+	XnUInt64 TellFile64Impl();
 	void CloseFileImpl();
 
 	//Node notifications
@@ -91,6 +99,9 @@ private:
 	void OnEndOfFileReached();
 	static void XN_CALLBACK_TYPE EndOfFileReachedCallback(void* pCookie);
 
+	void PlaybackThread();
+	static XN_THREAD_PROC PlaybackThread(XN_THREAD_PARAM pThreadParam);
+
 	typedef struct PlayedNodeInfo
 	{
 		XnNodeHandle hNode;
@@ -102,7 +113,8 @@ private:
 	XnNodeHandle m_hPlayer;
 	static XnPlayerInputStreamInterface s_fileInputStream;
 	static XnNodeNotifications s_nodeNotifications;
-	FILE* m_pInFile;
+	XnBool m_bIsFileOpen;
+	XN_FILE_HANDLE m_hInFile;
 	XnChar m_strSource[XN_FILE_MAX_PATH];
 	XnRecordMedium m_sourceType;
 	PlayedNodesHash m_playedNodes;
@@ -110,8 +122,12 @@ private:
 	XnUInt64 m_nStartTimestamp;
 	XnUInt64 m_nStartTime;
 	XnBool m_bHasTimeReference;
+	XN_THREAD_HANDLE m_hPlaybackThread;
+	XN_EVENT_HANDLE m_hPlaybackEvent;
+	XN_CRITICAL_SECTION_HANDLE m_hPlaybackLock;
+	XnBool m_bPlaybackThreadShutdown;
 };
 
 }
 
-#endif //__XN_PLAYER_IMPL_H__
\ No newline at end of file
+#endif //__XN_PLAYER_IMPL_H__
diff --git a/Source/OpenNI/XnProfiling.cpp b/Source/OpenNI/XnProfiling.cpp
index d9e1193..1882ad9 100644
--- a/Source/OpenNI/XnProfiling.cpp
+++ b/Source/OpenNI/XnProfiling.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -173,8 +173,6 @@ XN_C_API XnStatus xnProfilingInitFromINI(const XnChar* cpINIFileName, const XnCh
 
 XN_C_API XnStatus xnProfilingShutdown()
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	if (g_ProfilingData.hThread != NULL)
 	{
 		g_ProfilingData.bKillThread = TRUE;
diff --git a/Source/OpenNI/XnQueries.cpp b/Source/OpenNI/XnQueries.cpp
index 591b103..94cb7f5 100644
--- a/Source/OpenNI/XnQueries.cpp
+++ b/Source/OpenNI/XnQueries.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -29,10 +29,14 @@
 // Defines
 //---------------------------------------------------------------------------
 #define XN_MAX_CAPABILITIES_COUNT		100
+#define XN_MAX_NEEDED_NODES				100
 
 //---------------------------------------------------------------------------
 // Types
 //---------------------------------------------------------------------------
+
+
+
 struct XnNodeQuery
 {
 	XnChar strVendor[XN_MAX_NAME_LENGTH];
@@ -44,8 +48,9 @@ struct XnNodeQuery
 	XnMapOutputMode aSupportedMapOutputModes[XN_MAX_CAPABILITIES_COUNT];
 	XnUInt32 nSupportedMapOutputModes;
 	XnUInt32 nMinUserPositions;
-	XnBool bExistingNode;
-	const XnChar* astrNeededNodes[XN_MAX_CAPABILITIES_COUNT];
+	XnBool bExistingNodeOnly;
+	XnBool bNonExistingNodeOnly;
+	const XnChar* astrNeededNodes[XN_MAX_NEEDED_NODES];
 	XnUInt32 nNeededNodes;
 	XnChar strCreationInfo[XN_MAX_CREATION_INFO_LENGTH];
 };
@@ -127,7 +132,15 @@ XN_C_API XnStatus xnNodeQuerySetSupportedMinUserPositions(XnNodeQuery* pQuery, c
 XN_C_API XnStatus xnNodeQuerySetExistingNodeOnly(XnNodeQuery* pQuery, XnBool bExistingNode)
 {
 	XN_VALIDATE_INPUT_PTR(pQuery);
-	pQuery->bExistingNode = bExistingNode;
+	pQuery->bExistingNodeOnly = bExistingNode;
+	return (XN_STATUS_OK);
+}
+
+
+XN_C_API XnStatus XN_C_DECL xnNodeQuerySetNonExistingNodeOnly(XnNodeQuery* pQuery, XnBool bNonExistingNode)
+{
+	XN_VALIDATE_INPUT_PTR(pQuery);
+	pQuery->bNonExistingNodeOnly = bNonExistingNode;
 	return (XN_STATUS_OK);
 }
 
@@ -205,17 +218,10 @@ static XnBool xnIsMapOutputModeSupported(XnNodeHandle hNode, const XnMapOutputMo
 	return (FALSE);
 }
 
-static XnBool xnIsNodeMatch(XnContext* pContext, const XnNodeQuery* pQuery, XnNodeInfo* pNodeInfo)
+static XnBool xnIsInfoQueryMatch(const XnNodeQuery* pQuery, XnNodeInfo* pNodeInfo)
 {
-	// check existing node
-	XnNodeHandle hNode = xnNodeInfoGetHandle(pNodeInfo);
-	if (pQuery->bExistingNode && hNode == NULL)
-	{
-		return (FALSE);
-	}
-
 	const XnProductionNodeDescription* pDescription = xnNodeInfoGetDescription(pNodeInfo);
-
+	
 	// vendor
 	if (pQuery->strVendor[0] != '\0' && strcmp(pQuery->strVendor, pDescription->strVendor) != 0)
 	{
@@ -255,56 +261,83 @@ static XnBool xnIsNodeMatch(XnContext* pContext, const XnNodeQuery* pQuery, XnNo
 		return (FALSE);
 	}
 
-	// check if we need to create an instance, to check capabilities
-	XnBool bInstanceCreated = FALSE;
+	return (TRUE);
+}
 
-	if (pQuery->nSupportedCapabilities > 0 ||
-		pQuery->nSupportedMapOutputModes > 0 ||
-		pQuery->nMinUserPositions > 0)
+static XnBool xnIsNodeInstanceMatch(const XnNodeQuery* pQuery, XnNodeHandle hNode)
+{
+	for (XnUInt i = 0; i < pQuery->nSupportedCapabilities; ++i)
 	{
-		if (hNode == NULL)
+		if (!xnIsCapabilitySupported(hNode, pQuery->astrSupportedCapabilities[i]))
 		{
-			xnLogVerbose(XN_MASK_OPEN_NI, "Creating node '%s' of type '%s' for querying...", pDescription->strName, xnProductionNodeTypeToString(pDescription->Type));
-			if (XN_STATUS_OK != xnCreateProductionTree(pContext, pNodeInfo, &hNode))
-			{
-				return (FALSE);
-			}
+			return (FALSE);
+		}
+	}
 
-			bInstanceCreated = TRUE;
+	for (XnUInt i = 0; i < pQuery->nSupportedMapOutputModes; ++i)
+	{
+		if (!xnIsMapOutputModeSupported(hNode, &pQuery->aSupportedMapOutputModes[i]))
+		{
+			return (FALSE);
 		}
 	}
 
-	XnBool bResult = TRUE;
+	if (pQuery->nMinUserPositions > 0 && xnGetSupportedUserPositionsCount(hNode) < pQuery->nMinUserPositions)
+	{
+		return (FALSE);
+	}
 
-	for (XnUInt i = 0; i < pQuery->nSupportedCapabilities; ++i)
+	return (TRUE);
+}
+
+static XnBool xnIsNodeMatch(XnContext* pContext, const XnNodeQuery* pQuery, XnNodeInfo* pNodeInfo)
+{
+	// check existing node
+	XnNodeHandle hNode = xnNodeInfoGetRefHandle(pNodeInfo);
+	if (pQuery->bExistingNodeOnly && (hNode == NULL))
 	{
-		if (!xnIsCapabilitySupported(hNode, pQuery->astrSupportedCapabilities[i]))
+		return (FALSE);
+	}
+
+	if (pQuery->bNonExistingNodeOnly && (hNode != NULL))
+	{
+		return (FALSE);
+	}
+
+	if (!xnIsInfoQueryMatch(pQuery, pNodeInfo))
+	{
+		if (hNode != NULL)
 		{
-			bResult = FALSE;
-			break;
+			xnProductionNodeRelease(hNode);
 		}
+
+		return (FALSE);
 	}
 
-	if (bResult)
+	// check if we need to create an instance, to check capabilities
+	if (pQuery->nSupportedCapabilities > 0 ||
+		pQuery->nSupportedMapOutputModes > 0 ||
+		pQuery->nMinUserPositions > 0)
 	{
-		for (XnUInt i = 0; i < pQuery->nSupportedMapOutputModes; ++i)
+		if (hNode == NULL)
 		{
-			if (!xnIsMapOutputModeSupported(hNode, &pQuery->aSupportedMapOutputModes[i]))
+			const XnProductionNodeDescription* pDescription = xnNodeInfoGetDescription(pNodeInfo);
+			xnLogVerbose(XN_MASK_OPEN_NI, "Creating node '%s' of type '%s' for querying...", pDescription->strName, xnProductionNodeTypeToString(pDescription->Type));
+			XnStatus nRetVal = xnCreateProductionTree(pContext, pNodeInfo, &hNode);
+			if (nRetVal != XN_STATUS_OK)
 			{
-				bResult = FALSE;
-				break;
+				xnLogWarning(XN_MASK_OPEN_NI, "Failed to create node of type '%s' for querying: %s", xnProductionNodeTypeToString(pDescription->Type), xnGetStatusString(nRetVal));
+				return (FALSE);
 			}
 		}
 	}
 
-	if (bResult && pQuery->nMinUserPositions > 0)
-	{
-		bResult = (xnGetSupportedUserPositionsCount(hNode) >= pQuery->nMinUserPositions);
-	}
+	XnBool bResult = xnIsNodeInstanceMatch(pQuery, hNode);
 
-	if (bInstanceCreated)
+	// in any case, we need to release the node. if we created it, this will cause it to be destroyed. If we just took
+	// a reference to it, we need to release it.
+	if (hNode != NULL)
 	{
-		// destroy it
 		xnProductionNodeRelease(hNode);
 	}
 
diff --git a/Source/OpenNI/XnRecorderImpl.cpp b/Source/OpenNI/XnRecorderImpl.cpp
index de3e6f0..c97deb8 100644
--- a/Source/OpenNI/XnRecorderImpl.cpp
+++ b/Source/OpenNI/XnRecorderImpl.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -38,12 +38,15 @@ XnRecorderOutputStreamInterface RecorderImpl::s_fileOutputStream =
 	&RecorderImpl::WriteFile,
 	&RecorderImpl::SeekFile,
 	&RecorderImpl::TellFile,
-	&RecorderImpl::CloseFile
+	&RecorderImpl::CloseFile,
+	&RecorderImpl::SeekFile64,
+	&RecorderImpl::TellFile64
 };
 
 RecorderImpl::RecorderImpl() : 
 	m_hRecorder(NULL),
-	m_pOutFile(NULL)
+	m_bIsFileOpen(FALSE),
+	m_destType(XN_RECORD_MEDIUM_FILE)
 {
 	xnOSMemSet(m_strFileName, 0, sizeof(m_strFileName));
 }
@@ -91,7 +94,7 @@ XnStatus RecorderImpl::AddNode(ProductionNode &node, XnCodecID compression)
 	}
 
 	NodeWatchersMap::ConstIterator it = m_nodeWatchersMap.end();
-	if (m_nodeWatchersMap.Find(node, it) == XN_STATUS_OK)
+	if (m_nodeWatchersMap.Find(node.GetHandle(), it) == XN_STATUS_OK)
 	{
 		return XN_STATUS_NODE_ALREADY_RECORDED;
 	}
@@ -112,7 +115,7 @@ XnStatus RecorderImpl::AddNode(ProductionNode &node, XnCodecID compression)
 		return nRetVal;
 	}
 
-	nRetVal = NotifyNodeAdded(node, type, compression);
+	nRetVal = NotifyNodeAdded(node.GetHandle(), type, compression);
 	XN_IS_STATUS_OK(nRetVal);
 	nRetVal = pNodeWatcher->NotifyState();
 	if (nRetVal != XN_STATUS_OK)
@@ -121,7 +124,7 @@ XnStatus RecorderImpl::AddNode(ProductionNode &node, XnCodecID compression)
 		return nRetVal;
 	}
 
-	nRetVal = m_nodeWatchersMap.Set(node, pNodeWatcher);
+	nRetVal = m_nodeWatchersMap.Set(node.GetHandle(), pNodeWatcher);
 	if (nRetVal != XN_STATUS_OK)
 	{
 		XN_DELETE(pNodeWatcher);
@@ -138,7 +141,7 @@ XnStatus RecorderImpl::RemoveNode(ProductionNode &node)
 		return XN_STATUS_BAD_PARAM;		
 	}
 
-	XnStatus nRetVal = NotifyNodeRemoved(node);
+	XnStatus nRetVal = NotifyNodeRemoved(node.GetHandle());
 	XN_IS_STATUS_OK(nRetVal);
 	nRetVal = RemoveNodeImpl(node);
 	XN_IS_STATUS_OK(nRetVal);
@@ -157,12 +160,13 @@ XnStatus RecorderImpl::AddRawNode(const XnChar* strNodeName)
 
 	XnNodeHandle hNode = NULL;
 	NodeWatcher* pNodeWatcher = NULL;
-	if ((xnGetNodeHandleByName(m_hRecorder->pContext, strNodeName, &hNode) == XN_STATUS_OK) &&
+	if ((xnGetRefNodeHandleByName(m_hRecorder->pContext, strNodeName, &hNode) == XN_STATUS_OK) &&
 		(m_nodeWatchersMap.Get(hNode, pNodeWatcher) == XN_STATUS_OK))
 	{
 		//There's a node by that name and we're already watching it
 		xnLogWarning(XN_MASK_OPEN_NI, "Attempted to add a raw node by name of '%s' but there is already another node by that name that is being recorded", strNodeName);
 		XN_ASSERT(FALSE);
+		xnProductionNodeRelease(hNode);
 		return XN_STATUS_INVALID_OPERATION;
 	}
 
@@ -266,7 +270,7 @@ XnStatus RecorderImpl::SetRawNodeNewData(const XnChar* strNodeName, XnUInt64 nTi
 XnStatus RecorderImpl::RemoveNodeImpl(ProductionNode &node)
 {
 	NodeWatcher* pNodeWatcher = NULL;
-	XnNodeHandle hNode = node;
+	XnNodeHandle hNode = node.GetHandle();
 	XnStatus nRetVal = m_nodeWatchersMap.Remove(hNode, pNodeWatcher);
 	XN_DELETE(pNodeWatcher);
 	XN_IS_STATUS_OK(nRetVal);
@@ -309,11 +313,12 @@ XnStatus RecorderImpl::SetDestination(XnRecordMedium destType, const XnChar* str
 		//Right now only file destination is supported
 		case XN_RECORD_MEDIUM_FILE:
 		{
-			if (m_pOutFile != NULL)
+			if (m_bIsFileOpen)
 			{
 				XN_LOG_WARNING_RETURN(XN_STATUS_INVALID_OPERATION, XN_MASK_OPEN_NI, "Recorder destination is already set!");
 			}
 
+			m_destType = destType;
 			nRetVal = xnOSStrCopy(m_strFileName, strDest, sizeof(m_strFileName));
 			XN_IS_STATUS_OK(nRetVal);
 			nRetVal = ModuleRecorder().SetOutputStream(ModuleHandle(), this, &s_fileOutputStream);
@@ -328,6 +333,25 @@ XnStatus RecorderImpl::SetDestination(XnRecordMedium destType, const XnChar* str
 	return XN_STATUS_OK;
 }
 
+XnStatus RecorderImpl::GetDestination(XnRecordMedium& destType, XnChar* strDest, XnUInt32 nBufSize)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	switch (m_destType)
+	{
+		case XN_RECORD_MEDIUM_FILE:
+			destType = m_destType;
+			nRetVal = xnOSStrCopy(strDest, m_strFileName, nBufSize);
+			XN_IS_STATUS_OK(nRetVal);
+			break;
+
+		default:
+			XN_ASSERT(FALSE);
+			return XN_STATUS_ERROR;
+	}
+
+	return XN_STATUS_OK;
+}
+
 typedef struct 
 {
 	NodeWatcher* pWatcher;
@@ -413,13 +437,20 @@ XnStatus RecorderImpl::WriteFile(void* pCookie, const XnChar* strNodeName, const
 }
 
 
-XnStatus XN_CALLBACK_TYPE RecorderImpl::SeekFile(void* pCookie, XnOSSeekType seekType, const XnUInt32 nOffset)
+XnStatus XN_CALLBACK_TYPE RecorderImpl::SeekFile(void* pCookie, XnOSSeekType seekType, const XnInt32 nOffset)
 {
 	RecorderImpl* pThis = (RecorderImpl*)pCookie;
 	XN_VALIDATE_INPUT_PTR(pThis);
 	return pThis->SeekFileImpl(seekType, nOffset);
 }
 
+XnStatus XN_CALLBACK_TYPE RecorderImpl::SeekFile64(void* pCookie, XnOSSeekType seekType, const XnInt64 nOffset)
+{
+	RecorderImpl* pThis = (RecorderImpl*)pCookie;
+	XN_VALIDATE_INPUT_PTR(pThis);
+	return pThis->SeekFile64Impl(seekType, nOffset);
+}
+
 XnUInt32 XN_CALLBACK_TYPE RecorderImpl::TellFile(void* pCookie)
 {
 	RecorderImpl* pThis = (RecorderImpl*)pCookie;
@@ -427,6 +458,13 @@ XnUInt32 XN_CALLBACK_TYPE RecorderImpl::TellFile(void* pCookie)
 	return pThis->TellFileImpl();
 }
 
+XnUInt64 XN_CALLBACK_TYPE RecorderImpl::TellFile64(void* pCookie)
+{
+	RecorderImpl* pThis = (RecorderImpl*)pCookie;
+	XN_VALIDATE_INPUT_PTR(pThis);
+	return pThis->TellFile64Impl();
+}
+
 void RecorderImpl::CloseFile(void* pCookie)
 {
 	RecorderImpl* pThis = (RecorderImpl*)pCookie;
@@ -440,78 +478,76 @@ void RecorderImpl::CloseFile(void* pCookie)
 
 XnStatus RecorderImpl::OpenFileImpl()
 {
-	if (m_pOutFile != NULL)
+	if (m_bIsFileOpen)
 	{
 		//Already open
 		return XN_STATUS_OK;
 	}
 
-	m_pOutFile = fopen(m_strFileName, "wb");
-	if (m_pOutFile  == NULL)
+	XnStatus nRetVal = xnOSOpenFile(m_strFileName, XN_OS_FILE_WRITE | XN_OS_FILE_TRUNCATE, &m_hOutFile);
+
+	if (nRetVal != XN_STATUS_OK)
 	{
 		xnLogWarning(XN_MASK_OPEN_NI, "Failed to open file '%s' for writing", m_strFileName);
 		return XN_STATUS_OS_FILE_OPEN_FAILED;
 	}
+	m_bIsFileOpen = TRUE;
 
 	return XN_STATUS_OK;	
 }
 
-XnStatus RecorderImpl::WriteFileImpl(const XnChar* strNodeName, 
+XnStatus RecorderImpl::WriteFileImpl(const XnChar* /*strNodeName*/, 
 									 const void* pData, 
 									 XnUInt32 nSize)
 {
 	//strNodeName may be NULL
-	XN_VALIDATE_PTR(m_pOutFile, XN_STATUS_ERROR);
-	size_t nBytesWritten = fwrite(pData, 1, nSize, m_pOutFile);
-	if (nBytesWritten < nSize)
-	{
-		xnLogWarning(XN_MASK_OPEN_NI, "Written only %u bytes out of %u to file", nBytesWritten, nSize);
-		return XN_STATUS_OS_FILE_WRITE_FAILED;
-	}
-	return XN_STATUS_OK;
+	XN_IS_BOOL_OK_RET(m_bIsFileOpen, XN_STATUS_ERROR);
+
+	return xnOSWriteFile(m_hOutFile, pData, nSize);
 }
 
 
-XnStatus RecorderImpl::SeekFileImpl(XnOSSeekType seekType, const XnUInt32 nOffset)
+XnStatus RecorderImpl::SeekFileImpl(XnOSSeekType seekType, const XnInt32 nOffset)
 {
-	XN_VALIDATE_PTR(m_pOutFile, XN_STATUS_ERROR);
-	long nOrigin = 0;
-	switch (seekType)
-	{
-	case XN_OS_SEEK_CUR:
-		nOrigin = SEEK_CUR;
-		break;
-	case XN_OS_SEEK_END:
-		nOrigin = SEEK_END;
-		break;
-	case SEEK_SET:
-		nOrigin = SEEK_SET;
-		break;
-	default:
-		XN_ASSERT(FALSE);
-		return XN_STATUS_BAD_PARAM;
-	}
-
-	if (fseek(m_pOutFile, nOffset, nOrigin) != 0)
-	{
-		return XN_STATUS_ERROR;
-	}
-
-	return XN_STATUS_OK;
+	XN_IS_BOOL_OK_RET(m_bIsFileOpen, XN_STATUS_ERROR);
+	return xnOSSeekFile64(m_hOutFile, seekType, nOffset);
 }
 
+XnStatus RecorderImpl::SeekFile64Impl(XnOSSeekType seekType, const XnInt64 nOffset)
+{
+	XN_IS_BOOL_OK_RET(m_bIsFileOpen, XN_STATUS_ERROR);
+	return xnOSSeekFile64(m_hOutFile, seekType, nOffset);
+}
 
 XnUInt32 RecorderImpl::TellFileImpl()
 {
-	return ftell(m_pOutFile);
+	XN_IS_BOOL_OK_RET(m_bIsFileOpen, XN_STATUS_ERROR);
+	XnUInt64 pos;
+	XnStatus nRetVal = xnOSTellFile64(m_hOutFile, &pos);
+	XN_IS_STATUS_OK_RET(nRetVal, (XnUInt32) -1);
+	// Enforce uint32 limitation
+	if (pos >> 32)
+		return (XnUInt32) -1;
+
+	return (XnUInt32)pos;
+}
+
+XnUInt64 RecorderImpl::TellFile64Impl()
+{
+	XN_IS_BOOL_OK_RET(m_bIsFileOpen, XN_STATUS_ERROR);
+	XnUInt64 pos;
+	XnStatus nRetVal = xnOSTellFile64(m_hOutFile, &pos);
+	XN_IS_STATUS_OK_RET(nRetVal, (XnUInt64) -1);
+
+	return pos;
 }
 
 void RecorderImpl::CloseFileImpl()
 {
-	if (m_pOutFile != NULL)
+	if (m_bIsFileOpen)
 	{
-		fclose(m_pOutFile);
-		m_pOutFile = NULL;
+		xnOSCloseFile(&m_hOutFile);
+		m_bIsFileOpen = FALSE;
 	}
 }
 
diff --git a/Source/OpenNI/XnRecorderImpl.h b/Source/OpenNI/XnRecorderImpl.h
index 41e6c8d..5e77b9d 100644
--- a/Source/OpenNI/XnRecorderImpl.h
+++ b/Source/OpenNI/XnRecorderImpl.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -55,6 +55,7 @@ namespace xn
 		XnStatus SetRawNodeNewData(const XnChar* strNodeName, XnUInt64 nTimeStamp, XnUInt32 nFrame, const void* pData, XnUInt32 nSize);
 
 		XnStatus SetDestination(XnRecordMedium destType, const XnChar* strDest);
+		XnStatus GetDestination(XnRecordMedium& destType, XnChar* strDest, XnUInt32 nBufSize);
 		XnStatus Record();
 
 	protected:
@@ -70,14 +71,18 @@ namespace xn
 		static XnStatus XN_CALLBACK_TYPE OpenFile(void* pCookie);
 		static XnStatus XN_CALLBACK_TYPE WriteFile(void* pCookie, const XnChar* strNodeName, 
 			const void* pData, XnUInt32 nSize);
-		static XnStatus XN_CALLBACK_TYPE SeekFile(void* pCookie, XnOSSeekType seekType, const XnUInt32 nOffset);
+		static XnStatus XN_CALLBACK_TYPE SeekFile  (void* pCookie, XnOSSeekType seekType, const XnInt32 nOffset);
+		static XnStatus XN_CALLBACK_TYPE SeekFile64(void* pCookie, XnOSSeekType seekType, const XnInt64 nOffset);
 		static XnUInt32 XN_CALLBACK_TYPE TellFile(void* pCookie);
+		static XnUInt64 XN_CALLBACK_TYPE TellFile64(void* pCookie);
 		static void XN_CALLBACK_TYPE CloseFile(void* pCookie);
 
 		XnStatus OpenFileImpl();
 		XnStatus WriteFileImpl(const XnChar* strNodeName, const void* pData, XnUInt32 nSize);
-		XnStatus SeekFileImpl(XnOSSeekType seekType, const XnUInt32 nOffset);
+		XnStatus SeekFileImpl  (XnOSSeekType seekType, const XnInt32 nOffset);
+		XnStatus SeekFile64Impl(XnOSSeekType seekType, const XnInt64 nOffset);
 		XnUInt32 TellFileImpl();
+		XnUInt64 TellFile64Impl();
 		void CloseFileImpl();
 
 		XnCodecID GetDefaultCodecID(ProductionNode& node);
@@ -87,8 +92,10 @@ namespace xn
 		//XnRecorderOutputStreamInterface implementation that writes to an stdio file
 		static XnRecorderOutputStreamInterface s_fileOutputStream;
 
+		XnRecordMedium m_destType;
 		XnChar m_strFileName[XN_FILE_MAX_PATH];
-		FILE* m_pOutFile;
+		XnBool m_bIsFileOpen;
+		XN_FILE_HANDLE m_hOutFile;
 		XnNodeHandle m_hRecorder;
 		XN_DECLARE_DEFAULT_HASH(XnNodeHandle, NodeWatcher*, NodeWatchersMap);
 		NodeWatchersMap m_nodeWatchersMap;
diff --git a/Source/OpenNI/XnScheduler.cpp b/Source/OpenNI/XnScheduler.cpp
index b0a1469..985dcc6 100644
--- a/Source/OpenNI/XnScheduler.cpp
+++ b/Source/OpenNI/XnScheduler.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -154,8 +154,6 @@ XN_THREAD_PROC xnSchedulerThreadFunc(XN_THREAD_PARAM pThreadParam)
 
 void FreeScheduler(XnScheduler* pScheduler)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	// stop thread
 	if (pScheduler->hThread)
 	{
@@ -286,12 +284,15 @@ XN_C_API XnStatus xnSchedulerAddTask(XnScheduler* pScheduler, XnUInt64 nInterval
 
 void XnSchedulerRemoveTaskInternal(XnScheduler* pScheduler, XnScheduledTask* pTask)
 {
-	// check if this is the first task
-	if (pScheduler->pFirst == pTask)
+	if (pScheduler->pFirst == NULL) // check if any tasks exist
+	{
+		return;
+	}
+	else if (pScheduler->pFirst == pTask) // check if this is the first task
 	{
 		pScheduler->pFirst = pTask->pNextTask;
 	}
-	else
+	else // not first task
 	{
 		XnScheduledTask* pBefore = pScheduler->pFirst;
 
diff --git a/Source/OpenNI/XnStatusRegister.cpp b/Source/OpenNI/XnStatusRegister.cpp
index d7cdeb3..dc0de82 100644
--- a/Source/OpenNI/XnStatusRegister.cpp
+++ b/Source/OpenNI/XnStatusRegister.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -53,8 +53,8 @@ static XnStatus s_XN_OK_result = xnRegisterErrorCodeMessages(0, 0, 1, &s_OK_Data
 XnErrorCodeData* xnGetErrorCodeData(const XnStatus Status)
 {
 	// search for it
-	XnUInt32 nGroup = XN_STATUS_GROUP(Status);
-	XnUInt32 nCode = XN_STATUS_CODE(Status);
+	XnUInt16 nGroup = XN_STATUS_GROUP(Status);
+	XnUInt16 nCode = XN_STATUS_CODE(Status);
 
 	if (g_pErrorGroups == NULL)
 	{
@@ -100,9 +100,9 @@ XN_C_API XnStatus xnRegisterErrorCodeMessages(XnUInt16 nGroup, XnUInt16 nFirst,
 		data.csName = xnOSStrDup(pErrorCodeData[nIndex].csName);
 
 		XnErrorCodeData prevData = {0};
-		pStatusHash->Get(data.nCode, prevData);
+		pStatusHash->Get((XnUInt16)data.nCode, prevData);
 
-		nRetVal = pStatusHash->Set(data.nCode, data);
+		nRetVal = pStatusHash->Set((XnUInt16)data.nCode, data);
 		XN_IS_STATUS_OK(nRetVal);
 
 		// if prev contained anything, free it
diff --git a/Source/OpenNI/XnTypeManager.cpp b/Source/OpenNI/XnTypeManager.cpp
index 7a1ccd6..1960ef2 100644
--- a/Source/OpenNI/XnTypeManager.cpp
+++ b/Source/OpenNI/XnTypeManager.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -50,6 +50,7 @@ TypeManager::TypeManager()
 	AddNewType("Recorder", XN_NODE_TYPE_RECORDER, XN_NODE_TYPE_PRODUCTION_NODE);
 	AddNewType("Player", XN_NODE_TYPE_PLAYER, XN_NODE_TYPE_PRODUCTION_NODE);
 	AddNewType("Codec", XN_NODE_TYPE_CODEC, XN_NODE_TYPE_PRODUCTION_NODE);
+	AddNewType("Script", XN_NODE_TYPE_SCRIPT, XN_NODE_TYPE_PRODUCTION_NODE);
 	AddNewType("Generator", XN_NODE_TYPE_GENERATOR, XN_NODE_TYPE_PRODUCTION_NODE);
 
 	// Generators
@@ -94,7 +95,6 @@ XnStatus TypeManager::RegisterNewType(const XnChar* strName, XnProductionNodeTyp
 	if (XN_STATUS_OK == GetTypeByName(strName, &type))
 	{
 		*pNewType = type;
-		return (XN_STATUS_OK);
 	}
 	else
 	{
@@ -117,9 +117,14 @@ XnStatus TypeManager::RegisterNewType(const XnChar* strName, XnProductionNodeTyp
 	return (XN_STATUS_OK);
 }
 
-XnStatus TypeManager::GetTypeName(XnProductionNodeType type, const XnChar** pstrName)
+XnStatus TypeManager::GetTypeName(XnProductionNodeType type, const XnChar** pstrName) const
 {
-	NodeTypeInfo* pInfo = m_pTypesArray[type];
+	if (type > XN_MAX_TYPES_COUNT)
+	{
+		return XN_STATUS_NO_MATCH;
+	}
+
+	const NodeTypeInfo* pInfo = m_pTypesArray[type];
 	if (pInfo == NULL)
 	{
 		return XN_STATUS_NO_MATCH;
@@ -129,10 +134,8 @@ XnStatus TypeManager::GetTypeName(XnProductionNodeType type, const XnChar** pstr
 	return XN_STATUS_OK;
 }
 
-XnStatus TypeManager::GetTypeByName(const XnChar* strName, XnProductionNodeType* pType)
+XnStatus TypeManager::GetTypeByName(const XnChar* strName, XnProductionNodeType* pType) const
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-
 	// take current count (for thread safety reasons)
 	XnUInt32 nCount = m_nNextExtendedNodeType;
 
@@ -150,9 +153,9 @@ XnStatus TypeManager::GetTypeByName(const XnChar* strName, XnProductionNodeType*
 	return (XN_STATUS_NO_MATCH);
 }
 
-XnStatus TypeManager::IsTypeDerivedFrom(XnProductionNodeType type, XnProductionNodeType base, XnBool* pbIsDerived)
+XnStatus TypeManager::IsTypeDerivedFrom(XnProductionNodeType type, XnProductionNodeType base, XnBool* pbIsDerived) const
 {
-	NodeTypeInfo* pInfo = m_pTypesArray[type];
+	const NodeTypeInfo* pInfo = m_pTypesArray[type];
 	if (pInfo == NULL)
 	{
 		return XN_STATUS_NO_MATCH;
@@ -163,9 +166,9 @@ XnStatus TypeManager::IsTypeDerivedFrom(XnProductionNodeType type, XnProductionN
 	return XN_STATUS_OK;
 }
 
-XnStatus TypeManager::GetTypeHierarchy(XnProductionNodeType type, const XnBitSet*& pHierarchy)
+XnStatus TypeManager::GetTypeHierarchy(XnProductionNodeType type, const XnBitSet*& pHierarchy) const
 {
-	NodeTypeInfo* pInfo = m_pTypesArray[type];
+	const NodeTypeInfo* pInfo = m_pTypesArray[type];
 	if (pInfo == NULL)
 	{
 		return XN_STATUS_NO_MATCH;
diff --git a/Source/OpenNI/XnTypeManager.h b/Source/OpenNI/XnTypeManager.h
index 6392302..a62a55e 100644
--- a/Source/OpenNI/XnTypeManager.h
+++ b/Source/OpenNI/XnTypeManager.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -44,10 +44,10 @@ public:
 
 	XnStatus RegisterNewType(const XnChar* strName, XnProductionNodeType baseType, XnProductionNodeType* pNewType);
 
-	XnStatus GetTypeName(XnProductionNodeType type, const XnChar** pstrName);
-	XnStatus GetTypeByName(const XnChar* strName, XnProductionNodeType* pType);
-	XnStatus IsTypeDerivedFrom(XnProductionNodeType type, XnProductionNodeType base, XnBool* pbIsDerived);
-	XnStatus GetTypeHierarchy(XnProductionNodeType type, const XnBitSet*& pHierarchy);
+	XnStatus GetTypeName(XnProductionNodeType type, const XnChar** pstrName) const;
+	XnStatus GetTypeByName(const XnChar* strName, XnProductionNodeType* pType) const;
+	XnStatus IsTypeDerivedFrom(XnProductionNodeType type, XnProductionNodeType base, XnBool* pbIsDerived) const;
+	XnStatus GetTypeHierarchy(XnProductionNodeType type, const XnBitSet*& pHierarchy) const;
 
 private:
 	TypeManager();
diff --git a/Source/OpenNI/XnUSB.cpp b/Source/OpenNI/XnUSB.cpp
index 16ad6c5..04a6129 100644
--- a/Source/OpenNI/XnUSB.cpp
+++ b/Source/OpenNI/XnUSB.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/XnUSBInternal.h b/Source/OpenNI/XnUSBInternal.h
index 121c14f..54653ac 100644
--- a/Source/OpenNI/XnUSBInternal.h
+++ b/Source/OpenNI/XnUSBInternal.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/XnUtils.cpp b/Source/OpenNI/XnUtils.cpp
index 3aae706..b52e8af 100644
--- a/Source/OpenNI/XnUtils.cpp
+++ b/Source/OpenNI/XnUtils.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -458,5 +458,6 @@ XN_C_API XnStatus xnRegisterExtensionNode(const XnChar* strTypeName, XnProductio
 
 XN_C_API XnModuleNodeHandle xnGetModuleNodeHandle(XnNodeHandle hNode)
 {
+	XN_VALIDATE_PTR(hNode, NULL);
 	return hNode->pModuleInstance->hNode;
 }
diff --git a/Source/OpenNI/XnXml.cpp b/Source/OpenNI/XnXml.cpp
index 287739c..6dc603d 100644
--- a/Source/OpenNI/XnXml.cpp
+++ b/Source/OpenNI/XnXml.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -57,8 +57,6 @@ XnStatus xnXmlLoadDocument(TiXmlDocument& doc, const XnChar* strFileName)
 
 XnStatus xnXmlGetChildElement(const TiXmlElement* pElem, const XnChar* strName, const TiXmlElement** ppChild)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-	
 	*ppChild = pElem->FirstChildElement(strName);
 	if (*ppChild == NULL)
 	{
@@ -72,8 +70,6 @@ XnStatus xnXmlGetChildElement(const TiXmlElement* pElem, const XnChar* strName,
 
 XnStatus xnXmlReadStringAttribute(const TiXmlElement* pElem, const XnChar* strName, const XnChar** pstrValue)
 {
-	XnStatus nRetVal = XN_STATUS_OK;
-	
 	*pstrValue = pElem->Attribute(strName);
 	if (*pstrValue == NULL)
 	{
@@ -129,6 +125,64 @@ XnStatus xnXmlReadIntAttribute(const TiXmlElement* pElem, const XnChar* strName,
 	return (XN_STATUS_OK);
 }
 
+XnStatus xnXmlReadUInt32Attribute(const TiXmlElement* pElem, const XnChar* strName, XnUInt32* pnValue)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	const XnChar* strValue;
+	nRetVal = xnXmlReadStringAttribute(pElem, strName, &strValue);
+	XN_IS_STATUS_OK(nRetVal);
+
+	if (sscanf(strValue, "%u", pnValue) == 0)
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, 
+			"Invalid '%s' xml entry - '%s' attribute value should be a positive number (line %u, col %u)!", 
+			pElem->Value(), strName, pElem->Row(), pElem->Column());
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnXmlReadUInt16Attribute(const TiXmlElement* pElem, const XnChar* strName, XnUInt16* pnValue)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+	
+	XnUInt32 nValue;
+	nRetVal = xnXmlReadUInt32Attribute(pElem, strName, &nValue);
+	XN_IS_STATUS_OK(nRetVal);
+
+	if (nValue > XN_MAX_UINT16)
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_BAD_PARAM, XN_MASK_OPEN_NI, 
+			"Invalid '%s' xml entry - '%s' attribute value should be unsigned 16-bit number (line %u, col %u)!",
+			pElem->Value(), strName, pElem->Row(), pElem->Column());
+	}
+
+	*pnValue = (XnUInt16)nValue;
+	
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnXmlReadUInt8Attribute(const TiXmlElement* pElem, const XnChar* strName, XnUInt8* pnValue)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnUInt32 nValue;
+	nRetVal = xnXmlReadUInt32Attribute(pElem, strName, &nValue);
+	XN_IS_STATUS_OK(nRetVal);
+
+	if (nValue > XN_MAX_UINT8)
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_BAD_PARAM, XN_MASK_OPEN_NI, 
+			"Invalid '%s' xml entry - '%s' attribute value should be unsigned 8-bit number (line %u, col %u)!",
+			pElem->Value(), strName, pElem->Row(), pElem->Column());
+	}
+
+	*pnValue = (XnUInt8)nValue;
+
+	return (XN_STATUS_OK);
+}
+
 XnStatus xnXmlReadRealAttribute(const TiXmlElement* pElem, const XnChar* strName, XnDouble* pdValue)
 {
 	XnStatus nRetVal = XN_STATUS_OK;
diff --git a/Source/OpenNI/XnXml.h b/Source/OpenNI/XnXml.h
index debf1c1..01b74f9 100644
--- a/Source/OpenNI/XnXml.h
+++ b/Source/OpenNI/XnXml.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -41,6 +41,12 @@ XnStatus xnXmlReadBoolAttribute(const TiXmlElement* pElem, const XnChar* strName
 
 XnStatus xnXmlReadIntAttribute(const TiXmlElement* pElem, const XnChar* strName, XnInt* pnValue);
 
+XnStatus xnXmlReadUInt32Attribute(const TiXmlElement* pElem, const XnChar* strName, XnUInt32* pnValue);
+
+XnStatus xnXmlReadUInt16Attribute(const TiXmlElement* pElem, const XnChar* strName, XnUInt16* pnValue);
+
+XnStatus xnXmlReadUInt8Attribute(const TiXmlElement* pElem, const XnChar* strName, XnUInt8* pnValue);
+
 XnStatus xnXmlReadRealAttribute(const TiXmlElement* pElem, const XnChar* strName, XnDouble* pdValue);
 
 XnStatus xnXmlReadTextAsInt(const TiXmlElement* pElem, XnInt* pnValue);
diff --git a/Source/OpenNI/XnXmlConfig.cpp b/Source/OpenNI/XnXmlConfig.cpp
deleted file mode 100644
index b196cb2..0000000
--- a/Source/OpenNI/XnXmlConfig.cpp
+++ /dev/null
@@ -1,881 +0,0 @@
-/****************************************************************************
-*                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
-*  Copyright (C) 2011 PrimeSense Ltd.                                       *
-*                                                                           *
-*  This file is part of OpenNI.                                             *
-*                                                                           *
-*  OpenNI is free software: you can redistribute it and/or modify           *
-*  it under the terms of the GNU Lesser General Public License as published *
-*  by the Free Software Foundation, either version 3 of the License, or     *
-*  (at your option) any later version.                                      *
-*                                                                           *
-*  OpenNI is distributed in the hope that it will be useful,                *
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
-*  GNU Lesser General Public License for more details.                      *
-*                                                                           *
-*  You should have received a copy of the GNU Lesser General Public License *
-*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
-*                                                                           *
-****************************************************************************/
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include <XnOpenNI.h>
-#include "XnXml.h"
-#include <XnLog.h>
-#include <XnStringsHash.h>
-#include "XnLicensingInternal.h"
-
-//---------------------------------------------------------------------------
-// Code
-//---------------------------------------------------------------------------
-XnStatus xnXmlReadMapOutputMode(const TiXmlElement* pOpcode, XnMapOutputMode* pMapOutputMode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	XnInt nValue;
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "xRes", &nValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pMapOutputMode->nXRes = nValue;
-
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "yRes", &nValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pMapOutputMode->nYRes = nValue;
-
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "FPS", &nValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pMapOutputMode->nFPS = nValue;
-	
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnXmlReadWaveOutputMode(const TiXmlElement* pOpcode, XnWaveOutputMode* pWaveOutputMode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	XnInt nValue;
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "sampleRate", &nValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pWaveOutputMode->nSampleRate = nValue;
-
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "bitsPerSample", &nValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pWaveOutputMode->nBitsPerSample = nValue;
-
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "channels", &nValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pWaveOutputMode->nChannels = nValue;
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnXmlReadCropping(const TiXmlElement* pOpcode, XnCropping* pCropping)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	nRetVal = xnXmlReadBoolAttribute(pOpcode, "enabled", &pCropping->bEnabled);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	XnInt nValue;
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "xOffset", &nValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pCropping->nXOffset = nValue;
-
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "yOffset", &nValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pCropping->nYOffset = nValue;
-
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "xSize", &nValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pCropping->nXSize = nValue;
-
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "ySize", &nValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pCropping->nYSize = nValue;
-	
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnXmlReadVecotr3D(const TiXmlElement* pOpcode, XnVector3D* pVector)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	XnDouble dValue;
-	nRetVal = xnXmlReadRealAttribute(pOpcode, "x", &dValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pVector->X = (XnFloat)dValue;
-
-	nRetVal = xnXmlReadRealAttribute(pOpcode, "y", &dValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pVector->Y = (XnFloat)dValue;
-
-	nRetVal = xnXmlReadRealAttribute(pOpcode, "z", &dValue);
-	XN_IS_STATUS_OK(nRetVal);
-	pVector->Z = (XnFloat)dValue;
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnXmlReadBoundingBox3D(const TiXmlElement* pElem, XnBoundingBox3D* pBox)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	const TiXmlElement* pMin;
-	nRetVal = xnXmlGetChildElement(pElem, "Min", &pMin);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnXmlReadVecotr3D(pMin, &pBox->LeftBottomNear);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	const TiXmlElement* pMax;
-	nRetVal = xnXmlGetChildElement(pElem, "Max", &pMax);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnXmlReadVecotr3D(pMax, &pBox->RightTopFar);
-	XN_IS_STATUS_OK(nRetVal);
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnXmlReadUserPosition(const TiXmlElement* pOpcode, XnInt* pnIndex, XnBoundingBox3D* pUserPosition)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	nRetVal = xnXmlReadIntAttribute(pOpcode, "index", pnIndex);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnXmlReadBoundingBox3D(pOpcode, pUserPosition);
-	XN_IS_STATUS_OK(nRetVal);
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureMirror(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	XnBool bOn;
-	nRetVal = xnXmlReadBoolAttribute(pOpcode, "on", &bOn);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnSetMirror(hNode, bOn);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureMapOutputMode(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	XnMapOutputMode Mode;
-	nRetVal = xnXmlReadMapOutputMode(pOpcode, &Mode);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnSetMapOutputMode(hNode, &Mode);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureWaveOutputMode(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	XnWaveOutputMode Mode;
-	nRetVal = xnXmlReadWaveOutputMode(pOpcode, &Mode);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnSetWaveOutputMode(hNode, &Mode);
-	XN_IS_STATUS_OK(nRetVal);
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureCropping(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	XnCropping Cropping;
-	nRetVal = xnXmlReadCropping(pOpcode, &Cropping);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnSetCropping(hNode, &Cropping);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigurePixelFormat(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	XnPixelFormat format;
-	nRetVal = xnPixelFormatFromString(pOpcode->GetText(), &format);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnSetPixelFormat(hNode, format);
-	XN_IS_STATUS_OK(nRetVal);
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureUserPosition(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	XnInt nIndex;
-	XnBoundingBox3D UserPosition;
-	nRetVal = xnXmlReadUserPosition(pOpcode, &nIndex, &UserPosition);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnSetUserPosition(hNode, nIndex, &UserPosition);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureProperty(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	const XnChar* strName;
-	nRetVal = xnXmlReadStringAttribute(pOpcode, "name", &strName);
-	XN_IS_STATUS_OK(nRetVal);
-
-	const XnChar* strType;
-	nRetVal = xnXmlReadStringAttribute(pOpcode, "type", &strType);
-	XN_IS_STATUS_OK(nRetVal);
-
-	if (strcmp(strType, "int") == 0)
-	{
-		XnInt nValue;
-		nRetVal = xnXmlReadIntAttribute(pOpcode, "value", &nValue);
-		XN_IS_STATUS_OK(nRetVal);
-
-		nRetVal = xnSetIntProperty(hNode, strName, nValue);
-		XN_IS_STATUS_OK(nRetVal);
-	}
-	else if (strcmp(strType, "real") == 0)
-	{
-		XnDouble dValue;
-		nRetVal = xnXmlReadRealAttribute(pOpcode, "value", &dValue);
-		XN_IS_STATUS_OK(nRetVal);
-
-		nRetVal = xnSetRealProperty(hNode, strName, dValue);
-		XN_IS_STATUS_OK(nRetVal);
-	}
-	else if (strcmp(strType, "string") == 0)
-	{
-		const XnChar* strValue;
-		nRetVal = xnXmlReadStringAttribute(pOpcode, "value", &strValue);
-		XN_IS_STATUS_OK(nRetVal);
-
-		nRetVal = xnSetStringProperty(hNode, strName, strValue);
-		XN_IS_STATUS_OK(nRetVal);
-	}
-	else
-	{
-		XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Invalid property type: %s", strType);
-	}
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureFrameSync(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	XnContext* pContext = xnGetContextFromNodeHandle(hNode);
-	XnNodeHandle hOther = NULL;
-
-	nRetVal = xnGetNodeHandleByName(pContext, pOpcode->GetText(), &hOther);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnFrameSyncWith(hNode, hOther);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureAlternativeViewPoint(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	if (!xnIsCapabilitySupported(hNode, XN_CAPABILITY_ALTERNATIVE_VIEW_POINT))
-	{
-		return XN_STATUS_INVALID_OPERATION;
-	}
-
-	XnContext* pContext = xnGetContextFromNodeHandle(hNode);
-	XnNodeHandle hOther = NULL;
-
-	nRetVal = xnGetNodeHandleByName(pContext, pOpcode->GetText(), &hOther);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnSetViewPoint(hNode, hOther);
-	XN_IS_STATUS_OK(nRetVal);
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureRecorderDestination(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	XnRecordMedium medium = XN_RECORD_MEDIUM_FILE; // default
-
-	if (pOpcode->Attribute("medium") != NULL)
-	{
-		const XnChar* strMedium;
-		nRetVal = xnXmlReadStringAttribute(pOpcode, "medium", &strMedium);
-		XN_IS_STATUS_OK(nRetVal);
-
-		if (strcmp(strMedium, "File") == 0)
-		{
-			medium = XN_RECORD_MEDIUM_FILE;
-		}
-		else
-		{
-			XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Unknown recording medium: '%s'", strMedium);
-		}
-	}
-
-	const XnChar* strName;
-	nRetVal = xnXmlReadStringAttribute(pOpcode, "name", &strName);
-	XN_IS_STATUS_OK(nRetVal);
-
-	nRetVal = xnSetRecorderDestination(hNode, XN_RECORD_MEDIUM_FILE, strName);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureAddNodeToRecording(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	const XnChar* strName;
-	nRetVal = xnXmlReadStringAttribute(pOpcode, "name", &strName);
-	XN_IS_STATUS_OK(nRetVal);
-
-	const XnChar* strCodec;
-	nRetVal = xnXmlReadStringAttribute(pOpcode, "codec", &strCodec);
-	XN_IS_STATUS_OK(nRetVal);
-
-	// find node
-	XnContext* pContext = xnGetContextFromNodeHandle(hNode);
-	XnNodeHandle hOther = NULL;
-	nRetVal = xnGetNodeHandleByName(pContext, strName, &hOther);
-	XN_IS_STATUS_OK(nRetVal);
-
-	// find codec
-	if (strlen(strCodec) != sizeof(XnCodecID))
-	{
-		XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "'%s' is not a valid codec ID!", strCodec);
-	}
-
-	XnCodecID codecID;
-	xnOSMemCopy(&codecID, strCodec, sizeof(codecID));
-
-	nRetVal = xnAddNodeToRecording(hNode, hOther, codecID);
-	XN_IS_STATUS_OK(nRetVal);
-	
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureSetOpcode(XnNodeHandle hNode, const TiXmlElement* pOpcode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	const XnChar* strOpcode = pOpcode->Value();
-
-	if (strcmp(strOpcode, "Mirror") == 0)
-	{
-		return xnConfigureMirror(hNode, pOpcode);
-	}
-	else if (strcmp(strOpcode, "MapOutputMode") == 0)
-	{
-		return xnConfigureMapOutputMode(hNode, pOpcode);
-	}
-	else if (strcmp(strOpcode, "WaveOutputMode") == 0)
-	{
-		return xnConfigureWaveOutputMode(hNode, pOpcode);
-	}
-	else if (strcmp(strOpcode, "Cropping") == 0)
-	{
-		return xnConfigureCropping(hNode, pOpcode);
-	}
-	else if (strcmp(strOpcode, "PixelFormat") == 0)
-	{
-		return xnConfigurePixelFormat(hNode, pOpcode);
-	}
-	else if (strcmp(strOpcode, "UserPosition") == 0)
-	{
-		return xnConfigureUserPosition(hNode, pOpcode);
-	}
-	else if (strcmp(strOpcode, "Property") == 0)
-	{
-		return xnConfigureProperty(hNode, pOpcode);
-	}
-	else if (strcmp(strOpcode, "FrameSync") == 0)
-	{
-		return xnConfigureFrameSync(hNode, pOpcode);
-	}
-	else if (strcmp(strOpcode, "AlternativeViewPoint") == 0)
-	{
-		return xnConfigureAlternativeViewPoint(hNode, pOpcode);
-	}
-	else if (strcmp(strOpcode, "RecorderDestination") == 0)
-	{
-		return xnConfigureRecorderDestination(hNode, pOpcode);
-	}
-	else if (strcmp(strOpcode, "AddNodeToRecording") == 0)
-	{
-		return xnConfigureAddNodeToRecording(hNode, pOpcode);
-	}
-	else
-	{
-		XN_LOG_WARNING_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Invalid configuration option: %s", strOpcode);
-	}
-	
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureNodeFromXml(XnNodeHandle hNode, const TiXmlElement* pNode)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	const TiXmlElement* pConfig = pNode->FirstChildElement("Configuration");
-	if (pConfig == NULL)
-	{
-		return (XN_STATUS_OK);
-	}
-
-	XnBool bLock = FALSE;
-	const XnChar* strLock = pConfig->Attribute("lock");
-	if (strLock != NULL)
-	{
-		xnXmlReadBoolAttribute(pConfig, "lock", &bLock);
-	}
-
-	XnLockHandle hLock;
-
-	if (bLock)
-	{
-		nRetVal = xnLockNodeForChanges(hNode, &hLock);
-		XN_IS_STATUS_OK(nRetVal);
-
-		nRetVal = xnLockedNodeStartChanges(hNode, hLock);
-		XN_IS_STATUS_OK(nRetVal);
-	}
-
-	const TiXmlElement* pOpcode = pConfig->FirstChildElement();
-	while (pOpcode != NULL)
-	{
-		nRetVal = xnConfigureSetOpcode(hNode, pOpcode);
-		XN_IS_STATUS_OK(nRetVal);
-
-		pOpcode = pOpcode->NextSiblingElement();
-	}
-
-	if (bLock)
-	{
-		nRetVal = xnLockedNodeEndChanges(hNode, hLock);
-	}
-
-	return (XN_STATUS_OK);
-}
-
-static XnBool xnVersionGetNext(XnChar* strCurrent, XnChar** pstrNext)
-{
-	XnChar* strPoint = strchr(strCurrent, '.');
-	if (strPoint == NULL)
-	{
-		return FALSE;
-	}
-
-	*strPoint = '\0';
-	*pstrNext = strPoint + 1;
-
-	return TRUE;
-}
-
-XnBool xnReadVersionFromString(const XnChar* strVersion, XnVersion* pVersion)
-{
-	XnChar csVersion[XN_MAX_NAME_LENGTH];
-	strcpy(csVersion, strVersion);
-
-	XnChar* strMajor = csVersion;
-	XnChar* strMinor;
-	XnChar* strMaintenance;
-	XnChar* strBuild;
-
-	if (xnVersionGetNext(strMajor, &strMinor) &&
-		xnVersionGetNext(strMinor, &strMaintenance) &&
-		xnVersionGetNext(strMaintenance, &strBuild))
-	{
-		if (0 == sscanf(strMajor, "%hhu", &pVersion->nMajor) ||
-			0 == sscanf(strMinor, "%hhu", &pVersion->nMinor) ||
-			0 == sscanf(strMaintenance, "%hu", &pVersion->nMaintenance) ||
-			0 == sscanf(strBuild, "%u", &pVersion->nBuild))
-		{
-			return FALSE;
-		}
-	}
-	else
-	{
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-XnStatus xnReadVersionFromXml(const TiXmlElement* pElem, XnVersion* pVersion)
-{
-	if (!xnReadVersionFromString(pElem->GetText(), pVersion))
-	{
-		XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI,
-			"Invalid '%s' xml entry - version string is not legal (line %u, col %u)!",
-			pElem->Value(), pElem->Row(), pElem->Column());
-	}
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnXmlReadQuery(const TiXmlElement* pQueryElem, XnNodeQuery* pQuery)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	// vendor
-	const TiXmlElement* pVendor = pQueryElem->FirstChildElement("Vendor");
-	if (pVendor != NULL)
-	{
-		xnNodeQuerySetVendor(pQuery, pVendor->GetText());
-	}
-
-	// name
-	const TiXmlElement* pName = pQueryElem->FirstChildElement("Name");
-	if (pName != NULL)
-	{
-		xnNodeQuerySetName(pQuery, pName->GetText());
-	}
-
-	// Min version
-	const TiXmlElement* pMinVersion = pQueryElem->FirstChildElement("MinVersion");
-	if (pMinVersion != NULL)
-	{
-		XnVersion minVersion;
-		nRetVal = xnReadVersionFromXml(pMinVersion, &minVersion);
-		XN_IS_STATUS_OK(nRetVal);
-
-		xnNodeQuerySetMinVersion(pQuery, &minVersion);
-	}
-
-	// Max version
-	const TiXmlElement* pMaxVersion = pQueryElem->FirstChildElement("MaxVersion");
-	if (pMaxVersion != NULL)
-	{
-		XnVersion maxVersion;
-		nRetVal = xnReadVersionFromXml(pMaxVersion, &maxVersion);
-		XN_IS_STATUS_OK(nRetVal);
-
-		xnNodeQuerySetMaxVersion(pQuery, &maxVersion);
-	}
-
-	// Capabilities
-	const TiXmlElement* pCapabilities = pQueryElem->FirstChildElement("Capabilities");
-	if (pCapabilities != NULL)
-	{
-		const TiXmlElement* pCap = pCapabilities->FirstChildElement("Capability");
-		while (pCap != NULL)
-		{
-			xnNodeQueryAddSupportedCapability(pQuery, pCap->GetText());
-			pCap = pCap->NextSiblingElement("Capability");
-		}
-	}
-
-	// Map Output Modes
-	const TiXmlElement* pOutputModes = pQueryElem->FirstChildElement("MapOutputModes");
-	if (pOutputModes != NULL)
-	{
-		const TiXmlElement* pMode = pOutputModes->FirstChildElement("MapOutputMode");
-		while (pMode != NULL)
-		{
-			XnMapOutputMode Mode;
-			nRetVal = xnXmlReadMapOutputMode(pMode, &Mode);
-			XN_IS_STATUS_OK(nRetVal);
-
-			xnNodeQueryAddSupportedMapOutputMode(pQuery, &Mode);
-
-			pMode = pMode->NextSiblingElement("MapOutputMode");
-		}
-	}
-
-	// Min User Position
-	const TiXmlElement* pMinUserPositions = pQueryElem->FirstChildElement("MinUserPositions");
-	if (pMinUserPositions != NULL)
-	{
-		XnInt nMinUserPositions;
-		nRetVal = xnXmlReadTextAsInt(pMinUserPositions, &nMinUserPositions);
-		XN_IS_STATUS_OK(nRetVal);
-
-		xnNodeQuerySetSupportedMinUserPositions(pQuery, nMinUserPositions);
-	}
-
-	// Needed Nodes
-	const TiXmlElement* pNeededNodes = pQueryElem->FirstChildElement("NeededNodes");
-	if (pNeededNodes != NULL)
-	{
-		const TiXmlElement* pNode = pNeededNodes->FirstChildElement("Node");
-		while (pNode != NULL)
-		{
-			xnNodeQueryAddNeededNode(pQuery, pNode->GetText());
-
-			pNode = pNode->NextSiblingElement("Node");
-		}
-	}
-
-	// Creation info
-	const TiXmlElement* pCreationInfo = pQueryElem->FirstChildElement("CreationInfo");
-	if (pCreationInfo != NULL)
-	{
-		xnNodeQuerySetCreationInfo(pQuery, pCreationInfo->GetText());
-	}
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus xnConfigureCreateNodes(XnContext* pContext, const TiXmlElement* pRootElem, XnEnumerationErrors* pErrors)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	const TiXmlElement* pProudctionNodes = pRootElem->FirstChildElement("ProductionNodes");
-	if (pProudctionNodes == NULL)
-	{
-		return (XN_STATUS_OK);
-	}
-
-	// global mirror
-	const TiXmlElement* pGlobalMirror = pProudctionNodes->FirstChildElement("GlobalMirror");
-	if (pGlobalMirror != NULL)
-	{
-		XnBool bOn;
-		nRetVal = xnXmlReadBoolAttribute(pGlobalMirror, "on", &bOn);
-		XN_IS_STATUS_OK(nRetVal);
-
-		nRetVal = xnSetGlobalMirror(pContext, bOn);
-		XN_IS_STATUS_OK(nRetVal);
-	}
-
-	// file recordings
-	const TiXmlElement* pRecording = pProudctionNodes->FirstChildElement("Recording");
-	if (pRecording != NULL)
-	{
-		const XnChar* strFileName;
-		nRetVal = xnXmlReadStringAttribute(pRecording, "file", &strFileName);
-		XN_IS_STATUS_OK(nRetVal);
-
-		xnLogVerbose(XN_MASK_OPEN_NI, "Opening file recording '%s'...", strFileName);
-
-		nRetVal = xnContextOpenFileRecording(pContext, strFileName);
-		XN_IS_STATUS_OK(nRetVal);
-
-		XnNodeHandle hPlayer;
-		nRetVal = xnFindExistingNodeByType(pContext, XN_NODE_TYPE_PLAYER, &hPlayer);
-		XN_IS_STATUS_OK(nRetVal);
-
-		XnDouble dSpeed = 1.0;
-		if (NULL != pRecording->Attribute("playbackSpeed", &dSpeed))
-		{
-			nRetVal = xnSetPlaybackSpeed(hPlayer, dSpeed);
-			XN_IS_STATUS_OK(nRetVal);
-		}
-
-		const XnChar* REPEAT = "repeat";
-		if (NULL != pRecording->Attribute(REPEAT))
-		{
-			XnBool bRepeat;
-			nRetVal = xnXmlReadBoolAttribute(pRecording, REPEAT, &bRepeat);
-			XN_IS_STATUS_OK(nRetVal);
-
-			nRetVal = xnSetPlayerRepeat(hPlayer, bRepeat);
-			XN_IS_STATUS_OK(nRetVal);
-		}
-	}
-
-	const XnChar* strNodeTagName = "Node";
-	const XnChar* strStartGeneratingAttr = "startGenerating";
-
-	XnBool bStartGeneratingAll = TRUE;
-	if (NULL != pProudctionNodes->Attribute(strStartGeneratingAttr))
-	{
-		nRetVal = xnXmlReadBoolAttribute(pProudctionNodes, strStartGeneratingAttr, &bStartGeneratingAll);
-		XN_IS_STATUS_OK(nRetVal);
-	}
-
-	// new nodes
-	const TiXmlElement* pNode = pProudctionNodes->FirstChildElement(strNodeTagName);
-	while (pNode != NULL)
-	{
-		// get type
-		const XnChar* strType;
-		nRetVal = xnXmlReadStringAttribute(pNode, "type", &strType);
-		XN_IS_STATUS_OK(nRetVal);
-
-		// check stopOnError status
-		XnBool bStopOnError = TRUE;
-		if (NULL != pNode->Attribute("stopOnError"))
-		{
-			nRetVal = xnXmlReadBoolAttribute(pNode, "stopOnError", &bStopOnError);
-			XN_IS_STATUS_OK(nRetVal);
-		}
-
-		xnLogVerbose(XN_MASK_OPEN_NI, "Requested to create a node of type %s%s...", strType, bStopOnError ? "" : " (StopOnError=FALSE)");
-
-		XnProductionNodeType Type;
-		nRetVal = xnProductionNodeTypeFromString(strType, &Type);
-		XN_IS_STATUS_OK(nRetVal);
-
-		// check if there is a query
-		XnNodeQuery* pQuery = NULL;
-		const TiXmlElement* pQueryElem = pNode->FirstChildElement("Query");
-		if (pQueryElem != NULL)
-		{
-			nRetVal = xnNodeQueryAllocate(&pQuery);
-			XN_IS_STATUS_OK(nRetVal);
-
-			nRetVal = xnXmlReadQuery(pQueryElem, pQuery);
-			XN_IS_STATUS_OK(nRetVal);
-		}
-
-		// enumerate
-		XnNodeInfoList* pTrees;
-		nRetVal = xnEnumerateProductionTrees(pContext, Type, pQuery, &pTrees, pErrors);
-		if (nRetVal == XN_STATUS_NO_NODE_PRESENT && !bStopOnError)
-		{
-			// go to next one
-			pNode = pNode->NextSiblingElement(strNodeTagName);
-			continue;
-		}
-		XN_IS_STATUS_OK(nRetVal);
-
-		if (pQuery != NULL)
-		{
-			xnNodeQueryFree(pQuery);
-			pQuery = NULL;
-		}
-
-		// choose first one
-		XnNodeInfoListIterator itChosen = xnNodeInfoListGetFirst(pTrees);
-		XnNodeInfo* pChosenInfo = xnNodeInfoListGetCurrent(itChosen);
-
-		// check if a name was requested
-		if (NULL != pNode->Attribute("name"))
-		{
-			const XnChar* strName = NULL;
-			nRetVal = xnXmlReadStringAttribute(pNode, "name", &strName);
-			if (nRetVal != XN_STATUS_OK)
-			{
-				xnNodeInfoListFree(pTrees);
-				return (nRetVal);
-			}
-
-			nRetVal = xnNodeInfoSetInstanceName(pChosenInfo, strName);
-			if (nRetVal != XN_STATUS_OK)
-			{
-				xnNodeInfoListFree(pTrees);
-				return (nRetVal);
-			}
-		}
-
-		// create it
-		XnNodeHandle hNode;
-		nRetVal = xnCreateProductionTree(pContext, pChosenInfo, &hNode);
-		if (nRetVal != XN_STATUS_OK)
-		{
-			xnNodeInfoListFree(pTrees);
-			return (nRetVal);
-		}
-
-		// free the list
-		xnNodeInfoListFree(pTrees);
-
-		// config it
-		nRetVal = xnConfigureNodeFromXml(hNode, pNode);
-		XN_IS_STATUS_OK(nRetVal);
-
-		// check if we need to start it (if start generating all is on, it will be started at the end)
-		XnBool bStart = FALSE;
-		if (!bStartGeneratingAll)
-		{
-			if (NULL != pNode->Attribute(strStartGeneratingAttr))
-			{
-				nRetVal = xnXmlReadBoolAttribute(pNode, strStartGeneratingAttr, &bStart);
-				XN_IS_STATUS_OK(nRetVal);
-			}
-
-			if (bStart)
-			{
-				nRetVal = xnStartGenerating(hNode);
-				XN_IS_STATUS_OK(nRetVal);
-			}
-		}
-
-		pNode = pNode->NextSiblingElement(strNodeTagName);
-	}
-
-	// start generating all
-	if (bStartGeneratingAll)
-	{
-		nRetVal = xnStartGeneratingAll(pContext);
-		XN_IS_STATUS_OK(nRetVal);
-	}
-
-	return (XN_STATUS_OK);
-}
-
-XnStatus RunXmlScriptImpl(XnContext* pContext, TiXmlDocument* pDoc, XnEnumerationErrors* pErrors)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-	
-	TiXmlElement* pRootElem = pDoc->RootElement();
-	if (pRootElem != NULL)
-	{
-		nRetVal = xnLoadLicensesFromXml(pContext, pRootElem);
-		XN_IS_STATUS_OK(nRetVal);
-
-		nRetVal = xnConfigureCreateNodes(pContext, pRootElem, pErrors);
-		XN_IS_STATUS_OK(nRetVal);
-	}
-	
-	return (XN_STATUS_OK);
-}
-
-XN_C_API XnStatus xnContextRunXmlScriptFromFile(XnContext* pContext, const XnChar* strFileName, XnEnumerationErrors* pErrors)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	TiXmlDocument doc;
-	nRetVal = xnXmlLoadDocument(doc, strFileName);
-	XN_IS_STATUS_OK(nRetVal);
-
-	return RunXmlScriptImpl(pContext, &doc, pErrors);
-}
-
-XN_C_API XnStatus xnContextRunXmlScript(XnContext* pContext, const XnChar* xmlScript, XnEnumerationErrors* pErrors)
-{
-	XnStatus nRetVal = XN_STATUS_OK;
-
-	TiXmlDocument doc;
-	if (!doc.Parse(xmlScript))
-	{
-		XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI,
-			"Failed loading xml: %s [row %d, column %d]",
-			doc.ErrorDesc(), doc.ErrorRow(), doc.ErrorCol());
-	}
-
-	return RunXmlScriptImpl(pContext, &doc, pErrors);
-}
diff --git a/Source/OpenNI/XnXmlScriptNode.cpp b/Source/OpenNI/XnXmlScriptNode.cpp
new file mode 100644
index 0000000..13cd798
--- /dev/null
+++ b/Source/OpenNI/XnXmlScriptNode.cpp
@@ -0,0 +1,952 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnXmlScriptNode.h"
+#include <XnLog.h>
+#include <XnStringsHash.h>
+#include "XnLicensingInternal.h"
+#include <XnOSCpp.h>
+#include "XnInternalTypes.h"
+#include "XnTypeManager.h"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+XnStatus xnXmlReadMapOutputMode(const TiXmlElement* pOpcode, XnMapOutputMode* pMapOutputMode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	nRetVal = xnXmlReadUInt32Attribute(pOpcode, "xRes", &pMapOutputMode->nXRes);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadUInt32Attribute(pOpcode, "yRes", &pMapOutputMode->nYRes);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadUInt32Attribute(pOpcode, "FPS", &pMapOutputMode->nFPS);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnXmlReadWaveOutputMode(const TiXmlElement* pOpcode, XnWaveOutputMode* pWaveOutputMode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	nRetVal = xnXmlReadUInt32Attribute(pOpcode, "sampleRate", &pWaveOutputMode->nSampleRate);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadUInt16Attribute(pOpcode, "bitsPerSample", &pWaveOutputMode->nBitsPerSample);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadUInt8Attribute(pOpcode, "channels", &pWaveOutputMode->nChannels);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnXmlReadCropping(const TiXmlElement* pOpcode, XnCropping* pCropping)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	nRetVal = xnXmlReadBoolAttribute(pOpcode, "enabled", &pCropping->bEnabled);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadUInt16Attribute(pOpcode, "xOffset", &pCropping->nXOffset);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadUInt16Attribute(pOpcode, "yOffset", &pCropping->nYOffset);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadUInt16Attribute(pOpcode, "xSize", &pCropping->nXSize);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadUInt16Attribute(pOpcode, "ySize", &pCropping->nYSize);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnXmlReadVecotr3D(const TiXmlElement* pOpcode, XnVector3D* pVector)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnDouble dValue;
+	nRetVal = xnXmlReadRealAttribute(pOpcode, "x", &dValue);
+	XN_IS_STATUS_OK(nRetVal);
+	pVector->X = (XnFloat)dValue;
+
+	nRetVal = xnXmlReadRealAttribute(pOpcode, "y", &dValue);
+	XN_IS_STATUS_OK(nRetVal);
+	pVector->Y = (XnFloat)dValue;
+
+	nRetVal = xnXmlReadRealAttribute(pOpcode, "z", &dValue);
+	XN_IS_STATUS_OK(nRetVal);
+	pVector->Z = (XnFloat)dValue;
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnXmlReadBoundingBox3D(const TiXmlElement* pElem, XnBoundingBox3D* pBox)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	const TiXmlElement* pMin;
+	nRetVal = xnXmlGetChildElement(pElem, "Min", &pMin);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadVecotr3D(pMin, &pBox->LeftBottomNear);
+	XN_IS_STATUS_OK(nRetVal);
+
+	const TiXmlElement* pMax;
+	nRetVal = xnXmlGetChildElement(pElem, "Max", &pMax);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadVecotr3D(pMax, &pBox->RightTopFar);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnXmlReadUserPosition(const TiXmlElement* pOpcode, XnInt* pnIndex, XnBoundingBox3D* pUserPosition)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	nRetVal = xnXmlReadIntAttribute(pOpcode, "index", pnIndex);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnXmlReadBoundingBox3D(pOpcode, pUserPosition);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureMirror(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnBool bOn;
+	nRetVal = xnXmlReadBoolAttribute(pOpcode, "on", &bOn);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnSetMirror(hNode, bOn);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureMapOutputMode(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnMapOutputMode Mode;
+	nRetVal = xnXmlReadMapOutputMode(pOpcode, &Mode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnSetMapOutputMode(hNode, &Mode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureWaveOutputMode(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnWaveOutputMode Mode;
+	nRetVal = xnXmlReadWaveOutputMode(pOpcode, &Mode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnSetWaveOutputMode(hNode, &Mode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureCropping(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnCropping Cropping;
+	nRetVal = xnXmlReadCropping(pOpcode, &Cropping);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnSetCropping(hNode, &Cropping);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigurePixelFormat(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnPixelFormat format;
+	nRetVal = xnPixelFormatFromString(pOpcode->GetText(), &format);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnSetPixelFormat(hNode, format);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureUserPosition(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnInt nIndex;
+	XnBoundingBox3D UserPosition;
+	nRetVal = xnXmlReadUserPosition(pOpcode, &nIndex, &UserPosition);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnSetUserPosition(hNode, nIndex, &UserPosition);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureProperty(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	const XnChar* strName;
+	nRetVal = xnXmlReadStringAttribute(pOpcode, "name", &strName);
+	XN_IS_STATUS_OK(nRetVal);
+
+	const XnChar* strType;
+	nRetVal = xnXmlReadStringAttribute(pOpcode, "type", &strType);
+	XN_IS_STATUS_OK(nRetVal);
+
+	if (strcmp(strType, "int") == 0)
+	{
+		XnInt nValue;
+		nRetVal = xnXmlReadIntAttribute(pOpcode, "value", &nValue);
+		XN_IS_STATUS_OK(nRetVal);
+
+		nRetVal = xnSetIntProperty(hNode, strName, nValue);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnLogError(XN_MASK_OPEN_NI, "Failed to set property '%s' from xml: %s", strName, xnGetStatusString(nRetVal));
+			return nRetVal;
+		}
+	}
+	else if (strcmp(strType, "real") == 0)
+	{
+		XnDouble dValue;
+		nRetVal = xnXmlReadRealAttribute(pOpcode, "value", &dValue);
+		XN_IS_STATUS_OK(nRetVal);
+
+		nRetVal = xnSetRealProperty(hNode, strName, dValue);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnLogError(XN_MASK_OPEN_NI, "Failed to set property '%s' from xml: %s", strName, xnGetStatusString(nRetVal));
+			return nRetVal;
+		}
+	}
+	else if (strcmp(strType, "string") == 0)
+	{
+		const XnChar* strValue;
+		nRetVal = xnXmlReadStringAttribute(pOpcode, "value", &strValue);
+		XN_IS_STATUS_OK(nRetVal);
+
+		nRetVal = xnSetStringProperty(hNode, strName, strValue);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnLogError(XN_MASK_OPEN_NI, "Failed to set property '%s' from xml: %s", strName, xnGetStatusString(nRetVal));
+			return nRetVal;
+		}
+	}
+	else
+	{
+		XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Invalid property type: %s", strType);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureFrameSync(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnContext* pContext = hNode->pContext;
+	XnNodeHandle hOther = NULL;
+
+	nRetVal = xnGetRefNodeHandleByName(pContext, pOpcode->GetText(), &hOther);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnFrameSyncWith(hNode, hOther);
+	xnProductionNodeRelease(hOther);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureAlternativeViewPoint(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	if (!xnIsCapabilitySupported(hNode, XN_CAPABILITY_ALTERNATIVE_VIEW_POINT))
+	{
+		return XN_STATUS_INVALID_OPERATION;
+	}
+
+	XnContext* pContext = hNode->pContext;
+	XnNodeHandle hOther = NULL;
+
+	nRetVal = xnGetRefNodeHandleByName(pContext, pOpcode->GetText(), &hOther);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnSetViewPoint(hNode, hOther);
+	xnProductionNodeRelease(hOther);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureRecorderDestination(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	XnRecordMedium medium = XN_RECORD_MEDIUM_FILE; // default
+
+	if (pOpcode->Attribute("medium") != NULL)
+	{
+		const XnChar* strMedium;
+		nRetVal = xnXmlReadStringAttribute(pOpcode, "medium", &strMedium);
+		XN_IS_STATUS_OK(nRetVal);
+
+		if (strcmp(strMedium, "File") == 0)
+		{
+			medium = XN_RECORD_MEDIUM_FILE;
+		}
+		else
+		{
+			XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Unknown recording medium: '%s'", strMedium);
+		}
+	}
+
+	const XnChar* strName;
+	nRetVal = xnXmlReadStringAttribute(pOpcode, "name", &strName);
+	XN_IS_STATUS_OK(nRetVal);
+
+	nRetVal = xnSetRecorderDestination(hNode, XN_RECORD_MEDIUM_FILE, strName);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureAddNodeToRecording(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	const XnChar* strName;
+	nRetVal = xnXmlReadStringAttribute(pOpcode, "name", &strName);
+	XN_IS_STATUS_OK(nRetVal);
+
+	const XnChar* strCodec;
+	nRetVal = xnXmlReadStringAttribute(pOpcode, "codec", &strCodec);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// find node
+	XnContext* pContext = hNode->pContext;
+	XnNodeHandle hOther = NULL;
+	nRetVal = xnGetRefNodeHandleByName(pContext, strName, &hOther);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// find codec
+	if (strlen(strCodec) != sizeof(XnCodecID))
+	{
+		xnProductionNodeRelease(hOther);
+		XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "'%s' is not a valid codec ID!", strCodec);
+	}
+
+	XnCodecID codecID;
+	xnOSMemCopy(&codecID, strCodec, sizeof(codecID));
+
+	nRetVal = xnAddNodeToRecording(hNode, hOther, codecID);
+	xnProductionNodeRelease(hOther);
+	XN_IS_STATUS_OK(nRetVal);
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureSetOpcode(XnNodeHandle hNode, const TiXmlElement* pOpcode)
+{
+	const XnChar* strOpcode = pOpcode->Value();
+
+	if (strcmp(strOpcode, "Mirror") == 0)
+	{
+		return xnConfigureMirror(hNode, pOpcode);
+	}
+	else if (strcmp(strOpcode, "MapOutputMode") == 0)
+	{
+		return xnConfigureMapOutputMode(hNode, pOpcode);
+	}
+	else if (strcmp(strOpcode, "WaveOutputMode") == 0)
+	{
+		return xnConfigureWaveOutputMode(hNode, pOpcode);
+	}
+	else if (strcmp(strOpcode, "Cropping") == 0)
+	{
+		return xnConfigureCropping(hNode, pOpcode);
+	}
+	else if (strcmp(strOpcode, "PixelFormat") == 0)
+	{
+		return xnConfigurePixelFormat(hNode, pOpcode);
+	}
+	else if (strcmp(strOpcode, "UserPosition") == 0)
+	{
+		return xnConfigureUserPosition(hNode, pOpcode);
+	}
+	else if (strcmp(strOpcode, "Property") == 0)
+	{
+		return xnConfigureProperty(hNode, pOpcode);
+	}
+	else if (strcmp(strOpcode, "FrameSync") == 0)
+	{
+		return xnConfigureFrameSync(hNode, pOpcode);
+	}
+	else if (strcmp(strOpcode, "AlternativeViewPoint") == 0)
+	{
+		return xnConfigureAlternativeViewPoint(hNode, pOpcode);
+	}
+	else if (strcmp(strOpcode, "RecorderDestination") == 0)
+	{
+		return xnConfigureRecorderDestination(hNode, pOpcode);
+	}
+	else if (strcmp(strOpcode, "AddNodeToRecording") == 0)
+	{
+		return xnConfigureAddNodeToRecording(hNode, pOpcode);
+	}
+	else
+	{
+		XN_LOG_WARNING_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "Invalid configuration option: %s", strOpcode);
+	}
+}
+
+XnStatus xnConfigureNodeFromXml(XnNodeHandle hNode, const TiXmlElement* pNode)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	const TiXmlElement* pConfig = pNode->FirstChildElement("Configuration");
+	if (pConfig == NULL)
+	{
+		return (XN_STATUS_OK);
+	}
+
+	XnBool bLock = FALSE;
+	const XnChar* strLock = pConfig->Attribute("lock");
+	if (strLock != NULL)
+	{
+		xnXmlReadBoolAttribute(pConfig, "lock", &bLock);
+	}
+
+	XnLockHandle hLock = 0;
+
+	if (bLock)
+	{
+		nRetVal = xnLockNodeForChanges(hNode, &hLock);
+		XN_IS_STATUS_OK(nRetVal);
+
+		nRetVal = xnLockedNodeStartChanges(hNode, hLock);
+		XN_IS_STATUS_OK(nRetVal);
+	}
+
+	const TiXmlElement* pOpcode = pConfig->FirstChildElement();
+	while (pOpcode != NULL)
+	{
+		nRetVal = xnConfigureSetOpcode(hNode, pOpcode);
+		XN_IS_STATUS_OK(nRetVal);
+
+		pOpcode = pOpcode->NextSiblingElement();
+	}
+
+	if (bLock)
+	{
+		nRetVal = xnLockedNodeEndChanges(hNode, hLock);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+static XnBool xnVersionGetNext(XnChar* strCurrent, XnChar** pstrNext)
+{
+	XnChar* strPoint = strchr(strCurrent, '.');
+	if (strPoint == NULL)
+	{
+		return FALSE;
+	}
+
+	*strPoint = '\0';
+	*pstrNext = strPoint + 1;
+
+	return TRUE;
+}
+
+XnBool xnReadVersionFromString(const XnChar* strVersion, XnVersion* pVersion)
+{
+	XnChar csVersion[XN_MAX_NAME_LENGTH];
+	strcpy(csVersion, strVersion);
+
+	XnChar* strMajor = csVersion;
+	XnChar* strMinor;
+	XnChar* strMaintenance;
+	XnChar* strBuild;
+
+	if (xnVersionGetNext(strMajor, &strMinor) &&
+		xnVersionGetNext(strMinor, &strMaintenance) &&
+		xnVersionGetNext(strMaintenance, &strBuild))
+	{
+		if (0 == sscanf(strMajor, "%hhu", &pVersion->nMajor) ||
+			0 == sscanf(strMinor, "%hhu", &pVersion->nMinor) ||
+			0 == sscanf(strMaintenance, "%hu", &pVersion->nMaintenance) ||
+			0 == sscanf(strBuild, "%u", &pVersion->nBuild))
+		{
+			return FALSE;
+		}
+	}
+	else
+	{
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+XnStatus xnReadVersionFromXml(const TiXmlElement* pElem, XnVersion* pVersion)
+{
+	if (!xnReadVersionFromString(pElem->GetText(), pVersion))
+	{
+		XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI,
+			"Invalid '%s' xml entry - version string is not legal (line %u, col %u)!",
+			pElem->Value(), pElem->Row(), pElem->Column());
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnXmlReadQuery(const TiXmlElement* pQueryElem, XnNodeQuery* pQuery)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	// vendor
+	const TiXmlElement* pVendor = pQueryElem->FirstChildElement("Vendor");
+	if (pVendor != NULL)
+	{
+		xnNodeQuerySetVendor(pQuery, pVendor->GetText());
+	}
+
+	// name
+	const TiXmlElement* pName = pQueryElem->FirstChildElement("Name");
+	if (pName != NULL)
+	{
+		xnNodeQuerySetName(pQuery, pName->GetText());
+	}
+
+	// Min version
+	const TiXmlElement* pMinVersion = pQueryElem->FirstChildElement("MinVersion");
+	if (pMinVersion != NULL)
+	{
+		XnVersion minVersion;
+		nRetVal = xnReadVersionFromXml(pMinVersion, &minVersion);
+		XN_IS_STATUS_OK(nRetVal);
+
+		xnNodeQuerySetMinVersion(pQuery, &minVersion);
+	}
+
+	// Max version
+	const TiXmlElement* pMaxVersion = pQueryElem->FirstChildElement("MaxVersion");
+	if (pMaxVersion != NULL)
+	{
+		XnVersion maxVersion;
+		nRetVal = xnReadVersionFromXml(pMaxVersion, &maxVersion);
+		XN_IS_STATUS_OK(nRetVal);
+
+		xnNodeQuerySetMaxVersion(pQuery, &maxVersion);
+	}
+
+	// Capabilities
+	const TiXmlElement* pCapabilities = pQueryElem->FirstChildElement("Capabilities");
+	if (pCapabilities != NULL)
+	{
+		const TiXmlElement* pCap = pCapabilities->FirstChildElement("Capability");
+		while (pCap != NULL)
+		{
+			xnNodeQueryAddSupportedCapability(pQuery, pCap->GetText());
+			pCap = pCap->NextSiblingElement("Capability");
+		}
+	}
+
+	// Map Output Modes
+	const TiXmlElement* pOutputModes = pQueryElem->FirstChildElement("MapOutputModes");
+	if (pOutputModes != NULL)
+	{
+		const TiXmlElement* pMode = pOutputModes->FirstChildElement("MapOutputMode");
+		while (pMode != NULL)
+		{
+			XnMapOutputMode Mode;
+			nRetVal = xnXmlReadMapOutputMode(pMode, &Mode);
+			XN_IS_STATUS_OK(nRetVal);
+
+			xnNodeQueryAddSupportedMapOutputMode(pQuery, &Mode);
+
+			pMode = pMode->NextSiblingElement("MapOutputMode");
+		}
+	}
+
+	// Min User Position
+	const TiXmlElement* pMinUserPositions = pQueryElem->FirstChildElement("MinUserPositions");
+	if (pMinUserPositions != NULL)
+	{
+		XnInt nMinUserPositions;
+		nRetVal = xnXmlReadTextAsInt(pMinUserPositions, &nMinUserPositions);
+		XN_IS_STATUS_OK(nRetVal);
+
+		xnNodeQuerySetSupportedMinUserPositions(pQuery, nMinUserPositions);
+	}
+
+	// Existing Node Only
+	XnBool bExistingOnly = FALSE;
+	const TiXmlElement* pExistingOnly = pQueryElem->FirstChildElement("ExistingNodeOnly");
+	if (pExistingOnly != NULL)
+	{
+		xnNodeQuerySetExistingNodeOnly(pQuery, TRUE);
+		bExistingOnly = TRUE;
+	}
+
+	// Non Existing Node Only
+	const TiXmlElement* pNonExistingOnly = pQueryElem->FirstChildElement("NonExistingNodeOnly");
+	if (pNonExistingOnly != NULL)
+	{
+		if (bExistingOnly)
+		{
+			xnLogError(XN_MASK_OPEN_NI, "Cannot specify both <ExistingNodeOnly> and <NonExistingNodeOnly> in query");
+			XN_ASSERT(FALSE);
+			return XN_STATUS_INVALID_OPERATION;
+		}
+		xnNodeQuerySetNonExistingNodeOnly(pQuery, TRUE);
+	}
+
+	// Needed Nodes
+	const TiXmlElement* pNeededNodes = pQueryElem->FirstChildElement("NeededNodes");
+	if (pNeededNodes != NULL)
+	{
+		const TiXmlElement* pNode = pNeededNodes->FirstChildElement("Node");
+		while (pNode != NULL)
+		{
+			xnNodeQueryAddNeededNode(pQuery, pNode->GetText());
+
+			pNode = pNode->NextSiblingElement("Node");
+		}
+	}
+
+	// Creation info
+	const TiXmlElement* pCreationInfo = pQueryElem->FirstChildElement("CreationInfo");
+	if (pCreationInfo != NULL)
+	{
+		xnNodeQuerySetCreationInfo(pQuery, pCreationInfo->GetText());
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus xnConfigureCreateNodes(XnContext* pContext, const TiXmlElement* pRootElem, XnNodeInfoList* pCreatedNodes, XnEnumerationErrors* pErrors)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	const TiXmlElement* pProudctionNodes = pRootElem->FirstChildElement("ProductionNodes");
+	if (pProudctionNodes == NULL)
+	{
+		return (XN_STATUS_OK);
+	}
+
+	// global mirror
+	const TiXmlElement* pGlobalMirror = pProudctionNodes->FirstChildElement("GlobalMirror");
+	if (pGlobalMirror != NULL)
+	{
+		XnBool bOn;
+		nRetVal = xnXmlReadBoolAttribute(pGlobalMirror, "on", &bOn);
+		XN_IS_STATUS_OK(nRetVal);
+
+		nRetVal = xnSetGlobalMirror(pContext, bOn);
+		XN_IS_STATUS_OK(nRetVal);
+	}
+
+	// file recordings
+	const TiXmlElement* pRecording = pProudctionNodes->FirstChildElement("Recording");
+	if (pRecording != NULL)
+	{
+		const XnChar* strFileName;
+		nRetVal = xnXmlReadStringAttribute(pRecording, "file", &strFileName);
+		XN_IS_STATUS_OK(nRetVal);
+
+		xnLogVerbose(XN_MASK_OPEN_NI, "Opening file recording '%s'...", strFileName);
+
+		XnNodeHandle hPlayer;
+		nRetVal = xnContextOpenFileRecordingEx(pContext, strFileName, &hPlayer);
+		XN_IS_STATUS_OK(nRetVal);
+
+		nRetVal = xnNodeInfoListAddNode(pCreatedNodes, hPlayer->pNodeInfo);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnProductionNodeRelease(hPlayer);
+			return (nRetVal);
+		}
+
+		XnDouble dSpeed = 1.0;
+		if (NULL != pRecording->Attribute("playbackSpeed", &dSpeed))
+		{
+			nRetVal = xnSetPlaybackSpeed(hPlayer, dSpeed);
+			XN_IS_STATUS_OK(nRetVal);
+		}
+
+		const XnChar* REPEAT = "repeat";
+		if (NULL != pRecording->Attribute(REPEAT))
+		{
+			XnBool bRepeat;
+			nRetVal = xnXmlReadBoolAttribute(pRecording, REPEAT, &bRepeat);
+			XN_IS_STATUS_OK(nRetVal);
+
+			nRetVal = xnSetPlayerRepeat(hPlayer, bRepeat);
+			XN_IS_STATUS_OK(nRetVal);
+		}
+	}
+
+	const XnChar* strNodeTagName = "Node";
+	const XnChar* strStartGeneratingAttr = "startGenerating";
+
+	XnBool bStartGeneratingAll = TRUE;
+	if (NULL != pProudctionNodes->Attribute(strStartGeneratingAttr))
+	{
+		nRetVal = xnXmlReadBoolAttribute(pProudctionNodes, strStartGeneratingAttr, &bStartGeneratingAll);
+		XN_IS_STATUS_OK(nRetVal);
+	}
+
+	// new nodes
+	const TiXmlElement* pNode = pProudctionNodes->FirstChildElement(strNodeTagName);
+	while (pNode != NULL)
+	{
+		// get type
+		const XnChar* strType;
+		nRetVal = xnXmlReadStringAttribute(pNode, "type", &strType);
+		XN_IS_STATUS_OK(nRetVal);
+
+		// check stopOnError status
+		XnBool bStopOnError = TRUE;
+		if (NULL != pNode->Attribute("stopOnError"))
+		{
+			nRetVal = xnXmlReadBoolAttribute(pNode, "stopOnError", &bStopOnError);
+			XN_IS_STATUS_OK(nRetVal);
+		}
+
+		xnLogVerbose(XN_MASK_OPEN_NI, "Requested to create a node of type %s%s...", strType, bStopOnError ? "" : " (StopOnError=FALSE)");
+
+		XnProductionNodeType Type;
+		nRetVal = xnProductionNodeTypeFromString(strType, &Type);
+		XN_IS_STATUS_OK(nRetVal);
+
+		// check if there is a query
+		XnNodeQuery* pQuery = NULL;
+		const TiXmlElement* pQueryElem = pNode->FirstChildElement("Query");
+		if (pQueryElem != NULL)
+		{
+			nRetVal = xnNodeQueryAllocate(&pQuery);
+			XN_IS_STATUS_OK(nRetVal);
+
+			nRetVal = xnXmlReadQuery(pQueryElem, pQuery);
+			XN_IS_STATUS_OK(nRetVal);
+		}
+
+		// enumerate
+		XnNodeInfoList* pTrees;
+		nRetVal = xnEnumerateProductionTrees(pContext, Type, pQuery, &pTrees, pErrors);
+		if (nRetVal == XN_STATUS_NO_NODE_PRESENT && !bStopOnError)
+		{
+			// go to next one
+			pNode = pNode->NextSiblingElement(strNodeTagName);
+			continue;
+		}
+		XN_IS_STATUS_OK(nRetVal);
+
+		if (pQuery != NULL)
+		{
+			xnNodeQueryFree(pQuery);
+			pQuery = NULL;
+		}
+
+		// choose first one
+		XnNodeInfoListIterator itChosen = xnNodeInfoListGetFirst(pTrees);
+		XnNodeInfo* pChosenInfo = xnNodeInfoListGetCurrent(itChosen);
+
+		// check if a name was requested
+		if (NULL != pNode->Attribute("name"))
+		{
+			const XnChar* strName = NULL;
+			nRetVal = xnXmlReadStringAttribute(pNode, "name", &strName);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnNodeInfoListFree(pTrees);
+				return (nRetVal);
+			}
+
+			nRetVal = xnNodeInfoSetInstanceName(pChosenInfo, strName);
+			if (nRetVal != XN_STATUS_OK)
+			{
+				xnNodeInfoListFree(pTrees);
+				return (nRetVal);
+			}
+		}
+
+		// create it
+		XnNodeHandle hNode;
+		nRetVal = xnCreateProductionTree(pContext, pChosenInfo, &hNode);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnNodeInfoListFree(pTrees);
+			return (nRetVal);
+		}
+
+		// free the list
+		xnNodeInfoListFree(pTrees);
+
+		// add it to the list of created nodes
+		nRetVal = xnNodeInfoListAddNode(pCreatedNodes, pChosenInfo);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnProductionNodeRelease(hNode);
+			return (nRetVal);
+		}
+
+		// config it
+		nRetVal = xnConfigureNodeFromXml(hNode, pNode);
+		if (nRetVal != XN_STATUS_OK)
+		{
+			xnProductionNodeRelease(hNode);
+			return (nRetVal);
+		}
+
+		// check if we need to start it (if start generating all is on, it will be started at the end)
+		XnBool bStart = FALSE;
+		if (!bStartGeneratingAll)
+		{
+			if (NULL != pNode->Attribute(strStartGeneratingAttr))
+			{
+				nRetVal = xnXmlReadBoolAttribute(pNode, strStartGeneratingAttr, &bStart);
+				if (nRetVal != XN_STATUS_OK)
+				{
+					xnProductionNodeRelease(hNode);
+					return (nRetVal);
+				}
+			}
+
+			if (bStart)
+			{
+				nRetVal = xnStartGenerating(hNode);
+				if (nRetVal != XN_STATUS_OK)
+				{
+					xnProductionNodeRelease(hNode);
+					return (nRetVal);
+				}
+			}
+		}
+
+		pNode = pNode->NextSiblingElement(strNodeTagName);
+	}
+
+	// start generating all created nodes (by the order they were created in)
+	if (bStartGeneratingAll)
+	{
+		XnBool bIsGenerator;
+
+		for (XnNodeInfoListIterator it = xnNodeInfoListGetFirst(pCreatedNodes);
+			xnNodeInfoListIteratorIsValid(it);
+			it = xnNodeInfoListGetNext(it))
+		{
+			XnNodeInfo* pNodeInfo = xnNodeInfoListGetCurrent(it);
+			nRetVal = TypeManager::GetInstance().IsTypeDerivedFrom(pNodeInfo->Description.Type, XN_NODE_TYPE_GENERATOR, &bIsGenerator);
+			XN_IS_STATUS_OK(nRetVal);
+
+			if (bIsGenerator)
+			{
+				XN_ASSERT(pNodeInfo->hNode != NULL);
+				nRetVal = xnStartGenerating(pNodeInfo->hNode);
+				XN_IS_STATUS_OK(nRetVal);
+			}
+		}
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnStatus RunXmlScriptImpl(XnContext* pContext, TiXmlDocument* pDoc, XnNodeInfoList* pCreatedNodes, XnEnumerationErrors* pErrors)
+{
+	XnStatus nRetVal = XN_STATUS_OK;
+
+	TiXmlElement* pRootElem = pDoc->RootElement();
+	if (pRootElem != NULL)
+	{
+		nRetVal = xnLoadLicensesFromXml(pContext, pRootElem);
+		XN_IS_STATUS_OK(nRetVal);
+
+		nRetVal = xnConfigureCreateNodes(pContext, pRootElem, pCreatedNodes, pErrors);
+		XN_IS_STATUS_OK(nRetVal);
+	}
+
+	return (XN_STATUS_OK);
+}
+
+XnXmlScriptNode::XnXmlScriptNode(xn::Context context) : m_context(context)
+{
+}
+
+XnXmlScriptNode::~XnXmlScriptNode()
+{
+}
+
+const XnChar* XnXmlScriptNode::GetSupportedFormat()
+{
+	return XN_SCRIPT_FORMAT_XML;
+}
+
+XnStatus XnXmlScriptNode::LoadScriptFromFile(const XnChar* strFileName)
+{
+	return xnXmlLoadDocument(m_doc, strFileName);
+}
+
+XnStatus XnXmlScriptNode::LoadScriptFromString(const XnChar* strScript)
+{
+	if (!m_doc.Parse(strScript))
+	{
+		XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI,
+			"Failed loading xml: %s [row %d, column %d]",
+			m_doc.ErrorDesc(), m_doc.ErrorRow(), m_doc.ErrorCol());
+	}
+
+	return XN_STATUS_OK;
+}
+
+XnStatus XnXmlScriptNode::Run(xn::NodeInfoList& createdNodes, xn::EnumerationErrors& errors)
+{
+	return RunXmlScriptImpl(m_context.GetUnderlyingObject(), &m_doc, createdNodes.GetUnderlyingObject(), errors.GetUnderlying());
+}
\ No newline at end of file
diff --git a/Source/OpenNI/XnXmlScriptNode.h b/Source/OpenNI/XnXmlScriptNode.h
new file mode 100644
index 0000000..74b3020
--- /dev/null
+++ b/Source/OpenNI/XnXmlScriptNode.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __XN_XML_SCRIPT_NODE_H__
+#define __XN_XML_SCRIPT_NODE_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnModuleCppInterface.h>
+#include <XnCppWrapper.h>
+#include "XnXml.h"
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+class XnXmlScriptNode : public xn::ModuleScriptNode
+{
+public:
+	XnXmlScriptNode(xn::Context context);
+	virtual ~XnXmlScriptNode();
+	virtual const XnChar* GetSupportedFormat();
+	virtual XnStatus LoadScriptFromFile(const XnChar* strFileName);
+	virtual XnStatus LoadScriptFromString(const XnChar* strScript);
+	virtual XnStatus Run(xn::NodeInfoList& createdNodes, xn::EnumerationErrors& errors);
+
+private:
+	TiXmlDocument m_doc;
+	xn::Context m_context;
+};
+
+#endif // __XN_XML_SCRIPT_NODE_H__
diff --git a/Source/OpenNI/XnXmlScriptNodeExporter.cpp b/Source/OpenNI/XnXmlScriptNodeExporter.cpp
new file mode 100644
index 0000000..2d299a2
--- /dev/null
+++ b/Source/OpenNI/XnXmlScriptNodeExporter.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "XnXmlScriptNodeExporter.h"
+#include "XnXmlScriptNode.h"
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define XN_OPEN_NI_NODE_NAME	"OpenNI"
+
+//---------------------------------------------------------------------------
+// Code
+//---------------------------------------------------------------------------
+void GetOpenNIScriptNodeDescription(XnProductionNodeDescription* pDescription)
+{
+	pDescription->Type = XN_NODE_TYPE_SCRIPT;
+	xnGetVersion(&pDescription->Version);
+	strcpy(pDescription->strVendor, XN_VENDOR_OPEN_NI);
+	strcpy(pDescription->strName, XN_OPEN_NI_NODE_NAME);
+}
+
+void XnXmlScriptNodeExporter::GetDescription(XnProductionNodeDescription* pDescription)
+{
+	GetOpenNIScriptNodeDescription(pDescription);
+}
+
+XnStatus XnXmlScriptNodeExporter::EnumerateProductionTrees(xn::Context& /*context*/, xn::NodeInfoList& /*TreesList*/, xn::EnumerationErrors* /*pErrors*/)
+{
+	// never return any results. This node is only created explicitly.
+	return (XN_STATUS_OK);
+}
+
+XnStatus XnXmlScriptNodeExporter::Create(xn::Context& context, const XnChar* /*strInstanceName*/, const XnChar* /*strCreationInfo*/, xn::NodeInfoList* /*pNeededTrees*/, const XnChar* /*strConfigurationDir*/, xn::ModuleProductionNode** ppInstance)
+{
+	XN_VALIDATE_NEW(*ppInstance, XnXmlScriptNode, context);
+	return XN_STATUS_OK;
+}
+
+void XnXmlScriptNodeExporter::Destroy(xn::ModuleProductionNode* pInstance)
+{
+	xn::ModuleProductionNode* pNode = (xn::ModuleProductionNode*)pInstance;
+	XN_DELETE(pNode);
+}
+
diff --git a/Source/OpenNI/XnXmlScriptNodeExporter.h b/Source/OpenNI/XnXmlScriptNodeExporter.h
new file mode 100644
index 0000000..a2ba2ff
--- /dev/null
+++ b/Source/OpenNI/XnXmlScriptNodeExporter.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef __XN_MODULE_PRODUCTION_NODE_H__
+#define __XN_MODULE_PRODUCTION_NODE_H__
+
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include <XnModuleCppInterface.h>
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+class XnXmlScriptNodeExporter : public virtual xn::ModuleExportedProductionNode
+{
+public:
+	virtual void GetDescription(XnProductionNodeDescription* pDescription);
+	virtual XnStatus EnumerateProductionTrees(xn::Context& context, xn::NodeInfoList& TreesList, xn::EnumerationErrors* pErrors);
+	virtual XnStatus Create(xn::Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, xn::NodeInfoList* pNeededTrees, const XnChar* strConfigurationDir, xn::ModuleProductionNode** ppInstance);
+	virtual void Destroy(xn::ModuleProductionNode* pInstance);
+};
+
+#endif // __XN_MODULE_PRODUCTION_NODE_H__
diff --git a/Source/OpenNI/openNI.cpp b/Source/OpenNI/openNI.cpp
index e461612..df5738c 100644
--- a/Source/OpenNI/openNI.cpp
+++ b/Source/OpenNI/openNI.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
diff --git a/Source/OpenNI/xnInternalFuncs.h b/Source/OpenNI/xnInternalFuncs.h
index 5683ecd..94f8e7d 100644
--- a/Source/OpenNI/xnInternalFuncs.h
+++ b/Source/OpenNI/xnInternalFuncs.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -22,11 +22,19 @@
 #ifndef __XNINTERNALFUNCS_H__
 #define __XNINTERNALFUNCS_H__
 
+#include <XnModuleInterface.h>
+
 //---------------------------------------------------------------------------
 // ExtendedSerialization
 //---------------------------------------------------------------------------
 XnStatus xnNotifyExState(XnNodeHandle hInstance, XnNodeNotifications* pNotifications, void* pCookie);
 void xnUnregisterExNotifications(XnNodeHandle hInstance);
 
+//---------------------------------------------------------------------------
+// Others
+//---------------------------------------------------------------------------
+XnOpenNIModuleInterface* GetOpenNIModuleInterface();
+void GetOpenNIScriptNodeDescription(XnProductionNodeDescription* pDescription);
+XnStatus xnGetOpenNIConfFilesPath(XnChar* strDest, XnUInt32 nBufSize);
 
 #endif // __XNINTERNALFUNCS_H__
\ No newline at end of file
diff --git a/Source/Utils/niLicense/niLicense.cpp b/Source/Utils/niLicense/niLicense.cpp
index 8971f89..23623be 100644
--- a/Source/Utils/niLicense/niLicense.cpp
+++ b/Source/Utils/niLicense/niLicense.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -109,8 +109,7 @@ int main(int argc, char* argv[])
 
 	xnLogInitSystem();
 	xnLogSetConsoleOutput(bVerbose || bList);
-	xnLogSetSeverityFilter(bVerbose ? XN_LOG_VERBOSE : XN_LOG_WARNING);
-	xnLogSetMaskState(XN_LOG_MASK_ALL, TRUE);
+	xnLogSetMaskMinSeverity(XN_LOG_MASK_ALL, bVerbose ? XN_LOG_VERBOSE : XN_LOG_WARNING);
 
 	XnStatus nRetVal = XN_STATUS_OK;
 
diff --git a/Source/Utils/niReg/niReg.cpp b/Source/Utils/niReg/niReg.cpp
index c189065..6acdda4 100644
--- a/Source/Utils/niReg/niReg.cpp
+++ b/Source/Utils/niReg/niReg.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *                                                                           *
-*  OpenNI 1.1 Alpha                                                         *
+*  OpenNI 1.x Alpha                                                         *
 *  Copyright (C) 2011 PrimeSense Ltd.                                       *
 *                                                                           *
 *  This file is part of OpenNI.                                             *
@@ -110,8 +110,7 @@ int main(XnInt argc, XnChar* argv[])
 
 	xnLogInitSystem();
 	xnLogSetConsoleOutput(bVerbose || bList);
-	xnLogSetSeverityFilter(bVerbose ? XN_LOG_VERBOSE : XN_LOG_WARNING);
-	xnLogSetMaskState(XN_LOG_MASK_ALL, TRUE);
+	xnLogSetMaskMinSeverity(XN_LOG_MASK_ALL, bVerbose ? XN_LOG_VERBOSE : XN_LOG_WARNING);
 
 	XnStatus nRetVal = XN_STATUS_OK;
 	if (bList)
diff --git a/Wrappers/OpenNI.java/.classpath b/Wrappers/OpenNI.java/.classpath
new file mode 100644
index 0000000..0b272bf
--- /dev/null
+++ b/Wrappers/OpenNI.java/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry excluding=".svn/|org/.svn/|org/OpenNI/.svn/" kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/Wrappers/OpenNI.java/.project b/Wrappers/OpenNI.java/.project
new file mode 100644
index 0000000..e11b385
--- /dev/null
+++ b/Wrappers/OpenNI.java/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>OpenNI.java</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/Wrappers/OpenNI.java/AndroidManifest.xml b/Wrappers/OpenNI.java/AndroidManifest.xml
new file mode 100644
index 0000000..b9e6016
--- /dev/null
+++ b/Wrappers/OpenNI.java/AndroidManifest.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="org.OpenNI"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <uses-sdk android:minSdkVersion="9" />
+
+    <application android:icon="@drawable/icon" android:label="@string/app_name">
+
+
+    </application>
+</manifest>
\ No newline at end of file
diff --git a/Wrappers/OpenNI.java/default.properties b/Wrappers/OpenNI.java/default.properties
new file mode 100644
index 0000000..4694559
--- /dev/null
+++ b/Wrappers/OpenNI.java/default.properties
@@ -0,0 +1,12 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-9
+android.library=true
diff --git a/Wrappers/OpenNI.java/proguard.cfg b/Wrappers/OpenNI.java/proguard.cfg
new file mode 100644
index 0000000..12dd039
--- /dev/null
+++ b/Wrappers/OpenNI.java/proguard.cfg
@@ -0,0 +1,36 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+    native <methods>;
+}
+
+-keepclasseswithmembernames class * {
+    public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembernames class * {
+    public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers enum * {
+    public static **[] values();
+    public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+  public static final android.os.Parcelable$Creator *;
+}
diff --git a/Wrappers/OpenNI.java/res/drawable-hdpi/icon.png b/Wrappers/OpenNI.java/res/drawable-hdpi/icon.png
new file mode 100644
index 0000000..8074c4c
Binary files /dev/null and b/Wrappers/OpenNI.java/res/drawable-hdpi/icon.png differ
diff --git a/Wrappers/OpenNI.java/res/drawable-ldpi/icon.png b/Wrappers/OpenNI.java/res/drawable-ldpi/icon.png
new file mode 100644
index 0000000..1095584
Binary files /dev/null and b/Wrappers/OpenNI.java/res/drawable-ldpi/icon.png differ
diff --git a/Wrappers/OpenNI.java/res/drawable-mdpi/icon.png b/Wrappers/OpenNI.java/res/drawable-mdpi/icon.png
new file mode 100644
index 0000000..a07c69f
Binary files /dev/null and b/Wrappers/OpenNI.java/res/drawable-mdpi/icon.png differ
diff --git a/Wrappers/OpenNI.java/res/layout/main.xml b/Wrappers/OpenNI.java/res/layout/main.xml
new file mode 100644
index 0000000..1e416f0
--- /dev/null
+++ b/Wrappers/OpenNI.java/res/layout/main.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    >
+<TextView  
+    android:layout_width="fill_parent" 
+    android:layout_height="wrap_content" 
+    android:text="@string/hello"
+    />
+</LinearLayout>
diff --git a/Wrappers/OpenNI.java/res/values/strings.xml b/Wrappers/OpenNI.java/res/values/strings.xml
new file mode 100644
index 0000000..6a2c550
--- /dev/null
+++ b/Wrappers/OpenNI.java/res/values/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="hello">Hello World!</string>
+    <string name="app_name">OpenNI.java</string>
+</resources>
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ActiveHandDirectionEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/ActiveHandDirectionEventArgs.java
new file mode 100644
index 0000000..e4ef01e
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ActiveHandDirectionEventArgs.java
@@ -0,0 +1,57 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class ActiveHandDirectionEventArgs extends EventArgs
+{
+	public ActiveHandDirectionEventArgs(int id, Point3D position, float time, Direction direction)
+	{
+		this.id = id;
+		this.position = position;
+		this.time = time;
+		this.direction = direction;
+	}
+	
+	public int getId()
+	{
+		return this.id;
+	}
+	public Point3D getPosition()
+	{
+		return this.position;
+	}
+	public float getTime()
+	{
+		return this.time;
+	}
+	public Direction getDirection()
+	{
+		return this.direction;
+	}
+	
+	
+	private final int id;
+	private final Point3D position;
+	private final float time;
+	private final Direction direction;
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ActiveHandEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/ActiveHandEventArgs.java
new file mode 100644
index 0000000..a85be28
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ActiveHandEventArgs.java
@@ -0,0 +1,50 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class ActiveHandEventArgs extends EventArgs
+{
+	public ActiveHandEventArgs(int id, Point3D position, float time)
+	{
+		this.id = id;
+		this.position = position;
+		this.time = time;
+	}
+	
+	public int getId()
+	{
+		return this.id;
+	}
+	public Point3D getPosition()
+	{
+		return this.position;
+	}
+	public float getTime()
+	{
+		return this.time;
+	}
+	
+	
+	private final int id;
+	private final Point3D position;
+	private final float time;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/AlternativeViewpointCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/AlternativeViewpointCapability.java
new file mode 100644
index 0000000..609faae
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/AlternativeViewpointCapability.java
@@ -0,0 +1,71 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class AlternativeViewpointCapability extends CapabilityBase
+{
+	public AlternativeViewpointCapability(ProductionNode node) throws StatusException
+	{
+		super(node);
+		
+		this.viewPointChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToViewPointChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromViewPointChange(toNative(), hCallback);
+			}
+		};
+	}
+	
+	public boolean isViewpointSupported(ProductionNode other)
+	{
+		return NativeMethods.xnIsViewPointSupported(toNative(), other.toNative());
+	}
+	
+	public void setViewpoint(ProductionNode other) throws StatusException
+	{
+		int status = NativeMethods.xnSetViewPoint(toNative(), other.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void resetViewpoint() throws StatusException
+	{
+		int status = NativeMethods.xnResetViewPoint(toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public boolean isViewpointAs(ProductionNode other)
+	{
+		return NativeMethods.xnIsViewPointAs(toNative(), other.toNative());
+	}
+
+	public IStateChangedObservable getViewPointChangedEvent() { return this.viewPointChanged; }
+
+	private StateChangedObservable viewPointChanged;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/AntiFlickerCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/AntiFlickerCapability.java
new file mode 100644
index 0000000..8590e9e
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/AntiFlickerCapability.java
@@ -0,0 +1,60 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class AntiFlickerCapability extends CapabilityBase
+{
+	public AntiFlickerCapability(ProductionNode node) throws StatusException
+	{
+		super(node);
+
+		this.powerLineFrequencyChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToPowerLineFrequencyChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromPowerLineFrequencyChange(toNative(), hCallback);
+			}
+		};
+	}
+	
+	public PowerLineFrequency getPowerLineFrequency()
+	{
+		return PowerLineFrequency.fromNative(NativeMethods.xnGetPowerLineFrequency(toNative()));
+	}
+	
+	public void setPowerLineFrequency(PowerLineFrequency frequency) throws StatusException
+	{
+		int status = NativeMethods.xnSetPowerLineFrequency(toNative(), frequency.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public IStateChangedObservable getPowerLineFrequencyChangedEvent() { return this.powerLineFrequencyChanged; }
+
+	private StateChangedObservable powerLineFrequencyChanged;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/AudioGenerator.java b/Wrappers/OpenNI.java/src/org/OpenNI/AudioGenerator.java
new file mode 100644
index 0000000..8f7ba1c
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/AudioGenerator.java
@@ -0,0 +1,108 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class AudioGenerator extends Generator
+{
+	public AudioGenerator(Context context, long nodeHandle, boolean addRef) throws GeneralException
+	{
+		super(context, nodeHandle, addRef);
+		
+		this.waveOutputModeChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToWaveOutputModeChanges(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromWaveOutputModeChanges(toNative(), hCallback);
+			}
+		}; 
+	}
+
+	public static AudioGenerator create(Context context, Query query, EnumerationErrors errors) throws GeneralException
+	{
+		OutArg<Long> handle = new OutArg<Long>();
+		int status = NativeMethods.xnCreateAudioGenerator(context.toNative(), handle,
+			query == null ? 0 : query.toNative(),
+			errors == null ? 0 : errors.toNative());
+		WrapperUtils.throwOnError(status);
+		AudioGenerator result = (AudioGenerator)context.createProductionNodeObject(handle.value, NodeType.AUDIO);
+		NativeMethods.xnProductionNodeRelease(handle.value);
+		return result;
+	}
+
+	public static AudioGenerator create(Context context, Query query) throws GeneralException
+	{
+		return create(context, query, null);
+	}
+
+	public static AudioGenerator create(Context context) throws GeneralException
+	{
+		return create(context, null, null);
+	}
+	
+	public WaveOutputMode[] getSupportedMapOutputModes() throws StatusException
+	{
+		int count = NativeMethods.xnGetSupportedWaveOutputModesCount(this.toNative());
+		WaveOutputMode[] supportedModes = new WaveOutputMode[count];
+		int status = NativeMethods.xnGetSupportedWaveOutputModes(this.toNative(), supportedModes);
+		WrapperUtils.throwOnError(status);
+		return supportedModes;
+	}
+
+	public WaveOutputMode getWaveOutputMode() throws StatusException
+	{
+		OutArg<Integer> sampleRate = new OutArg<Integer>();
+		OutArg<Short> bitsPerSample = new OutArg<Short>();
+		OutArg<Byte> numberOfChannels = new OutArg<Byte>();
+		int status = NativeMethods.xnGetWaveOutputMode(this.toNative(), sampleRate, bitsPerSample, numberOfChannels);
+		WrapperUtils.throwOnError(status);
+		return new WaveOutputMode(sampleRate.value, bitsPerSample.value, numberOfChannels.value);
+	}
+	
+	public void setWaveOutputMode(WaveOutputMode mode) throws StatusException
+	{
+		int status = NativeMethods.xnSetWaveOutputMode(this.toNative(), mode.getSampleRate(), mode.getBitsPerSample(), mode.getNumberOfChannels());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public IStateChangedObservable getMapOutputModeChangedEvent() { return this.waveOutputModeChanged; }
+
+	public void getMetaData(AudioMetaData audioMD)
+	{
+		NativeMethods.xnGetAudioMetaData(this.toNative(), audioMD);
+	}
+
+	public AudioMetaData getMetaData()
+	{
+		AudioMetaData audioMD = new AudioMetaData();
+		getMetaData(audioMD);
+		return audioMD;
+	}
+
+	private StateChangedObservable waveOutputModeChanged;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/AudioMetaData.java b/Wrappers/OpenNI.java/src/org/OpenNI/AudioMetaData.java
new file mode 100644
index 0000000..d51dde9
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/AudioMetaData.java
@@ -0,0 +1,66 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+public class AudioMetaData extends OutputMetaData
+{
+	public int getSampleRate()
+	{
+		return this.sampleRate;
+	}
+	public void setSampleRate(int sampleRate)
+	{
+		this.sampleRate = sampleRate;
+	}
+	public short getBitsPerSample()
+	{
+		return this.bitsPerSample;
+	}
+	public void setBitsPerSample(short bitsPerSample)
+	{
+		this.bitsPerSample = bitsPerSample;
+	}
+	public byte getNumberOfChannels()
+	{
+		return this.numberOfChannels;
+	}
+	public void setNumberOfChannels(byte numberOfChannels)
+	{
+		this.numberOfChannels = numberOfChannels;
+	}
+	
+	public ByteBuffer createByteBuffer()
+	{
+		int size = getDataSize();
+		ByteBuffer buffer = ByteBuffer.allocateDirect(size);
+		buffer.order(ByteOrder.LITTLE_ENDIAN);
+		NativeMethods.copyToBuffer(buffer, getDataPtr(), size);
+		return buffer;
+	}
+
+	private int sampleRate;
+	private short bitsPerSample;
+	private byte numberOfChannels;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/BoundingBox3D.java b/Wrappers/OpenNI.java/src/org/OpenNI/BoundingBox3D.java
new file mode 100644
index 0000000..3772a41
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/BoundingBox3D.java
@@ -0,0 +1,52 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class BoundingBox3D
+{
+	public BoundingBox3D(Point3D leftBottomNear, Point3D rightTopFar)
+	{
+		this.leftBottomNear = leftBottomNear;
+		this.rightTopFar = rightTopFar;
+	}
+
+	public Point3D getLeftBottomNear()
+	{
+		return this.leftBottomNear;
+	}
+	public Point3D getRightTopFar()
+	{
+		return this.rightTopFar;
+	}
+	
+	public Point3D getMins()
+	{
+		return getLeftBottomNear();
+	}
+	public Point3D getMaxs()
+	{
+		return getRightTopFar();
+	}
+	
+	private final Point3D leftBottomNear;
+	private final Point3D rightTopFar;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/CalibrationProgressEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/CalibrationProgressEventArgs.java
new file mode 100644
index 0000000..bf8c21d
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/CalibrationProgressEventArgs.java
@@ -0,0 +1,43 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class CalibrationProgressEventArgs extends EventArgs
+{
+	public CalibrationProgressEventArgs(int user, CalibrationProgressStatus state)
+	{
+		this.user = user;
+		this.state = state;
+	}
+	
+	public int getUser()
+	{
+		return this.user;
+	}
+	public CalibrationProgressStatus getStatus()
+	{
+		return this.state;
+	}
+	
+	private final int user;
+	private final CalibrationProgressStatus state;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/CalibrationProgressStatus.java b/Wrappers/OpenNI.java/src/org/OpenNI/CalibrationProgressStatus.java
new file mode 100644
index 0000000..4fd6b8e
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/CalibrationProgressStatus.java
@@ -0,0 +1,64 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum CalibrationProgressStatus
+{
+	OK(0),
+	NO_USER(1),
+	ARM(2),
+	LEG(3),
+	HEAD(4),
+	TORSO(5),
+	TOP_FOV(6),
+	SIDE_FOV(7),
+	POSE(8),
+	MANUAL_ABORT(9),
+	MANUAL_RESET(10),
+	TIMEOUT_FAIL(11);
+
+	
+	CalibrationProgressStatus(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static CalibrationProgressStatus fromNative(int value)
+	{
+		for (CalibrationProgressStatus type : CalibrationProgressStatus.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private final int val;
+
+
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/CalibrationStartEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/CalibrationStartEventArgs.java
new file mode 100644
index 0000000..cf59d28
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/CalibrationStartEventArgs.java
@@ -0,0 +1,39 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class CalibrationStartEventArgs extends EventArgs
+{
+	CalibrationStartEventArgs(int user)
+	{
+		this.user = user;
+	}
+	
+	public int getUser()
+	{
+		return this.user;
+	}
+	
+	private int user;
+	
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Capability.java b/Wrappers/OpenNI.java/src/org/OpenNI/Capability.java
new file mode 100644
index 0000000..5641829
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Capability.java
@@ -0,0 +1,64 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public enum Capability 
+{
+	ExtendedSerialization ("ExtendedSerialization"),
+	Mirror ("Mirror"),
+	AlternativeViewPoint ("AlternativeViewPoint"),
+	Cropping ("Cropping"),
+	UserPosition ("UserPosition"),
+	Skeleton ("User::Skeleton"),
+	PoseDetection ("User::PoseDetection"),
+	LockAware ("LockAware"),
+	ErrorState ("ErrorState"),
+	FrameSync ("FrameSync"),
+	DeviceIdentification ("DeviceIdentification"),
+	Brightness ("Brightness"),
+	Contrast ("Contrast"),
+	Hue ("Hue"),
+	Saturation ("Saturation"),
+	Sharpness ("Sharpness"),
+	Gamma ("Gamma"),
+	WhiteBalance ("ColorTemperature"),
+	BacklightCompensation ("BacklightCompensation"),
+	Gain ("Gain"),
+	Pan ("Pan"),
+	Tilt ("Tilt"),
+	Roll ("Roll"),
+	Zoom ("Zoom"),
+	Exposure ("Exposure"),
+	Iris ("Iris"),
+	Focus ("Focus"),
+	LowLightCompensation ("LowLightCompensation"),
+	AntiFlicker ("AntiFlicker");
+	
+	Capability(String name)
+	{
+		this.name = name;
+	}
+	
+	public String getName() { return this.name; }
+	
+	private String name;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/CapabilityBase.java b/Wrappers/OpenNI.java/src/org/OpenNI/CapabilityBase.java
new file mode 100644
index 0000000..827a6e3
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/CapabilityBase.java
@@ -0,0 +1,33 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class CapabilityBase extends NodeWrapper
+{
+	public CapabilityBase(ProductionNode node) throws StatusException
+	{
+		super(node.getContext(), node.toNative(), true);
+		this.node = node;
+	}
+
+	private ProductionNode node;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Codec.java b/Wrappers/OpenNI.java/src/org/OpenNI/Codec.java
new file mode 100644
index 0000000..2dde500
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Codec.java
@@ -0,0 +1,62 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class Codec extends ProductionNode
+{
+	Codec(Context context, long nodeHandle, boolean addRef) throws StatusException
+	{
+		super(context, nodeHandle, addRef);
+	}
+
+	public static Codec create(Context context, CodecID codecID, ProductionNode initializer) throws GeneralException
+	{
+		OutArg<Long> handle = new OutArg<Long>();
+		int status = NativeMethods.xnCreateCodec(context.toNative(), codecID.toNative(), initializer.toNative(), handle);
+		WrapperUtils.throwOnError(status);
+		Codec result = (Codec)context.createProductionNodeObject(handle.value, NodeType.CODEC);
+		NativeMethods.xnProductionNodeRelease(handle.value);
+		return result;
+	}
+
+	public CodecID getCodecID()
+	{
+		int codecID = NativeMethods.xnGetCodecID(toNative());
+		return new CodecID(codecID);
+	}
+	
+	public int EncodeData(long pSrcPtr, int nSrcSize, long pDstPtr, int nDstSize) throws StatusException
+	{
+		OutArg<Integer> written = new OutArg<Integer>();
+		int status = NativeMethods.xnEncodeData(toNative(), pSrcPtr, nSrcSize, pDstPtr, nDstSize, written);
+		WrapperUtils.throwOnError(status);
+		return written.value;
+	}
+
+	public int DecodeData(long pSrcPtr, int nSrcSize, long pDstPtr, int nDstSize) throws StatusException
+	{
+		OutArg<Integer> written = new OutArg<Integer>();
+		int status = NativeMethods.xnDecodeData(toNative(), pSrcPtr, nSrcSize, pDstPtr, nDstSize, written);
+		WrapperUtils.throwOnError(status);
+		return written.value;
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/CodecID.java b/Wrappers/OpenNI.java/src/org/OpenNI/CodecID.java
new file mode 100644
index 0000000..35bdb89
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/CodecID.java
@@ -0,0 +1,75 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class CodecID
+{
+	public static final CodecID Null = new CodecID((byte)0, (byte)0, (byte)0, (byte)0);
+	public static final CodecID Uncompressed = new CodecID('N', 'O', 'N', 'E');
+	public static final CodecID Jpeg = new CodecID('J', 'P', 'E', 'G');
+	public static final CodecID Z16 = new CodecID('1', '6', 'z', 'P');
+	public static final CodecID Z16WithTables = new CodecID('1', '6', 'z', 'T');
+	public static final CodecID Z8 = new CodecID('I', 'm', '8', 'z');
+	
+	public CodecID(int nativeValue)
+	{
+		this.value = nativeValue;
+	}
+	
+	public CodecID(byte byte1, byte byte2, byte byte3, byte byte4)
+	{
+		this(byte4 << 24 | byte3 << 16 | byte2 << 8 | byte1);
+	}
+	
+	public CodecID(char char1, char char2, char char3, char char4)
+	{
+		this((byte)char1, (byte)char2, (byte)char3, (byte)char4);
+	}
+	
+	@Override
+	public int hashCode()
+	{
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + this.value;
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj)
+	{
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		CodecID other = (CodecID) obj;
+		if (this.value != other.value)
+			return false;
+		return true;
+	}
+
+	public int toNative() { return this.value; }
+	
+	private int value;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Context.java b/Wrappers/OpenNI.java/src/org/OpenNI/Context.java
new file mode 100644
index 0000000..0dd45d6
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Context.java
@@ -0,0 +1,385 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.Hashtable;
+
+public class Context extends ObjectWrapper
+{
+	public Context() throws GeneralException
+	{
+		this(init(), false);
+	}
+	
+	public static Context createFromXmlFile(String xmlFile, OutArg<ScriptNode> scriptNode) throws GeneralException
+	{
+		OutArg<Long> hScript = new OutArg<Long>();
+		long pContext = Context.initFromXmlEx(xmlFile, hScript);
+		Context context = new Context(pContext, false);
+		scriptNode.value = new ScriptNode(context, hScript.value, false);
+		return context;
+	}
+	
+	public static Context fromNative(long pContext) throws GeneralException
+	{
+		synchronized (Context.allContexts)
+		{
+			if (Context.allContexts.containsKey(pContext))
+			{
+				return Context.allContexts.get(pContext);
+			}
+			else
+			{
+				return new Context(pContext);
+			}
+		}
+	}
+	
+	public static Version getVersion() throws StatusException
+	{
+		OutArg<Version> pVersion = new OutArg<Version>();
+		int status = NativeMethods.xnGetVersion(pVersion);
+		WrapperUtils.throwOnError(status);
+		return pVersion.value;
+	}
+	
+	public ScriptNode runXmlScriptFromFile(String scriptFile) throws GeneralException
+	{
+		EnumerationErrors errors = new EnumerationErrors();
+		OutArg<Long> phScriptNode = new OutArg<Long>();
+		int status = NativeMethods.xnContextRunXmlScriptFromFileEx(toNative(), scriptFile, errors.toNative(), phScriptNode);
+		WrapperUtils.checkEnumeration(status, errors);
+		return new ScriptNode(this, phScriptNode.value, false);
+	}
+
+	public ScriptNode runXmlScript(String script) throws GeneralException
+	{
+		EnumerationErrors errors = new EnumerationErrors();
+		OutArg<Long> phScriptNode = new OutArg<Long>();
+		int status = NativeMethods.xnContextRunXmlScriptEx(toNative(), script, errors.toNative(), phScriptNode);
+		WrapperUtils.checkEnumeration(status, errors);
+		return new ScriptNode(this, phScriptNode.value, false);
+	}
+
+	public Player openFileRecordingEx(String fileName) throws GeneralException
+	{
+		OutArg<Long> phPlayer = new OutArg<Long>();
+		int status = NativeMethods.xnContextOpenFileRecordingEx(toNative(), fileName, phPlayer);
+		WrapperUtils.throwOnError(status);
+		return (Player)createProductionNodeFromNative(phPlayer.value);
+	}
+	
+	public void release()
+	{
+		dispose();
+	}
+	
+	public void addLicense(License license) throws StatusException
+	{
+		int status = NativeMethods.xnAddLicense(toNative(), license.getVendor(), license.getKey());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public License[] enumerateLicenses() throws StatusException
+	{
+		OutArg<License[]> licenses = new OutArg<License[]>();
+		int status = NativeMethods.xnEnumerateLicenses(toNative(), licenses);
+		WrapperUtils.throwOnError(status);
+		return licenses.value;
+	}
+	
+	public NodeInfoList enumerateProductionTrees(NodeType type, Query query) throws GeneralException
+	{
+		EnumerationErrors errors = new EnumerationErrors();
+		OutArg<Long> ppNodesList = new OutArg<Long>();
+		int status = NativeMethods.xnEnumerateProductionTrees(toNative(), type.toNative(),
+				query == null ? 0 : query.toNative(),
+				ppNodesList,
+				errors.toNative());
+		WrapperUtils.checkEnumeration(status, errors);
+		return new NodeInfoList(ppNodesList.value);
+	}
+
+	public NodeInfoList enumerateProductionTrees(NodeType type) throws GeneralException
+	{
+		return enumerateProductionTrees(type, null);
+	}
+	
+	public ProductionNode createProductionTree(NodeInfo nodeInfo) throws GeneralException
+	{
+		OutArg<Long> phNode = new OutArg<Long>();
+		int status = NativeMethods.xnCreateProductionTree(toNative(), nodeInfo.toNative(), phNode);
+		WrapperUtils.throwOnError(status);
+		return createProductionNodeObject(phNode.value);
+	}
+	
+	public ProductionNode createAnyProductionTree(NodeType type, Query query) throws GeneralException
+	{
+		EnumerationErrors errors = new EnumerationErrors();
+		OutArg<Long> phNode = new OutArg<Long>();
+		int status = NativeMethods.xnCreateAnyProductionTree(toNative(), type.toNative(),
+				query == null ? 0 : query.toNative(),
+				phNode,
+				errors.toNative());
+		WrapperUtils.checkEnumeration(status, errors);
+		return createProductionNodeFromNative(phNode.value);
+	}
+
+	public NodeInfoList enumerateExistingNodes() throws GeneralException
+	{
+		OutArg<Long> ppList = new OutArg<Long>();
+		int status = NativeMethods.xnEnumerateExistingNodes(this.toNative(), ppList);
+		WrapperUtils.throwOnError(status);
+		return new NodeInfoList(ppList.value);
+	}
+
+	public NodeInfoList enumerateExistingNodes(NodeType type) throws GeneralException
+	{
+		OutArg<Long> ppList = new OutArg<Long>();
+		int status = NativeMethods.xnEnumerateExistingNodesByType(this.toNative(), type.toNative(), ppList);
+		WrapperUtils.throwOnError(status);
+		return new NodeInfoList(ppList.value);
+	}
+
+	public ProductionNode findExistingNode(NodeType type) throws GeneralException
+	{
+		OutArg<Long> phNode = new OutArg<Long>();
+		int status = NativeMethods.xnFindExistingRefNodeByType(this.toNative(), type.toNative(), phNode);
+		WrapperUtils.throwOnError(status);
+		ProductionNode node = createProductionNodeObject(phNode.value, type);
+		// release the handle
+		NativeMethods.xnProductionNodeRelease(phNode.value);
+
+		return node;
+	}
+
+	public ProductionNode getProductionNodeByName(String name) throws GeneralException
+	{
+		OutArg<Long> phNode = new OutArg<Long>();
+		int status = NativeMethods.xnGetRefNodeHandleByName(this.toNative(), name, phNode);
+		WrapperUtils.throwOnError(status);
+		ProductionNode node = createProductionNodeObject(phNode.value);
+		// release the handle
+		NativeMethods.xnProductionNodeRelease(phNode.value);
+
+		return node;
+	}
+
+	public NodeInfo getProductionNodeInfoByName(String name) throws GeneralException
+	{
+		return getProductionNodeByName(name).getInfo();
+	}
+
+	public void startGeneratingAll() throws StatusException
+	{
+		int status = NativeMethods.xnStartGeneratingAll(this.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void stopGeneratingAll() throws StatusException
+	{
+		int status = NativeMethods.xnStopGeneratingAll(this.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public boolean getGlobalMirror()
+	{
+		return NativeMethods.xnGetGlobalMirror(toNative());
+	}
+	
+	public void setGlobalMirror(boolean mirror) throws StatusException
+	{
+		int status = NativeMethods.xnSetGlobalMirror(toNative(), mirror);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void waitAndUpdateAll() throws StatusException
+	{
+		int status = NativeMethods.xnWaitAndUpdateAll(this.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void waitOneUpdateAll(ProductionNode waitFor) throws StatusException
+	{
+		int status = NativeMethods.xnWaitOneUpdateAll(toNative(), waitFor.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void waitAnyUpdateAll() throws StatusException
+	{
+		int status = NativeMethods.xnWaitAnyUpdateAll(this.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void waitNoneUpdateAll() throws StatusException
+	{
+		int status = NativeMethods.xnWaitNoneUpdateAll(this.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public IObservable<ErrorStateEventArgs> getErrorStateChangedEvent()
+	{
+		return errorStateChangedEvent;
+	}
+	
+	public static ProductionNode createProductionNodeFromNative(long nodeHandle) throws GeneralException
+	{
+		long pContext = NativeMethods.xnGetRefContextFromNodeHandle(nodeHandle);
+		Context context = Context.fromNative(pContext);
+		NativeMethods.xnContextRelease(pContext);
+		return context.createProductionNodeObject(nodeHandle);
+	}
+
+	protected void freeObject(long ptr)
+	{
+		synchronized (Context.allContexts) 
+		{
+			Context.allContexts.remove(ptr);
+		}
+		NativeMethods.xnContextRelease(ptr);
+	}
+	
+	private Context(long pContext, boolean addRef) throws GeneralException
+	{
+		super(pContext);
+		
+		errorStateChangedEvent = new Observable<ErrorStateEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToGlobalErrorStateChange(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromGlobalErrorStateChange(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int status)
+			{
+				notify(new ErrorStateEventArgs(status));
+			}
+		};
+		
+		synchronized (Context.allContexts) 
+		{
+			if (Context.allContexts.containsKey(pContext))
+			{
+				throw new GeneralException("Java wrapper: creating a Context object wrapping an already wrapped object!");
+			}
+			Context.allContexts.put(pContext, this);
+		}
+		
+		if (addRef)
+		{
+			WrapperUtils.throwOnError(NativeMethods.xnContextAddRef(pContext));
+		}
+	}
+	
+	private Context(long pContext) throws GeneralException
+	{
+		this(pContext, true);
+	}
+
+	private static long init() throws StatusException
+	{
+		OutArg<Long> pContext = new OutArg<Long>();
+		int status = NativeMethods.xnInit(pContext);
+		WrapperUtils.throwOnError(status);
+		return pContext.value;
+	}
+	
+	private static long initFromXmlEx(String xmlFile, OutArg<Long> hScriptNode) throws StatusException
+	{
+		OutArg<Long> pContext = new OutArg<Long>();
+		int status = NativeMethods.xnInitFromXmlFileEx(xmlFile, pContext, 0L, hScriptNode);
+		WrapperUtils.throwOnError(status);
+		return pContext.value;
+	}
+	
+	ProductionNode createProductionNodeObject(long nodeHandle, NodeType type) throws GeneralException
+	{
+		synchronized (this.allNodes)
+		{
+			if (!this.allNodes.containsKey(nodeHandle))
+			{
+				// create it
+				ProductionNode node;
+				
+				if (type.equals(NodeType.DEVICE))
+					node = new Device(this, nodeHandle, true);
+				else if (type.equals(NodeType.DEPTH))
+					node = new DepthGenerator(this, nodeHandle, true);
+				else if (type.equals(NodeType.IMAGE))
+					node = new ImageGenerator(this, nodeHandle, true);
+				else if (type.equals(NodeType.AUDIO))
+					node = new AudioGenerator(this, nodeHandle, true);
+				else if (type.equals(NodeType.IR))
+					node = new IRGenerator(this, nodeHandle, true);
+				else if (type.equals(NodeType.USER))
+					node = new UserGenerator(this, nodeHandle, true);
+				else if (type.equals(NodeType.RECORDER))
+					node = new Recorder(this, nodeHandle, true);
+				else if (type.equals(NodeType.PLAYER))
+					node = new Player(this, nodeHandle, true);
+				else if (type.equals(NodeType.GESTURE))
+					node = new GestureGenerator(this, nodeHandle, true);
+				else if (type.equals(NodeType.SCENE))
+					node = new SceneAnalyzer(this, nodeHandle, true);
+				else if (type.equals(NodeType.HANDS))
+					node = new HandsGenerator(this, nodeHandle, true);
+				else if (type.equals(NodeType.CODEC))
+					node = new Codec(this, nodeHandle, true);
+				else if (type.equals(NodeType.SCRIPT_NODE))
+					node = new ScriptNode(this, nodeHandle, true);
+				else if (type.equals(NodeType.PRODUCTION_NODE))
+					node = new ProductionNode(this, nodeHandle, true);
+				else if (type.equals(NodeType.GENERATOR))
+					node = new Generator(this, nodeHandle, true);
+				else if (type.equals(NodeType.MAP_GENERATOR))
+					node = new MapGenerator(this, nodeHandle, true);
+				else
+					throw new GeneralException("java wrapper: Unknown generator type!");
+				
+				// add it to map
+				this.allNodes.put(nodeHandle, node);
+			} // create
+			
+			return this.allNodes.get(nodeHandle);
+		} // synch
+	}
+
+	ProductionNode createProductionNodeObject(long hNode) throws GeneralException
+	{
+		long pNodeInfo = NativeMethods.xnGetNodeInfo(hNode);
+		NodeType type = NativeMethods.xnNodeInfoGetDescription(pNodeInfo).getType();
+		return createProductionNodeObject(hNode, type);
+	}
+
+	private Observable<ErrorStateEventArgs> errorStateChangedEvent;
+	private Hashtable<Long, ProductionNode> allNodes = new Hashtable<Long, ProductionNode>();
+	
+	private static Hashtable<Long, Context> allContexts = new Hashtable<Long, Context>(); 
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Cropping.java b/Wrappers/OpenNI.java/src/org/OpenNI/Cropping.java
new file mode 100644
index 0000000..509c789
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Cropping.java
@@ -0,0 +1,82 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class Cropping 
+{
+	public Cropping(int xOffset, int yOffset, int xSize, int ySize, boolean enabled) 
+	{
+		super();
+		this.xOffset = xOffset;
+		this.yOffset = yOffset;
+		this.xSize = xSize;
+		this.ySize = ySize;
+		this.enabled = enabled;
+	}
+
+	public int getXOffset() 
+	{
+		return xOffset;
+	}
+	public void setXOffset(int xOffset) 
+	{
+		this.xOffset = xOffset;
+	}
+	public int getYOffset() 
+	{
+		return yOffset;
+	}
+	public void setYOffset(int yOffset) 
+	{
+		this.yOffset = yOffset;
+	}
+	public int getXSize() 
+	{
+		return xSize;
+	}
+	public void setXSize(int xSize) 
+	{
+		this.xSize = xSize;
+	}
+	public int getYSize() 
+	{
+		return ySize;
+	}
+	public void setYSize(int ySize) 
+	{
+		this.ySize = ySize;
+	}
+	public boolean isEnabled() 
+	{
+		return enabled;
+	}
+	public void setEnabled(boolean enabled) 
+	{
+		this.enabled = enabled;
+	}
+	
+	private int xOffset;
+	private int yOffset;
+	private int xSize;
+	private int ySize;
+	private boolean enabled;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/CroppingCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/CroppingCapability.java
new file mode 100644
index 0000000..79b36bf
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/CroppingCapability.java
@@ -0,0 +1,67 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class CroppingCapability extends CapabilityBase
+{
+	public CroppingCapability(ProductionNode node) throws StatusException
+	{
+		super(node);
+		
+		this.croppingChanged = new StateChangedObservable()
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToCroppingChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromCroppingChange(toNative(), hCallback);
+			}
+		};
+	}
+	
+	public void setCropping(Cropping cropping) throws StatusException
+	{
+		int status = NativeMethods.xnSetCropping(toNative(), cropping.getXOffset(), cropping.getYOffset(), cropping.getXSize(), cropping.getYSize(), cropping.isEnabled());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public Cropping getCropping() throws StatusException
+	{
+		OutArg<Integer> xOffset = new OutArg<Integer>();
+		OutArg<Integer> yOffset = new OutArg<Integer>();
+		OutArg<Integer> xSize = new OutArg<Integer>();
+		OutArg<Integer> ySize = new OutArg<Integer>();
+		OutArg<Boolean> isEnabled = new OutArg<Boolean>();
+		int status = NativeMethods.xnGetCropping(toNative(), xOffset, yOffset, xSize, ySize, isEnabled);
+		WrapperUtils.throwOnError(status);
+		return new Cropping(xOffset.value, yOffset.value, xSize.value, ySize.value, isEnabled.value);
+	}
+	
+	public IStateChangedObservable getCroppingChangedEvent() { return this.croppingChanged; }
+
+	private StateChangedObservable croppingChanged;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/DepthGenerator.java b/Wrappers/OpenNI.java/src/org/OpenNI/DepthGenerator.java
new file mode 100644
index 0000000..e82c451
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/DepthGenerator.java
@@ -0,0 +1,151 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class DepthGenerator extends MapGenerator 
+{
+	DepthGenerator(Context context, long nodeHandle, boolean addRef) throws GeneralException 
+	{
+		super(context, nodeHandle, addRef);
+		
+		this.fovChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback)
+			{
+				return NativeMethods.xnRegisterToDepthFieldOfViewChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromDepthFieldOfViewChange(toNative(), hCallback);
+			}
+		};
+	}
+	
+	public static DepthGenerator create(Context context, Query query, EnumerationErrors errors) throws GeneralException
+	{
+		OutArg<Long> handle = new OutArg<Long>();
+		int status = NativeMethods.xnCreateDepthGenerator(context.toNative(), handle,
+			query == null ? 0 : query.toNative(),
+			errors == null ? 0 : errors.toNative());
+		WrapperUtils.throwOnError(status);
+		DepthGenerator result = (DepthGenerator)context.createProductionNodeObject(handle.value, NodeType.DEPTH);
+		NativeMethods.xnProductionNodeRelease(handle.value);
+		return result;
+	}
+
+	public static DepthGenerator create(Context context, Query query) throws GeneralException
+	{
+		return create(context, query, null);
+	}
+
+	public static DepthGenerator create(Context context) throws GeneralException
+	{
+		return create(context, null, null);
+	}
+
+	public DepthMap getDepthMap() throws GeneralException
+	{
+		int frameID = getFrameID();
+		
+		if ((this.currDepthMap == null) || (this.currDepthMapFrameID != frameID))
+		{
+			long ptr = NativeMethods.xnGetDepthMap(toNative());
+			MapOutputMode mode = getMapOutputMode();
+			this.currDepthMap = new DepthMap(ptr, mode.getXRes(), mode.getYRes());
+			this.currDepthMapFrameID = frameID; 
+		}
+
+		return this.currDepthMap;
+	}
+	
+	public int getDeviceMaxDepth()
+	{
+		return NativeMethods.xnGetDeviceMaxDepth(this.toNative());
+	}
+
+	public FieldOfView getFieldOfView() throws StatusException
+	{
+		OutArg<Double> hFOV = new OutArg<Double>();
+		OutArg<Double> vFOV = new OutArg<Double>();
+		int status = NativeMethods.xnGetDepthFieldOfView(this.toNative(), hFOV, vFOV);
+		WrapperUtils.throwOnError(status);
+		return new FieldOfView(hFOV.value, vFOV.value);
+	}
+	
+	public IStateChangedObservable getFieldOfViewChangedEvent() { return this.fovChanged; }
+
+	public Point3D[] convertProjectiveToRealWorld(Point3D[] projectivePoints) throws StatusException
+	{
+		Point3D[] realWorld = new Point3D[projectivePoints.length];
+		int status = NativeMethods.xnConvertProjectiveToRealWorld(this.toNative(), projectivePoints, realWorld);
+		WrapperUtils.throwOnError(status);
+		return realWorld;
+	}
+
+    public Point3D convertProjectiveToRealWorld(Point3D projectivePoint) throws StatusException
+    {
+        Point3D[] projectivePoints = new Point3D[1];
+        projectivePoints[0] = projectivePoint;
+
+        return convertProjectiveToRealWorld(projectivePoints)[0];
+    }
+
+    public Point3D[] convertRealWorldToProjective(Point3D[] realWorldPoints) throws StatusException
+    {
+        Point3D[] projective = new Point3D[realWorldPoints.length];
+        int status = NativeMethods.xnConvertRealWorldToProjective(this.toNative(), realWorldPoints, projective);
+        WrapperUtils.throwOnError(status);
+        return projective;
+    }
+    
+    public Point3D convertRealWorldToProjective(Point3D realWorldPoint) throws StatusException
+	{
+        Point3D[] realWorldPoints = new Point3D[1];
+        realWorldPoints[0] = realWorldPoint;
+
+        return convertRealWorldToProjective(realWorldPoints)[0];
+    }
+
+	public UserPositionCapability getUserPositionCapability() throws StatusException
+	{
+		return new UserPositionCapability(this);
+	}
+
+	public void getMetaData(DepthMetaData depthMD)
+	{
+		NativeMethods.xnGetDepthMetaData(this.toNative(), depthMD);
+	}
+
+	public DepthMetaData getMetaData()
+	{
+		DepthMetaData depthMD = new DepthMetaData();
+		getMetaData(depthMD);
+		return depthMD;
+	}
+
+	private StateChangedObservable fovChanged;
+	private DepthMap currDepthMap;
+	private int currDepthMapFrameID;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/DepthMap.java b/Wrappers/OpenNI.java/src/org/OpenNI/DepthMap.java
new file mode 100644
index 0000000..1a9a8b5
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/DepthMap.java
@@ -0,0 +1,35 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class DepthMap extends ShortMap 
+{
+	DepthMap()
+	{
+		super();
+	}
+	
+	DepthMap(long ptr, int xRes, int yRes)
+	{
+		super(ptr, xRes, yRes);
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/DepthMetaData.java b/Wrappers/OpenNI.java/src/org/OpenNI/DepthMetaData.java
new file mode 100644
index 0000000..f0993dc
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/DepthMetaData.java
@@ -0,0 +1,45 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class DepthMetaData extends MapMetaData 
+{
+	public DepthMetaData() 
+	{
+		super(PixelFormat.GRAYSCALE_16BIT, new DepthMap());
+	}
+	
+	public int getZRes() {
+		return zRes;
+	}
+
+	public void setZRes(int zRes) {
+		this.zRes = zRes;
+	}
+	
+	public DepthMap getData()
+	{
+		return (DepthMap)super.getData();
+	}
+	
+	private int zRes;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Device.java b/Wrappers/OpenNI.java/src/org/OpenNI/Device.java
new file mode 100644
index 0000000..73c002b
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Device.java
@@ -0,0 +1,57 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class Device extends ProductionNode 
+{
+	public Device(Context context, long nodeHandle, boolean addRef) throws StatusException 
+	{
+		super(context, nodeHandle, addRef);
+	}
+	
+	public static Device create(Context context, Query query, EnumerationErrors errors) throws GeneralException
+	{
+		OutArg<Long> handle = new OutArg<Long>();
+		int status = NativeMethods.xnCreateDevice(context.toNative(), handle,
+			query == null ? 0 : query.toNative(),
+			errors == null ? 0 : errors.toNative());
+		WrapperUtils.throwOnError(status);
+		Device result = (Device)context.createProductionNodeObject(handle.value, NodeType.DEVICE);
+		NativeMethods.xnProductionNodeRelease(handle.value);
+		return result;
+	}
+
+	public static Device create(Context context, Query query) throws GeneralException
+	{
+		return create(context, query, null);
+	}
+
+	public static Device create(Context context) throws GeneralException
+	{
+		return create(context, null, null);
+	}
+	
+	public DeviceIdentificationCapability getDeviceIdentificationCapability() throws StatusException
+	{
+		return new DeviceIdentificationCapability(this);
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/DeviceIdentificationCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/DeviceIdentificationCapability.java
new file mode 100644
index 0000000..a317222
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/DeviceIdentificationCapability.java
@@ -0,0 +1,55 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class DeviceIdentificationCapability extends CapabilityBase
+{
+	public DeviceIdentificationCapability(ProductionNode node)
+			throws StatusException
+	{
+		super(node);
+	}
+
+	public String getDeviceName() throws StatusException
+	{
+		OutArg<String> result = new OutArg<String>();
+		int status = NativeMethods.xnGetDeviceName(toNative(), result);
+		WrapperUtils.throwOnError(status);
+		return result.value;
+	}
+
+	public String getVendorSpecificData() throws StatusException
+	{
+		OutArg<String> result = new OutArg<String>();
+		int status = NativeMethods.xnGetVendorSpecificData(toNative(), result);
+		WrapperUtils.throwOnError(status);
+		return result.value;
+	}
+
+	public String getSerialNumber() throws StatusException
+	{
+		OutArg<String> result = new OutArg<String>();
+		int status = NativeMethods.xnGetSerialNumber(toNative(), result);
+		WrapperUtils.throwOnError(status);
+		return result.value;
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Direction.java b/Wrappers/OpenNI.java/src/org/OpenNI/Direction.java
new file mode 100644
index 0000000..7cf0ee6
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Direction.java
@@ -0,0 +1,56 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum Direction 
+{
+	ILLEGAL(0),
+	LEFT(1),
+	RIGHT(2),
+	UP(3),
+	DOWN(4),
+	FORWARD(5),
+	BACKWARD(6);
+	
+	Direction(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static Direction fromNative(int value)
+	{
+		for (Direction type : Direction.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private final int val;
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/EnumerationErrors.java b/Wrappers/OpenNI.java/src/org/OpenNI/EnumerationErrors.java
new file mode 100644
index 0000000..350c6ab
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/EnumerationErrors.java
@@ -0,0 +1,63 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class EnumerationErrors extends ObjectWrapper
+{
+	public EnumerationErrors() throws StatusException
+	{
+		this(create());
+	}
+	
+	public boolean isEmpty()
+	{
+		long first = NativeMethods.xnEnumerationErrorsGetFirst(toNative());
+		return !NativeMethods.xnEnumerationErrorsIteratorIsValid(first);
+	}
+	
+	@Override
+	public String toString() 
+	{
+		OutArg<String> result = new OutArg<String>();
+		NativeMethods.xnEnumerationErrorsToString(toNative(), result);
+		return result.value;
+	}
+	
+	@Override
+	protected void freeObject(long ptr) 
+	{
+		NativeMethods.xnEnumerationErrorsFree(ptr);
+	}
+
+	private EnumerationErrors(long ptr) 
+	{
+		super(ptr);
+	}
+	
+	private static long create() throws StatusException
+	{
+		OutArg<Long> pErrors = new OutArg<Long>();
+		int status = NativeMethods.xnEnumerationErrorsAllocate(pErrors);
+		WrapperUtils.throwOnError(status);
+		return pErrors.value;
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ErrorStateCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/ErrorStateCapability.java
new file mode 100644
index 0000000..64fc86f
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ErrorStateCapability.java
@@ -0,0 +1,62 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class ErrorStateCapability extends CapabilityBase
+{
+	public ErrorStateCapability(ProductionNode node) throws StatusException
+	{
+		super(node);
+		
+		this.errorStateChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToNodeErrorStateChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromNodeErrorStateChange(toNative(), hCallback);
+			}
+		};
+	}
+	
+	public String getErrorState()
+	{
+		int status = NativeMethods.xnGetNodeErrorState(toNative());
+		if (status == 0)
+		{
+			return null;
+		}
+		else
+		{
+			return NativeMethods.xnGetStatusString(status);
+		}
+	}
+	
+	public IStateChangedObservable getErrorStateChangedEvent() { return this.errorStateChanged; }
+
+	private StateChangedObservable errorStateChanged;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ErrorStateEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/ErrorStateEventArgs.java
new file mode 100644
index 0000000..59d77f6
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ErrorStateEventArgs.java
@@ -0,0 +1,44 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class ErrorStateEventArgs extends EventArgs
+{
+	public ErrorStateEventArgs(int status)
+	{
+		if (status == 0)
+		{
+			this.currError = null;
+		}
+		else
+		{
+			this.currError = WrapperUtils.getErrorMessage(status);
+		}
+	}
+	
+	public String getCurrentError()
+	{
+		return currError;
+	}
+
+	private String currError;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/EventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/EventArgs.java
new file mode 100644
index 0000000..6919ae4
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/EventArgs.java
@@ -0,0 +1,26 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class EventArgs 
+{
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/FieldOfView.java b/Wrappers/OpenNI.java/src/org/OpenNI/FieldOfView.java
new file mode 100644
index 0000000..f94b7f1
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/FieldOfView.java
@@ -0,0 +1,50 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class FieldOfView 
+{
+	public FieldOfView(double hFOV, double vFOV) {
+		super();
+		this.hFOV = hFOV;
+		this.vFOV = vFOV;
+	}
+	
+	public double getHFOV() {
+		return hFOV;
+	}
+	
+	public void setHFOV(double hFOV) {
+		this.hFOV = hFOV;
+	}
+	
+	public double getVFOV() {
+		return vFOV;
+	}
+	
+	public void setVFOV(double vFOV) {
+		this.vFOV = vFOV;
+	}
+	
+	private double hFOV;
+	private double vFOV;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/FrameSyncCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/FrameSyncCapability.java
new file mode 100644
index 0000000..9223359
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/FrameSyncCapability.java
@@ -0,0 +1,72 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class FrameSyncCapability extends CapabilityBase
+{
+	public FrameSyncCapability(ProductionNode node)
+			throws StatusException
+	{
+		super(node);
+		
+		this.frameSyncChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToFrameSyncChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromFrameSyncChange(toNative(), hCallback);
+			}
+		};
+	}
+	
+	public boolean canFrameSyncWith(Generator other)
+	{
+		return NativeMethods.xnCanFrameSyncWith(toNative(), other.toNative());
+	}
+	
+	public void frameSyncWith(Generator other) throws StatusException
+	{
+		int status = NativeMethods.xnFrameSyncWith(toNative(), other.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void stopFrameSyncWith(Generator other) throws StatusException
+	{
+		int status = NativeMethods.xnStopFrameSyncWith(toNative(), other.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public boolean isFrameSyncedWith(Generator other)
+	{
+		return NativeMethods.xnIsFrameSyncedWith(toNative(), other.toNative());
+	}
+
+	public IStateChangedObservable getFrameSyncChangedEvent() { return this.frameSyncChanged; }
+
+	private StateChangedObservable frameSyncChanged;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/GeneralException.java b/Wrappers/OpenNI.java/src/org/OpenNI/GeneralException.java
new file mode 100644
index 0000000..8d41ccd
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/GeneralException.java
@@ -0,0 +1,35 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class GeneralException extends Exception
+{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	public GeneralException(String message)
+	{
+		super(message);
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/GeneralIntCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/GeneralIntCapability.java
new file mode 100644
index 0000000..27aa87f
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/GeneralIntCapability.java
@@ -0,0 +1,112 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class GeneralIntCapability extends CapabilityBase
+{
+	public GeneralIntCapability(ProductionNode node, Capability capName) throws StatusException
+	{
+		super(node);
+		this.capName = capName.getName();
+		
+		OutArg<Integer> pMin = new OutArg<Integer>();
+		OutArg<Integer> pMax = new OutArg<Integer>();
+		OutArg<Integer> pStep = new OutArg<Integer>();
+		OutArg<Integer> pDefault = new OutArg<Integer>();
+		OutArg<Boolean> pAutoSupported = new OutArg<Boolean>();
+		
+		int status = NativeMethods.xnGetGeneralIntRange(toNative(), getCapName(), pMin, pMax, pStep, pDefault, pAutoSupported);
+		WrapperUtils.throwOnError(status);
+		
+		this.min = pMin.value;
+		this.max = pMax.value;
+		this.step = pStep.value;
+		this.defaultVal = pDefault.value;
+		this.autoSupported = pAutoSupported.value;
+		
+		this.valueChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToGeneralIntValueChange(toNative(), getCapName(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromNodeErrorStateChange(toNative(), hCallback);
+			}
+		};
+	}
+	
+	public int getMin()
+	{
+		return this.min;
+	}
+
+	public int getMax()
+	{
+		return this.max;
+	}
+
+	public int getStep()
+	{
+		return this.step;
+	}
+
+	public int getDefault()
+	{
+		return this.defaultVal;
+	}
+
+	public boolean isAutoSupported()
+	{
+		return this.autoSupported;
+	}
+	
+	public int getValue() throws StatusException
+	{
+		OutArg<Integer> val = new OutArg<Integer>();
+		int status = NativeMethods.xnGetGeneralIntValue(toNative(), this.capName, val);
+		WrapperUtils.throwOnError(status);
+		return val.value;
+	}
+	
+	public void setValue(int value) throws StatusException
+	{
+		int status = NativeMethods.xnSetGeneralIntValue(toNative(), this.capName, value);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public IStateChangedObservable getValueChangedEvent() { return this.valueChanged; }
+	
+	String getCapName() { return this.capName; }
+
+	private StateChangedObservable valueChanged;
+	private final String capName;
+	private int min;
+	private int max;
+	private int step;
+	private int defaultVal;
+	private boolean autoSupported;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Generator.java b/Wrappers/OpenNI.java/src/org/OpenNI/Generator.java
new file mode 100644
index 0000000..9d18fa7
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Generator.java
@@ -0,0 +1,166 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+public class Generator extends ProductionNode 
+{
+	Generator(Context context, long nodeHandle, boolean addRef) throws GeneralException 
+	{
+		super(context, nodeHandle, addRef);
+		
+		this.generationRunningChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToGenerationRunningChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromGenerationRunningChange(toNative(), hCallback);
+			}
+		};
+		
+		this.newDataAvailable = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToNewDataAvailable(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromNewDataAvailable(toNative(), hCallback);
+			}
+		};		
+	}
+
+	public void startGenerating() throws StatusException
+	{
+		int status = NativeMethods.xnStartGenerating(this.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public boolean isGenerating()
+	{
+		return NativeMethods.xnIsGenerating(this.toNative());
+	}
+
+	public void stopGenerating() throws StatusException
+	{
+		int status = NativeMethods.xnStopGenerating(this.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public IStateChangedObservable getGenerationRunningChangedEvent()
+	{
+		return this.generationRunningChanged;
+	}
+
+	public boolean isNewDataAvailable()
+	{
+		OutArg<Long> timestamp = new OutArg<Long>();
+		return NativeMethods.xnIsNewDataAvailable(this.toNative(), timestamp);
+	}
+
+	public long getAvailableTimestamp()
+	{
+		OutArg<Long> timestamp = new OutArg<Long>();
+		NativeMethods.xnIsNewDataAvailable(this.toNative(), timestamp);
+		return timestamp.value;
+	}
+
+	public IStateChangedObservable getNewDataAvailableEvent()
+	{
+		return this.newDataAvailable;
+	}
+
+	public void waitAndUpdateData() throws StatusException
+	{
+		int status = NativeMethods.xnWaitAndUpdateData(this.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public boolean isDataNew()
+	{
+		return NativeMethods.xnIsDataNew(this.toNative());
+	}
+
+	public int getDataSize()
+	{
+		return NativeMethods.xnGetDataSize(this.toNative());
+	}
+	
+	public long getDataPtr()
+	{
+		return NativeMethods.xnGetData(this.toNative());
+	}
+
+	public ByteBuffer createDataByteBuffer()
+	{
+		int size = getDataSize();
+		ByteBuffer buffer = ByteBuffer.allocateDirect(size);
+		buffer.order(ByteOrder.LITTLE_ENDIAN);
+		NativeMethods.copyToBuffer(buffer, getDataPtr(), size);
+		return buffer;
+	}
+	
+	public void copyDataToBuffer(ByteBuffer buffer, int size)
+	{
+		NativeMethods.copyToBuffer(buffer, getDataPtr(), size);
+	} 	
+
+	public long getTimestamp()
+	{
+		return NativeMethods.xnGetTimestamp(this.toNative());
+	}
+
+	public int getFrameID()
+	{
+		return NativeMethods.xnGetFrameID(this.toNative());
+	}
+
+	public MirrorCapability getMirrorCapability() throws StatusException
+	{
+		return new MirrorCapability(this);
+	}
+
+	public AlternativeViewpointCapability getAlternativeViewpointCapability() throws StatusException
+	{
+		return new AlternativeViewpointCapability(this);
+	}
+
+	public FrameSyncCapability getFrameSyncCapability() throws StatusException
+	{
+		return new FrameSyncCapability(this);
+	}
+
+	private StateChangedObservable generationRunningChanged;
+	private StateChangedObservable newDataAvailable;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/GestureGenerator.java b/Wrappers/OpenNI.java/src/org/OpenNI/GestureGenerator.java
new file mode 100644
index 0000000..8d4e2b5
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/GestureGenerator.java
@@ -0,0 +1,226 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class GestureGenerator extends Generator
+{
+	GestureGenerator(Context context, long nodeHandle, boolean addRef) throws GeneralException 
+	{
+		super(context, nodeHandle, addRef);
+		
+		gestureRecognizedEvent = new Observable<GestureRecognizedEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterGestureCallbacks(toNative(), this, "callback", null, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterHandCallbacks(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(String gesture, Point3D idPosition, Point3D endPosition)
+			{
+				notify(new GestureRecognizedEventArgs(gesture, idPosition, endPosition));
+			}
+		};
+		gestureProgressEvent = new Observable<GestureProgressEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterGestureCallbacks(toNative(), this, null, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterHandCallbacks(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(String gesture, Point3D position, float progress)
+			{
+				notify(new GestureProgressEventArgs(gesture, position, progress));
+			}
+		};
+		gestureIntermediateStageCompletedEvent = new Observable<GesturePositionEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToGestureIntermediateStageCompleted(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromGestureIntermediateStageCompleted(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(String gesture, Point3D position)
+			{
+				notify(new GesturePositionEventArgs(gesture, position));
+			}
+		};
+		gestureReadyForNextIntermediateStageEvent = new Observable<GesturePositionEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToGestureReadyForNextIntermediateStage(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromGestureReadyForNextIntermediateStage(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(String gesture, Point3D position)
+			{
+				notify(new GesturePositionEventArgs(gesture, position));
+			}
+		};
+		gestureChangedEvent = new StateChangedObservable()
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback)
+			{
+				return NativeMethods.xnRegisterToGestureChange(toNative(), this, cb, phCallback);
+			}
+			@Override
+			protected void unregisterNative(long hCallback)
+			{
+				NativeMethods.xnUnregisterFromGestureChange(toNative(), hCallback);
+			}
+			
+		};
+	}
+	
+	public static GestureGenerator create(Context context, Query query, EnumerationErrors errors) throws GeneralException
+	{
+		OutArg<Long> handle = new OutArg<Long>();
+		int status = NativeMethods.xnCreateGestureGenerator(context.toNative(), handle,
+			query == null ? 0 : query.toNative(),
+			errors == null ? 0 : errors.toNative());
+		WrapperUtils.throwOnError(status);
+		GestureGenerator result = (GestureGenerator)context.createProductionNodeObject(handle.value, NodeType.GESTURE);
+		NativeMethods.xnProductionNodeRelease(handle.value);
+		return result;
+	}
+
+	public static GestureGenerator create(Context context, Query query) throws GeneralException
+	{
+		return create(context, query, null);
+	}
+
+	public static GestureGenerator create(Context context) throws GeneralException
+	{
+		return create(context, null, null);
+	}
+	
+	public void addGesture(String gesture) throws StatusException
+	{
+		int status = NativeMethods.xnAddGesture(toNative(), gesture);
+		WrapperUtils.throwOnError(status);
+	}
+	public void addGesture(String gesture, BoundingBox3D area) throws StatusException
+	{
+		if (area == null)
+		{
+			addGesture(gesture);
+			return;
+		}
+		int status = NativeMethods.xnAddGesture(toNative(), gesture, area.getMins().getX(), area.getMins().getY(), area.getMins().getZ(), area.getMaxs().getX(), area.getMaxs().getY(), area.getMaxs().getZ());
+		WrapperUtils.throwOnError(status);
+	}
+	public void removeGesture(String gesture) throws StatusException
+	{
+		int status = NativeMethods.xnRemoveGesture(toNative(), gesture);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public int getNumberOfAvailableGestures()
+	{
+		return NativeMethods.xnGetNumberOfAvailableGestures(toNative());
+	}
+	
+	public boolean isGestureAvailable(String gesture)
+	{
+		return NativeMethods.xnIsGestureAvailable(toNative(), gesture);
+	}
+	public boolean isGestureProgressSupported(String gesture)
+	{
+		return NativeMethods.xnIsGestureProgressSupported(toNative(), gesture);
+	}
+
+	public String[] enumerateAllGestures() throws StatusException
+	{
+		OutArg<String[]> gestures = new OutArg<String[]>();
+		int status = NativeMethods.xnEnumerateAllGestures(toNative(), gestures);
+		WrapperUtils.throwOnError(status);
+		return gestures.value;
+	}
+	
+	public String[] getAllActiveGestures() throws StatusException
+	{
+		OutArg<String[]> gestures = new OutArg<String[]>();
+		int status = NativeMethods.xnGetAllActiveGestures(toNative(), gestures);
+		WrapperUtils.throwOnError(status);
+		return gestures.value;
+	}
+	
+	// Events
+	public IObservable<GestureRecognizedEventArgs> getGestureRecognizedEvent()
+	{
+		return gestureRecognizedEvent;
+	}
+	public IObservable<GestureProgressEventArgs> getGestureProgressEvent()
+	{
+		return gestureProgressEvent;
+	}
+	public IObservable<GesturePositionEventArgs> getGestureIntermediateStageCompletedEvent()
+	{
+		return gestureIntermediateStageCompletedEvent;
+	}
+	public IObservable<GesturePositionEventArgs> getGestureReadyForNextIntermediateStageEvent()
+	{
+		return gestureReadyForNextIntermediateStageEvent;
+	}
+	public IStateChangedObservable getGestureChangedEvent()
+	{
+		return gestureChangedEvent;
+	}
+	
+	private Observable<GestureRecognizedEventArgs> gestureRecognizedEvent;
+	private Observable<GestureProgressEventArgs> gestureProgressEvent;
+	private Observable<GesturePositionEventArgs> gestureIntermediateStageCompletedEvent;
+	private Observable<GesturePositionEventArgs> gestureReadyForNextIntermediateStageEvent;
+	private StateChangedObservable gestureChangedEvent;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/GesturePositionEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/GesturePositionEventArgs.java
new file mode 100644
index 0000000..0d0274b
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/GesturePositionEventArgs.java
@@ -0,0 +1,44 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class GesturePositionEventArgs extends EventArgs
+{
+	public GesturePositionEventArgs(String gesture, Point3D position)
+	{
+		this.gesture = gesture;
+		this.position = position;
+	}
+	
+	public String getGesture()
+	{
+		return this.gesture;
+	}
+	public Point3D getPosition()
+	{
+		return this.position;
+	}
+	
+	private final String gesture;
+	private final Point3D position;
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/GestureProgressEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/GestureProgressEventArgs.java
new file mode 100644
index 0000000..997177b
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/GestureProgressEventArgs.java
@@ -0,0 +1,49 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class GestureProgressEventArgs extends EventArgs
+{
+	public GestureProgressEventArgs(String gesture, Point3D position , float progress)
+	{
+		this.gesture = gesture;
+		this.position = position;
+		this.progress = progress;
+	}
+	
+	public String getGesture()
+	{
+		return this.gesture;
+	}
+	public Point3D getPosition()
+	{
+		return this.position;
+	}
+	public float getProgress()
+	{
+		return this.progress;
+	}
+	
+	private final String gesture;
+	private final Point3D position;
+	private final float progress;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/GestureRecognizedEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/GestureRecognizedEventArgs.java
new file mode 100644
index 0000000..d59e4fc
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/GestureRecognizedEventArgs.java
@@ -0,0 +1,50 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class GestureRecognizedEventArgs extends EventArgs
+{
+	public GestureRecognizedEventArgs(String gesture, Point3D idPosition, Point3D endPosition)
+	{
+		this.gesture = gesture;
+		this.idPosition = idPosition;
+		this.endPosition = endPosition;
+	}
+	
+	public String getGesture()
+	{
+		return this.gesture;
+	}
+	public Point3D getIdPosition()
+	{
+		return this.idPosition;
+	}
+	public Point3D getEndPosition()
+	{
+		return this.endPosition;
+	}
+	
+	private final String gesture;
+	private final Point3D idPosition;
+	private final Point3D endPosition;
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/HandTouchingFOVEdgeCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/HandTouchingFOVEdgeCapability.java
new file mode 100644
index 0000000..c18fb0d
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/HandTouchingFOVEdgeCapability.java
@@ -0,0 +1,60 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class HandTouchingFOVEdgeCapability extends CapabilityBase
+{
+	public HandTouchingFOVEdgeCapability(ProductionNode node) throws StatusException
+	{
+		super(node);
+		
+		// Events
+		handTouchingFOVEdgeEvent = new Observable<ActiveHandDirectionEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToHandTouchingFOVEdge(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromHandTouchingFOVEdge(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int id, Point3D position, float time, int direction)
+			{
+				notify(new ActiveHandDirectionEventArgs(id, position, time, Direction.fromNative(direction)));
+			}
+		};
+	}
+
+	// Events
+	public IObservable<ActiveHandDirectionEventArgs> getHandTouchingFOVEdgeEvent()
+	{
+		return handTouchingFOVEdgeEvent;
+	}
+	
+	private Observable<ActiveHandDirectionEventArgs> handTouchingFOVEdgeEvent;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/HandleWrapper.java b/Wrappers/OpenNI.java/src/org/OpenNI/HandleWrapper.java
new file mode 100644
index 0000000..2054c39
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/HandleWrapper.java
@@ -0,0 +1,34 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class HandleWrapper 
+{
+	public HandleWrapper(int handle)
+	{
+		this.handle = handle;
+	}
+	
+	public int toNative() { return this.handle; }
+	
+	private int handle;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/HandsGenerator.java b/Wrappers/OpenNI.java/src/org/OpenNI/HandsGenerator.java
new file mode 100644
index 0000000..13eaea1
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/HandsGenerator.java
@@ -0,0 +1,160 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class HandsGenerator extends Generator
+{
+
+	HandsGenerator(Context context, long nodeHandle, boolean addRef)
+			throws GeneralException
+	{
+		super(context, nodeHandle, addRef);
+		// TODO Auto-generated constructor stub
+		
+		handCreateEvent = new Observable<ActiveHandEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterHandCallbacks(toNative(), this, "callback", null, null, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterHandCallbacks(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int id, Point3D point, float time)
+			{
+				notify(new ActiveHandEventArgs(id, point, time));
+			}
+		};
+		handUpdateEvent = new Observable<ActiveHandEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterHandCallbacks(toNative(), this, null, "callback", null, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterHandCallbacks(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int id, Point3D point, float time)
+			{
+				notify(new ActiveHandEventArgs(id, point, time));
+			}
+		};
+		handDestroyEvent = new Observable<InactiveHandEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterHandCallbacks(toNative(), this, null, null, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterHandCallbacks(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int id, float time)
+			{
+				notify(new InactiveHandEventArgs(id, time));
+			}
+		};
+	}
+
+	public static HandsGenerator create(Context context, Query query, EnumerationErrors errors) throws GeneralException
+	{
+		OutArg<Long> handle = new OutArg<Long>();
+		int status = NativeMethods.xnCreateHandsGenerator(context.toNative(), handle,
+			query == null ? 0 : query.toNative(),
+			errors == null ? 0 : errors.toNative());
+		WrapperUtils.throwOnError(status);
+		HandsGenerator result = (HandsGenerator)context.createProductionNodeObject(handle.value, NodeType.HANDS);
+		NativeMethods.xnProductionNodeRelease(handle.value);
+		return result;
+	}
+
+	public static HandsGenerator create(Context context, Query query) throws GeneralException
+	{
+		return create(context, query, null);
+	}
+
+	public static HandsGenerator create(Context context) throws GeneralException
+	{
+		return create(context, null, null);
+	}
+
+	public void StopTracking(int id) throws StatusException
+	{
+		int status = NativeMethods.xnStopTracking(toNative(), id);
+		WrapperUtils.throwOnError(status);
+	}
+	public void StopTrackingAll() throws StatusException
+	{
+		int status = NativeMethods.xnStopTrackingAll(toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	public void StartTracking(Point3D position) throws StatusException
+	{
+		int status = NativeMethods.xnStartTracking(toNative(), position.getX(), position.getY(), position.getZ());
+		WrapperUtils.throwOnError(status);
+	}
+	public void SetSmoothing(float factor) throws StatusException
+	{
+		int status = NativeMethods.xnSetTrackingSmoothing(toNative(), factor);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public HandTouchingFOVEdgeCapability getHandTouchingFOVEdgeCapability() throws StatusException
+	{
+		return new HandTouchingFOVEdgeCapability(this);
+	}
+
+	// Events
+	public IObservable<ActiveHandEventArgs> getHandCreateEvent()
+	{
+		return handCreateEvent;
+	}
+	public IObservable<ActiveHandEventArgs> getHandUpdateEvent()
+	{
+		return handUpdateEvent;
+	}
+	public IObservable<InactiveHandEventArgs> getHandDestroyEvent()
+	{
+		return handDestroyEvent;
+	}
+	
+	private Observable<ActiveHandEventArgs> handCreateEvent;
+	private Observable<ActiveHandEventArgs> handUpdateEvent;
+	private Observable<InactiveHandEventArgs> handDestroyEvent;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/IObservable.java b/Wrappers/OpenNI.java/src/org/OpenNI/IObservable.java
new file mode 100644
index 0000000..abbef99
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/IObservable.java
@@ -0,0 +1,28 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public interface IObservable<Args> 
+{
+	void addObserver(IObserver<Args> observer) throws StatusException;
+	void deleteObserver(IObserver<Args> observer);
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/IObserver.java b/Wrappers/OpenNI.java/src/org/OpenNI/IObserver.java
new file mode 100644
index 0000000..21f3551
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/IObserver.java
@@ -0,0 +1,27 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public interface IObserver<Args> 
+{
+	void update(IObservable<Args> observable, Args args);
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/IRGenerator.java b/Wrappers/OpenNI.java/src/org/OpenNI/IRGenerator.java
new file mode 100644
index 0000000..5cf1781
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/IRGenerator.java
@@ -0,0 +1,83 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class IRGenerator extends MapGenerator
+{
+	IRGenerator(Context context, long nodeHandle, boolean addRef) throws GeneralException
+	{
+		super(context, nodeHandle, addRef);
+		// TODO Auto-generated constructor stub
+	}
+
+	public static IRGenerator create(Context context, Query query, EnumerationErrors errors) throws GeneralException
+	{
+		OutArg<Long> handle = new OutArg<Long>();
+		int status = NativeMethods.xnCreateIRGenerator(context.toNative(), handle,
+			query == null ? 0 : query.toNative(),
+			errors == null ? 0 : errors.toNative());
+		WrapperUtils.throwOnError(status);
+		IRGenerator result = (IRGenerator)context.createProductionNodeObject(handle.value, NodeType.IR);
+		NativeMethods.xnProductionNodeRelease(handle.value);
+		return result;
+	}
+
+	public static IRGenerator create(Context context, Query query) throws GeneralException
+	{
+		return create(context, query, null);
+	}
+
+	public static IRGenerator create(Context context) throws GeneralException
+	{
+		return create(context, null, null);
+	}
+	
+	public IRMap getIRMap() throws GeneralException
+	{
+		int frameID = getFrameID();
+		
+		if ((this.currIRMap == null) || (this.currIRMapFrameID != frameID))
+		{
+			long ptr = NativeMethods.xnGetIRMap(toNative());
+			MapOutputMode mode = getMapOutputMode();
+			this.currIRMap = new IRMap(ptr, mode.getXRes(), mode.getYRes());
+			this.currIRMapFrameID = frameID; 
+		}
+
+		return this.currIRMap;
+	}
+	
+	public void getMetaData(IRMetaData IRMD)
+	{
+		NativeMethods.xnGetIRMetaData(this.toNative(), IRMD);
+	}
+
+	public IRMetaData getMetaData()
+	{
+		IRMetaData IRMD = new IRMetaData();
+		getMetaData(IRMD);
+		return IRMD;
+	}
+
+	private IRMap currIRMap;
+	private int currIRMapFrameID;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/IRMap.java b/Wrappers/OpenNI.java/src/org/OpenNI/IRMap.java
new file mode 100644
index 0000000..abfcb93
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/IRMap.java
@@ -0,0 +1,35 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class IRMap extends ShortMap
+{
+	IRMap()
+	{
+		super();
+	}
+	
+	IRMap(long ptr, int xRes, int yRes)
+	{
+		super(ptr, xRes, yRes);
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/IRMetaData.java b/Wrappers/OpenNI.java/src/org/OpenNI/IRMetaData.java
new file mode 100644
index 0000000..f55a652
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/IRMetaData.java
@@ -0,0 +1,35 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class IRMetaData extends MapMetaData
+{
+	public IRMetaData()
+	{
+		super(PixelFormat.GRAYSCALE_16BIT, new IRMap());
+	}
+	
+	public IRMap getData()
+	{
+		return (IRMap)super.getData();
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/IStateChangedObservable.java b/Wrappers/OpenNI.java/src/org/OpenNI/IStateChangedObservable.java
new file mode 100644
index 0000000..e267dfc
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/IStateChangedObservable.java
@@ -0,0 +1,26 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public interface IStateChangedObservable extends IObservable<EventArgs> 
+{
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ImageGenerator.java b/Wrappers/OpenNI.java/src/org/OpenNI/ImageGenerator.java
new file mode 100644
index 0000000..b1acc44
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ImageGenerator.java
@@ -0,0 +1,116 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class ImageGenerator extends MapGenerator
+{
+	ImageGenerator(Context context, long nodeHandle, boolean addRef) throws GeneralException
+	{
+		super(context, nodeHandle, addRef);
+		
+		this.pixelFormatChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToPixelFormatChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromPixelFormatChange(toNative(), hCallback);
+			}
+		};
+	}
+
+	public static ImageGenerator create(Context context, Query query, EnumerationErrors errors) throws GeneralException
+	{
+		OutArg<Long> handle = new OutArg<Long>();
+		int status = NativeMethods.xnCreateImageGenerator(context.toNative(), handle,
+			query == null ? 0 : query.toNative(),
+			errors == null ? 0 : errors.toNative());
+		WrapperUtils.throwOnError(status);
+		ImageGenerator result = (ImageGenerator)context.createProductionNodeObject(handle.value, NodeType.IMAGE);
+		NativeMethods.xnProductionNodeRelease(handle.value);
+		return result;
+	}
+
+	public static ImageGenerator create(Context context, Query query) throws GeneralException
+	{
+		return create(context, query, null);
+	}
+
+	public static ImageGenerator create(Context context) throws GeneralException
+	{
+		return create(context, null, null);
+	}
+	
+	public boolean isPixelFormatSupported(PixelFormat format)
+	{
+		return NativeMethods.xnIsPixelFormatSupported(toNative(), format.toNative());
+	}
+	
+	public void setPixelFormat(PixelFormat format) throws StatusException
+	{
+		int status = NativeMethods.xnSetPixelFormat(toNative(), format.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public PixelFormat getPixelFormat()
+	{
+		return PixelFormat.fromNative(NativeMethods.xnGetPixelFormat(toNative()));
+	}
+	
+	public ImageMap getImageMap() throws GeneralException
+	{
+		int frameID = getFrameID();
+		
+		if ((this.currImageMap == null) || (this.currImageMapFrameID != frameID))
+		{
+			long ptr = NativeMethods.xnGetImageMap(toNative());
+			MapOutputMode mode = getMapOutputMode();
+			this.currImageMap = new ImageMap(ptr, mode.getXRes(), mode.getYRes(), NativeMethods.xnGetBytesPerPixel(toNative()));
+			this.currImageMapFrameID = frameID; 
+		}
+
+		return this.currImageMap;
+	}
+	
+	public IStateChangedObservable getPixelFormatChangedEvent() { return this.pixelFormatChanged; }
+	
+	public void getMetaData(ImageMetaData ImageMD)
+	{
+		NativeMethods.xnGetImageMetaData(this.toNative(), ImageMD);
+	}
+
+	public ImageMetaData getMetaData()
+	{
+		ImageMetaData ImageMD = new ImageMetaData();
+		getMetaData(ImageMD);
+		return ImageMD;
+	}
+
+	private ImageMap currImageMap;
+	private int currImageMapFrameID;
+	private StateChangedObservable pixelFormatChanged;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ImageMap.java b/Wrappers/OpenNI.java/src/org/OpenNI/ImageMap.java
new file mode 100644
index 0000000..a0a43d0
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ImageMap.java
@@ -0,0 +1,41 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.nio.ByteBuffer;
+
+public class ImageMap extends Map
+{
+	public ImageMap()
+	{
+	}
+
+	public ImageMap(long ptr, int xRes, int yRes, int bytesPerPixel)
+	{
+		super(ptr, xRes, yRes, bytesPerPixel);
+	}
+	
+	public ByteBuffer createByteBuffer()
+	{
+		return super.createByteBuffer();
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ImageMetaData.java b/Wrappers/OpenNI.java/src/org/OpenNI/ImageMetaData.java
new file mode 100644
index 0000000..03e496e
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ImageMetaData.java
@@ -0,0 +1,41 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class ImageMetaData extends MapMetaData
+{
+	public ImageMetaData()
+	{
+		super(PixelFormat.RGB24, new ImageMap());
+		setPixelFormat(PixelFormat.RGB24);
+	}
+
+	public void setPixelFormat(PixelFormat format)
+	{
+		super.setPixelFormat(format);
+	}
+	
+	public ImageMap getData()
+	{
+		return (ImageMap)super.getData();
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/InactiveHandEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/InactiveHandEventArgs.java
new file mode 100644
index 0000000..8108c4e
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/InactiveHandEventArgs.java
@@ -0,0 +1,43 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class InactiveHandEventArgs extends EventArgs
+{
+	public InactiveHandEventArgs(int id, float time)
+	{
+		this.id = id;
+		this.time = time;
+	}
+	
+	public int getId()
+	{
+		return this.id;
+	}
+	public float getTime()
+	{
+		return this.time;
+	}
+	
+	private final int id;
+	private final float time;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/License.java b/Wrappers/OpenNI.java/src/org/OpenNI/License.java
new file mode 100644
index 0000000..d7e6c1d
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/License.java
@@ -0,0 +1,44 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class License
+{
+	public License(String vendor, String key)
+	{
+		this.vendor = vendor;
+		this.key = key;
+	}
+	
+	public String getVendor()
+	{
+		return this.vendor;
+	}
+	
+	public String getKey()
+	{
+		return this.key;
+	}
+	
+	private final String vendor;
+	private final String key;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/LockHandle.java b/Wrappers/OpenNI.java/src/org/OpenNI/LockHandle.java
new file mode 100644
index 0000000..95b298d
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/LockHandle.java
@@ -0,0 +1,30 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class LockHandle extends HandleWrapper 
+{
+	public LockHandle(int handle) 
+	{
+		super(handle);
+	}
+}
\ No newline at end of file
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Log.java b/Wrappers/OpenNI.java/src/org/OpenNI/Log.java
new file mode 100644
index 0000000..9efe6b1
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Log.java
@@ -0,0 +1,44 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class Log 
+{
+	public enum Severity
+	{
+		VERBOSE (0),
+		INFO (1),
+		WARNING (2),
+		ERROR (3);
+		
+		Severity(int val)
+		{
+			this.val = val;
+		}
+		
+		public int getValue() { return this.val; }
+		
+		private int val;
+	}
+	
+	
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Map.java b/Wrappers/OpenNI.java/src/org/OpenNI/Map.java
new file mode 100644
index 0000000..d2e85e7
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Map.java
@@ -0,0 +1,98 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+public class Map 
+{
+	Map()
+	{
+	}
+	
+	Map(long ptr, int xRes, int yRes, int bytesPerPixel)
+	{
+		this.ptr = ptr;
+		this.xRes = xRes;
+		this.yRes = yRes;
+		this.bytesPerPixel = bytesPerPixel;
+	}
+	
+	public long getNativePtr()
+	{
+		return this.ptr;
+	}
+	
+	public void setNativePtr(long ptr)
+	{
+		this.ptr = ptr;
+	}
+	
+	protected ByteBuffer createByteBuffer()
+	{
+		int size = this.xRes * this.yRes * this.bytesPerPixel;
+		ByteBuffer buffer = ByteBuffer.allocateDirect(size);
+		buffer.order(ByteOrder.LITTLE_ENDIAN);
+		NativeMethods.copyToBuffer(buffer, this.ptr, size);
+		return buffer;
+	}
+	
+	public void copyToBuffer(ByteBuffer buffer, int size)
+	{
+		NativeMethods.copyToBuffer(buffer, this.ptr, size);
+	} 	
+	
+	protected long getPixelPtr(int x, int y) 
+	{ 
+		return this.ptr + (y * this.xRes + x) * this.bytesPerPixel; 
+	} 
+
+	public int getXRes() {
+		return xRes;
+	}
+
+	public void setXRes(int xRes) {
+		this.xRes = xRes;
+	}
+
+	public int getYRes() {
+		return yRes;
+	}
+
+	public void setYRes(int yRes) {
+		this.yRes = yRes;
+	}
+
+	public int getBytesPerPixel() {
+		return bytesPerPixel;
+	}
+
+	protected void setBytesPerPixel(int bytesPerPixel) {
+		this.bytesPerPixel = bytesPerPixel;
+	}
+
+	protected long ptr;
+	protected int xRes;
+	protected int yRes;
+	protected int bytesPerPixel;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/MapGenerator.java b/Wrappers/OpenNI.java/src/org/OpenNI/MapGenerator.java
new file mode 100644
index 0000000..9ac34c4
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/MapGenerator.java
@@ -0,0 +1,169 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class MapGenerator extends Generator 
+{
+	MapGenerator(Context context, long nodeHandle, boolean addRef) throws GeneralException 
+	{
+		super(context, nodeHandle, addRef);
+		
+		this.mapOutputModeChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToMapOutputModeChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromMapOutputModeChange(toNative(), hCallback);
+			}
+		}; 
+	}
+
+	public MapOutputMode[] getSupportedMapOutputModes() throws StatusException
+	{
+		int count = NativeMethods.xnGetSupportedMapOutputModesCount(this.toNative());
+		MapOutputMode[] supportedModes = new MapOutputMode[count];
+		int status = NativeMethods.xnGetSupportedMapOutputModes(this.toNative(), supportedModes);
+		WrapperUtils.throwOnError(status);
+		return supportedModes;
+	}
+
+	public MapOutputMode getMapOutputMode() throws StatusException
+	{
+		OutArg<Integer> xRes = new OutArg<Integer>();
+		OutArg<Integer> yRes = new OutArg<Integer>();
+		OutArg<Integer> FPS = new OutArg<Integer>();
+		int status = NativeMethods.xnGetMapOutputMode(this.toNative(), xRes, yRes, FPS);
+		WrapperUtils.throwOnError(status);
+		return new MapOutputMode(xRes.value, yRes.value, FPS.value);
+	}
+	
+	public void setMapOutputMode(MapOutputMode mode) throws StatusException
+	{
+		int status = NativeMethods.xnSetMapOutputMode(this.toNative(), mode.getXRes(), mode.getYRes(), mode.getFPS());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public IStateChangedObservable getMapOutputModeChangedEvent() { return this.mapOutputModeChanged; }
+
+	public CroppingCapability getCroppingCapability() throws StatusException
+	{
+		return new CroppingCapability(this);
+	}
+
+	public GeneralIntCapability getBrightnessCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Brightness);
+	}
+
+	public GeneralIntCapability getContrastCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Contrast);
+	}
+
+	public GeneralIntCapability getSaturationCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Saturation);
+	}
+
+	public GeneralIntCapability getHueCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Hue);
+	}
+
+	public GeneralIntCapability getSharpnessCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Sharpness);
+	}
+
+	public GeneralIntCapability getGammaCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Gamma);
+	}
+
+	public GeneralIntCapability getWhiteBalanceCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.WhiteBalance);
+	}
+
+	public GeneralIntCapability getBacklightCompensationCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.BacklightCompensation);
+	}
+
+	public GeneralIntCapability getGainCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Gain);
+	}
+
+	public GeneralIntCapability getPanCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Pan);
+	}
+
+	public GeneralIntCapability getTiltCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Tilt);
+	}
+
+	public GeneralIntCapability getRollCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Roll);
+	}
+
+	public GeneralIntCapability getZoomCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Zoom);
+	}
+
+	public GeneralIntCapability getExposureCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Exposure);
+	}
+
+	public GeneralIntCapability getIrisCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Iris);
+	}
+
+	public GeneralIntCapability getFocusCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.Focus);
+	}
+
+	public GeneralIntCapability getLowLightCompensationCapability() throws StatusException
+	{
+		return new GeneralIntCapability(this, Capability.LowLightCompensation);
+	}
+
+	public AntiFlickerCapability getAntiFlickerCapability() throws StatusException
+	{
+		return new AntiFlickerCapability(this);
+	}
+
+	private StateChangedObservable mapOutputModeChanged;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/MapMetaData.java b/Wrappers/OpenNI.java/src/org/OpenNI/MapMetaData.java
new file mode 100644
index 0000000..3a8d449
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/MapMetaData.java
@@ -0,0 +1,104 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public abstract class MapMetaData extends OutputMetaData 
+{
+	MapMetaData(PixelFormat format, Map map)
+	{
+		this.pixelFormat = format;
+		this.map = map;
+	}
+	
+	public int getXRes() {
+		return xRes;
+	}
+	public void setXRes(int xRes) {
+		this.xRes = xRes;
+		this.map.setXRes(xRes);
+	}
+	public int getYRes() {
+		return yRes;
+	}
+	public void setYRes(int yRes) {
+		this.yRes = yRes;
+		this.map.setYRes(yRes);
+	}
+	public int getXOffset() {
+		return xOffset;
+	}
+	public void setXOffset(int xOffset) {
+		this.xOffset = xOffset;
+	}
+	public int getYOffset() {
+		return yOffset;
+	}
+	public void setYOffset(int yOffset) {
+		this.yOffset = yOffset;
+	}
+	public int getFullXRes() {
+		return fullXRes;
+	}
+	public void setFullXRes(int fullXRes) {
+		this.fullXRes = fullXRes;
+	}
+	public int getFullYRes() {
+		return fullYRes;
+	}
+	public void setFullYRes(int fullYRes) {
+		this.fullYRes = fullYRes;
+	}
+	public PixelFormat getPixelFormat() {
+		return pixelFormat;
+	}
+	public int getFPS() {
+		return FPS;
+	}
+	public void setFPS(int fPS) {
+		FPS = fPS;
+	}
+	public Map getData() {
+		return this.map;
+	}
+	
+	@Override
+	public void setDataPtr(long ptr) {
+		super.setDataPtr(ptr);
+		this.map.setNativePtr(ptr);
+	}
+	
+	protected void setPixelFormat(PixelFormat format)
+	{
+		this.pixelFormat = format;
+		this.map.setBytesPerPixel(format.getBytesPerPixel());
+	}
+	
+	private int xRes;
+	private int yRes;
+	private int xOffset;
+	private int yOffset;
+	private int fullXRes;
+	private int fullYRes;
+	private PixelFormat pixelFormat;
+	private int FPS;
+	private Map map;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/MapOutputMode.java b/Wrappers/OpenNI.java/src/org/OpenNI/MapOutputMode.java
new file mode 100644
index 0000000..23b2208
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/MapOutputMode.java
@@ -0,0 +1,55 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class MapOutputMode 
+{
+	public MapOutputMode(int xRes, int yRes, int FPS)
+	{
+		this.xRes = xRes;
+		this.yRes = yRes;
+		this.FPS = FPS;
+	}
+	
+	public void setXRes(int xRes)
+	{
+		this.xRes = xRes;
+	}
+
+	public void setYRes(int yRes)
+	{
+		this.yRes = yRes;
+	}
+
+	public void setFPS(int fPS)
+	{
+		this.FPS = fPS;
+	}
+
+	public int getXRes() { return this.xRes; }
+	public int getYRes() { return this.yRes; }
+	public int getFPS() { return this.FPS; }
+	
+	private int xRes;
+	private int yRes;
+	private int FPS;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/MirrorCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/MirrorCapability.java
new file mode 100644
index 0000000..5434761
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/MirrorCapability.java
@@ -0,0 +1,60 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class MirrorCapability extends CapabilityBase
+{
+	public MirrorCapability(ProductionNode node) throws StatusException
+	{
+		super(node);
+		
+		this.mirrorChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToMirrorChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromMirrorChange(toNative(), hCallback);
+			}
+		};
+	}
+	
+	public boolean isMirrored()
+	{
+		return NativeMethods.xnIsMirrored(toNative());
+	}
+	
+	public void setMirror(boolean isMirrored) throws StatusException
+	{
+		int status = NativeMethods.xnSetMirror(toNative(), isMirrored);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public IStateChangedObservable getMirrorChangedEvent() { return this.mirrorChanged; }
+
+	private StateChangedObservable mirrorChanged;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/NativeMethods.java b/Wrappers/OpenNI.java/src/org/OpenNI/NativeMethods.java
new file mode 100644
index 0000000..4a885f5
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/NativeMethods.java
@@ -0,0 +1,490 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.nio.ByteBuffer;
+
+class NativeMethods
+{
+	static 
+	{ 
+		String arch = System.getenv("PROCESSOR_ARCHITECTURE");
+		if ((arch != null) && ((arch.equals("AMD64")) || (arch.equals("IA64"))))
+			System.loadLibrary("OpenNI.jni64"); 
+		else
+			System.loadLibrary("OpenNI.jni");
+	}
+
+	// Marshaling
+	static native byte readByte(long ptr);
+	static native short readShort(long ptr);
+	static native int readInt(long ptr);
+	static native long readLong(long ptr);
+	static native void copyToBuffer(ByteBuffer buffer, long ptr, int size);
+	static native long createProductionNodeDescription(int type, String vendor, String name, byte major, byte minor, short maintenance, int build);
+	static native void freeProductionNodeDescription(long pDescription);
+
+	// General
+	static native String xnGetStatusString(int status);
+	
+	// Context
+	static native int xnInit(OutArg<Long> ppContext);
+	static native int xnContextRunXmlScriptFromFileEx(long pContext, String strFileName, long pErrors, OutArg<Long> phScriptNode);
+	static native int xnContextRunXmlScriptEx(long pContext, String xmlScript, long pErrors, OutArg<Long> phScriptNode);
+	static native int xnInitFromXmlFileEx(String fileName, OutArg<Long> ppContext, long pErrors, OutArg<Long> ppScriptNode);
+	static native int xnContextOpenFileRecordingEx(long pContext, String strFileName, OutArg<Long> phPlayerNode);
+	static native int xnContextAddRef(long pContext);
+	static native void xnContextRelease(long pContext);
+	static native int xnEnumerateProductionTrees(long pContext,int Type, long pQuery, OutArg<Long> ppTreesList, long pErrors);
+	static native int xnCreateProductionTree(long pContext, long pTree, OutArg<Long> phNode);
+	static native int xnCreateAnyProductionTree(long pContext, int type, long pQuery, OutArg<Long> phNode, long pErrors);
+	//static native int xnCreateMockNode(long pContext, int type, String strName, OutArg<Long> phNode);
+	//static native int xnCreateMockNodeBasedOn(long pContext, long hOriginalNode, String strName, OutArg<Long> phMockNode);
+	static native int xnEnumerateExistingNodes(long pContext, OutArg<Long> ppList);
+	static native int xnEnumerateExistingNodesByType(long pContext, int type, OutArg<Long> ppList);
+	static native int xnFindExistingRefNodeByType(long pContext, int type, OutArg<Long> phNode);
+	static native int xnGetRefNodeHandleByName(long pContext, String strInstanceName, OutArg<Long> phNode);
+	static native int xnWaitAndUpdateAll(long pContext);
+	static native int xnWaitOneUpdateAll(long pContext, long hNode);
+	static native int xnWaitAnyUpdateAll(long pContext);
+	static native int xnWaitNoneUpdateAll(long pContext);
+	static native int xnStartGeneratingAll(long pContext);
+	static native int xnStopGeneratingAll(long pContext);
+	static native int xnSetGlobalMirror(long pContext, boolean bMirror);
+	static native boolean xnGetGlobalMirror(long pContext);
+	static native int xnGetGlobalErrorState(long pContext);
+	static native int xnRegisterToGlobalErrorStateChange(long pContext, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromGlobalErrorStateChange(long pContext, long hCallback);
+	
+	// Licenses
+	static native int xnAddLicense(long pContext, String vendor, String key);
+	static native int xnEnumerateLicenses(long pContext, OutArg<License[]> licenses);
+	
+	// Enumeration Errors
+	static native int xnEnumerationErrorsAllocate(OutArg<Long> ppErrors);
+	static native void xnEnumerationErrorsFree(long pErrors);
+	//static native int xnEnumerationErrorsAdd(long pErrors, long pDesc, int nError);
+	static native int xnEnumerationErrorsToString(long pErrors, OutArg<String> value);
+	static native int xnEnumerationErrorsClear(long pErrors);
+	static native long xnEnumerationErrorsGetFirst(long pErrors);
+	//static native long xnEnumerationErrorsGetNext(long it);
+	static native boolean xnEnumerationErrorsIteratorIsValid(long it);
+	//static native long xnEnumerationErrorsGetCurrentDescription(long it);
+	//static native int xnEnumerationErrorsGetCurrentError(long it);
+	
+	// NodeInfo
+	//static native int xnNodeInfoAllocate(long pDescription, String strCreationInfo, long pNeededNodes, OutArg<Long> ppNodeInfo);
+	//static native void xnNodeInfoFree(long pNodeInfo);
+	static native int xnNodeInfoSetInstanceName(long pNodeInfo, String strInstanceName);
+	static native ProductionNodeDescription xnNodeInfoGetDescription(long pNodeInfo);
+	static native int xnNodeInfoGetTreeStringRepresentation(long pNodeInfo, OutArg<String> result);
+	static native String xnNodeInfoGetInstanceName(long pNodeInfo);
+	static native String xnNodeInfoGetCreationInfo(long pNodeInfo);
+	static native long xnNodeInfoGetNeededNodes(long pNodeInfo);
+	static native long xnNodeInfoGetRefHandle(long pNodeInfo);
+	//static native Object xnNodeInfoGetAdditionalData(long pNodeInfo);
+	
+	// NodeInfoList
+	static native int xnNodeInfoListAllocate(OutArg<Long> ppList);
+	static native void xnNodeInfoListFree(long pList);
+	static native int xnNodeInfoListAdd(long pList, long pDescription, String strCreationInfo, long pNeededNodes);
+	//static native int xnNodeInfoListAddEx(long pList, long pDescription, String strCreationInfo, long pNeededNodes, Object additionalData);
+	static native int xnNodeInfoListAddNode(long pList, long pNode);
+	static native int xnNodeInfoListAddNodeFromList(long pList, long it);
+	static native int xnNodeInfoListRemove(long pList, long it);
+	static native int xnNodeInfoListClear(long pList);
+	static native int xnNodeInfoListAppend(long pList, long other);
+	static native boolean xnNodeInfoListIsEmpty(long pList);
+	static native long xnNodeInfoListGetFirst(long pNodeInfoList);
+	//static native long xnNodeInfoListGetLast(long pList);
+	static native boolean xnNodeInfoListIteratorIsValid(long it);
+	static native long xnNodeInfoListGetCurrent(long it);
+	static native long xnNodeInfoListGetNext(long it);
+	//static native long xnNodeInfoListGetPrevious(long it);
+
+	// Queries
+	static native int xnNodeQueryAllocate(OutArg<Long> ppQuery);
+	static native void xnNodeQueryFree(long pQuery);
+	static native int xnNodeQuerySetVendor(long pQuery, String strVendor);
+	static native int xnNodeQuerySetName(long pQuery, String strName);
+	static native int xnNodeQuerySetMinVersion(long pQuery, byte major, byte minor, short maintenance, int build);
+	static native int xnNodeQuerySetMaxVersion(long pQuery, byte major, byte minor, short maintenance, int build);
+	static native int xnNodeQueryAddSupportedCapability(long pQuery, String strNeededCapability);
+	static native int xnNodeQueryAddSupportedMapOutputMode(long pQuery, int xRes, int yRes, int FPS);
+	static native int xnNodeQuerySetSupportedMinUserPositions(long pQuery, int nCount);
+	static native int xnNodeQuerySetExistingNodeOnly(long pQuery, boolean bExistingNode);
+	static native int xnNodeQuerySetNonExistingNodeOnly(long pQuery, boolean bNonExistingNode);
+	static native int xnNodeQueryAddNeededNode(long pQuery, String strInstanceName);
+	static native int xnNodeQuerySetCreationInfo(long pQuery, String strCreationInfo);
+	static native int xnNodeQueryFilterList(long pContext, long pQuery, long pList);
+	
+	// Production Node
+	static native int xnProductionNodeAddRef(long hNode);
+	static native void xnProductionNodeRelease(long hNode);
+	
+	static native long xnGetNodeInfo(long hNode);
+	static native String xnGetNodeName(long hNode);
+	static native long xnGetRefContextFromNodeHandle(long hNode);
+	static native boolean xnIsCapabilitySupported(long hInstance, String strCapabilityName);
+	static native int xnSetIntProperty(long hInstance, String strName, long nValue);
+	static native int xnSetRealProperty(long hInstance, String strName, double dValue);
+	static native int xnSetStringProperty(long hInstance, String strName, String strValue);
+	static native int xnSetGeneralProperty(long hInstance, String strName, int nBufferSize, long pBuffer);
+	static native int xnSetGeneralPropertyArray(long hInstance, String strName, byte[] buffer);
+	static native int xnGetIntProperty(long hInstance, String strName, OutArg<Long> pnValue);
+	static native int xnGetRealProperty(long hInstance, String strName, OutArg<Double> pdValue);
+	static native int xnGetStringProperty(long hInstance, String strName, OutArg<String> csValue);
+	static native int xnGetGeneralProperty(long hInstance, String strName, int nBufferSize, long pBuffer);
+	static native int xnGetGeneralPropertyArray(long hInstance, String strName, byte[] buffer);
+	static native int xnLockNodeForChanges(long hInstance, OutArg<Integer> phLock);
+	static native int xnUnlockNodeForChanges(long hInstance, int hLock);
+	static native int xnLockedNodeStartChanges(long hInstance, int hLock);
+	static native int xnLockedNodeEndChanges(long hInstance, int hLock);
+	static native int xnAddNeededNode(long hInstance, long hNeededNode);
+	static native int xnRemoveNeededNode(long hInstance, long hNeededNode);
+	
+	// Device
+	static native int xnCreateDevice(long pContext, OutArg<Long> phDevice, long pQuery, long pErrors);
+
+	// Device Identification Capability
+	static native int xnGetDeviceName(long hInstance, OutArg<String> result);
+	static native int xnGetVendorSpecificData(long hInstance, OutArg<String> result);
+	static native int xnGetSerialNumber(long hInstance, OutArg<String> result);
+
+	// Error State Capability
+	static native int xnGetNodeErrorState(long hInstance);
+	static native int xnRegisterToNodeErrorStateChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromNodeErrorStateChange(long hInstance, long hCallback);
+
+	// General Int Capability
+	static native int xnGetGeneralIntRange(long hNode, String strCap, OutArg<Integer> pnMin, OutArg<Integer> pnMax, OutArg<Integer> pnStep, OutArg<Integer> pnDefault, OutArg<Boolean> pbIsAutoSupported);
+	static native int xnGetGeneralIntValue(long hNode, String strCap, OutArg<Integer> pnValue);
+	static native int xnSetGeneralIntValue(long hNode, String strCap, int nValue);
+	static native int xnRegisterToGeneralIntValueChange(long hInstance, String strCap, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromGeneralIntValueChange(long hNode, String strCap, long hCallback);
+	
+	// Generator
+	static native int xnStartGenerating(long hInstance);
+	static native boolean xnIsGenerating(long hInstance);
+	static native int xnStopGenerating(long hInstance);
+	static native int xnRegisterToGenerationRunningChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromGenerationRunningChange(long hInstance, long hCallback);
+	static native int xnRegisterToNewDataAvailable(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromNewDataAvailable(long hInstance, long hCallback);
+	static native boolean xnIsNewDataAvailable(long hInstance, OutArg<Long> pnTimestamp);
+	static native int xnWaitAndUpdateData(long hInstance);
+	static native boolean xnIsDataNew(long hInstance);
+	static native long xnGetData(long hInstance);
+	static native int xnGetDataSize(long hInstance);
+	static native long xnGetTimestamp(long hInstance);
+	static native int xnGetFrameID(long hInstance);
+
+	// Mirror Capability
+	static native int xnSetMirror(long hInstance, boolean bMirror);
+	static native boolean xnIsMirrored(long hInstance);
+	static native int xnRegisterToMirrorChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromMirrorChange(long hInstance, long hCallback);
+
+	// Alternative View Point
+	static native boolean xnIsViewPointSupported(long hInstance, long hOther);
+	static native int xnSetViewPoint(long hInstance, long hOther);
+	static native int xnResetViewPoint(long hInstance);
+	static native boolean xnIsViewPointAs(long hInstance, long hOther);
+	static native int xnRegisterToViewPointChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromViewPointChange(long hInstance, long hCallback);
+
+	// Frame Sync
+	static native boolean xnCanFrameSyncWith(long hInstance, long hOther);
+	static native int xnFrameSyncWith(long hInstance, long hOther);
+	static native int xnStopFrameSyncWith(long hInstance, long hOther);
+	static native boolean xnIsFrameSyncedWith(long hInstance, long hOther);
+	static native int xnRegisterToFrameSyncChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromFrameSyncChange(long hInstance, long hCallback);
+
+	// Map Generators
+	static native int xnGetSupportedMapOutputModesCount(long hInstance);
+	static native int xnGetSupportedMapOutputModes(long hInstance, MapOutputMode[] aModes);
+	static native int xnSetMapOutputMode(long hInstance, int xRes, int yRes, int FPS);
+	static native int xnGetMapOutputMode(long hInstance, OutArg<Integer> pxRes, OutArg<Integer> pyRes, OutArg<Integer> pFPS);
+	static native int xnRegisterToMapOutputModeChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromMapOutputModeChange(long hInstance, long hCallback);
+	static native int xnGetBytesPerPixel(long hInstance);
+	
+	// Cropping
+	static native int xnSetCropping(long hInstance, int xOffset, int yOffset, int xSize, int ySize, boolean enabled);
+	static native int xnGetCropping(long hInstance, OutArg<Integer> xOffset, OutArg<Integer> yOffset, OutArg<Integer> xSize, OutArg<Integer> ySize, OutArg<Boolean> enabled);
+	static native int xnRegisterToCroppingChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromCroppingChange(long hInstance, long hCallback);
+
+	// Anti Flicker
+	static native int xnSetPowerLineFrequency(long hGenerator, int nFrequency);
+	static native int xnGetPowerLineFrequency(long hGenerator);
+	static native int xnRegisterToPowerLineFrequencyChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromPowerLineFrequencyChange(long hGenerator, long hCallback);
+
+	// Depth
+	static native int xnCreateDepthGenerator(long pContext, OutArg<Long> phDepthGenerator, long pQuery, long pErrors);
+	static native short xnGetDeviceMaxDepth(long hInstance);
+	static native int xnGetDepthFieldOfView(long hInstance, OutArg<Double> hFOV, OutArg<Double> vFOV);
+	static native int xnRegisterToDepthFieldOfViewChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromDepthFieldOfViewChange(long hInstance, long hCallback);
+	static native int xnConvertProjectiveToRealWorld(long hInstance, Point3D[] aProjective, Point3D[] aRealWorld);
+	static native int xnConvertRealWorldToProjective(long hInstance, Point3D[] aRealWorld, Point3D[] aProjective);
+	static native long xnGetDepthMap(long hInstance);
+	static native void xnGetDepthMetaData(long hInstance, DepthMetaData metaData);
+
+	// User Position
+	static native int xnGetSupportedUserPositionsCount(long hInstance);
+	static native int xnSetUserPosition(long hInstance, int nIndex, float xMin, float yMin, float zMin, float xMax, float yMax, float zMax);
+	static native int xnGetUserPosition(long hInstance, int nIndex, OutArg<BoundingBox3D> pPosition);
+	static native int xnRegisterToUserPositionChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromUserPositionChange(long hInstance, long hCallback);
+
+	// Image
+	static native int xnCreateImageGenerator(long pContext, OutArg<Long> phImageGenerator, long pQuery, long pErrors);
+	//static native XnRGB24Pixel* xnGetRGB24ImageMap(long hInstance);
+	//static native XnYUV422DoublePixel* xnGetYUV422ImageMap(long hInstance);
+	//static native XnGrayscale8Pixel* xnGetGrayscale8ImageMap(long hInstance);
+	//static native XnGrayscale16Pixel* xnGetGrayscale16ImageMap(long hInstance);
+	static native long xnGetImageMap(long hInstance);
+	static native boolean xnIsPixelFormatSupported(long hInstance, int Format);
+	static native int xnSetPixelFormat(long hInstance, int Format);
+	static native int xnGetPixelFormat(long hInstance);
+	static native int xnRegisterToPixelFormatChange(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromPixelFormatChange(long hInstance, long hCallback);
+	static native void xnGetImageMetaData(long hInstance, ImageMetaData pMetaData);
+
+	// IR
+	static native int xnCreateIRGenerator(long pContext, OutArg<Long> phIRGenerator, long pQuery, long pErrors);
+	static native long xnGetIRMap(long hInstance);
+	static native void xnGetIRMetaData(long hInstance, IRMetaData pMetaData);
+
+	// Gestures
+	static native int xnCreateGestureGenerator(long pContext, OutArg<Long> phGestureGenerator, long pQuery, long pErrors);
+	static native int xnAddGesture(long hInstance, String strGesture);
+	static native int xnAddGesture(long hInstance, String strGesture, float minx, float miny, float minz, float maxx, float maxy, float maxz);
+	static native int xnRemoveGesture(long hInstance, String strGesture);
+//	static native int xnGetActiveGestures(long hInstance, XnChar** pstrGestures, XnUInt16* nGestures);
+	static native int xnGetAllActiveGestures(long hInstance, OutArg<String[]> gestures);
+//	static native int xnEnumerateGestures(long hInstance, XnChar** pstrGestures, XnUInt16* nGestures);
+	static native int xnGetNumberOfAvailableGestures(long hInstance);
+	static native int xnEnumerateAllGestures(long hInstance, OutArg<String[]> gestures);
+	static native boolean xnIsGestureAvailable(long hInstance, String strGesture);
+	static native boolean xnIsGestureProgressSupported(long hInstance, String strGesture);
+	static native int xnRegisterGestureCallbacks(long hInstance, Object obj, String gestureRecognizedCB, String gestureProgressCB, OutArg<Long> phCallback);
+	static native void xnUnregisterGestureCallbacks(long hInstance, long hCallback);
+	static native int xnRegisterToGestureChange(long hInstance, Object obj, String cb, OutArg<Long> phCallback);
+	static native void xnUnregisterFromGestureChange(long hInstance, long hCallback);
+	static native int xnRegisterToGestureIntermediateStageCompleted(long hInstance, Object obj, String cb, OutArg<Long> phCallback);
+	static native void xnUnregisterFromGestureIntermediateStageCompleted(long hInstance, long hCallback);
+	static native int xnRegisterToGestureReadyForNextIntermediateStage(long hInstance, Object obj, String cb, OutArg<Long> phCallback);
+	static native void xnUnregisterFromGestureReadyForNextIntermediateStage(long hInstance, long hCallback);
+
+	// Scene
+	static native int xnCreateSceneAnalyzer(
+			long pContext,
+			OutArg<Long> phSceneAnalyzer,
+			long pQuery, 
+			long pErrors
+			);
+	static native long xnGetLabelMap(long hInstance);
+	static native int xnGetFloor(long hInstance, OutArg<Point3D> normal, OutArg<Point3D> point);
+	static native void xnGetSceneMetaData(long hInstance, SceneMetaData pMetaData);
+
+	// User
+	static native int xnCreateUserGenerator(
+			long pContext,
+			OutArg<Long> phUserGenerator,
+			long pQuery, 
+			long pErrors
+			);
+	static native int xnGetNumberOfUsers(long hInstance);
+	static native int xnGetUsers(long hInstance, OutArg<Integer[]> ids);
+	static native int xnGetUserCoM(long hInstance, int user, OutArg<Point3D> pCoM);
+	static native int xnGetUserPixels(long hInstance, int user, SceneMetaData pScene);
+	static native int xnRegisterUserCallbacks(long hInstance, Object obj, String newUserCb, String lostUserCB, OutArg<Long> phCallback);
+	static native void xnUnregisterUserCallbacks(long hInstance, long hCallback);
+	static native int xnRegisterToUserExit(long hInstance, Object obj, String cb, OutArg<Long> phCallback);
+	static native void xnUnregisterFromUserExit(long hInstance, long hCallback);
+	static native int xnRegisterToUserReEnter(long hInstance, Object obj, String cb, OutArg<Long> phCallback);
+	static native void xnUnregisterFromUserReEnter(long hInstance, long hCallback);
+
+	// Skeleton Capability
+	static native boolean xnIsJointAvailable(long hInstance, int eJoint);
+	static native boolean xnIsProfileAvailable(long hInstance, int eProfile);
+	static native int xnSetSkeletonProfile(long hInstance, int  eProfile);
+	static native int xnSetJointActive(long hInstance, int eJoint, boolean bState);
+	static native boolean xnIsJointActive(long hInstance, int eJoint);
+	static native int xnRegisterToJointConfigurationChange(long hInstance, Object obj, String cb, OutArg<Long> phCallback);
+	static native void xnUnregisterFromJointConfigurationChange(long hInstance, long hCallback);
+	static native int xnEnumerateActiveJoints(long hInstance, OutArg<Integer[]> pJoints);
+	static native int xnGetSkeletonJoint(long hInstance, int user, int eJoint, OutArg<SkeletonJointTransformation> pJoint);
+	static native int xnGetSkeletonJointPosition(long hInstance, int user, int eJoint, OutArg<SkeletonJointPosition> pJoint);
+	static native int xnGetSkeletonJointOrientation(long hInstance, int user, int eJoint, OutArg<SkeletonJointOrientation> pJoint);
+	static native boolean xnIsSkeletonTracking(long hInstance, int user);
+	static native boolean xnIsSkeletonCalibrated(long hInstance, int user);
+	static native boolean xnIsSkeletonCalibrating(long hInstance, int user);
+	static native int xnRequestSkeletonCalibration(long hInstance, int user, boolean bForce);
+	static native int xnAbortSkeletonCalibration(long hInstance, int user);
+	static native int xnSaveSkeletonCalibrationDataToFile(long hInstance, int user, String strFileName);
+	static native int xnLoadSkeletonCalibrationDataFromFile(long hInstance, int user, String strFileName);
+	static native int xnSaveSkeletonCalibrationData(long hInstance, int user, int nSlot);
+	static native int xnLoadSkeletonCalibrationData(long hInstance, int user, int nSlot);
+	static native int xnClearSkeletonCalibrationData(long hInstance, int nSlot);
+	static native boolean xnIsSkeletonCalibrationData(long hInstance, int nSlot);
+	static native int xnStartSkeletonTracking(long hInstance, int user);
+	static native int xnStopSkeletonTracking(long hInstance, int user);
+	static native int xnResetSkeleton(long hInstance, int user);
+	static native boolean xnNeedPoseForSkeletonCalibration(long hInstance);
+	static native int xnGetSkeletonCalibrationPose(long hInstance, OutArg<String> strPose);
+	static native int xnSetSkeletonSmoothing(long hInstance, float fFactor);
+	static native int xnRegisterToCalibrationStart(long hInstance, Object obj, String calibrationStartCB, OutArg<Long> phCallback);
+	static native void xnUnregisterFromCalibrationStart(long hInstnace, long hCallback);
+	static native int xnRegisterToCalibrationInProgress(long hInstance, Object obj, String calibrationInProgressCB, OutArg<Long> phCallback);
+	static native void xnUnregisterFromCalibrationInProgress(long hInstance, long hCallback);
+	static native int xnRegisterToCalibrationComplete(long hInstance, Object obj, String calibrationCompleteCB, OutArg<Long> phCallback);
+	static native void xnUnregisterFromCalibrationComplete(long hInstance, long hCallback);
+	// Pose Detection
+	static native int xnGetNumberOfPoses(long hInstance);
+	static native int xnGetAllAvailablePoses(long hInstance, OutArg<String[]> pstrPoses);
+	static native int xnStartPoseDetection(long hInstance, String strPose, int user);
+	static native int xnStopPoseDetection(long hInstance, int user);
+	static native int xnStopSinglePoseDetection(long hInstance, int user, String strPose);
+	static native int xnRegisterToPoseDetected(long hInstance, Object obj, String cb, OutArg<Long> phCallback);
+	static native void xnUnregisterFromPoseDetected(long hInstance, long hCallback);
+	static native int xnRegisterToOutOfPose(long hInstance, Object obj, String cb, OutArg<Long> phCallback);
+	static native void xnUnregisterFromOutOfPose(long hInstance, long hCallback);
+	static native int xnRegisterToPoseDetectionInProgress(long hInstance, Object obj, String poseDetectionInProgressCB, OutArg<Long> phCallback);
+	static native void xnUnregisterFromPoseDetectionInProgress(long hInstance, long hCallback);
+	static native boolean xnIsPoseSupported(long hInstance, String strPose);
+	static native int xnGetPoseStatus(long hInstance, int user, String strPose, OutArg<Long> poseTime, OutArg<Integer> eStatus, OutArg<Integer> eState);
+	// Hands
+	static native int xnCreateHandsGenerator(
+			long pContext,
+			OutArg<Long> phHandsGenerator,
+			long pQuery, 
+			long pErrors
+			);
+	static native int xnRegisterHandCallbacks(long hInstance, Object obj, String createCB, String updateCB, String destroyCB, OutArg<Long> phCallback);
+	static native void xnUnregisterHandCallbacks(long hInstance, long hCallback);
+	static native int xnStopTracking(long hInstance, int user); // XnUserID
+	static native int xnStopTrackingAll(long hInstance);
+	static native int xnStartTracking(long hInstance, float x, float y, float z);
+	static native int xnSetTrackingSmoothing(long hInstance, float fFactor);
+	static native int xnRegisterToHandTouchingFOVEdge(long hInstance, Object obj, String cb, OutArg<Long> phCallback);
+	static native void xnUnregisterFromHandTouchingFOVEdge(long hInstance, long hCallback);
+
+	// Audio
+	static native int xnCreateAudioGenerator(
+			long pContext,
+			OutArg<Long> phAudioGenerator,
+			long pQuery, 
+			long pErrors
+			);
+
+	static native long xnGetAudioBuffer(long hInstance);
+	static native int xnGetSupportedWaveOutputModesCount(long hInstance);
+	static native int xnGetSupportedWaveOutputModes(long hInstance, WaveOutputMode[] aSupportedModes);
+	static native int xnSetWaveOutputMode(long hInstance, int sampleRate, short bitsPerSample, byte numberOfChannels);
+	static native int xnGetWaveOutputMode(long hInstance, OutArg<Integer> sampleRate, OutArg<Short> bitsPerSample, OutArg<Byte> numberOfChannels);
+	static native int xnRegisterToWaveOutputModeChanges(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromWaveOutputModeChanges(long hInstance, long hCallback);
+	static native void xnGetAudioMetaData(long hInstance, AudioMetaData pMetaData);
+/*
+	// Mocks
+	static native int xnMockDepthSetData(long hInstance, int nFrameID, long nTimestamp, int nDataSize, const XnDepthPixel* pData);
+	static native int xnMockImageSetData(long hInstance, int nFrameID, long nTimestamp, int nDataSize, const XnUInt8* pData);
+	static native int xnMockIRSetData(long hInstance, int nFrameID, long nTimestamp, int nDataSize, const XnIRPixel* pData);
+	static native int xnMockAudioSetData(long hInstance, int nFrameID, long nTimestamp, int nDataSize, const XnUInt8* pData);
+	static native int xnMockRawSetData(long hInstance, int nFrameID, long nTimestamp, int nDataSize, const void* pData);
+*/
+	// Codecs
+	static native int xnCreateCodec(long pContext, int codecID, long hInitializerNode, OutArg<Long> phCodec);
+	static native int xnGetCodecID(long hCodec);
+	static native int xnEncodeData(long hCodec, long pSrc, int nSrcSize, 
+								   long pDst, int nDstSize, OutArg<Integer> pnBytesWritten);
+	static native int xnDecodeData(long hCodec, long pSrc, int nSrcSize, 
+								   long pDst, int nDstSize, OutArg<Integer> pnBytesWritten);
+
+	// Recorder
+	static native int xnCreateRecorder(long pContext, String strFormatName, OutArg<Long> phRecorder);
+	static native int xnSetRecorderDestination(long hRecorder, int destType, String strDest);
+	static native int xnGetRecorderDestination(long hRecorder, OutArg<Integer> pSourceType, OutArg<String> strSource);
+	static native int xnAddNodeToRecording(long hRecorder, long hNode, int compression);
+	static native int xnRemoveNodeFromRecording(long hRecorder, long hNode);
+	static native int xnRecord(long hRecorder);
+	static native String xnGetRecorderFormat(long hRecorder);
+
+	// Player
+	static native int xnCreatePlayer(long pContext, String strFormatName, OutArg<Long> phPlayer);
+	static native int xnSetPlayerRepeat(long hPlayer, boolean bRepeat);
+	static native int xnSetPlayerSource(long hPlayer, int sourceType, String strSource);
+	static native int xnGetPlayerSource(long hPlayer, OutArg<Integer> pSourceType, OutArg<String> strSource);
+	static native int xnPlayerReadNext(long hPlayer);
+	static native int xnSeekPlayerToTimeStamp(long hPlayer, long nTimeOffset, int origin);
+	static native int xnSeekPlayerToFrame(long hPlayer, String strNodeName, int nFrameOffset, int origin);
+	static native int xnTellPlayerTimestamp(long hPlayer, OutArg<Long> pnTimestamp);
+	static native int xnTellPlayerFrame(long hPlayer, String strNodeName, OutArg<Integer> pnFrame);
+	static native int xnGetPlayerNumFrames(long hPlayer, String strNodeName, OutArg<Integer> pnFrames);
+	static native String xnGetPlayerSupportedFormat(long hPlayer);
+	static native int xnEnumeratePlayerNodes(long hPlayer, OutArg<Long> ppList);
+	static native boolean xnIsPlayerAtEOF(long hPlayer);
+	static native int xnRegisterToEndOfFileReached(long hInstance, Object obj, String methodName, OutArg<Long> phCallback);
+	static native void xnUnregisterFromEndOfFileReached(long hInstance, long hCallback);
+	static native int xnSetPlaybackSpeed(long hInstance, double dSpeed);
+	static native double xnGetPlaybackSpeed(long hInstance);
+
+	// Script
+	static native int xnCreateScriptNode(long pContext, String strFormat, OutArg<Long> phScript);
+	static native String xnScriptNodeGetSupportedFormat(long hScript);
+	static native int xnLoadScriptFromFile(long hScript, String strFileName);
+	static native int xnLoadScriptFromString(long hScript, String strScript);
+	static native int xnScriptNodeRun(long hScript, long pErrors);
+	
+	// Utils
+	static native String xnProductionNodeTypeToString(int Type);
+	
+	static native int xnResolutionGetXRes(int resolution);
+	static native int xnResolutionGetYRes(int resolution);
+	static native int xnResolutionGetFromXYRes(int xRes, int yRes);
+	static native int xnResolutionGetFromName(String strName);
+	static native String xnResolutionGetName(int resolution);
+
+	static native int xnGetVersion(OutArg<Version> pVersion);
+	static native boolean xnIsTypeGenerator(int type);
+	static native boolean xnIsTypeDerivedFrom(int type, int base);
+
+	/*
+	static native int xnProductionNodeTypeFromString(const XnChar* strType, XnProductionNodeType* pType);
+	
+	static native const XnChar* xnPixelFormatToString(XnPixelFormat format);
+	static native int xnPixelFormatFromString(const XnChar* strName, XnPixelFormat* pFormat);
+	static native XnUInt32 xnGetBytesPerPixelForPixelFormat(XnPixelFormat format);
+	
+	static native XnInt32 xnVersionCompare(const XnVersion* pVersion1, const XnVersion* pVersion2);
+
+	static native int xnProductionNodeDescriptionToString(const XnProductionNodeDescription* pDescription, XnChar* csResult, XnUInt32 nSize);
+	static native int xnVersionToString(const XnVersion* pVersion, XnChar* csResult, XnUInt32 nSize);
+	*/
+	
+	static native int xnGetBytesPerPixelForPixelFormat(int format);
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/NodeInfo.java b/Wrappers/OpenNI.java/src/org/OpenNI/NodeInfo.java
new file mode 100644
index 0000000..2b1a18c
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/NodeInfo.java
@@ -0,0 +1,70 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class NodeInfo extends ObjectWrapper 
+{
+	public ProductionNodeDescription getDescription()
+	{
+		return NativeMethods.xnNodeInfoGetDescription(toNative());
+	}
+	
+	public String getInstanceName()
+	{
+		return NativeMethods.xnNodeInfoGetInstanceName(toNative());
+	}
+	
+	public String getCreationInfo()
+	{
+		return NativeMethods.xnNodeInfoGetCreationInfo(toNative());
+	}
+	
+	public NodeInfoList getNeededNodes() throws GeneralException
+	{
+		return new NodeInfoList(NativeMethods.xnNodeInfoGetNeededNodes(toNative()));
+	}
+	
+	public ProductionNode getInstance() throws GeneralException
+	{
+		long hNode = NativeMethods.xnNodeInfoGetRefHandle(toNative());
+		return Context.createProductionNodeFromNative(hNode);
+	}
+	
+	@Override
+	public String toString() 
+	{
+		OutArg<String> result = new OutArg<String>();
+		NativeMethods.xnNodeInfoGetTreeStringRepresentation(toNative(), result);
+		return result.value;
+	}
+	
+	protected NodeInfo(long pNodeInfo) throws GeneralException 
+	{
+		super(pNodeInfo);
+	}
+	
+	@Override
+	protected void freeObject(long ptr) 
+	{
+		// no need to free
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/NodeInfoList.java b/Wrappers/OpenNI.java/src/org/OpenNI/NodeInfoList.java
new file mode 100644
index 0000000..9020558
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/NodeInfoList.java
@@ -0,0 +1,139 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+public class NodeInfoList extends ObjectWrapper implements Iterable<NodeInfo>
+{
+	NodeInfoList(long ptr)
+	{
+		super(ptr);
+	}
+	
+	public void add(ProductionNodeDescription description, String creationInfo, NodeInfoList neededNodes) throws StatusException
+	{
+		long pNativeDesc = description.createNative();
+		int status = NativeMethods.xnNodeInfoListAdd(toNative(), pNativeDesc, creationInfo,
+				neededNodes == null ? 0 : neededNodes.toNative());
+		ProductionNodeDescription.freeNative(pNativeDesc);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void addNode(NodeInfo nodeInfo) throws StatusException
+	{
+		int status = NativeMethods.xnNodeInfoListAddNode(toNative(), nodeInfo.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void addNodeFromList(Iterator<NodeInfo> current) throws StatusException
+	{
+		NodeInfoListIterator iter = (NodeInfoListIterator)current;
+		int status = NativeMethods.xnNodeInfoListAddNodeFromList(toNative(), iter.it);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void remove(Iterator<NodeInfo> location) throws StatusException
+	{
+		NodeInfoListIterator iter = (NodeInfoListIterator)location;
+		int status = NativeMethods.xnNodeInfoListRemove(toNative(), iter.it);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void clear() throws StatusException
+	{
+		int status = NativeMethods.xnNodeInfoListClear(toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void append(NodeInfoList other) throws StatusException
+	{
+		int status = NativeMethods.xnNodeInfoListAppend(toNative(), other.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public boolean isEmpty()
+	{
+		return NativeMethods.xnNodeInfoListIsEmpty(toNative());
+	}
+	
+	public void filter(Query query, Context context) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQueryFilterList(context.toNative(), query.toNative(), toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	@Override
+	public Iterator<NodeInfo> iterator() {
+		return new NodeInfoListIterator(toNative());
+	}
+
+	@Override
+	protected void freeObject(long ptr) 
+	{
+		NativeMethods.xnNodeInfoListFree(ptr);
+	}
+	
+	private class NodeInfoListIterator implements Iterator<NodeInfo>
+	{
+		NodeInfoListIterator(long pNodeInfoList)
+		{
+			this.it = NativeMethods.xnNodeInfoListGetFirst(pNodeInfoList);
+		}
+		
+		@Override
+		public boolean hasNext() 
+		{
+			return NativeMethods.xnNodeInfoListIteratorIsValid(this.it);
+		}
+
+		@Override
+		public NodeInfo next() 
+		{
+			if (!hasNext())
+				throw new NoSuchElementException();
+			
+			NodeInfo next = null;
+			
+			try 
+			{
+				next = new NodeInfo(NativeMethods.xnNodeInfoListGetCurrent(this.it));
+			} 
+			catch (GeneralException e) 
+			{
+				// can't happen
+			}
+			
+			this.it = NativeMethods.xnNodeInfoListGetNext(this.it);
+			return next;
+		}
+
+		@Override
+		public void remove() 
+		{
+			throw new UnsupportedOperationException();
+		}
+
+		protected long it;
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/NodeType.java b/Wrappers/OpenNI.java/src/org/OpenNI/NodeType.java
new file mode 100644
index 0000000..407b685
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/NodeType.java
@@ -0,0 +1,123 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class NodeType 
+{
+	public static NodeType INVALID = new NodeType(0);
+
+	/** A device node **/
+	public static NodeType DEVICE = new NodeType(1);
+
+	/** A depth generator **/
+	public static NodeType DEPTH = new NodeType(2);
+
+	/** An image generator **/
+	public static NodeType IMAGE = new NodeType(3);
+
+	/** An audio generator **/
+	public static NodeType AUDIO = new NodeType(4);
+
+	/** An IR generator **/
+	public static NodeType IR = new NodeType(5);
+
+	/** A user generator **/
+	public static NodeType USER = new NodeType(6);
+
+	/** A recorder **/
+	public static NodeType RECORDER = new NodeType(7);
+
+	/** A player **/
+	public static NodeType PLAYER = new NodeType(8);
+
+	/** A gesture generator **/
+	public static NodeType GESTURE = new NodeType(9);
+
+	/** A scene analyzer **/
+	public static NodeType SCENE = new NodeType(10);
+
+	/** A hands generator **/
+	public static NodeType HANDS = new NodeType(11);
+
+	/** A Codec **/
+	public static NodeType CODEC = new NodeType(12);
+
+	/** A general production node **/
+	public static NodeType PRODUCTION_NODE = new NodeType(13);
+
+	/** A general generator **/
+	public static NodeType GENERATOR = new NodeType(14);
+
+	/** A general map generator **/
+	public static NodeType MAP_GENERATOR = new NodeType(15);
+
+	public static NodeType SCRIPT_NODE = new NodeType(16);
+	
+	NodeType(int val)
+	{
+		this.val = val;
+	}
+	
+	@Override
+	public int hashCode()
+	{
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + this.val;
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj)
+	{
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		NodeType other = (NodeType) obj;
+		if (this.val != other.val)
+			return false;
+		return true;
+	}
+
+	public int toNative() { return this.val; }
+	
+	@Override
+	public String toString()
+	{
+		return NativeMethods.xnProductionNodeTypeToString(toNative());
+	}
+	
+	public boolean isGenerator()
+	{
+		return NativeMethods.xnIsTypeGenerator(toNative());
+	}
+	
+	public boolean isDerivedFrom(NodeType base)
+	{
+		return NativeMethods.xnIsTypeDerivedFrom(toNative(), base.toNative());
+	}
+	
+	private final int val;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/NodeWrapper.java b/Wrappers/OpenNI.java/src/org/OpenNI/NodeWrapper.java
new file mode 100644
index 0000000..a0e2e6a
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/NodeWrapper.java
@@ -0,0 +1,54 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class NodeWrapper extends ObjectWrapper
+{
+	NodeWrapper(Context context, long hNode, boolean addRef) throws StatusException
+	{
+		super(hNode);
+		
+		this.context = context;
+		
+		if (addRef)
+		{
+			WrapperUtils.throwOnError(NativeMethods.xnProductionNodeAddRef(hNode));
+		}
+	}
+	
+	public Context getContext()
+	{
+		return this.context;
+	}
+	
+	public String getName()
+	{
+		return NativeMethods.xnGetNodeName(toNative());
+	}
+
+	protected void freeObject(long ptr)
+	{
+		NativeMethods.xnProductionNodeRelease(ptr);
+	}
+	
+	private Context context;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ObjectWrapper.java b/Wrappers/OpenNI.java/src/org/OpenNI/ObjectWrapper.java
new file mode 100644
index 0000000..5618f1f
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ObjectWrapper.java
@@ -0,0 +1,57 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public abstract class ObjectWrapper
+{
+	public ObjectWrapper(long ptr)
+	{
+		if (ptr == 0)
+		{
+			throw new NullPointerException("JavaWrapper: Trying to wrap a null object!");
+		}
+		this.ptr = ptr;
+	}
+	
+	public long toNative()
+	{
+		return this.ptr;
+	}
+
+	protected void finalize()
+	{
+		dispose();
+	}
+	
+	public void dispose()
+	{
+		if (this.ptr != 0)
+		{
+			freeObject(this.ptr);
+			this.ptr = 0;
+		}
+	}
+	
+	protected abstract void freeObject(long ptr);
+	
+	private long ptr;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Observable.java b/Wrappers/OpenNI.java/src/org/OpenNI/Observable.java
new file mode 100644
index 0000000..06989c4
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Observable.java
@@ -0,0 +1,71 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.ArrayList;
+
+public abstract class Observable<Args> implements IObservable<Args> 
+{
+	public Observable()
+	{
+		this.observers = new ArrayList<IObserver<Args>>();
+	}
+	
+	@Override
+	public void addObserver(IObserver<Args> observer) throws StatusException 
+	{
+		if (this.observers.size() == 0)
+		{
+			OutArg<Long> hCallback = new OutArg<Long>();
+			int status = registerNative(hCallback);
+			WrapperUtils.throwOnError(status);
+			this.hCallback = hCallback.value;
+		}
+		
+		this.observers.add(observer);
+	}
+
+	@Override
+	public void deleteObserver(IObserver<Args> observer) 
+	{
+		this.observers.remove(observer);
+
+		if (this.observers.size() == 0)
+		{
+			unregisterNative(this.hCallback);
+		}
+	}
+	
+	public void notify(Args args)
+	{
+		for (IObserver<Args> observer : this.observers)
+		{
+			observer.update(this, args);
+		}
+	}
+	
+	protected abstract int registerNative(OutArg<Long> phCallback) throws StatusException;
+	protected abstract void unregisterNative(long hCallback);
+
+	private ArrayList<IObserver<Args>> observers; 
+	private long hCallback;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/OutArg.java b/Wrappers/OpenNI.java/src/org/OpenNI/OutArg.java
new file mode 100644
index 0000000..943af31
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/OutArg.java
@@ -0,0 +1,27 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class OutArg<T> 
+{
+	public T value;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/OutputMetaData.java b/Wrappers/OpenNI.java/src/org/OpenNI/OutputMetaData.java
new file mode 100644
index 0000000..85276fa
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/OutputMetaData.java
@@ -0,0 +1,71 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class OutputMetaData 
+{
+	public long getTimestamp() {
+		return timestamp;
+	}
+	
+	public void setTimestamp(long timestamp) {
+		this.timestamp = timestamp;
+	}
+	
+	public int getFrameID() {
+		return frameID;
+	}
+	
+	public void setFrameID(int frameID) {
+		this.frameID = frameID;
+	}
+	
+	public int getDataSize() {
+		return dataSize;
+	}
+	
+	public void setDataSize(int dataSize) {
+		this.dataSize = dataSize;
+	}
+	
+	public boolean getIsNew() {
+		return isNew;
+	}
+	
+	public void setIsNew(boolean isNew) {
+		this.isNew = isNew;
+	}
+
+	public long getDataPtr() {
+		return this.dataPtr;
+	}
+	
+	public void setDataPtr(long ptr) {
+		this.dataPtr = ptr;
+	}
+
+	private long timestamp;
+	private int frameID;
+	private int dataSize;
+	private boolean isNew;
+	private long dataPtr;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/PixelFormat.java b/Wrappers/OpenNI.java/src/org/OpenNI/PixelFormat.java
new file mode 100644
index 0000000..d9273ee
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/PixelFormat.java
@@ -0,0 +1,57 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum PixelFormat 
+{
+	RGB24 (1),
+	YUV422 (2),
+	GRAYSCALE_8BIT (3),
+	GRAYSCALE_16BIT (4);
+	
+	PixelFormat(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public int getBytesPerPixel()
+	{
+		return NativeMethods.xnGetBytesPerPixelForPixelFormat(this.val);
+	}
+	
+	public static PixelFormat fromNative(int value)
+	{
+		for (PixelFormat type : PixelFormat.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private int val;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Plane3D.java b/Wrappers/OpenNI.java/src/org/OpenNI/Plane3D.java
new file mode 100644
index 0000000..53c91c3
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Plane3D.java
@@ -0,0 +1,45 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class Plane3D
+{
+	public Plane3D(Point3D normal, Point3D point)
+	{
+		this.normal = normal;
+		this.point = point;
+	}
+	
+	public Point3D getNormal()
+	{
+		return this.normal;
+	}
+	public Point3D getPoint()
+	{
+		return this.point;
+	}
+	
+	
+	private final Point3D normal;
+	private final Point3D point;
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Player.java b/Wrappers/OpenNI.java/src/org/OpenNI/Player.java
new file mode 100644
index 0000000..1165c26
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Player.java
@@ -0,0 +1,160 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class Player extends ProductionNode 
+{
+	Player(Context context, long nodeHandle, boolean addRef) throws StatusException 
+	{
+		super(context, nodeHandle, addRef);
+		
+		this.eofReached = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToEndOfFileReached(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromEndOfFileReached(toNative(), hCallback);
+			}
+		};
+	}
+
+	public static Player create(Context context, String formatName) throws GeneralException
+	{
+		OutArg<Long> phPlayer = new OutArg<Long>();
+		int status = NativeMethods.xnCreatePlayer(context.toNative(), formatName, phPlayer);
+		WrapperUtils.throwOnError(status);
+		Player player = (Player)context.createProductionNodeObject(phPlayer.value, NodeType.PLAYER);
+		NativeMethods.xnProductionNodeRelease(phPlayer.value);
+		return player;
+	}
+
+	public String getFormat()
+	{
+		return NativeMethods.xnGetPlayerSupportedFormat(toNative());
+	}
+	
+	public void setSource(RecordMedium medium, String name) throws StatusException
+	{
+		int status = NativeMethods.xnSetPlayerSource(toNative(), medium.toNative(), name);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public RecordMedium getSourceMedium() throws StatusException
+	{
+		OutArg<Integer> pMedium = new OutArg<Integer>();
+		OutArg<String> pDest = new OutArg<String>();
+		int status = NativeMethods.xnGetPlayerSource(toNative(), pMedium, pDest);
+		WrapperUtils.throwOnError(status);
+		return RecordMedium.fromNative(pMedium.value);
+	}
+
+	public String getSource() throws StatusException
+	{
+		OutArg<Integer> pMedium = new OutArg<Integer>();
+		OutArg<String> pDest = new OutArg<String>();
+		int status = NativeMethods.xnGetPlayerSource(toNative(), pMedium, pDest);
+		WrapperUtils.throwOnError(status);
+		return pDest.value;
+	}
+
+	public void setRepeat(boolean repeat) throws StatusException
+	{
+		int status = NativeMethods.xnSetPlayerRepeat(toNative(), repeat);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void readNext() throws StatusException
+	{
+		int status = NativeMethods.xnPlayerReadNext(toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void seekToTimestamp(PlayerSeekOrigin origin, long offset) throws StatusException
+	{
+		int status = NativeMethods.xnSeekPlayerToTimeStamp(toNative(), offset, origin.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void seekToFrame(ProductionNode node, PlayerSeekOrigin origin, int offset) throws StatusException
+	{
+		int status = NativeMethods.xnSeekPlayerToFrame(toNative(), node.getName(), offset, origin.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public long tellTimestamp() throws StatusException
+	{
+		OutArg<Long> pnTimestamp = new OutArg<Long>();
+		int status = NativeMethods.xnTellPlayerTimestamp(toNative(), pnTimestamp);
+		WrapperUtils.throwOnError(status);
+		return pnTimestamp.value;
+	}
+
+	public int tellFrame(ProductionNode node) throws StatusException
+	{
+		OutArg<Integer> pnFrameID = new OutArg<Integer>();
+		int status = NativeMethods.xnTellPlayerFrame(toNative(), node.getName(), pnFrameID);
+		WrapperUtils.throwOnError(status);
+		return pnFrameID.value;
+	}
+	
+	public int getNumberOfFrames(ProductionNode node) throws StatusException
+	{
+		OutArg<Integer> pnFrames = new OutArg<Integer>();
+		int status = NativeMethods.xnGetPlayerNumFrames(toNative(), node.getName(), pnFrames);
+		WrapperUtils.throwOnError(status);
+		return pnFrames.value;
+	}
+
+	public NodeInfoList enumerateNodes() throws StatusException
+	{
+		OutArg<Long> ppList = new OutArg<Long>();
+		int status = NativeMethods.xnEnumeratePlayerNodes(toNative(), ppList);
+		WrapperUtils.throwOnError(status);
+		return new NodeInfoList(ppList.value);
+	}
+	
+	public boolean isEOF()
+	{
+		return NativeMethods.xnIsPlayerAtEOF(toNative());
+	}
+	
+	public IStateChangedObservable getEOFReachedEvent() { return this.eofReached; }
+	
+	public double getPlaybackSpeed()
+	{
+		return NativeMethods.xnGetPlaybackSpeed(toNative());
+	}
+	
+	public void setPlaybackSpeed(double speed) throws StatusException
+	{
+		int status = NativeMethods.xnSetPlaybackSpeed(toNative(), speed);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	private StateChangedObservable eofReached;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/PlayerSeekOrigin.java b/Wrappers/OpenNI.java/src/org/OpenNI/PlayerSeekOrigin.java
new file mode 100644
index 0000000..def188a
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/PlayerSeekOrigin.java
@@ -0,0 +1,52 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum PlayerSeekOrigin
+{
+	SET (0),
+	CURRENT (1),
+	END (2);
+	
+	PlayerSeekOrigin(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static PlayerSeekOrigin fromNative(int value)
+	{
+		for (PlayerSeekOrigin type : PlayerSeekOrigin.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private final int val;
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Point3D.java b/Wrappers/OpenNI.java/src/org/OpenNI/Point3D.java
new file mode 100644
index 0000000..d93dc62
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Point3D.java
@@ -0,0 +1,60 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class Point3D
+{
+	public Point3D(float x, float y, float z)
+	{
+		this.X = x;
+		this.Y = y;
+		this.Z = z;
+	}
+	public Point3D()
+	{
+		this(0f,0f,0f);
+	}
+	public void setPoint(float x, float y, float z)
+	{
+		this.X = x;
+		this.Y = y;
+		this.Z = z;
+	}
+
+	public float getX()
+	{
+		return X;
+	}
+	public float getY()
+	{
+		return Y;
+	}
+	public float getZ()
+	{
+		return Z;
+	}
+	
+	
+	private float X;
+	private float Y;
+	private float Z;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionCapability.java
new file mode 100644
index 0000000..10b78cd
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionCapability.java
@@ -0,0 +1,170 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class PoseDetectionCapability extends CapabilityBase
+{
+	public PoseDetectionCapability(ProductionNode node) throws StatusException
+	{
+		super(node);
+		
+		// Events
+		poseDetectedEvent = new Observable<PoseDetectionEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToPoseDetected(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromPoseDetected(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(String pose, int user)
+			{
+				notify(new PoseDetectionEventArgs(pose, user));
+			}
+		};
+		outOfPoseEvent = new Observable<PoseDetectionEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToOutOfPose(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromOutOfPose(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(String pose, int user)
+			{
+				notify(new PoseDetectionEventArgs(pose, user));
+			}
+		};
+		poseDetectionInProgressEvent = new Observable<PoseDetectionInProgressEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToPoseDetectionInProgress(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromPoseDetectionInProgress(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(String pose, int user, int status)
+			{
+				notify(new PoseDetectionInProgressEventArgs(pose, user, PoseDetectionStatus.fromNative(status)));
+			}
+		};
+	}
+
+	public int getNumberOfPoses()
+	{
+		return NativeMethods.xnGetNumberOfPoses(toNative());
+	}
+	
+	public boolean isPoseSupported(String pose)
+	{
+		return NativeMethods.xnIsPoseSupported(toNative(),pose);
+	}
+	
+	public void getPoseStatus(int user, String pose, OutArg<Long> poseTime, OutArg<PoseDetectionStatus> eStatus, OutArg<PoseDetectionState> eState ) throws StatusException
+	{
+		OutArg<Integer> eInnerStatus = new OutArg<Integer>();
+		OutArg<Integer> eInnerState = new OutArg<Integer>();
+		int status = NativeMethods.xnGetPoseStatus(toNative(), user, pose, poseTime, eInnerStatus,eInnerState);
+		eStatus.value = PoseDetectionStatus.fromNative(eInnerStatus.value);
+		eState.value = PoseDetectionState.fromNative(eInnerState.value);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public String[] getAllAvailablePoses() throws StatusException
+	{
+		OutArg<String[]> poses = new OutArg<String[]>();
+		int status = NativeMethods.xnGetAllAvailablePoses(toNative(), poses);
+		WrapperUtils.throwOnError(status);
+		return poses.value;
+	}
+	/**
+	 * @deprecated Out of date. Use startPoseDetection() instead.
+	 */ 
+	@Deprecated
+	 public void StartPoseDetection(String pose, int user) throws StatusException
+	{
+		int status = NativeMethods.xnStartPoseDetection(toNative(), pose, user);
+		WrapperUtils.throwOnError(status);
+	}
+	/**
+	 * @deprecated Out of date. Use stopPoseDetection() instead.
+	 */ 
+	@Deprecated
+	public void StopPoseDetection(int user) throws StatusException
+	{
+		int status = NativeMethods.xnStopPoseDetection(toNative(), user);
+		WrapperUtils.throwOnError(status);
+	}
+	public void startPoseDetection(String pose, int user) throws StatusException
+	{
+		int status = NativeMethods.xnStartPoseDetection(toNative(), pose, user);
+		WrapperUtils.throwOnError(status);
+	}
+	public void stopPoseDetection(int user) throws StatusException
+	{
+		int status = NativeMethods.xnStopPoseDetection(toNative(), user);
+		WrapperUtils.throwOnError(status);
+	}
+	public void stopSinglePoseDetection(int user, String pose) throws StatusException
+	{
+		int status = NativeMethods.xnStopSinglePoseDetection(toNative(), user, pose);
+		WrapperUtils.throwOnError(status);
+	}
+	// Events
+	public IObservable<PoseDetectionEventArgs> getPoseDetectedEvent()
+	{
+		return poseDetectedEvent;
+	}
+	public IObservable<PoseDetectionEventArgs> getOutOfPoseEvent()
+	{
+		return outOfPoseEvent;
+	}
+	public IObservable<PoseDetectionInProgressEventArgs> getPoseDetectionInProgressEvent()
+	{
+		return poseDetectionInProgressEvent;
+	}
+	
+	private Observable<PoseDetectionEventArgs> poseDetectedEvent;
+	private Observable<PoseDetectionEventArgs> outOfPoseEvent;
+	private Observable<PoseDetectionInProgressEventArgs> poseDetectionInProgressEvent;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionEventArgs.java
new file mode 100644
index 0000000..6e8f501
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionEventArgs.java
@@ -0,0 +1,44 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class PoseDetectionEventArgs extends EventArgs
+{
+	public PoseDetectionEventArgs(String pose, int user)
+	{
+		this.pose = pose;
+		this.user = user;
+	}
+	
+	public String getPose()
+	{
+		return this.pose;
+	}
+	public int getUser()
+	{
+		return this.user;
+	}
+	
+	private final String pose;
+	private final int user;
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionInProgressEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionInProgressEventArgs.java
new file mode 100644
index 0000000..7b6767f
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionInProgressEventArgs.java
@@ -0,0 +1,49 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class PoseDetectionInProgressEventArgs extends EventArgs
+{
+	public PoseDetectionInProgressEventArgs(String pose, int user, PoseDetectionStatus status)
+	{
+		this.pose = pose;
+		this.user = user;
+		this.status = status;
+	}
+	
+	public String getPose()
+	{
+		return this.pose;
+	}
+	public int getUser()
+	{
+		return this.user;
+	}
+	public PoseDetectionStatus getStatus()
+	{
+		return this.status;
+	}
+	
+	private final String pose;
+	private final int user;
+	private final PoseDetectionStatus status;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionState.java b/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionState.java
new file mode 100644
index 0000000..8553d2c
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionState.java
@@ -0,0 +1,54 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum PoseDetectionState
+{
+	InPose(0),
+	OutOfPose(1),
+	Undefined(2);
+	
+	PoseDetectionState(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static PoseDetectionState fromNative(int value)
+	{
+		for (PoseDetectionState type : PoseDetectionState.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private final int val;
+
+
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionStatus.java b/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionStatus.java
new file mode 100644
index 0000000..677c8c5
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/PoseDetectionStatus.java
@@ -0,0 +1,57 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum PoseDetectionStatus
+{
+	OK(0),
+	NO_USER(1),
+	TOP_FOV(2),
+	SIDE_FOV(3),
+	ERROR(4),
+	NO_TRACKING(5);
+	
+	PoseDetectionStatus(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static PoseDetectionStatus fromNative(int value)
+	{
+		for (PoseDetectionStatus type : PoseDetectionStatus.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private final int val;
+
+
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/PowerLineFrequency.java b/Wrappers/OpenNI.java/src/org/OpenNI/PowerLineFrequency.java
new file mode 100644
index 0000000..1221cb8
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/PowerLineFrequency.java
@@ -0,0 +1,51 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum PowerLineFrequency 
+{
+	OFF (0),
+	HZ50 (50),
+	HZ60 (60);
+	
+	PowerLineFrequency(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static PowerLineFrequency fromNative(int value)
+	{
+		for (PowerLineFrequency type : PowerLineFrequency.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private final int val;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ProductionNode.java b/Wrappers/OpenNI.java/src/org/OpenNI/ProductionNode.java
new file mode 100644
index 0000000..84c4ab3
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ProductionNode.java
@@ -0,0 +1,159 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class ProductionNode extends NodeWrapper
+{
+	ProductionNode(Context context, long nodeHandle, boolean addRef) throws StatusException
+	{
+		super(context, nodeHandle, addRef);
+	}
+	
+	public static ProductionNode fromNative(long hNode) throws GeneralException
+	{
+		return Context.createProductionNodeFromNative(hNode);
+	}
+	
+	public NodeInfo getInfo() throws GeneralException
+	{
+		return new NodeInfo(NativeMethods.xnGetNodeInfo(toNative()));
+	}
+	
+	public void addNeededNode(ProductionNode needed) throws StatusException
+	{
+		int status = NativeMethods.xnAddNeededNode(toNative(), needed.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void removeNeededNode(ProductionNode needed) throws StatusException
+	{
+		int status = NativeMethods.xnRemoveNeededNode(toNative(), needed.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public boolean isCapabilitySupported(String capabilityName)
+	{
+		return NativeMethods.xnIsCapabilitySupported(this.toNative(), capabilityName);
+	}
+
+	public void setIntProperty(String propName, long value) throws StatusException
+	{
+		int status = NativeMethods.xnSetIntProperty(this.toNative(), propName, value);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void setRealProperty(String propName, double value) throws StatusException
+	{
+		int status = NativeMethods.xnSetRealProperty(this.toNative(), propName, value);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void setStringProperty(String propName, String value) throws StatusException
+	{
+		int status = NativeMethods.xnSetStringProperty(this.toNative(), propName, value);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void setGeneralProperty(String propName, int size, long buff) throws StatusException
+	{
+		int status = NativeMethods.xnSetGeneralProperty(this.toNative(), propName, size, buff);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void setGeneralProperty(String propName, byte[] buffer) throws StatusException
+	{
+		int status = NativeMethods.xnSetGeneralPropertyArray(this.toNative(), propName, buffer);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public long getIntProperty(String propName) throws StatusException
+	{
+		OutArg<Long> value = new OutArg<Long>();
+		int status = NativeMethods.xnGetIntProperty(this.toNative(), propName, value);
+		WrapperUtils.throwOnError(status);
+		return value.value.longValue();
+	}
+
+	public double getRealProperty(String propName) throws StatusException
+	{
+		OutArg<Double> value = new OutArg<Double>();
+		int status = NativeMethods.xnGetRealProperty(this.toNative(), propName, value);
+		WrapperUtils.throwOnError(status);
+		return value.value.doubleValue();
+	}
+
+	public String getStringProperty(String propName) throws StatusException
+	{
+		OutArg<String> value = new OutArg<String>();
+		int status = NativeMethods.xnGetStringProperty(this.toNative(), propName, value);
+		WrapperUtils.throwOnError(status);
+		return value.value;
+	}
+
+	public void getGeneralProperty(String propName, int size, long buff) throws StatusException
+	{
+		int status = NativeMethods.xnGetGeneralProperty(this.toNative(), propName, size, buff);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void getGeneralProperty(String propName, byte[] buffer) throws StatusException
+	{
+		int status = NativeMethods.xnGetGeneralPropertyArray(this.toNative(), propName, buffer);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public LockHandle lockForChanges() throws StatusException
+	{
+		OutArg<Integer> handle = new OutArg<Integer>();
+		int status = NativeMethods.xnLockNodeForChanges(this.toNative(), handle);
+		WrapperUtils.throwOnError(status);
+		return new LockHandle(handle.value.intValue());
+	}
+
+	public void unlockForChanges(LockHandle lockHandle) throws StatusException
+	{
+		int status = NativeMethods.xnUnlockNodeForChanges(this.toNative(), lockHandle.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void lockedNodeStartChanges(LockHandle lockHandle) throws StatusException
+	{
+		int status = NativeMethods.xnLockedNodeStartChanges(this.toNative(), lockHandle.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void lockedNodeEndChanges(LockHandle lockHandle) throws StatusException
+	{
+		int status = NativeMethods.xnLockedNodeEndChanges(this.toNative(), lockHandle.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public ErrorStateCapability getErrorStateCapability() throws StatusException
+	{
+		return new ErrorStateCapability(this);
+	}
+
+	public GeneralIntCapability getGeneralIntCapability(Capability capability) throws StatusException
+	{
+		return new GeneralIntCapability(this, capability);
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ProductionNodeDescription.java b/Wrappers/OpenNI.java/src/org/OpenNI/ProductionNodeDescription.java
new file mode 100644
index 0000000..a2fe1a0
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ProductionNodeDescription.java
@@ -0,0 +1,59 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class ProductionNodeDescription 
+{
+	public ProductionNodeDescription(NodeType type, String vendor, String name, Version version)
+	{
+		this.type = type;
+		this.vendor = vendor;
+		this.name = name;
+		this.version = version;
+	}
+
+	@SuppressWarnings("unused")
+	private ProductionNodeDescription(int type, String vendor, String name, Version version)
+	{
+		this(new NodeType(type), vendor, name, version);
+	}
+
+	public NodeType getType() { return this.type; }
+	public String getVendor() { return this.vendor; }
+	public String getName() { return this.name; }
+	public Version getVersion() { return this.version; }
+	
+	protected long createNative()
+	{
+		return NativeMethods.createProductionNodeDescription(type.toNative(), vendor, name, version.getMajor(), version.getMinor(), version.getMaintenance(), version.getBuild());
+	}
+	
+	protected static void freeNative(long pNative)
+	{
+		NativeMethods.freeProductionNodeDescription(pNative);
+	}
+
+	private NodeType type;
+	private String vendor;
+	private String name;
+	private Version version; 
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Query.java b/Wrappers/OpenNI.java/src/org/OpenNI/Query.java
new file mode 100644
index 0000000..69b6e0a
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Query.java
@@ -0,0 +1,111 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class Query extends ObjectWrapper
+{
+	public Query() throws GeneralException 
+	{
+		super(allocate());
+	}
+	
+	public void setVendor(String vendor) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQuerySetVendor(toNative(), vendor);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void setName(String name) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQuerySetName(toNative(), name);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void setMinVersion(Version version) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQuerySetMinVersion(toNative(), version.getMajor(), version.getMinor(), version.getMaintenance(), version.getBuild());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void setMaxVersion(Version version) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQuerySetMaxVersion(toNative(), version.getMajor(), version.getMinor(), version.getMaintenance(), version.getBuild());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void addSupportedCapability(Capability capability) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQueryAddSupportedCapability(toNative(), capability.getName());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void addSupportedMapOutputMode(MapOutputMode mode) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQueryAddSupportedMapOutputMode(toNative(), mode.getXRes(), mode.getYRes(), mode.getFPS());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void addSupportedMinUserPositions(int count) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQuerySetSupportedMinUserPositions(toNative(), count);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void setExistingNodeOnly(boolean existingOnly) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQuerySetExistingNodeOnly(toNative(), existingOnly);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void setNonExistingNodeOnly(boolean nonExistingOnly) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQuerySetNonExistingNodeOnly(toNative(), nonExistingOnly);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void addNeededNode(ProductionNode node) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQueryAddNeededNode(toNative(), node.getName());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void setCreationInfo(String creationInfo) throws StatusException
+	{
+		int status = NativeMethods.xnNodeQuerySetCreationInfo(toNative(), creationInfo);
+		WrapperUtils.throwOnError(status);
+	}
+
+	@Override
+	protected void freeObject(long ptr) 
+	{
+		NativeMethods.xnNodeQueryFree(ptr);
+	}
+	
+	private static long allocate() throws StatusException
+	{
+		OutArg<Long> pQuery = new OutArg<Long>();
+		int status = NativeMethods.xnNodeQueryAllocate(pQuery);
+		WrapperUtils.throwOnError(status);
+		return pQuery.value;
+	}
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/RecordMedium.java b/Wrappers/OpenNI.java/src/org/OpenNI/RecordMedium.java
new file mode 100644
index 0000000..dea2d89
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/RecordMedium.java
@@ -0,0 +1,49 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum RecordMedium
+{
+	FILE (0);
+	
+	RecordMedium(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static RecordMedium fromNative(int value)
+	{
+		for (RecordMedium type : RecordMedium.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private final int val;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Recorder.java b/Wrappers/OpenNI.java/src/org/OpenNI/Recorder.java
new file mode 100644
index 0000000..a4f8dbf
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Recorder.java
@@ -0,0 +1,92 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class Recorder extends ProductionNode
+{
+	Recorder(Context context, long nodeHandle, boolean addRef) throws StatusException
+	{
+		super(context, nodeHandle, addRef);
+	}
+
+	public static Recorder create(Context context, String formatName) throws GeneralException
+	{
+		OutArg<Long> phRecorder = new OutArg<Long>();
+		int status = NativeMethods.xnCreateRecorder(context.toNative(), formatName, phRecorder);
+		WrapperUtils.throwOnError(status);
+		Recorder recorder = (Recorder)context.createProductionNodeObject(phRecorder.value, NodeType.RECORDER);
+		NativeMethods.xnProductionNodeRelease(phRecorder.value);
+		return recorder;
+	}
+	
+	public String getFormat()
+	{
+		return NativeMethods.xnGetRecorderFormat(toNative());
+	}
+	
+	public void setDestination(RecordMedium medium, String name) throws StatusException
+	{
+		int status = NativeMethods.xnSetRecorderDestination(toNative(), medium.toNative(), name);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public RecordMedium getDestinationMedium() throws StatusException
+	{
+		OutArg<Integer> pMedium = new OutArg<Integer>();
+		OutArg<String> pDest = new OutArg<String>();
+		int status = NativeMethods.xnGetRecorderDestination(toNative(), pMedium, pDest);
+		WrapperUtils.throwOnError(status);
+		return RecordMedium.fromNative(pMedium.value);
+	}
+
+	public String getDestination() throws StatusException
+	{
+		OutArg<Integer> pMedium = new OutArg<Integer>();
+		OutArg<String> pDest = new OutArg<String>();
+		int status = NativeMethods.xnGetRecorderDestination(toNative(), pMedium, pDest);
+		WrapperUtils.throwOnError(status);
+		return pDest.value;
+	}
+	
+	public void addNodeToRecording(ProductionNode node, CodecID codec) throws StatusException
+	{
+		int status = NativeMethods.xnAddNodeToRecording(toNative(), node.toNative(), codec.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void addNodeToRecording(ProductionNode node) throws StatusException
+	{
+		addNodeToRecording(node, CodecID.Null);
+	}
+
+	public void removeNodeToRecording(ProductionNode node) throws StatusException
+	{
+		int status = NativeMethods.xnRemoveNodeFromRecording(toNative(), node.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void Record() throws StatusException
+	{
+		int status = NativeMethods.xnRecord(toNative());
+		WrapperUtils.throwOnError(status);
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Resolution.java b/Wrappers/OpenNI.java/src/org/OpenNI/Resolution.java
new file mode 100644
index 0000000..28af338
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Resolution.java
@@ -0,0 +1,90 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum Resolution 
+{
+	CUSTOM (0),
+	QQVGA (1),
+	CGA (2),
+	QVGA (3),
+	VGA (4),
+	SVGA (5),
+	XGA (6),
+	P720 (7),
+	SXGA (8),
+	UXGA (9),
+	P1080 (10);
+	
+	Resolution(int val)
+	{
+		this.val = val;
+		this.xRes = NativeMethods.xnResolutionGetXRes(val);
+		this.yRes = NativeMethods.xnResolutionGetYRes(val);
+		this.name = NativeMethods.xnResolutionGetName(val);
+	}
+	
+	public int getxRes()
+	{
+		return this.xRes;
+	}
+
+	public int getyRes()
+	{
+		return this.yRes;
+	}
+
+	public String getName()
+	{
+		return this.name;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static Resolution fromNative(int value)
+	{
+		for (Resolution type : Resolution.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	public static Resolution fromName(String name)
+	{
+		return fromNative(NativeMethods.xnResolutionGetFromName(name));
+	}
+	
+	public static Resolution fromXYRes(int xRes, int yRes)
+	{
+		return fromNative(NativeMethods.xnResolutionGetFromXYRes(xRes, yRes));
+	}
+	
+	private final int val;
+	private final int xRes;
+	private final int yRes;
+	private final String name;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/SceneAnalyzer.java b/Wrappers/OpenNI.java/src/org/OpenNI/SceneAnalyzer.java
new file mode 100644
index 0000000..78740a4
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/SceneAnalyzer.java
@@ -0,0 +1,93 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class SceneAnalyzer extends MapGenerator
+{
+
+	SceneAnalyzer(Context context, long nodeHandle, boolean addRef)
+			throws GeneralException
+	{
+		super(context, nodeHandle, addRef);
+	}
+
+	public static SceneAnalyzer create(Context context, Query query, EnumerationErrors errors) throws GeneralException
+	{
+		OutArg<Long> handle = new OutArg<Long>();
+		int status = NativeMethods.xnCreateSceneAnalyzer(context.toNative(), handle,
+			query == null ? 0 : query.toNative(),
+			errors == null ? 0 : errors.toNative());
+		WrapperUtils.throwOnError(status);
+		SceneAnalyzer result = (SceneAnalyzer)context.createProductionNodeObject(handle.value, NodeType.SCENE);
+		NativeMethods.xnProductionNodeRelease(handle.value);
+		return result;
+	}
+
+	public static SceneAnalyzer create(Context context, Query query) throws GeneralException
+	{
+		return create(context, query, null);
+	}
+
+	public static SceneAnalyzer create(Context context) throws GeneralException
+	{
+		return create(context, null, null);
+	}
+
+	public SceneMap getSceneMap() throws GeneralException
+	{
+		int frameID = getFrameID();
+		
+		if ((this.currSceneMap == null) || (this.currSceneMapFrameID != frameID))
+		{
+			long ptr = NativeMethods.xnGetLabelMap(toNative());
+			MapOutputMode mode = getMapOutputMode();
+			this.currSceneMap = new SceneMap(ptr, mode.getXRes(), mode.getYRes());
+			this.currSceneMapFrameID = frameID; 
+		}
+
+		return this.currSceneMap;
+	}
+	public void getMetaData(SceneMetaData sceneMD)
+	{
+		NativeMethods.xnGetSceneMetaData(this.toNative(), sceneMD);
+	}
+
+	public SceneMetaData getMetaData()
+	{
+		SceneMetaData sceneMD = new SceneMetaData();
+		getMetaData(sceneMD);
+		return sceneMD;
+	}
+
+	public Plane3D getFloor() throws StatusException
+	{
+		OutArg<Point3D> planeNormal = new OutArg<Point3D>();
+		OutArg<Point3D> planePoint = new OutArg<Point3D>();
+		
+		int status = NativeMethods.xnGetFloor(toNative(), planeNormal, planePoint);
+		WrapperUtils.throwOnError(status);
+		return new Plane3D(planeNormal.value, planePoint.value);
+	}
+
+	private SceneMap currSceneMap;
+	private int currSceneMapFrameID;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/SceneMap.java b/Wrappers/OpenNI.java/src/org/OpenNI/SceneMap.java
new file mode 100644
index 0000000..22a5f91
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/SceneMap.java
@@ -0,0 +1,35 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class SceneMap extends ShortMap
+{
+	SceneMap()
+	{
+		super();
+	}
+	SceneMap(long ptr, int xres, int yres)
+	{
+		super(ptr, xres, yres);
+	}
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/SceneMetaData.java b/Wrappers/OpenNI.java/src/org/OpenNI/SceneMetaData.java
new file mode 100644
index 0000000..db3691d
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/SceneMetaData.java
@@ -0,0 +1,35 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class SceneMetaData extends MapMetaData
+{
+	public SceneMetaData() 
+	{
+		super(PixelFormat.GRAYSCALE_16BIT, new SceneMap());
+	}
+	public SceneMap getData()
+	{
+		return (SceneMap)super.getData();
+	}
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ScriptNode.java b/Wrappers/OpenNI.java/src/org/OpenNI/ScriptNode.java
new file mode 100644
index 0000000..d462118
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ScriptNode.java
@@ -0,0 +1,63 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class ScriptNode extends ProductionNode
+{
+	ScriptNode(Context context, long nodeHandle, boolean addRef) throws StatusException
+	{
+		super(context, nodeHandle, addRef);
+	}
+
+	public static ScriptNode create(Context context, String formatName) throws GeneralException
+	{
+		OutArg<Long> phScriptNode = new OutArg<Long>();
+		int status = NativeMethods.xnCreateScriptNode(context.toNative(), formatName, phScriptNode);
+		WrapperUtils.throwOnError(status);
+		ScriptNode ScriptNode = (ScriptNode)context.createProductionNodeObject(phScriptNode.value, NodeType.SCRIPT_NODE);
+		NativeMethods.xnProductionNodeRelease(phScriptNode.value);
+		return ScriptNode;
+	}
+
+	public String getSupportedFormat()
+	{
+		return NativeMethods.xnScriptNodeGetSupportedFormat(toNative());
+	}
+	
+	public void loadScriptFromFile(String fileName) throws StatusException
+	{
+		int status = NativeMethods.xnLoadScriptFromFile(toNative(), fileName);
+		WrapperUtils.throwOnError(status);
+	}
+
+	public void loadScriptFromString(String script) throws StatusException
+	{
+		int status = NativeMethods.xnLoadScriptFromString(toNative(), script);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public void Run(EnumerationErrors errors) throws StatusException
+	{
+		int status = NativeMethods.xnScriptNodeRun(toNative(), errors.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/ShortMap.java b/Wrappers/OpenNI.java/src/org/OpenNI/ShortMap.java
new file mode 100644
index 0000000..f2b943e
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/ShortMap.java
@@ -0,0 +1,50 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.nio.ShortBuffer;
+
+public class ShortMap extends Map 
+{
+	ShortMap()
+	{
+		super();
+		this.setBytesPerPixel(BYTES_PER_PIXEL);
+	}
+	
+	ShortMap(long ptr, int xRes, int yRes)
+	{
+		super(ptr, xRes, yRes, BYTES_PER_PIXEL);
+	}
+	
+	public short readPixel(int x, int y)
+	{
+		return NativeMethods.readShort(getPixelPtr(x, y));
+	}
+	
+	public ShortBuffer createShortBuffer()
+	{
+		return createByteBuffer().asShortBuffer();
+	}
+	
+	private static final int BYTES_PER_PIXEL = Short.SIZE / 8;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonCapability.java
new file mode 100644
index 0000000..32c8594
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonCapability.java
@@ -0,0 +1,282 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class SkeletonCapability extends CapabilityBase
+{
+	public SkeletonCapability(ProductionNode node) throws StatusException
+	{
+		super(node);
+		
+		// Events
+		jointConfigurationChangeEvent = new StateChangedObservable()
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback)
+			{
+				return NativeMethods.xnRegisterToJointConfigurationChange(toNative(), this, cb, phCallback);
+			}
+			@Override
+			protected void unregisterNative(long hCallback)
+			{
+				NativeMethods.xnUnregisterFromJointConfigurationChange(toNative(), hCallback);
+			}
+		};
+		calibrationStartEvent = new Observable<CalibrationStartEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToCalibrationStart(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromCalibrationStart(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int user)
+			{
+				notify(new CalibrationStartEventArgs(user));
+			}
+		};
+		calibrationInProgressEvent = new Observable<CalibrationProgressEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToCalibrationInProgress(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromCalibrationInProgress(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int user, int state)
+			{
+				notify(new CalibrationProgressEventArgs(user, CalibrationProgressStatus.fromNative(state)));
+			}
+		};
+		calibrationCompleteEvent = new Observable<CalibrationProgressEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToCalibrationComplete(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromCalibrationComplete(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int user, int state)
+			{
+				notify(new CalibrationProgressEventArgs(user, CalibrationProgressStatus.fromNative(state)));
+			}
+		};
+	}
+
+	// Joint / Profile
+	public boolean isJointAvailable(SkeletonJoint joint)
+	{
+		return NativeMethods.xnIsJointAvailable(toNative(), joint.toNative());
+	}
+	public boolean isProfileAvailable(SkeletonProfile profile)
+	{
+		return NativeMethods.xnIsProfileAvailable(toNative(), profile.toNative());
+	}
+	public void setSkeletonProfile(SkeletonProfile profile) throws StatusException
+	{
+		int status = NativeMethods.xnSetSkeletonProfile(toNative(), profile.toNative());
+		WrapperUtils.throwOnError(status);
+	}
+	public void setJointActive(SkeletonJoint joint, boolean active) throws StatusException
+	{
+		int status = NativeMethods.xnSetJointActive(toNative(), joint.toNative(), active);
+		WrapperUtils.throwOnError(status);
+	}
+	public boolean isJointActive(SkeletonJoint joint)
+	{
+		return NativeMethods.xnIsJointActive(toNative(), joint.toNative());
+	}
+	public SkeletonJoint[] enumerateActiveJoints() throws StatusException
+	{
+		OutArg<Integer[]> nativeJoints = new OutArg<Integer[]>();
+		int status = NativeMethods.xnEnumerateActiveJoints(toNative(), nativeJoints);
+		WrapperUtils.throwOnError(status);
+		SkeletonJoint[] joints = new SkeletonJoint[nativeJoints.value.length];
+		for (int i = 0; i < nativeJoints.value.length; ++i)
+		{
+			joints[i] = SkeletonJoint.fromNative(nativeJoints.value[i]);
+		}
+		return joints;
+	}
+	// Get joint information
+	public SkeletonJointTransformation getSkeletonJoint(int user, SkeletonJoint joint) throws StatusException
+	{
+		OutArg<SkeletonJointTransformation> transformation = new OutArg<SkeletonJointTransformation>();
+		int status = NativeMethods.xnGetSkeletonJoint(toNative(), user, joint.toNative(), transformation);
+		WrapperUtils.throwOnError(status);
+		return transformation.value;
+	}
+	public SkeletonJointPosition getSkeletonJointPosition(int user, SkeletonJoint joint) throws StatusException
+	{
+		OutArg<SkeletonJointPosition> position = new OutArg<SkeletonJointPosition>();
+		int status = NativeMethods.xnGetSkeletonJointPosition(toNative(), user, joint.toNative(), position);
+		WrapperUtils.throwOnError(status);
+		return position.value;
+	}
+	public SkeletonJointOrientation getSkeletonJointOrientation(int user, SkeletonJoint joint) throws StatusException
+	{
+		OutArg<SkeletonJointOrientation> orientation = new OutArg<SkeletonJointOrientation>();
+		int status = NativeMethods.xnGetSkeletonJointOrientation(toNative(), user, joint.toNative(), orientation);
+		WrapperUtils.throwOnError(status);
+		return orientation.value;
+	}
+	// Check state
+	public boolean isSkeletonTracking(int user)
+	{
+		return NativeMethods.xnIsSkeletonTracking(toNative(), user);
+	}
+	public boolean isSkeletonCalibrated(int user)
+	{
+		return NativeMethods.xnIsSkeletonCalibrated(toNative(), user);
+	}
+	public boolean isSkeletonCalibrating(int user)
+	{
+		return NativeMethods.xnIsSkeletonCalibrating(toNative(), user);
+	}
+	// Control calibration
+	public void requestSkeletonCalibration(int user, boolean force) throws StatusException
+	{
+		int status = NativeMethods.xnRequestSkeletonCalibration(toNative(), user, force);
+		WrapperUtils.throwOnError(status);
+	}
+	public void requestSkeletonCalibration(int user) throws StatusException
+	{
+		requestSkeletonCalibration(user, false);
+	}
+	public void abortSkeletonCalibration(int user) throws StatusException
+	{
+		int status = NativeMethods.xnAbortSkeletonCalibration(toNative(), user);
+		WrapperUtils.throwOnError(status);
+	}
+	// Calibration data files
+	public void saveSkeletonCalibrationDataToFile(int user, String fileName) throws StatusException
+	{
+		int status = NativeMethods.xnSaveSkeletonCalibrationDataToFile(toNative(), user, fileName);
+		WrapperUtils.throwOnError(status);
+	}
+	public void loadSkeletonCalibrationDatadFromFile(int user, String fileName) throws StatusException
+	{
+		int status = NativeMethods.xnLoadSkeletonCalibrationDataFromFile(toNative(), user, fileName);
+		WrapperUtils.throwOnError(status);
+	}
+	// Calibration data slots
+	public void saveSkeletonCalibrationData(int user,  int slot) throws StatusException
+	{
+		int status = NativeMethods.xnSaveSkeletonCalibrationData(toNative(), user, slot);
+		WrapperUtils.throwOnError(status);
+	}
+	public void loadSkeletonCalibrationData(int user, int slot) throws StatusException
+	{
+		int status = NativeMethods.xnLoadSkeletonCalibrationData(toNative(), user, slot);
+		WrapperUtils.throwOnError(status);		
+	}
+	public void clearSkeletonCalibrationData(int slot) throws StatusException
+	{
+		int status = NativeMethods.xnClearSkeletonCalibrationData(toNative(), slot);
+		WrapperUtils.throwOnError(status);
+	}
+	public boolean isSkeletonCalibrationData(int slot)
+	{
+		return NativeMethods.xnIsSkeletonCalibrationData(toNative(), slot);
+	}
+
+	// Tracking
+	public void startTracking(int user) throws StatusException
+	{
+		int status = NativeMethods.xnStartSkeletonTracking(toNative(), user);
+		WrapperUtils.throwOnError(status);
+	}
+	public void stopTracking(int user) throws StatusException
+	{
+		int status = NativeMethods.xnStopSkeletonTracking(toNative(), user);
+		WrapperUtils.throwOnError(status);		
+	}
+	public void reset(int user) throws StatusException
+	{
+		int status = NativeMethods.xnResetSkeleton(toNative(), user);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	// Pose
+	public boolean needPoseForCalibration()
+	{
+		return NativeMethods.xnNeedPoseForSkeletonCalibration(toNative());
+	}
+	public String getSkeletonCalibrationPose() throws StatusException
+	{
+		OutArg<String> pose = new OutArg<String>();
+		int status = NativeMethods.xnGetSkeletonCalibrationPose(toNative(),	pose);
+		WrapperUtils.throwOnError(status);
+		return pose.value;
+	}
+	
+	// Misc
+	public void setSmoothing(float factor) throws StatusException
+	{
+		int status = NativeMethods.xnSetSkeletonSmoothing(toNative(), factor);
+		WrapperUtils.throwOnError(status);
+	}
+	
+	// Events
+	public IStateChangedObservable getJointConfigurationChangeEvent()
+	{
+		return jointConfigurationChangeEvent;
+	}
+	public IObservable<CalibrationStartEventArgs> getCalibrationStartEvent()
+	{
+		return calibrationStartEvent;
+	}
+	public IObservable<CalibrationProgressEventArgs> getCalibrationInProgressEvent()
+	{
+		return calibrationInProgressEvent;
+	}
+	public IObservable<CalibrationProgressEventArgs> getCalibrationCompleteEvent()
+	{
+		return calibrationCompleteEvent;
+	}
+	
+	private StateChangedObservable jointConfigurationChangeEvent;
+	private Observable<CalibrationStartEventArgs> calibrationStartEvent;
+	private Observable<CalibrationProgressEventArgs> calibrationInProgressEvent;
+	private Observable<CalibrationProgressEventArgs> calibrationCompleteEvent;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJoint.java b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJoint.java
new file mode 100644
index 0000000..a735fb2
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJoint.java
@@ -0,0 +1,72 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum SkeletonJoint
+{
+	HEAD(1),
+	NECK(2),
+	TORSO(3),
+	WAIST(4),
+	LEFT_COLLAR(5),
+	LEFT_SHOULDER(6),
+	LEFT_ELBOW(7),
+	LEFT_WRIST(8),
+	LEFT_HAND(9),
+	LEFT_FINGER_TIP(10),
+	RIGHT_COLLAR(11),
+	RIGHT_SHOULDER(12),
+	RIGHT_ELBOW(13),
+	RIGHT_WRIST(14),
+	RIGHT_HAND(15),
+	RIGHT_FINGER_TIP(16),
+	LEFT_HIP(17),
+	LEFT_KNEE(18),
+	LEFT_ANKLE(19),
+	LEFT_FOOT(20),
+	RIGHT_HIP(21),
+	RIGHT_KNEE(22),
+	RIGHT_ANKLE(23),
+	RIGHT_FOOT(24);
+
+	SkeletonJoint(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static SkeletonJoint fromNative(int value)
+	{
+		for (SkeletonJoint type : SkeletonJoint.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private final int val;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJointOrientation.java b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJointOrientation.java
new file mode 100644
index 0000000..ea867dd
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJointOrientation.java
@@ -0,0 +1,91 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class SkeletonJointOrientation
+{
+	public SkeletonJointOrientation(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float confidence)
+	{
+		this.x1 = x1;
+		this.y1 = y1;
+		this.z1 = z1;
+		this.x2 = x2;
+		this.y2 = y2;
+		this.z2 = z2;
+		this.x3 = x3;
+		this.y3 = y3;
+		this.z3 = z3;
+		this.confidence = confidence;
+	}
+	
+	public float getX1()
+	{
+		return this.x1;
+	}
+	public float getY1()
+	{
+		return this.y1;
+	}
+	public float getZ1()
+	{
+		return this.z1;
+	}
+	public float getX2()
+	{
+		return this.x2;
+	}
+	public float getY2()
+	{
+		return this.y2;
+	}
+	public float getZ2()
+	{
+		return this.z2;
+	}
+	public float getX3()
+	{
+		return this.x3;
+	}
+	public float getY3()
+	{
+		return this.y3;
+	}
+	public float getZ3()
+	{
+		return this.z3;
+	}
+	public float getConfidence()
+	{
+		return this.confidence;
+	}
+
+	private float x1;
+	private float y1;
+	private float z1;
+	private float x2;
+	private float y2;
+	private float z2;
+	private float x3;
+	private float y3;
+	private float z3;
+	private float confidence;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJointPosition.java b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJointPosition.java
new file mode 100644
index 0000000..c833eb5
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJointPosition.java
@@ -0,0 +1,43 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class SkeletonJointPosition
+{
+	public SkeletonJointPosition(Point3D position, float confidence)
+	{
+		this.position = position;
+		this.confidence = confidence;
+	}
+	
+	public Point3D getPosition()
+	{
+		return this.position;
+	}
+	public float getConfidence()
+	{
+		return this.confidence;
+	}
+	
+	private Point3D position;
+	private float confidence;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJointTransformation.java b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJointTransformation.java
new file mode 100644
index 0000000..1e6881d
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonJointTransformation.java
@@ -0,0 +1,44 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class SkeletonJointTransformation
+{
+	public SkeletonJointTransformation(SkeletonJointPosition position, SkeletonJointOrientation orientation)
+	{
+		this.position = position;
+		this.orientation = orientation;
+	}
+	
+	public SkeletonJointPosition getPosition()
+	{
+		return position;
+	}
+	public SkeletonJointOrientation getOrientation()
+	{
+		return orientation;
+	}
+	
+	private SkeletonJointPosition position;
+	private SkeletonJointOrientation orientation;
+
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonPoseProcessingMode.java b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonPoseProcessingMode.java
new file mode 100644
index 0000000..ebaed51
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonPoseProcessingMode.java
@@ -0,0 +1,50 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum SkeletonPoseProcessingMode
+{
+	NONE(0),
+	ALL(1);
+	
+	SkeletonPoseProcessingMode(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static SkeletonPoseProcessingMode fromNative(int value)
+	{
+		for (SkeletonPoseProcessingMode type : SkeletonPoseProcessingMode.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private final int val;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonProfile.java b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonProfile.java
new file mode 100644
index 0000000..b4ac0e4
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/SkeletonProfile.java
@@ -0,0 +1,62 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+import java.util.NoSuchElementException;
+
+public enum SkeletonProfile
+{
+	/** No joints at all **/
+	NONE(1),
+
+	/** All joints **/
+	ALL(2),
+	
+	/** All the joints in the upper body (torso and upwards) **/
+	UPPER_BODY(3),
+	
+	/** All the joints in the lower body (torso and downwards) **/
+	LOWER_BODY(4),
+	
+	/** The head and the hands **/
+	HEAD_HANDS(5);
+	
+	SkeletonProfile(int val)
+	{
+		this.val = val;
+	}
+	
+	public int toNative() { return this.val; }
+	
+	public static SkeletonProfile fromNative(int value)
+	{
+		for (SkeletonProfile type : SkeletonProfile.values()) 
+		{
+			if (type.val == value)
+				return type;
+		}
+		
+		throw new NoSuchElementException();
+	}
+	
+	private final int val;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/StateChangedObservable.java b/Wrappers/OpenNI.java/src/org/OpenNI/StateChangedObservable.java
new file mode 100644
index 0000000..c445ad0
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/StateChangedObservable.java
@@ -0,0 +1,40 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+
+public abstract class StateChangedObservable extends Observable<EventArgs> implements IStateChangedObservable
+{
+	@Override
+	protected int registerNative(OutArg<Long> phCallback) 
+	{
+		return registerNative("callback", phCallback);
+	}
+
+	protected abstract int registerNative(String cb, OutArg<Long> phCallback);
+
+	@SuppressWarnings("unused")
+	private void callback()
+	{
+		notify(null);
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/StatusException.java b/Wrappers/OpenNI.java/src/org/OpenNI/StatusException.java
new file mode 100644
index 0000000..a8ca2ff
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/StatusException.java
@@ -0,0 +1,35 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class StatusException extends GeneralException
+{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	public StatusException(int status)
+	{
+		super(WrapperUtils.getErrorMessage(status));
+	}
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/UserEventArgs.java b/Wrappers/OpenNI.java/src/org/OpenNI/UserEventArgs.java
new file mode 100644
index 0000000..bd89494
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/UserEventArgs.java
@@ -0,0 +1,37 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class UserEventArgs extends EventArgs
+{
+	public UserEventArgs(int id)
+	{
+		this.id = id;
+	}
+	
+	public int getId()
+	{
+		return this.id;
+	}
+	
+	private final int id;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/UserGenerator.java b/Wrappers/OpenNI.java/src/org/OpenNI/UserGenerator.java
new file mode 100644
index 0000000..d905657
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/UserGenerator.java
@@ -0,0 +1,204 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class UserGenerator extends Generator
+{
+	UserGenerator(Context context, long nodeHandle, boolean addRef) throws GeneralException 
+	{
+		super(context, nodeHandle, addRef);
+		
+		newUserEvent = new Observable<UserEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterUserCallbacks(toNative(), this, "callback", null, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterUserCallbacks(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int user)
+			{
+				notify(new UserEventArgs(user));
+			}
+		};
+		lostUserEvent = new Observable<UserEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterUserCallbacks(toNative(), this, null, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterUserCallbacks(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int user)
+			{
+				notify(new UserEventArgs(user));
+			}
+		};
+		userExitEvent = new Observable<UserEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToUserExit(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromUserExit(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int user)
+			{
+				notify(new UserEventArgs(user));
+			}
+		};
+		userReenterEvent = new Observable<UserEventArgs>()
+		{
+			@Override
+			protected int registerNative(OutArg<Long> phCallback) throws StatusException 
+			{
+				return NativeMethods.xnRegisterToUserReEnter(toNative(), this, "callback", phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromUserExit(toNative(), hCallback);
+			}
+			
+			@SuppressWarnings("unused")
+			public void callback(int user)
+			{
+				notify(new UserEventArgs(user));
+			}
+		};
+	}
+	
+	public static UserGenerator create(Context context, Query query, EnumerationErrors errors) throws GeneralException
+	{
+		OutArg<Long> handle = new OutArg<Long>();
+		int status = NativeMethods.xnCreateUserGenerator(context.toNative(), handle,
+			query == null ? 0 : query.toNative(),
+			errors == null ? 0 : errors.toNative());
+		WrapperUtils.throwOnError(status);
+		UserGenerator result = (UserGenerator)context.createProductionNodeObject(handle.value, NodeType.USER);
+		NativeMethods.xnProductionNodeRelease(handle.value);
+		return result;
+	}
+
+	public static UserGenerator create(Context context, Query query) throws GeneralException
+	{
+		return create(context, query, null);
+	}
+
+	public static UserGenerator create(Context context) throws GeneralException
+	{
+		return create(context, null, null);
+	}
+	
+	public int getNumberOfUsers()
+	{
+		return NativeMethods.xnGetNumberOfUsers(toNative());
+	}
+	public int[] getUsers() throws StatusException
+	{
+		OutArg<Integer[]> users = new OutArg<Integer[]>();
+		int status = NativeMethods.xnGetUsers(toNative(), users);
+		WrapperUtils.throwOnError(status);
+		
+		int[] outUsers = new int[users.value.length];
+		for (int i = 0; i < users.value.length; ++i)
+		{
+			outUsers[i] = users.value[i];
+		}
+		
+		return outUsers;
+	}
+	public Point3D getUserCoM(int id) throws StatusException
+	{
+		OutArg<Point3D> com = new OutArg<Point3D>();
+		int status = NativeMethods.xnGetUserCoM(toNative(), id, com);
+		WrapperUtils.throwOnError(status);
+		return com.value;
+	}
+	
+	public void getUserPixels(int user, SceneMetaData smd)
+	{
+		NativeMethods.xnGetUserPixels(toNative(), user, smd);
+	}
+	public SceneMetaData getUserPixels(int user)
+	{
+		SceneMetaData smd = new SceneMetaData();
+		getUserPixels(user, smd);
+		return smd;
+	}
+
+	public PoseDetectionCapability getPoseDetectionCapability() throws StatusException
+	{
+		return new PoseDetectionCapability(this);
+	}
+	public SkeletonCapability getSkeletonCapability() throws StatusException
+	{
+		return new SkeletonCapability(this);
+	}
+	
+	
+	// Events
+	public IObservable<UserEventArgs> getNewUserEvent()
+	{
+		return newUserEvent;
+	}
+	public IObservable<UserEventArgs> getLostUserEvent()
+	{
+		return lostUserEvent;
+	}
+	public IObservable<UserEventArgs> getUserExitEvent()
+	{
+		return userExitEvent;
+	}
+	public IObservable<UserEventArgs> getUserReenterEvent()
+	{
+		return userReenterEvent;
+	}
+	
+	private Observable<UserEventArgs> newUserEvent;
+	private Observable<UserEventArgs> lostUserEvent;
+	private Observable<UserEventArgs> userExitEvent;
+	private Observable<UserEventArgs> userReenterEvent;
+	
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/UserPositionCapability.java b/Wrappers/OpenNI.java/src/org/OpenNI/UserPositionCapability.java
new file mode 100644
index 0000000..bf15fbe
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/UserPositionCapability.java
@@ -0,0 +1,70 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class UserPositionCapability extends CapabilityBase
+{
+	public UserPositionCapability(ProductionNode node) throws StatusException
+	{
+		super(node);
+		
+		this.userPositionChanged = new StateChangedObservable() 
+		{
+			@Override
+			protected int registerNative(String cb, OutArg<Long> phCallback) 
+			{
+				return NativeMethods.xnRegisterToUserPositionChange(toNative(), this, cb, phCallback);
+			}
+
+			@Override
+			protected void unregisterNative(long hCallback) 
+			{
+				NativeMethods.xnUnregisterFromUserPositionChange(toNative(), hCallback);
+			}
+		};
+	}
+
+	public int getSupportedCount()
+	{
+		return NativeMethods.xnGetSupportedUserPositionsCount(toNative());
+	}
+	
+	public void setUserPosition(int index, BoundingBox3D position) throws StatusException
+	{
+		Point3D leftBottomNear = position.getLeftBottomNear();
+		Point3D rightTopFar = position.getRightTopFar();
+		int status = NativeMethods.xnSetUserPosition(toNative(), index, leftBottomNear.getX(), leftBottomNear.getY(), leftBottomNear.getZ(), rightTopFar.getX(), rightTopFar.getY(), rightTopFar.getZ());
+		WrapperUtils.throwOnError(status);
+	}
+	
+	public BoundingBox3D getUserPosition(int index) throws StatusException
+	{
+		OutArg<BoundingBox3D> position = new OutArg<BoundingBox3D>();
+		int status = NativeMethods.xnGetUserPosition(toNative(), index, position);
+		WrapperUtils.throwOnError(status);
+		return position.value;
+	}
+	
+	public IStateChangedObservable getUserPositionChangedEvent() { return this.userPositionChanged; }
+	
+	private StateChangedObservable userPositionChanged;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/Version.java b/Wrappers/OpenNI.java/src/org/OpenNI/Version.java
new file mode 100644
index 0000000..b44cbb8
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/Version.java
@@ -0,0 +1,55 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class Version 
+{
+	public Version(byte major, byte minor, short maintenance, int build)
+	{
+		this.major = major;
+		this.minor = minor;
+		this.maintenance = maintenance;
+		this.build = build;
+	}
+
+	public byte getMajor()
+	{
+		return this.major;
+	}
+	public byte getMinor()
+	{
+		return this.minor;
+	}
+	public short getMaintenance()
+	{
+		return this.maintenance;
+	}
+	public int getBuild()
+	{
+		return this.build;
+	}
+	
+	private final byte major;
+	private final byte minor;
+	private final short maintenance;
+	private final int build;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/WaveOutputMode.java b/Wrappers/OpenNI.java/src/org/OpenNI/WaveOutputMode.java
new file mode 100644
index 0000000..34df907
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/WaveOutputMode.java
@@ -0,0 +1,62 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class WaveOutputMode
+{
+	public WaveOutputMode(int sampleRate, short bitsPerSample, byte numberOfChannels)
+	{
+		super();
+		this.sampleRate = sampleRate;
+		this.bitsPerSample = bitsPerSample;
+		this.numberOfChannels = numberOfChannels;
+	}
+	
+	public int getSampleRate()
+	{
+		return this.sampleRate;
+	}
+	public void setSampleRate(int sampleRate)
+	{
+		this.sampleRate = sampleRate;
+	}
+	public short getBitsPerSample()
+	{
+		return this.bitsPerSample;
+	}
+	public void setBitsPerSample(short bitsPerSample)
+	{
+		this.bitsPerSample = bitsPerSample;
+	}
+	public byte getNumberOfChannels()
+	{
+		return this.numberOfChannels;
+	}
+	public void setNumberOfChannels(byte numberOfChannels)
+	{
+		this.numberOfChannels = numberOfChannels;
+	}
+	
+	private int sampleRate;
+	private short bitsPerSample;
+	private byte numberOfChannels;
+}
diff --git a/Wrappers/OpenNI.java/src/org/OpenNI/WrapperUtils.java b/Wrappers/OpenNI.java/src/org/OpenNI/WrapperUtils.java
new file mode 100644
index 0000000..c89a382
--- /dev/null
+++ b/Wrappers/OpenNI.java/src/org/OpenNI/WrapperUtils.java
@@ -0,0 +1,54 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+package org.OpenNI;
+
+public class WrapperUtils
+{
+	public static void throwOnError(int status) throws StatusException
+	{
+		if (status != 0)
+		{
+			throw new StatusException(status);
+		}
+	}
+	
+	public static void checkEnumeration(int status, EnumerationErrors errors) throws GeneralException
+	{
+		if (status != 0)
+		{
+			if (errors != null && !errors.isEmpty())
+			{
+				throw new GeneralException(errors.toString());
+			}
+			else
+			{
+				throw new StatusException(status);
+			}
+		}
+	}
+	
+	public static String getErrorMessage(int status)
+	{
+		String message = NativeMethods.xnGetStatusString(status);
+		return message;
+	}
+}
diff --git a/Wrappers/OpenNI.jni/CreateMethods.py b/Wrappers/OpenNI.jni/CreateMethods.py
new file mode 100644
index 0000000..4a9096e
--- /dev/null
+++ b/Wrappers/OpenNI.jni/CreateMethods.py
@@ -0,0 +1,52 @@
+#/***************************************************************************
+#*                                                                          *
+#*  OpenNI 1.x Alpha                                                        *
+#*  Copyright (C) 2011 PrimeSense Ltd.                                      *
+#*                                                                          *
+#*  This file is part of OpenNI.                                            *
+#*                                                                          *
+#*  OpenNI is free software: you can redistribute it and/or modify          *
+#*  it under the terms of the GNU Lesser General Public License as published*
+#*  by the Free Software Foundation, either version 3 of the License, or    *
+#*  (at your option) any later version.                                     *
+#*                                                                          *
+#*  OpenNI is distributed in the hope that it will be useful,               *
+#*  but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+#*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
+#*  GNU Lesser General Public License for more details.                     *
+#*                                                                          *
+#*  You should have received a copy of the GNU Lesser General Public License*
+#*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.          *
+#*                                                                          *
+#***************************************************************************/
+import os
+import re
+
+# ----------------------- MAIN -------------------------
+java_header = open("org_OpenNI_NativeMethods.h")
+cont = java_header.read()
+java_header.close()
+result = open("methods.inl", "w")
+result.write("static JNINativeMethod methods[] = {\n")
+
+while True:
+    match = re.search("Method:\s*(\w*)", cont)
+    if match is None:
+        break
+    method_name = match.group(1)
+    
+    match = re.search("Signature:\s*([\w\(\)\[;/]*)", cont)
+    if match is None:
+        break
+    signature = match.group(1)
+        
+    match = re.search("JNIEXPORT.*JNICALL (\w*)", cont)
+    if match is None:
+        break
+    method = match.group(1)
+
+    result.write('\t{ "' + method_name + '", "' + signature + '", (void*)&' + method + ' },\n')
+    cont = cont[match.end():];
+
+result.write('};\n');
+result.close()
diff --git a/Wrappers/OpenNI.jni/OpenNI.jni.cpp b/Wrappers/OpenNI.jni/OpenNI.jni.cpp
new file mode 100644
index 0000000..d2db476
--- /dev/null
+++ b/Wrappers/OpenNI.jni/OpenNI.jni.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#include <jni.h>
+#include "org_OpenNI_NativeMethods.h"
+
+#ifdef ANDROID
+#include <android/log.h>
+#endif
+
+#define DEBUG 1
+
+#if DEBUG && defined(ANDROID)
+#include <android/log.h>
+#  define  LOGD(x...)  __android_log_print(ANDROID_LOG_INFO,"OpenNIJNI",x)
+#  define  LOGE(x...)  __android_log_print(ANDROID_LOG_ERROR,"OpenNIJNI",x)
+#else
+#  define  LOGD(...)  do {} while (0)
+#  define  LOGE(...)  do {} while (0)
+#endif
+
+typedef union {
+    JNIEnv* env;
+    void* venv;
+} UnionJNIEnvToVoid;
+
+extern JavaVM* g_pVM;
+
+static const char *classPathName = "org/OpenNI/NativeMethods";
+
+#include "methods.inl"
+
+/*
+ * Register several native methods for one class.
+ */
+static int registerNativeMethods(JNIEnv* env, const char* className,
+JNINativeMethod* gMethods, int numMethods)
+{
+    jclass clazz;
+    clazz = env->FindClass(className);
+    if (clazz == NULL) {
+        LOGE("Native registration unable to find class '%s'", className);
+        return JNI_FALSE;
+    }
+    if (env->RegisterNatives(clazz, gMethods, numMethods) < 0) {
+        LOGE("RegisterNatives failed for '%s'", className);
+        return JNI_FALSE;
+    }
+
+    return JNI_TRUE;
+}
+
+/*
+ * Register native methods for all classes we know about.
+ */
+static int registerNatives(JNIEnv* env)
+{
+    if (!registerNativeMethods(env, classPathName, methods, sizeof(methods) / sizeof(methods[0]))) {
+        return JNI_FALSE;
+    }
+    return JNI_TRUE;
+}
+
+JNIEXPORT
+jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
+{
+    UnionJNIEnvToVoid uenv;
+    uenv.venv = NULL;
+    LOGD("enter JNI_OnLoad()");
+
+    if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_4) != JNI_OK)
+    {
+        LOGE("ERROR: GetEnv failed");
+        return -1;
+    }
+    
+    if (!registerNatives(uenv.env))
+    {
+        LOGE("ERROR: registerNatives failed");
+        return -1;
+    }
+
+	g_pVM = vm;
+
+    LOGD("JNI_OnLoad() complete!");
+    return JNI_VERSION_1_4;
+}
+
+JNIEXPORT
+void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved)
+{
+	g_pVM = NULL;
+}
+
diff --git a/Wrappers/OpenNI.jni/UpdateHeaders.bat b/Wrappers/OpenNI.jni/UpdateHeaders.bat
new file mode 100644
index 0000000..091c4bb
--- /dev/null
+++ b/Wrappers/OpenNI.jni/UpdateHeaders.bat
@@ -0,0 +1,2 @@
+"%JAVA_HOME%\bin\javah" -classpath ..\..\Platform\Win32\Build\Wrappers\OpenNI.java\bin org.OpenNI.NativeMethods
+CreateMethods.py
\ No newline at end of file
diff --git a/Wrappers/OpenNI.jni/jni.h b/Wrappers/OpenNI.jni/jni.h
new file mode 100644
index 0000000..11f376b
--- /dev/null
+++ b/Wrappers/OpenNI.jni/jni.h
@@ -0,0 +1,1965 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+/*
+ * %W% %E%
+ *
+ * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * ORACLE PROPRIETARY/CONFIDENTIAL.  Use is subject to license terms.
+ */
+
+/*
+ * We used part of Netscape's Java Runtime Interface (JRI) as the starting
+ * point of our design and implementation.
+ */
+
+/******************************************************************************
+ * Java Runtime Interface
+ * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
+ *****************************************************************************/
+
+#ifndef _JAVASOFT_JNI_H_
+#define _JAVASOFT_JNI_H_
+
+#include <stdio.h>
+#include <stdarg.h>
+
+/* jni_md.h contains the machine-dependent typedefs for jbyte, jint
+   and jlong */
+
+#include "jni_md.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * JNI Types
+ */
+
+#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
+
+typedef unsigned char	jboolean;
+typedef unsigned short	jchar;
+typedef short		jshort;
+typedef float		jfloat;
+typedef double		jdouble;
+
+typedef jint            jsize;
+
+#ifdef __cplusplus
+
+class _jobject {};
+class _jclass : public _jobject {};
+class _jthrowable : public _jobject {};
+class _jstring : public _jobject {};
+class _jarray : public _jobject {};
+class _jbooleanArray : public _jarray {};
+class _jbyteArray : public _jarray {};
+class _jcharArray : public _jarray {};
+class _jshortArray : public _jarray {};
+class _jintArray : public _jarray {};
+class _jlongArray : public _jarray {};
+class _jfloatArray : public _jarray {};
+class _jdoubleArray : public _jarray {};
+class _jobjectArray : public _jarray {};
+
+typedef _jobject *jobject;
+typedef _jclass *jclass;
+typedef _jthrowable *jthrowable;
+typedef _jstring *jstring;
+typedef _jarray *jarray;
+typedef _jbooleanArray *jbooleanArray;
+typedef _jbyteArray *jbyteArray;
+typedef _jcharArray *jcharArray;
+typedef _jshortArray *jshortArray;
+typedef _jintArray *jintArray;
+typedef _jlongArray *jlongArray;
+typedef _jfloatArray *jfloatArray;
+typedef _jdoubleArray *jdoubleArray;
+typedef _jobjectArray *jobjectArray;
+
+#else
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+
+#endif
+
+typedef jobject jweak;
+
+typedef union jvalue {
+    jboolean z;
+    jbyte    b;
+    jchar    c;
+    jshort   s;
+    jint     i;
+    jlong    j;
+    jfloat   f;
+    jdouble  d;
+    jobject  l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/* Return values from jobjectRefType */
+typedef enum _jobjectType {
+     JNIInvalidRefType    = 0,
+     JNILocalRefType      = 1,
+     JNIGlobalRefType     = 2,
+     JNIWeakGlobalRefType = 3 
+} jobjectRefType;
+
+
+#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK           0                 /* success */
+#define JNI_ERR          (-1)              /* unknown error */
+#define JNI_EDETACHED    (-2)              /* thread detached from the VM */
+#define JNI_EVERSION     (-3)              /* JNI version error */
+#define JNI_ENOMEM       (-4)              /* not enough memory */
+#define JNI_EEXIST       (-5)              /* VM already created */
+#define JNI_EINVAL       (-6)              /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
+
+/*
+ * used in RegisterNatives to describe native method name, signature,
+ * and function pointer.
+ */
+
+typedef struct {
+    const char *name;
+    const char *signature;
+    void *fnPtr;
+} JNINativeMethod;
+
+/*
+ * JNI Native Method Interface.
+ */
+
+struct JNINativeInterface_;
+
+struct JNIEnv_;
+
+#ifdef __cplusplus
+typedef JNIEnv_ JNIEnv;
+#else
+typedef const struct JNINativeInterface_ *JNIEnv;
+#endif
+
+/*
+ * JNI Invocation Interface.
+ */
+
+struct JNIInvokeInterface_;
+
+struct JavaVM_;
+
+#ifdef __cplusplus
+typedef JavaVM_ JavaVM;
+#else
+typedef const struct JNIInvokeInterface_ *JavaVM;
+#endif
+
+struct JNINativeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    void *reserved3;
+    jint (JNICALL *GetVersion)(JNIEnv *env);
+
+    jclass (JNICALL *DefineClass)
+      (JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
+       jsize len);
+    jclass (JNICALL *FindClass)
+      (JNIEnv *env, const char *name);
+
+    jmethodID (JNICALL *FromReflectedMethod)
+      (JNIEnv *env, jobject method);
+    jfieldID (JNICALL *FromReflectedField)
+      (JNIEnv *env, jobject field);
+
+    jobject (JNICALL *ToReflectedMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
+
+    jclass (JNICALL *GetSuperclass)
+      (JNIEnv *env, jclass sub);
+    jboolean (JNICALL *IsAssignableFrom)
+      (JNIEnv *env, jclass sub, jclass sup);
+
+    jobject (JNICALL *ToReflectedField)
+      (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
+
+    jint (JNICALL *Throw)
+      (JNIEnv *env, jthrowable obj);
+    jint (JNICALL *ThrowNew)
+      (JNIEnv *env, jclass clazz, const char *msg);
+    jthrowable (JNICALL *ExceptionOccurred)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionDescribe)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionClear)
+      (JNIEnv *env);
+    void (JNICALL *FatalError)
+      (JNIEnv *env, const char *msg);
+
+    jint (JNICALL *PushLocalFrame)
+      (JNIEnv *env, jint capacity);
+    jobject (JNICALL *PopLocalFrame)
+      (JNIEnv *env, jobject result);
+
+    jobject (JNICALL *NewGlobalRef)
+      (JNIEnv *env, jobject lobj);
+    void (JNICALL *DeleteGlobalRef)
+      (JNIEnv *env, jobject gref);
+    void (JNICALL *DeleteLocalRef)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsSameObject)
+      (JNIEnv *env, jobject obj1, jobject obj2);
+    jobject (JNICALL *NewLocalRef)
+      (JNIEnv *env, jobject ref);
+    jint (JNICALL *EnsureLocalCapacity)
+      (JNIEnv *env, jint capacity);
+
+    jobject (JNICALL *AllocObject)
+      (JNIEnv *env, jclass clazz);
+    jobject (JNICALL *NewObject)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *NewObjectV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *NewObjectA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jclass (JNICALL *GetObjectClass)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsInstanceOf)
+      (JNIEnv *env, jobject obj, jclass clazz);
+
+    jmethodID (JNICALL *GetMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallObjectMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jobject (JNICALL *CallObjectMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallObjectMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jboolean (JNICALL *CallBooleanMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jboolean (JNICALL *CallBooleanMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallBooleanMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jbyte (JNICALL *CallByteMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jbyte (JNICALL *CallByteMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallByteMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallCharMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jchar (JNICALL *CallCharMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallCharMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallShortMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jshort (JNICALL *CallShortMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallShortMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallIntMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jint (JNICALL *CallIntMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jint (JNICALL *CallIntMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallLongMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jlong (JNICALL *CallLongMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallLongMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallFloatMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jfloat (JNICALL *CallFloatMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallFloatMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallDoubleMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jdouble (JNICALL *CallDoubleMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallDoubleMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallVoidMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    void (JNICALL *CallVoidMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    void (JNICALL *CallVoidMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jobject (JNICALL *CallNonvirtualObjectMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallNonvirtualObjectMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jobject (JNICALL *CallNonvirtualObjectMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jboolean (JNICALL *CallNonvirtualBooleanMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jbyte (JNICALL *CallNonvirtualByteMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallNonvirtualByteMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jbyte (JNICALL *CallNonvirtualByteMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jchar (JNICALL *CallNonvirtualCharMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallNonvirtualCharMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jchar (JNICALL *CallNonvirtualCharMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jshort (JNICALL *CallNonvirtualShortMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallNonvirtualShortMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jshort (JNICALL *CallNonvirtualShortMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jint (JNICALL *CallNonvirtualIntMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallNonvirtualIntMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jint (JNICALL *CallNonvirtualIntMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jlong (JNICALL *CallNonvirtualLongMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallNonvirtualLongMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jlong (JNICALL *CallNonvirtualLongMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jfloat (JNICALL *CallNonvirtualFloatMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallNonvirtualFloatMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jfloat (JNICALL *CallNonvirtualFloatMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jdouble (JNICALL *CallNonvirtualDoubleMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    void (JNICALL *CallNonvirtualVoidMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    void (JNICALL *CallNonvirtualVoidMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    void (JNICALL *CallNonvirtualVoidMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jfieldID (JNICALL *GetFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *GetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jboolean (JNICALL *GetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jbyte (JNICALL *GetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jchar (JNICALL *GetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jshort (JNICALL *GetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jint (JNICALL *GetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jlong (JNICALL *GetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jfloat (JNICALL *GetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jdouble (JNICALL *GetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+
+    void (JNICALL *SetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
+    void (JNICALL *SetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
+    void (JNICALL *SetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
+    void (JNICALL *SetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
+    void (JNICALL *SetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
+    void (JNICALL *SetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
+    void (JNICALL *SetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
+    void (JNICALL *SetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
+    void (JNICALL *SetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
+
+    jmethodID (JNICALL *GetStaticMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallStaticObjectMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallStaticObjectMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallStaticObjectMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jboolean (JNICALL *CallStaticBooleanMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallStaticBooleanMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallStaticBooleanMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jbyte (JNICALL *CallStaticByteMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallStaticByteMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallStaticByteMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallStaticCharMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallStaticCharMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallStaticCharMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallStaticShortMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallStaticShortMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallStaticShortMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallStaticIntMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallStaticIntMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jint (JNICALL *CallStaticIntMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallStaticLongMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallStaticLongMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallStaticLongMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallStaticFloatMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallStaticFloatMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallStaticFloatMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallStaticDoubleMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallStaticDoubleMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallStaticDoubleMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallStaticVoidMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, ...);
+    void (JNICALL *CallStaticVoidMethodV)
+      (JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
+    void (JNICALL *CallStaticVoidMethodA)
+      (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);
+
+    jfieldID (JNICALL *GetStaticFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+    jobject (JNICALL *GetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jboolean (JNICALL *GetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jbyte (JNICALL *GetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jchar (JNICALL *GetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jshort (JNICALL *GetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jint (JNICALL *GetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jlong (JNICALL *GetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jfloat (JNICALL *GetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jdouble (JNICALL *GetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+
+    void (JNICALL *SetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);
+    void (JNICALL *SetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);
+    void (JNICALL *SetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);
+    void (JNICALL *SetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);
+    void (JNICALL *SetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);
+    void (JNICALL *SetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);
+    void (JNICALL *SetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);
+    void (JNICALL *SetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);
+    void (JNICALL *SetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);
+
+    jstring (JNICALL *NewString)
+      (JNIEnv *env, const jchar *unicode, jsize len);
+    jsize (JNICALL *GetStringLength)
+      (JNIEnv *env, jstring str);
+    const jchar *(JNICALL *GetStringChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringChars)
+      (JNIEnv *env, jstring str, const jchar *chars);
+
+    jstring (JNICALL *NewStringUTF)
+      (JNIEnv *env, const char *utf);
+    jsize (JNICALL *GetStringUTFLength)
+      (JNIEnv *env, jstring str);
+    const char* (JNICALL *GetStringUTFChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringUTFChars)
+      (JNIEnv *env, jstring str, const char* chars);
+
+
+    jsize (JNICALL *GetArrayLength)
+      (JNIEnv *env, jarray array);
+
+    jobjectArray (JNICALL *NewObjectArray)
+      (JNIEnv *env, jsize len, jclass clazz, jobject init);
+    jobject (JNICALL *GetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index);
+    void (JNICALL *SetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index, jobject val);
+
+    jbooleanArray (JNICALL *NewBooleanArray)
+      (JNIEnv *env, jsize len);
+    jbyteArray (JNICALL *NewByteArray)
+      (JNIEnv *env, jsize len);
+    jcharArray (JNICALL *NewCharArray)
+      (JNIEnv *env, jsize len);
+    jshortArray (JNICALL *NewShortArray)
+      (JNIEnv *env, jsize len);
+    jintArray (JNICALL *NewIntArray)
+      (JNIEnv *env, jsize len);
+    jlongArray (JNICALL *NewLongArray)
+      (JNIEnv *env, jsize len);
+    jfloatArray (JNICALL *NewFloatArray)
+      (JNIEnv *env, jsize len);
+    jdoubleArray (JNICALL *NewDoubleArray)
+      (JNIEnv *env, jsize len);
+
+    jboolean * (JNICALL *GetBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *isCopy);
+    jbyte * (JNICALL *GetByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jboolean *isCopy);
+    jchar * (JNICALL *GetCharArrayElements)
+      (JNIEnv *env, jcharArray array, jboolean *isCopy);
+    jshort * (JNICALL *GetShortArrayElements)
+      (JNIEnv *env, jshortArray array, jboolean *isCopy);
+    jint * (JNICALL *GetIntArrayElements)
+      (JNIEnv *env, jintArray array, jboolean *isCopy);
+    jlong * (JNICALL *GetLongArrayElements)
+      (JNIEnv *env, jlongArray array, jboolean *isCopy);
+    jfloat * (JNICALL *GetFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jboolean *isCopy);
+    jdouble * (JNICALL *GetDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jboolean *isCopy);
+
+    void (JNICALL *ReleaseBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);
+    void (JNICALL *ReleaseByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);
+    void (JNICALL *ReleaseCharArrayElements)
+      (JNIEnv *env, jcharArray array, jchar *elems, jint mode);
+    void (JNICALL *ReleaseShortArrayElements)
+      (JNIEnv *env, jshortArray array, jshort *elems, jint mode);
+    void (JNICALL *ReleaseIntArrayElements)
+      (JNIEnv *env, jintArray array, jint *elems, jint mode);
+    void (JNICALL *ReleaseLongArrayElements)
+      (JNIEnv *env, jlongArray array, jlong *elems, jint mode);
+    void (JNICALL *ReleaseFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);
+    void (JNICALL *ReleaseDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);
+
+    void (JNICALL *GetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);
+    void (JNICALL *GetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);
+    void (JNICALL *GetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);
+    void (JNICALL *GetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);
+    void (JNICALL *GetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);
+    void (JNICALL *GetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);
+    void (JNICALL *GetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);
+
+    void (JNICALL *SetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);
+    void (JNICALL *SetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);
+    void (JNICALL *SetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);
+    void (JNICALL *SetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);
+    void (JNICALL *SetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);
+    void (JNICALL *SetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);
+    void (JNICALL *SetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);
+    void (JNICALL *SetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);
+
+    jint (JNICALL *RegisterNatives)
+      (JNIEnv *env, jclass clazz, const JNINativeMethod *methods,
+       jint nMethods);
+    jint (JNICALL *UnregisterNatives)
+      (JNIEnv *env, jclass clazz);
+
+    jint (JNICALL *MonitorEnter)
+      (JNIEnv *env, jobject obj);
+    jint (JNICALL *MonitorExit)
+      (JNIEnv *env, jobject obj);
+
+    jint (JNICALL *GetJavaVM)
+      (JNIEnv *env, JavaVM **vm);
+
+    void (JNICALL *GetStringRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetStringUTFRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
+
+    void * (JNICALL *GetPrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, jboolean *isCopy);
+    void (JNICALL *ReleasePrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, void *carray, jint mode);
+
+    const jchar * (JNICALL *GetStringCritical)
+      (JNIEnv *env, jstring string, jboolean *isCopy);
+    void (JNICALL *ReleaseStringCritical)
+      (JNIEnv *env, jstring string, const jchar *cstring);
+
+    jweak (JNICALL *NewWeakGlobalRef)
+       (JNIEnv *env, jobject obj);
+    void (JNICALL *DeleteWeakGlobalRef)
+       (JNIEnv *env, jweak ref);
+
+    jboolean (JNICALL *ExceptionCheck)
+       (JNIEnv *env);
+
+    jobject (JNICALL *NewDirectByteBuffer)
+       (JNIEnv* env, void* address, jlong capacity);
+    void* (JNICALL *GetDirectBufferAddress)
+       (JNIEnv* env, jobject buf);
+    jlong (JNICALL *GetDirectBufferCapacity)
+       (JNIEnv* env, jobject buf);
+
+    /* New JNI 1.6 Features */
+
+    jobjectRefType (JNICALL *GetObjectRefType)
+        (JNIEnv* env, jobject obj);
+};
+
+/*
+ * We use inlined functions for C++ so that programmers can write:
+ *
+ *    env->FindClass("java/lang/String")
+ *
+ * in C++ rather than:
+ *
+ *    (*env)->FindClass(env, "java/lang/String")
+ *
+ * in C.
+ */
+
+struct JNIEnv_ {
+    const struct JNINativeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint GetVersion() {
+        return functions->GetVersion(this);
+    }
+    jclass DefineClass(const char *name, jobject loader, const jbyte *buf,
+		       jsize len) {
+        return functions->DefineClass(this, name, loader, buf, len);
+    }
+    jclass FindClass(const char *name) {
+        return functions->FindClass(this, name);
+    }
+    jmethodID FromReflectedMethod(jobject method) {
+        return functions->FromReflectedMethod(this,method);
+    }
+    jfieldID FromReflectedField(jobject field) {
+        return functions->FromReflectedField(this,field);
+    }
+
+    jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) {
+        return functions->ToReflectedMethod(this, cls, methodID, isStatic);
+    }
+
+    jclass GetSuperclass(jclass sub) {
+        return functions->GetSuperclass(this, sub);
+    }
+    jboolean IsAssignableFrom(jclass sub, jclass sup) {
+        return functions->IsAssignableFrom(this, sub, sup);
+    }
+
+    jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) {
+        return functions->ToReflectedField(this,cls,fieldID,isStatic);
+    }
+
+    jint Throw(jthrowable obj) {
+        return functions->Throw(this, obj);
+    }
+    jint ThrowNew(jclass clazz, const char *msg) {
+        return functions->ThrowNew(this, clazz, msg);
+    }
+    jthrowable ExceptionOccurred() {
+        return functions->ExceptionOccurred(this);
+    }
+    void ExceptionDescribe() {
+        functions->ExceptionDescribe(this);
+    }
+    void ExceptionClear() {
+        functions->ExceptionClear(this);
+    }
+    void FatalError(const char *msg) {
+        functions->FatalError(this, msg);
+    }
+
+    jint PushLocalFrame(jint capacity) {
+        return functions->PushLocalFrame(this,capacity);
+    }
+    jobject PopLocalFrame(jobject result) {
+        return functions->PopLocalFrame(this,result);
+    }
+
+    jobject NewGlobalRef(jobject lobj) {
+        return functions->NewGlobalRef(this,lobj);
+    }
+    void DeleteGlobalRef(jobject gref) {
+        functions->DeleteGlobalRef(this,gref);
+    }
+    void DeleteLocalRef(jobject obj) {
+        functions->DeleteLocalRef(this, obj);
+    }
+
+    jboolean IsSameObject(jobject obj1, jobject obj2) {
+        return functions->IsSameObject(this,obj1,obj2);
+    }
+
+    jobject NewLocalRef(jobject ref) {
+        return functions->NewLocalRef(this,ref);
+    }
+    jint EnsureLocalCapacity(jint capacity) {
+        return functions->EnsureLocalCapacity(this,capacity);
+    }
+
+    jobject AllocObject(jclass clazz) {
+        return functions->AllocObject(this,clazz);
+    }
+    jobject NewObject(jclass clazz, jmethodID methodID, ...) {
+        va_list args;
+	jobject result;
+	va_start(args, methodID);
+        result = functions->NewObjectV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jobject NewObjectV(jclass clazz, jmethodID methodID,
+		       va_list args) {
+        return functions->NewObjectV(this,clazz,methodID,args);
+    }
+    jobject NewObjectA(jclass clazz, jmethodID methodID,
+		       const jvalue *args) {
+        return functions->NewObjectA(this,clazz,methodID,args);
+    }
+
+    jclass GetObjectClass(jobject obj) {
+        return functions->GetObjectClass(this,obj);
+    }
+    jboolean IsInstanceOf(jobject obj, jclass clazz) {
+        return functions->IsInstanceOf(this,obj,clazz);
+    }
+
+    jmethodID GetMethodID(jclass clazz, const char *name,
+			  const char *sig) {
+        return functions->GetMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jobject result;
+	va_start(args,methodID);
+	result = functions->CallObjectMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jobject CallObjectMethodV(jobject obj, jmethodID methodID,
+			va_list args) {
+        return functions->CallObjectMethodV(this,obj,methodID,args);
+    }
+    jobject CallObjectMethodA(jobject obj, jmethodID methodID,
+			const jvalue * args) {
+        return functions->CallObjectMethodA(this,obj,methodID,args);
+    }
+
+    jboolean CallBooleanMethod(jobject obj,
+			       jmethodID methodID, ...) {
+        va_list args;
+	jboolean result;
+	va_start(args,methodID);
+	result = functions->CallBooleanMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jboolean CallBooleanMethodV(jobject obj, jmethodID methodID,
+				va_list args) {
+        return functions->CallBooleanMethodV(this,obj,methodID,args);
+    }
+    jboolean CallBooleanMethodA(jobject obj, jmethodID methodID,
+				const jvalue * args) {
+        return functions->CallBooleanMethodA(this,obj,methodID, args);
+    }
+
+    jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jbyte result;
+	va_start(args,methodID);
+	result = functions->CallByteMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jbyte CallByteMethodV(jobject obj, jmethodID methodID,
+			  va_list args) {
+        return functions->CallByteMethodV(this,obj,methodID,args);
+    }
+    jbyte CallByteMethodA(jobject obj, jmethodID methodID,
+			  const jvalue * args) {
+        return functions->CallByteMethodA(this,obj,methodID,args);
+    }
+
+    jchar CallCharMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jchar result;
+	va_start(args,methodID);
+	result = functions->CallCharMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jchar CallCharMethodV(jobject obj, jmethodID methodID,
+			  va_list args) {
+        return functions->CallCharMethodV(this,obj,methodID,args);
+    }
+    jchar CallCharMethodA(jobject obj, jmethodID methodID,
+			  const jvalue * args) {
+        return functions->CallCharMethodA(this,obj,methodID,args);
+    }
+
+    jshort CallShortMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jshort result;
+	va_start(args,methodID);
+	result = functions->CallShortMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jshort CallShortMethodV(jobject obj, jmethodID methodID,
+			    va_list args) {
+        return functions->CallShortMethodV(this,obj,methodID,args);
+    }
+    jshort CallShortMethodA(jobject obj, jmethodID methodID,
+			    const jvalue * args) {
+        return functions->CallShortMethodA(this,obj,methodID,args);
+    }
+
+    jint CallIntMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jint result;
+	va_start(args,methodID);
+	result = functions->CallIntMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jint CallIntMethodV(jobject obj, jmethodID methodID,
+			va_list args) {
+        return functions->CallIntMethodV(this,obj,methodID,args);
+    }
+    jint CallIntMethodA(jobject obj, jmethodID methodID,
+			const jvalue * args) {
+        return functions->CallIntMethodA(this,obj,methodID,args);
+    }
+
+    jlong CallLongMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jlong result;
+	va_start(args,methodID);
+	result = functions->CallLongMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jlong CallLongMethodV(jobject obj, jmethodID methodID,
+			  va_list args) {
+        return functions->CallLongMethodV(this,obj,methodID,args);
+    }
+    jlong CallLongMethodA(jobject obj, jmethodID methodID,
+			  const jvalue * args) {
+        return functions->CallLongMethodA(this,obj,methodID,args);
+    }
+
+    jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jfloat result;
+	va_start(args,methodID);
+	result = functions->CallFloatMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jfloat CallFloatMethodV(jobject obj, jmethodID methodID,
+			    va_list args) {
+        return functions->CallFloatMethodV(this,obj,methodID,args);
+    }
+    jfloat CallFloatMethodA(jobject obj, jmethodID methodID,
+			    const jvalue * args) {
+        return functions->CallFloatMethodA(this,obj,methodID,args);
+    }
+
+    jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	jdouble result;
+	va_start(args,methodID);
+	result = functions->CallDoubleMethodV(this,obj,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jdouble CallDoubleMethodV(jobject obj, jmethodID methodID,
+			va_list args) {
+        return functions->CallDoubleMethodV(this,obj,methodID,args);
+    }
+    jdouble CallDoubleMethodA(jobject obj, jmethodID methodID,
+			const jvalue * args) {
+        return functions->CallDoubleMethodA(this,obj,methodID,args);
+    }
+
+    void CallVoidMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+	va_start(args,methodID);
+	functions->CallVoidMethodV(this,obj,methodID,args);
+	va_end(args);
+    }
+    void CallVoidMethodV(jobject obj, jmethodID methodID,
+			 va_list args) {
+        functions->CallVoidMethodV(this,obj,methodID,args);
+    }
+    void CallVoidMethodA(jobject obj, jmethodID methodID,
+			 const jvalue * args) {
+        functions->CallVoidMethodA(this,obj,methodID,args);
+    }
+
+    jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz,
+				       jmethodID methodID, ...) {
+        va_list args;
+	jobject result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+							methodID,args);
+	va_end(args);
+	return result;
+    }
+    jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz,
+					jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+						      methodID,args);
+    }
+    jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz,
+					jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualObjectMethodA(this,obj,clazz,
+						      methodID,args);
+    }
+
+    jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz,
+					 jmethodID methodID, ...) {
+        va_list args;
+	jboolean result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+							 methodID,args);
+	va_end(args);
+	return result;
+    }
+    jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz,
+					  jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+						       methodID,args);
+    }
+    jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz,
+					  jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualBooleanMethodA(this,obj,clazz,
+						       methodID, args);
+    }
+
+    jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz,
+				   jmethodID methodID, ...) {
+        va_list args;
+	jbyte result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualByteMethodV(this,obj,clazz,
+						      methodID,args);
+	va_end(args);
+	return result;
+    }
+    jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz,
+				    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualByteMethodV(this,obj,clazz,
+						    methodID,args);
+    }
+    jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz,
+				    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualByteMethodA(this,obj,clazz,
+						    methodID,args);
+    }
+
+    jchar CallNonvirtualCharMethod(jobject obj, jclass clazz,
+				   jmethodID methodID, ...) {
+        va_list args;
+	jchar result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualCharMethodV(this,obj,clazz,
+						      methodID,args);
+	va_end(args);
+	return result;
+    }
+    jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz,
+				    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualCharMethodV(this,obj,clazz,
+						    methodID,args);
+    }
+    jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz,
+				    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualCharMethodA(this,obj,clazz,
+						    methodID,args);
+    }
+
+    jshort CallNonvirtualShortMethod(jobject obj, jclass clazz,
+				     jmethodID methodID, ...) {
+        va_list args;
+	jshort result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualShortMethodV(this,obj,clazz,
+						       methodID,args);
+	va_end(args);
+	return result;
+    }
+    jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz,
+				      jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualShortMethodV(this,obj,clazz,
+						     methodID,args);
+    }
+    jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz,
+				      jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualShortMethodA(this,obj,clazz,
+						     methodID,args);
+    }
+
+    jint CallNonvirtualIntMethod(jobject obj, jclass clazz,
+				 jmethodID methodID, ...) {
+        va_list args;
+	jint result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualIntMethodV(this,obj,clazz,
+						     methodID,args);
+	va_end(args);
+	return result;
+    }
+    jint CallNonvirtualIntMethodV(jobject obj, jclass clazz,
+				  jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualIntMethodV(this,obj,clazz,
+						   methodID,args);
+    }
+    jint CallNonvirtualIntMethodA(jobject obj, jclass clazz,
+				  jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualIntMethodA(this,obj,clazz,
+						   methodID,args);
+    }
+
+    jlong CallNonvirtualLongMethod(jobject obj, jclass clazz,
+				   jmethodID methodID, ...) {
+        va_list args;
+	jlong result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualLongMethodV(this,obj,clazz,
+						      methodID,args);
+	va_end(args);
+	return result;
+    }
+    jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz,
+				    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualLongMethodV(this,obj,clazz,
+						    methodID,args);
+    }
+    jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz,
+				    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualLongMethodA(this,obj,clazz,
+						    methodID,args);
+    }
+
+    jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz,
+				     jmethodID methodID, ...) {
+        va_list args;
+	jfloat result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+						       methodID,args);
+	va_end(args);
+	return result;
+    }
+    jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz,
+				      jmethodID methodID,
+				      va_list args) {
+        return functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+						     methodID,args);
+    }
+    jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz,
+				      jmethodID methodID,
+				      const jvalue * args) {
+        return functions->CallNonvirtualFloatMethodA(this,obj,clazz,
+						     methodID,args);
+    }
+
+    jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz,
+				       jmethodID methodID, ...) {
+        va_list args;
+	jdouble result;
+	va_start(args,methodID);
+	result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+							methodID,args);
+	va_end(args);
+	return result;
+    }
+    jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz,
+					jmethodID methodID,
+					va_list args) {
+        return functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+						      methodID,args);
+    }
+    jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz,
+					jmethodID methodID,
+					const jvalue * args) {
+        return functions->CallNonvirtualDoubleMethodA(this,obj,clazz,
+						      methodID,args);
+    }
+
+    void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
+				  jmethodID methodID, ...) {
+        va_list args;
+	va_start(args,methodID);
+	functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+	va_end(args);
+    }
+    void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
+				   jmethodID methodID,
+				   va_list args) {
+        functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+    }
+    void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
+				   jmethodID methodID,
+				   const jvalue * args) {
+        functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args);
+    }
+
+    jfieldID GetFieldID(jclass clazz, const char *name,
+			const char *sig) {
+        return functions->GetFieldID(this,clazz,name,sig);
+    }
+
+    jobject GetObjectField(jobject obj, jfieldID fieldID) {
+        return functions->GetObjectField(this,obj,fieldID);
+    }
+    jboolean GetBooleanField(jobject obj, jfieldID fieldID) {
+        return functions->GetBooleanField(this,obj,fieldID);
+    }
+    jbyte GetByteField(jobject obj, jfieldID fieldID) {
+        return functions->GetByteField(this,obj,fieldID);
+    }
+    jchar GetCharField(jobject obj, jfieldID fieldID) {
+        return functions->GetCharField(this,obj,fieldID);
+    }
+    jshort GetShortField(jobject obj, jfieldID fieldID) {
+        return functions->GetShortField(this,obj,fieldID);
+    }
+    jint GetIntField(jobject obj, jfieldID fieldID) {
+        return functions->GetIntField(this,obj,fieldID);
+    }
+    jlong GetLongField(jobject obj, jfieldID fieldID) {
+        return functions->GetLongField(this,obj,fieldID);
+    }
+    jfloat GetFloatField(jobject obj, jfieldID fieldID) {
+        return functions->GetFloatField(this,obj,fieldID);
+    }
+    jdouble GetDoubleField(jobject obj, jfieldID fieldID) {
+        return functions->GetDoubleField(this,obj,fieldID);
+    }
+
+    void SetObjectField(jobject obj, jfieldID fieldID, jobject val) {
+        functions->SetObjectField(this,obj,fieldID,val);
+    }
+    void SetBooleanField(jobject obj, jfieldID fieldID,
+			 jboolean val) {
+        functions->SetBooleanField(this,obj,fieldID,val);
+    }
+    void SetByteField(jobject obj, jfieldID fieldID,
+		      jbyte val) {
+        functions->SetByteField(this,obj,fieldID,val);
+    }
+    void SetCharField(jobject obj, jfieldID fieldID,
+		      jchar val) {
+        functions->SetCharField(this,obj,fieldID,val);
+    }
+    void SetShortField(jobject obj, jfieldID fieldID,
+		       jshort val) {
+        functions->SetShortField(this,obj,fieldID,val);
+    }
+    void SetIntField(jobject obj, jfieldID fieldID,
+		     jint val) {
+        functions->SetIntField(this,obj,fieldID,val);
+    }
+    void SetLongField(jobject obj, jfieldID fieldID,
+		      jlong val) {
+        functions->SetLongField(this,obj,fieldID,val);
+    }
+    void SetFloatField(jobject obj, jfieldID fieldID,
+		       jfloat val) {
+        functions->SetFloatField(this,obj,fieldID,val);
+    }
+    void SetDoubleField(jobject obj, jfieldID fieldID,
+			jdouble val) {
+        functions->SetDoubleField(this,obj,fieldID,val);
+    }
+
+    jmethodID GetStaticMethodID(jclass clazz, const char *name,
+				const char *sig) {
+        return functions->GetStaticMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID,
+			     ...) {
+        va_list args;
+	jobject result;
+	va_start(args,methodID);
+	result = functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID,
+			      va_list args) {
+        return functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+    }
+    jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID,
+			      const jvalue *args) {
+        return functions->CallStaticObjectMethodA(this,clazz,methodID,args);
+    }
+
+    jboolean CallStaticBooleanMethod(jclass clazz,
+				     jmethodID methodID, ...) {
+        va_list args;
+	jboolean result;
+	va_start(args,methodID);
+	result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jboolean CallStaticBooleanMethodV(jclass clazz,
+				      jmethodID methodID, va_list args) {
+        return functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+    }
+    jboolean CallStaticBooleanMethodA(jclass clazz,
+				      jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticBooleanMethodA(this,clazz,methodID,args);
+    }
+
+    jbyte CallStaticByteMethod(jclass clazz,
+			       jmethodID methodID, ...) {
+        va_list args;
+	jbyte result;
+	va_start(args,methodID);
+	result = functions->CallStaticByteMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jbyte CallStaticByteMethodV(jclass clazz,
+				jmethodID methodID, va_list args) {
+        return functions->CallStaticByteMethodV(this,clazz,methodID,args);
+    }
+    jbyte CallStaticByteMethodA(jclass clazz,
+				jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticByteMethodA(this,clazz,methodID,args);
+    }
+
+    jchar CallStaticCharMethod(jclass clazz,
+			       jmethodID methodID, ...) {
+        va_list args;
+	jchar result;
+	va_start(args,methodID);
+	result = functions->CallStaticCharMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jchar CallStaticCharMethodV(jclass clazz,
+				jmethodID methodID, va_list args) {
+        return functions->CallStaticCharMethodV(this,clazz,methodID,args);
+    }
+    jchar CallStaticCharMethodA(jclass clazz,
+				jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticCharMethodA(this,clazz,methodID,args);
+    }
+
+    jshort CallStaticShortMethod(jclass clazz,
+				 jmethodID methodID, ...) {
+        va_list args;
+	jshort result;
+	va_start(args,methodID);
+	result = functions->CallStaticShortMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jshort CallStaticShortMethodV(jclass clazz,
+				  jmethodID methodID, va_list args) {
+        return functions->CallStaticShortMethodV(this,clazz,methodID,args);
+    }
+    jshort CallStaticShortMethodA(jclass clazz,
+				  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticShortMethodA(this,clazz,methodID,args);
+    }
+
+    jint CallStaticIntMethod(jclass clazz,
+			     jmethodID methodID, ...) {
+        va_list args;
+	jint result;
+	va_start(args,methodID);
+	result = functions->CallStaticIntMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jint CallStaticIntMethodV(jclass clazz,
+			      jmethodID methodID, va_list args) {
+        return functions->CallStaticIntMethodV(this,clazz,methodID,args);
+    }
+    jint CallStaticIntMethodA(jclass clazz,
+			      jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticIntMethodA(this,clazz,methodID,args);
+    }
+
+    jlong CallStaticLongMethod(jclass clazz,
+			       jmethodID methodID, ...) {
+        va_list args;
+	jlong result;
+	va_start(args,methodID);
+	result = functions->CallStaticLongMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jlong CallStaticLongMethodV(jclass clazz,
+				jmethodID methodID, va_list args) {
+        return functions->CallStaticLongMethodV(this,clazz,methodID,args);
+    }
+    jlong CallStaticLongMethodA(jclass clazz,
+				jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticLongMethodA(this,clazz,methodID,args);
+    }
+
+    jfloat CallStaticFloatMethod(jclass clazz,
+				 jmethodID methodID, ...) {
+        va_list args;
+	jfloat result;
+	va_start(args,methodID);
+	result = functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jfloat CallStaticFloatMethodV(jclass clazz,
+				  jmethodID methodID, va_list args) {
+        return functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+    }
+    jfloat CallStaticFloatMethodA(jclass clazz,
+				  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticFloatMethodA(this,clazz,methodID,args);
+    }
+
+    jdouble CallStaticDoubleMethod(jclass clazz,
+				   jmethodID methodID, ...) {
+        va_list args;
+	jdouble result;
+	va_start(args,methodID);
+	result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+	va_end(args);
+	return result;
+    }
+    jdouble CallStaticDoubleMethodV(jclass clazz,
+				    jmethodID methodID, va_list args) {
+        return functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+    }
+    jdouble CallStaticDoubleMethodA(jclass clazz,
+				    jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticDoubleMethodA(this,clazz,methodID,args);
+    }
+
+    void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
+        va_list args;
+	va_start(args,methodID);
+	functions->CallStaticVoidMethodV(this,cls,methodID,args);
+	va_end(args);
+    }
+    void CallStaticVoidMethodV(jclass cls, jmethodID methodID,
+			       va_list args) {
+        functions->CallStaticVoidMethodV(this,cls,methodID,args);
+    }
+    void CallStaticVoidMethodA(jclass cls, jmethodID methodID,
+			       const jvalue * args) {
+        functions->CallStaticVoidMethodA(this,cls,methodID,args);
+    }
+
+    jfieldID GetStaticFieldID(jclass clazz, const char *name,
+			      const char *sig) {
+        return functions->GetStaticFieldID(this,clazz,name,sig);
+    }
+    jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticObjectField(this,clazz,fieldID);
+    }
+    jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticBooleanField(this,clazz,fieldID);
+    }
+    jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticByteField(this,clazz,fieldID);
+    }
+    jchar GetStaticCharField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticCharField(this,clazz,fieldID);
+    }
+    jshort GetStaticShortField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticShortField(this,clazz,fieldID);
+    }
+    jint GetStaticIntField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticIntField(this,clazz,fieldID);
+    }
+    jlong GetStaticLongField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticLongField(this,clazz,fieldID);
+    }
+    jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticFloatField(this,clazz,fieldID);
+    }
+    jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticDoubleField(this,clazz,fieldID);
+    }
+
+    void SetStaticObjectField(jclass clazz, jfieldID fieldID,
+			jobject value) {
+      functions->SetStaticObjectField(this,clazz,fieldID,value);
+    }
+    void SetStaticBooleanField(jclass clazz, jfieldID fieldID,
+			jboolean value) {
+      functions->SetStaticBooleanField(this,clazz,fieldID,value);
+    }
+    void SetStaticByteField(jclass clazz, jfieldID fieldID,
+			jbyte value) {
+      functions->SetStaticByteField(this,clazz,fieldID,value);
+    }
+    void SetStaticCharField(jclass clazz, jfieldID fieldID,
+			jchar value) {
+      functions->SetStaticCharField(this,clazz,fieldID,value);
+    }
+    void SetStaticShortField(jclass clazz, jfieldID fieldID,
+			jshort value) {
+      functions->SetStaticShortField(this,clazz,fieldID,value);
+    }
+    void SetStaticIntField(jclass clazz, jfieldID fieldID,
+			jint value) {
+      functions->SetStaticIntField(this,clazz,fieldID,value);
+    }
+    void SetStaticLongField(jclass clazz, jfieldID fieldID,
+			jlong value) {
+      functions->SetStaticLongField(this,clazz,fieldID,value);
+    }
+    void SetStaticFloatField(jclass clazz, jfieldID fieldID,
+			jfloat value) {
+      functions->SetStaticFloatField(this,clazz,fieldID,value);
+    }
+    void SetStaticDoubleField(jclass clazz, jfieldID fieldID,
+			jdouble value) {
+      functions->SetStaticDoubleField(this,clazz,fieldID,value);
+    }
+
+    jstring NewString(const jchar *unicode, jsize len) {
+        return functions->NewString(this,unicode,len);
+    }
+    jsize GetStringLength(jstring str) {
+        return functions->GetStringLength(this,str);
+    }
+    const jchar *GetStringChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringChars(this,str,isCopy);
+    }
+    void ReleaseStringChars(jstring str, const jchar *chars) {
+        functions->ReleaseStringChars(this,str,chars);
+    }
+
+    jstring NewStringUTF(const char *utf) {
+        return functions->NewStringUTF(this,utf);
+    }
+    jsize GetStringUTFLength(jstring str) {
+        return functions->GetStringUTFLength(this,str);
+    }
+    const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringUTFChars(this,str,isCopy);
+    }
+    void ReleaseStringUTFChars(jstring str, const char* chars) {
+        functions->ReleaseStringUTFChars(this,str,chars);
+    }
+
+    jsize GetArrayLength(jarray array) {
+        return functions->GetArrayLength(this,array);
+    }
+
+    jobjectArray NewObjectArray(jsize len, jclass clazz,
+				jobject init) {
+        return functions->NewObjectArray(this,len,clazz,init);
+    }
+    jobject GetObjectArrayElement(jobjectArray array, jsize index) {
+        return functions->GetObjectArrayElement(this,array,index);
+    }
+    void SetObjectArrayElement(jobjectArray array, jsize index,
+			       jobject val) {
+        functions->SetObjectArrayElement(this,array,index,val);
+    }
+
+    jbooleanArray NewBooleanArray(jsize len) {
+        return functions->NewBooleanArray(this,len);
+    }
+    jbyteArray NewByteArray(jsize len) {
+        return functions->NewByteArray(this,len);
+    }
+    jcharArray NewCharArray(jsize len) {
+        return functions->NewCharArray(this,len);
+    }
+    jshortArray NewShortArray(jsize len) {
+        return functions->NewShortArray(this,len);
+    }
+    jintArray NewIntArray(jsize len) {
+        return functions->NewIntArray(this,len);
+    }
+    jlongArray NewLongArray(jsize len) {
+        return functions->NewLongArray(this,len);
+    }
+    jfloatArray NewFloatArray(jsize len) {
+        return functions->NewFloatArray(this,len);
+    }
+    jdoubleArray NewDoubleArray(jsize len) {
+        return functions->NewDoubleArray(this,len);
+    }
+
+    jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) {
+        return functions->GetBooleanArrayElements(this,array,isCopy);
+    }
+    jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) {
+        return functions->GetByteArrayElements(this,array,isCopy);
+    }
+    jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) {
+        return functions->GetCharArrayElements(this,array,isCopy);
+    }
+    jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) {
+        return functions->GetShortArrayElements(this,array,isCopy);
+    }
+    jint * GetIntArrayElements(jintArray array, jboolean *isCopy) {
+        return functions->GetIntArrayElements(this,array,isCopy);
+    }
+    jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) {
+        return functions->GetLongArrayElements(this,array,isCopy);
+    }
+    jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) {
+        return functions->GetFloatArrayElements(this,array,isCopy);
+    }
+    jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) {
+        return functions->GetDoubleArrayElements(this,array,isCopy);
+    }
+
+    void ReleaseBooleanArrayElements(jbooleanArray array,
+				     jboolean *elems,
+				     jint mode) {
+        functions->ReleaseBooleanArrayElements(this,array,elems,mode);
+    }
+    void ReleaseByteArrayElements(jbyteArray array,
+				  jbyte *elems,
+				  jint mode) {
+        functions->ReleaseByteArrayElements(this,array,elems,mode);
+    }
+    void ReleaseCharArrayElements(jcharArray array,
+				  jchar *elems,
+				  jint mode) {
+        functions->ReleaseCharArrayElements(this,array,elems,mode);
+    }
+    void ReleaseShortArrayElements(jshortArray array,
+				   jshort *elems,
+				   jint mode) {
+        functions->ReleaseShortArrayElements(this,array,elems,mode);
+    }
+    void ReleaseIntArrayElements(jintArray array,
+				 jint *elems,
+				 jint mode) {
+        functions->ReleaseIntArrayElements(this,array,elems,mode);
+    }
+    void ReleaseLongArrayElements(jlongArray array,
+				  jlong *elems,
+				  jint mode) {
+        functions->ReleaseLongArrayElements(this,array,elems,mode);
+    }
+    void ReleaseFloatArrayElements(jfloatArray array,
+				   jfloat *elems,
+				   jint mode) {
+        functions->ReleaseFloatArrayElements(this,array,elems,mode);
+    }
+    void ReleaseDoubleArrayElements(jdoubleArray array,
+				    jdouble *elems,
+				    jint mode) {
+        functions->ReleaseDoubleArrayElements(this,array,elems,mode);
+    }
+
+    void GetBooleanArrayRegion(jbooleanArray array,
+			       jsize start, jsize len, jboolean *buf) {
+        functions->GetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void GetByteArrayRegion(jbyteArray array,
+			    jsize start, jsize len, jbyte *buf) {
+        functions->GetByteArrayRegion(this,array,start,len,buf);
+    }
+    void GetCharArrayRegion(jcharArray array,
+			    jsize start, jsize len, jchar *buf) {
+        functions->GetCharArrayRegion(this,array,start,len,buf);
+    }
+    void GetShortArrayRegion(jshortArray array,
+			     jsize start, jsize len, jshort *buf) {
+        functions->GetShortArrayRegion(this,array,start,len,buf);
+    }
+    void GetIntArrayRegion(jintArray array,
+			   jsize start, jsize len, jint *buf) {
+        functions->GetIntArrayRegion(this,array,start,len,buf);
+    }
+    void GetLongArrayRegion(jlongArray array,
+			    jsize start, jsize len, jlong *buf) {
+        functions->GetLongArrayRegion(this,array,start,len,buf);
+    }
+    void GetFloatArrayRegion(jfloatArray array,
+			     jsize start, jsize len, jfloat *buf) {
+        functions->GetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void GetDoubleArrayRegion(jdoubleArray array,
+			      jsize start, jsize len, jdouble *buf) {
+        functions->GetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
+			       const jboolean *buf) {
+        functions->SetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
+			    const jbyte *buf) {
+        functions->SetByteArrayRegion(this,array,start,len,buf);
+    }
+    void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
+			    const jchar *buf) {
+        functions->SetCharArrayRegion(this,array,start,len,buf);
+    }
+    void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
+			     const jshort *buf) {
+        functions->SetShortArrayRegion(this,array,start,len,buf);
+    }
+    void SetIntArrayRegion(jintArray array, jsize start, jsize len,
+			   const jint *buf) {
+        functions->SetIntArrayRegion(this,array,start,len,buf);
+    }
+    void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
+			    const jlong *buf) {
+        functions->SetLongArrayRegion(this,array,start,len,buf);
+    }
+    void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
+			     const jfloat *buf) {
+        functions->SetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
+			      const jdouble *buf) {
+        functions->SetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    jint RegisterNatives(jclass clazz, const JNINativeMethod *methods,
+			 jint nMethods) {
+        return functions->RegisterNatives(this,clazz,methods,nMethods);
+    }
+    jint UnregisterNatives(jclass clazz) {
+        return functions->UnregisterNatives(this,clazz);
+    }
+
+    jint MonitorEnter(jobject obj) {
+        return functions->MonitorEnter(this,obj);
+    }
+    jint MonitorExit(jobject obj) {
+        return functions->MonitorExit(this,obj);
+    }
+
+    jint GetJavaVM(JavaVM **vm) {
+        return functions->GetJavaVM(this,vm);
+    }
+
+    void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) {
+        functions->GetStringRegion(this,str,start,len,buf);
+    }
+    void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) {
+        functions->GetStringUTFRegion(this,str,start,len,buf);
+    }
+
+    void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) {
+        return functions->GetPrimitiveArrayCritical(this,array,isCopy);
+    }
+    void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) {
+        functions->ReleasePrimitiveArrayCritical(this,array,carray,mode);
+    }
+
+    const jchar * GetStringCritical(jstring string, jboolean *isCopy) {
+        return functions->GetStringCritical(this,string,isCopy);
+    }
+    void ReleaseStringCritical(jstring string, const jchar *cstring) {
+        functions->ReleaseStringCritical(this,string,cstring);
+    }
+
+    jweak NewWeakGlobalRef(jobject obj) {
+        return functions->NewWeakGlobalRef(this,obj);
+    }
+    void DeleteWeakGlobalRef(jweak ref) {
+        functions->DeleteWeakGlobalRef(this,ref);
+    }
+
+    jboolean ExceptionCheck() {
+	return functions->ExceptionCheck(this);
+    }
+
+    jobject NewDirectByteBuffer(void* address, jlong capacity) {
+        return functions->NewDirectByteBuffer(this, address, capacity);
+    }
+    void* GetDirectBufferAddress(jobject buf) {
+        return functions->GetDirectBufferAddress(this, buf);
+    }
+    jlong GetDirectBufferCapacity(jobject buf) {
+        return functions->GetDirectBufferCapacity(this, buf);
+    }
+    jobjectRefType GetObjectRefType(jobject obj) {
+        return functions->GetObjectRefType(this, obj);
+    }
+
+#endif /* __cplusplus */
+};
+
+typedef struct JavaVMOption {
+    char *optionString;
+    void *extraInfo;
+} JavaVMOption;
+
+typedef struct JavaVMInitArgs {
+    jint version;
+
+    jint nOptions;
+    JavaVMOption *options;
+    jboolean ignoreUnrecognized;
+} JavaVMInitArgs;
+
+typedef struct JavaVMAttachArgs {
+    jint version;
+
+    char *name;
+    jobject group;
+} JavaVMAttachArgs;
+
+/* These will be VM-specific. */
+
+#define JDK1_2
+#define JDK1_4
+
+/* End VM-specific. */
+
+struct JNIInvokeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    jint (JNICALL *DestroyJavaVM)(JavaVM *vm);
+
+    jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args);
+
+    jint (JNICALL *DetachCurrentThread)(JavaVM *vm);
+
+    jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version);
+
+    jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args);
+};
+
+struct JavaVM_ {
+    const struct JNIInvokeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint DestroyJavaVM() {
+        return functions->DestroyJavaVM(this);
+    }
+    jint AttachCurrentThread(void **penv, void *args) {
+        return functions->AttachCurrentThread(this, penv, args);
+    }
+    jint DetachCurrentThread() {
+        return functions->DetachCurrentThread(this);
+    }
+
+    jint GetEnv(void **penv, jint version) {
+        return functions->GetEnv(this, penv, version);
+    }
+    jint AttachCurrentThreadAsDaemon(void **penv, void *args) {
+        return functions->AttachCurrentThreadAsDaemon(this, penv, args);
+    }
+#endif
+};
+
+#ifdef _JNI_IMPLEMENTATION_
+#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
+#else
+#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
+#endif
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetDefaultJavaVMInitArgs(void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
+
+/* Defined by native libraries. */
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved);
+
+JNIEXPORT void JNICALL
+JNI_OnUnload(JavaVM *vm, void *reserved);
+
+#define JNI_VERSION_1_1 0x00010001
+#define JNI_VERSION_1_2 0x00010002
+#define JNI_VERSION_1_4 0x00010004
+#define JNI_VERSION_1_6 0x00010006
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* !_JAVASOFT_JNI_H_ */
+
+
+
diff --git a/Wrappers/OpenNI.jni/jni_md.h b/Wrappers/OpenNI.jni/jni_md.h
new file mode 100644
index 0000000..36d8511
--- /dev/null
+++ b/Wrappers/OpenNI.jni/jni_md.h
@@ -0,0 +1,35 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#include <XnPlatform.h>
+
+#define JNIEXPORT XN_API_EXPORT
+#define JNIIMPORT XN_API_IMPORT
+#define JNICALL XN_CALLBACK_TYPE
+
+typedef XnInt32 jint;
+typedef XnInt64 jlong;
+typedef XnInt8 jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
diff --git a/Wrappers/OpenNI.jni/methods.inl b/Wrappers/OpenNI.jni/methods.inl
new file mode 100644
index 0000000..ebe83dd
--- /dev/null
+++ b/Wrappers/OpenNI.jni/methods.inl
@@ -0,0 +1,321 @@
+static JNINativeMethod methods[] = {
+	{ "readByte", "(J)B", (void*)&Java_org_OpenNI_NativeMethods_readByte },
+	{ "readShort", "(J)S", (void*)&Java_org_OpenNI_NativeMethods_readShort },
+	{ "readInt", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_readInt },
+	{ "readLong", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_readLong },
+	{ "copyToBuffer", "(Ljava/nio/ByteBuffer;JI)V", (void*)&Java_org_OpenNI_NativeMethods_copyToBuffer },
+	{ "createProductionNodeDescription", "(ILjava/lang/String;Ljava/lang/String;BBSI)J", (void*)&Java_org_OpenNI_NativeMethods_createProductionNodeDescription },
+	{ "freeProductionNodeDescription", "(J)V", (void*)&Java_org_OpenNI_NativeMethods_freeProductionNodeDescription },
+	{ "xnGetStatusString", "(I)Ljava/lang/String;", (void*)&Java_org_OpenNI_NativeMethods_xnGetStatusString },
+	{ "xnInit", "(Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnInit },
+	{ "xnContextRunXmlScriptFromFileEx", "(JLjava/lang/String;JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnContextRunXmlScriptFromFileEx },
+	{ "xnContextRunXmlScriptEx", "(JLjava/lang/String;JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnContextRunXmlScriptEx },
+	{ "xnInitFromXmlFileEx", "(Ljava/lang/String;Lorg/OpenNI/OutArg;JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnInitFromXmlFileEx },
+	{ "xnContextOpenFileRecordingEx", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnContextOpenFileRecordingEx },
+	{ "xnContextAddRef", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnContextAddRef },
+	{ "xnContextRelease", "(J)V", (void*)&Java_org_OpenNI_NativeMethods_xnContextRelease },
+	{ "xnEnumerateProductionTrees", "(JIJLorg/OpenNI/OutArg;J)I", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerateProductionTrees },
+	{ "xnCreateProductionTree", "(JJLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateProductionTree },
+	{ "xnCreateAnyProductionTree", "(JIJLorg/OpenNI/OutArg;J)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateAnyProductionTree },
+	{ "xnEnumerateExistingNodes", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerateExistingNodes },
+	{ "xnEnumerateExistingNodesByType", "(JILorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerateExistingNodesByType },
+	{ "xnFindExistingRefNodeByType", "(JILorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnFindExistingRefNodeByType },
+	{ "xnGetRefNodeHandleByName", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetRefNodeHandleByName },
+	{ "xnWaitAndUpdateAll", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnWaitAndUpdateAll },
+	{ "xnWaitOneUpdateAll", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnWaitOneUpdateAll },
+	{ "xnWaitAnyUpdateAll", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnWaitAnyUpdateAll },
+	{ "xnWaitNoneUpdateAll", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnWaitNoneUpdateAll },
+	{ "xnStartGeneratingAll", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnStartGeneratingAll },
+	{ "xnStopGeneratingAll", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnStopGeneratingAll },
+	{ "xnSetGlobalMirror", "(JZ)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetGlobalMirror },
+	{ "xnGetGlobalMirror", "(J)Z", (void*)&Java_org_OpenNI_NativeMethods_xnGetGlobalMirror },
+	{ "xnGetGlobalErrorState", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetGlobalErrorState },
+	{ "xnRegisterToGlobalErrorStateChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToGlobalErrorStateChange },
+	{ "xnUnregisterFromGlobalErrorStateChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromGlobalErrorStateChange },
+	{ "xnAddLicense", "(JLjava/lang/String;Ljava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnAddLicense },
+	{ "xnEnumerateLicenses", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerateLicenses },
+	{ "xnEnumerationErrorsAllocate", "(Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerationErrorsAllocate },
+	{ "xnEnumerationErrorsFree", "(J)V", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerationErrorsFree },
+	{ "xnEnumerationErrorsToString", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerationErrorsToString },
+	{ "xnEnumerationErrorsClear", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerationErrorsClear },
+	{ "xnEnumerationErrorsGetFirst", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerationErrorsGetFirst },
+	{ "xnEnumerationErrorsIteratorIsValid", "(J)Z", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerationErrorsIteratorIsValid },
+	{ "xnNodeInfoSetInstanceName", "(JLjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoSetInstanceName },
+	{ "xnNodeInfoGetDescription", "(J)Lorg/OpenNI/ProductionNodeDescription;", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoGetDescription },
+	{ "xnNodeInfoGetTreeStringRepresentation", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoGetTreeStringRepresentation },
+	{ "xnNodeInfoGetInstanceName", "(J)Ljava/lang/String;", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoGetInstanceName },
+	{ "xnNodeInfoGetCreationInfo", "(J)Ljava/lang/String;", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoGetCreationInfo },
+	{ "xnNodeInfoGetNeededNodes", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoGetNeededNodes },
+	{ "xnNodeInfoGetRefHandle", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoGetRefHandle },
+	{ "xnNodeInfoListAllocate", "(Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListAllocate },
+	{ "xnNodeInfoListFree", "(J)V", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListFree },
+	{ "xnNodeInfoListAdd", "(JJLjava/lang/String;J)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListAdd },
+	{ "xnNodeInfoListAddNode", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListAddNode },
+	{ "xnNodeInfoListAddNodeFromList", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListAddNodeFromList },
+	{ "xnNodeInfoListRemove", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListRemove },
+	{ "xnNodeInfoListClear", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListClear },
+	{ "xnNodeInfoListAppend", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListAppend },
+	{ "xnNodeInfoListIsEmpty", "(J)Z", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListIsEmpty },
+	{ "xnNodeInfoListGetFirst", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListGetFirst },
+	{ "xnNodeInfoListIteratorIsValid", "(J)Z", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListIteratorIsValid },
+	{ "xnNodeInfoListGetCurrent", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListGetCurrent },
+	{ "xnNodeInfoListGetNext", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnNodeInfoListGetNext },
+	{ "xnNodeQueryAllocate", "(Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQueryAllocate },
+	{ "xnNodeQueryFree", "(J)V", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQueryFree },
+	{ "xnNodeQuerySetVendor", "(JLjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQuerySetVendor },
+	{ "xnNodeQuerySetName", "(JLjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQuerySetName },
+	{ "xnNodeQuerySetMinVersion", "(JBBSI)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQuerySetMinVersion },
+	{ "xnNodeQuerySetMaxVersion", "(JBBSI)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQuerySetMaxVersion },
+	{ "xnNodeQueryAddSupportedCapability", "(JLjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQueryAddSupportedCapability },
+	{ "xnNodeQueryAddSupportedMapOutputMode", "(JIII)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQueryAddSupportedMapOutputMode },
+	{ "xnNodeQuerySetSupportedMinUserPositions", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQuerySetSupportedMinUserPositions },
+	{ "xnNodeQuerySetExistingNodeOnly", "(JZ)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQuerySetExistingNodeOnly },
+	{ "xnNodeQuerySetNonExistingNodeOnly", "(JZ)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQuerySetNonExistingNodeOnly },
+	{ "xnNodeQueryAddNeededNode", "(JLjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQueryAddNeededNode },
+	{ "xnNodeQuerySetCreationInfo", "(JLjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQuerySetCreationInfo },
+	{ "xnNodeQueryFilterList", "(JJJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnNodeQueryFilterList },
+	{ "xnProductionNodeAddRef", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnProductionNodeAddRef },
+	{ "xnProductionNodeRelease", "(J)V", (void*)&Java_org_OpenNI_NativeMethods_xnProductionNodeRelease },
+	{ "xnGetNodeInfo", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnGetNodeInfo },
+	{ "xnGetNodeName", "(J)Ljava/lang/String;", (void*)&Java_org_OpenNI_NativeMethods_xnGetNodeName },
+	{ "xnGetRefContextFromNodeHandle", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnGetRefContextFromNodeHandle },
+	{ "xnIsCapabilitySupported", "(JLjava/lang/String;)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsCapabilitySupported },
+	{ "xnSetIntProperty", "(JLjava/lang/String;J)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetIntProperty },
+	{ "xnSetRealProperty", "(JLjava/lang/String;D)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetRealProperty },
+	{ "xnSetStringProperty", "(JLjava/lang/String;Ljava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetStringProperty },
+	{ "xnSetGeneralProperty", "(JLjava/lang/String;IJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetGeneralProperty },
+	{ "xnSetGeneralPropertyArray", "(JLjava/lang/String;[B)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetGeneralPropertyArray },
+	{ "xnGetIntProperty", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetIntProperty },
+	{ "xnGetRealProperty", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetRealProperty },
+	{ "xnGetStringProperty", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetStringProperty },
+	{ "xnGetGeneralProperty", "(JLjava/lang/String;IJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetGeneralProperty },
+	{ "xnGetGeneralPropertyArray", "(JLjava/lang/String;[B)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetGeneralPropertyArray },
+	{ "xnLockNodeForChanges", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnLockNodeForChanges },
+	{ "xnUnlockNodeForChanges", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnUnlockNodeForChanges },
+	{ "xnLockedNodeStartChanges", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnLockedNodeStartChanges },
+	{ "xnLockedNodeEndChanges", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnLockedNodeEndChanges },
+	{ "xnAddNeededNode", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnAddNeededNode },
+	{ "xnRemoveNeededNode", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnRemoveNeededNode },
+	{ "xnCreateDevice", "(JLorg/OpenNI/OutArg;JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateDevice },
+	{ "xnGetDeviceName", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetDeviceName },
+	{ "xnGetVendorSpecificData", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetVendorSpecificData },
+	{ "xnGetSerialNumber", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetSerialNumber },
+	{ "xnGetNodeErrorState", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetNodeErrorState },
+	{ "xnRegisterToNodeErrorStateChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToNodeErrorStateChange },
+	{ "xnUnregisterFromNodeErrorStateChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromNodeErrorStateChange },
+	{ "xnGetGeneralIntRange", "(JLjava/lang/String;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetGeneralIntRange },
+	{ "xnGetGeneralIntValue", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetGeneralIntValue },
+	{ "xnSetGeneralIntValue", "(JLjava/lang/String;I)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetGeneralIntValue },
+	{ "xnRegisterToGeneralIntValueChange", "(JLjava/lang/String;Ljava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToGeneralIntValueChange },
+	{ "xnUnregisterFromGeneralIntValueChange", "(JLjava/lang/String;J)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromGeneralIntValueChange },
+	{ "xnStartGenerating", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnStartGenerating },
+	{ "xnIsGenerating", "(J)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsGenerating },
+	{ "xnStopGenerating", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnStopGenerating },
+	{ "xnRegisterToGenerationRunningChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToGenerationRunningChange },
+	{ "xnUnregisterFromGenerationRunningChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromGenerationRunningChange },
+	{ "xnRegisterToNewDataAvailable", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToNewDataAvailable },
+	{ "xnUnregisterFromNewDataAvailable", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromNewDataAvailable },
+	{ "xnIsNewDataAvailable", "(JLorg/OpenNI/OutArg;)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsNewDataAvailable },
+	{ "xnWaitAndUpdateData", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnWaitAndUpdateData },
+	{ "xnIsDataNew", "(J)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsDataNew },
+	{ "xnGetData", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnGetData },
+	{ "xnGetDataSize", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetDataSize },
+	{ "xnGetTimestamp", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnGetTimestamp },
+	{ "xnGetFrameID", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetFrameID },
+	{ "xnSetMirror", "(JZ)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetMirror },
+	{ "xnIsMirrored", "(J)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsMirrored },
+	{ "xnRegisterToMirrorChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToMirrorChange },
+	{ "xnUnregisterFromMirrorChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromMirrorChange },
+	{ "xnIsViewPointSupported", "(JJ)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsViewPointSupported },
+	{ "xnSetViewPoint", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetViewPoint },
+	{ "xnResetViewPoint", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnResetViewPoint },
+	{ "xnIsViewPointAs", "(JJ)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsViewPointAs },
+	{ "xnRegisterToViewPointChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToViewPointChange },
+	{ "xnUnregisterFromViewPointChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromViewPointChange },
+	{ "xnCanFrameSyncWith", "(JJ)Z", (void*)&Java_org_OpenNI_NativeMethods_xnCanFrameSyncWith },
+	{ "xnFrameSyncWith", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnFrameSyncWith },
+	{ "xnStopFrameSyncWith", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnStopFrameSyncWith },
+	{ "xnIsFrameSyncedWith", "(JJ)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsFrameSyncedWith },
+	{ "xnRegisterToFrameSyncChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToFrameSyncChange },
+	{ "xnUnregisterFromFrameSyncChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromFrameSyncChange },
+	{ "xnGetSupportedMapOutputModesCount", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetSupportedMapOutputModesCount },
+	{ "xnGetSupportedMapOutputModes", "(J[Lorg/OpenNI/MapOutputMode;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetSupportedMapOutputModes },
+	{ "xnSetMapOutputMode", "(JIII)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetMapOutputMode },
+	{ "xnGetMapOutputMode", "(JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetMapOutputMode },
+	{ "xnRegisterToMapOutputModeChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToMapOutputModeChange },
+	{ "xnUnregisterFromMapOutputModeChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromMapOutputModeChange },
+	{ "xnGetBytesPerPixel", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetBytesPerPixel },
+	{ "xnSetCropping", "(JIIIIZ)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetCropping },
+	{ "xnGetCropping", "(JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetCropping },
+	{ "xnRegisterToCroppingChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToCroppingChange },
+	{ "xnUnregisterFromCroppingChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromCroppingChange },
+	{ "xnSetPowerLineFrequency", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetPowerLineFrequency },
+	{ "xnGetPowerLineFrequency", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetPowerLineFrequency },
+	{ "xnRegisterToPowerLineFrequencyChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToPowerLineFrequencyChange },
+	{ "xnUnregisterFromPowerLineFrequencyChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromPowerLineFrequencyChange },
+	{ "xnCreateDepthGenerator", "(JLorg/OpenNI/OutArg;JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateDepthGenerator },
+	{ "xnGetDeviceMaxDepth", "(J)S", (void*)&Java_org_OpenNI_NativeMethods_xnGetDeviceMaxDepth },
+	{ "xnGetDepthFieldOfView", "(JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetDepthFieldOfView },
+	{ "xnRegisterToDepthFieldOfViewChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToDepthFieldOfViewChange },
+	{ "xnUnregisterFromDepthFieldOfViewChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromDepthFieldOfViewChange },
+	{ "xnConvertProjectiveToRealWorld", "(J[Lorg/OpenNI/Point3D;[Lorg/OpenNI/Point3D;)I", (void*)&Java_org_OpenNI_NativeMethods_xnConvertProjectiveToRealWorld },
+	{ "xnConvertRealWorldToProjective", "(J[Lorg/OpenNI/Point3D;[Lorg/OpenNI/Point3D;)I", (void*)&Java_org_OpenNI_NativeMethods_xnConvertRealWorldToProjective },
+	{ "xnGetDepthMap", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnGetDepthMap },
+	{ "xnGetDepthMetaData", "(JLorg/OpenNI/DepthMetaData;)V", (void*)&Java_org_OpenNI_NativeMethods_xnGetDepthMetaData },
+	{ "xnGetSupportedUserPositionsCount", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetSupportedUserPositionsCount },
+	{ "xnSetUserPosition", "(JIFFFFFF)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetUserPosition },
+	{ "xnGetUserPosition", "(JILorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetUserPosition },
+	{ "xnRegisterToUserPositionChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToUserPositionChange },
+	{ "xnUnregisterFromUserPositionChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromUserPositionChange },
+	{ "xnCreateImageGenerator", "(JLorg/OpenNI/OutArg;JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateImageGenerator },
+	{ "xnGetImageMap", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnGetImageMap },
+	{ "xnIsPixelFormatSupported", "(JI)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsPixelFormatSupported },
+	{ "xnSetPixelFormat", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetPixelFormat },
+	{ "xnGetPixelFormat", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetPixelFormat },
+	{ "xnRegisterToPixelFormatChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToPixelFormatChange },
+	{ "xnUnregisterFromPixelFormatChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromPixelFormatChange },
+	{ "xnGetImageMetaData", "(JLorg/OpenNI/ImageMetaData;)V", (void*)&Java_org_OpenNI_NativeMethods_xnGetImageMetaData },
+	{ "xnCreateIRGenerator", "(JLorg/OpenNI/OutArg;JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateIRGenerator },
+	{ "xnGetIRMap", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnGetIRMap },
+	{ "xnGetIRMetaData", "(JLorg/OpenNI/IRMetaData;)V", (void*)&Java_org_OpenNI_NativeMethods_xnGetIRMetaData },
+	{ "xnCreateGestureGenerator", "(JLorg/OpenNI/OutArg;JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateGestureGenerator },
+	{ "xnAddGesture", "(JLjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnAddGesture__JLjava_lang_String_2 },
+	{ "xnAddGesture", "(JLjava/lang/String;FFFFFF)I", (void*)&Java_org_OpenNI_NativeMethods_xnAddGesture__JLjava_lang_String_2FFFFFF },
+	{ "xnRemoveGesture", "(JLjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRemoveGesture },
+	{ "xnGetAllActiveGestures", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetAllActiveGestures },
+	{ "xnGetNumberOfAvailableGestures", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetNumberOfAvailableGestures },
+	{ "xnEnumerateAllGestures", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerateAllGestures },
+	{ "xnIsGestureAvailable", "(JLjava/lang/String;)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsGestureAvailable },
+	{ "xnIsGestureProgressSupported", "(JLjava/lang/String;)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsGestureProgressSupported },
+	{ "xnRegisterGestureCallbacks", "(JLjava/lang/Object;Ljava/lang/String;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterGestureCallbacks },
+	{ "xnUnregisterGestureCallbacks", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterGestureCallbacks },
+	{ "xnRegisterToGestureChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToGestureChange },
+	{ "xnUnregisterFromGestureChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromGestureChange },
+	{ "xnRegisterToGestureIntermediateStageCompleted", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToGestureIntermediateStageCompleted },
+	{ "xnUnregisterFromGestureIntermediateStageCompleted", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromGestureIntermediateStageCompleted },
+	{ "xnRegisterToGestureReadyForNextIntermediateStage", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToGestureReadyForNextIntermediateStage },
+	{ "xnUnregisterFromGestureReadyForNextIntermediateStage", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromGestureReadyForNextIntermediateStage },
+	{ "xnCreateSceneAnalyzer", "(JLorg/OpenNI/OutArg;JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateSceneAnalyzer },
+	{ "xnGetLabelMap", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnGetLabelMap },
+	{ "xnGetFloor", "(JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetFloor },
+	{ "xnGetSceneMetaData", "(JLorg/OpenNI/SceneMetaData;)V", (void*)&Java_org_OpenNI_NativeMethods_xnGetSceneMetaData },
+	{ "xnCreateUserGenerator", "(JLorg/OpenNI/OutArg;JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateUserGenerator },
+	{ "xnGetNumberOfUsers", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetNumberOfUsers },
+	{ "xnGetUsers", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetUsers },
+	{ "xnGetUserCoM", "(JILorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetUserCoM },
+	{ "xnGetUserPixels", "(JILorg/OpenNI/SceneMetaData;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetUserPixels },
+	{ "xnRegisterUserCallbacks", "(JLjava/lang/Object;Ljava/lang/String;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterUserCallbacks },
+	{ "xnUnregisterUserCallbacks", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterUserCallbacks },
+	{ "xnRegisterToUserExit", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToUserExit },
+	{ "xnUnregisterFromUserExit", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromUserExit },
+	{ "xnRegisterToUserReEnter", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToUserReEnter },
+	{ "xnUnregisterFromUserReEnter", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromUserReEnter },
+	{ "xnIsJointAvailable", "(JI)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsJointAvailable },
+	{ "xnIsProfileAvailable", "(JI)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsProfileAvailable },
+	{ "xnSetSkeletonProfile", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetSkeletonProfile },
+	{ "xnSetJointActive", "(JIZ)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetJointActive },
+	{ "xnIsJointActive", "(JI)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsJointActive },
+	{ "xnRegisterToJointConfigurationChange", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToJointConfigurationChange },
+	{ "xnUnregisterFromJointConfigurationChange", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromJointConfigurationChange },
+	{ "xnEnumerateActiveJoints", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnEnumerateActiveJoints },
+	{ "xnGetSkeletonJoint", "(JIILorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetSkeletonJoint },
+	{ "xnGetSkeletonJointPosition", "(JIILorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetSkeletonJointPosition },
+	{ "xnGetSkeletonJointOrientation", "(JIILorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetSkeletonJointOrientation },
+	{ "xnIsSkeletonTracking", "(JI)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsSkeletonTracking },
+	{ "xnIsSkeletonCalibrated", "(JI)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsSkeletonCalibrated },
+	{ "xnIsSkeletonCalibrating", "(JI)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsSkeletonCalibrating },
+	{ "xnRequestSkeletonCalibration", "(JIZ)I", (void*)&Java_org_OpenNI_NativeMethods_xnRequestSkeletonCalibration },
+	{ "xnAbortSkeletonCalibration", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnAbortSkeletonCalibration },
+	{ "xnSaveSkeletonCalibrationDataToFile", "(JILjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnSaveSkeletonCalibrationDataToFile },
+	{ "xnLoadSkeletonCalibrationDataFromFile", "(JILjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnLoadSkeletonCalibrationDataFromFile },
+	{ "xnSaveSkeletonCalibrationData", "(JII)I", (void*)&Java_org_OpenNI_NativeMethods_xnSaveSkeletonCalibrationData },
+	{ "xnLoadSkeletonCalibrationData", "(JII)I", (void*)&Java_org_OpenNI_NativeMethods_xnLoadSkeletonCalibrationData },
+	{ "xnClearSkeletonCalibrationData", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnClearSkeletonCalibrationData },
+	{ "xnIsSkeletonCalibrationData", "(JI)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsSkeletonCalibrationData },
+	{ "xnStartSkeletonTracking", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnStartSkeletonTracking },
+	{ "xnStopSkeletonTracking", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnStopSkeletonTracking },
+	{ "xnResetSkeleton", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnResetSkeleton },
+	{ "xnNeedPoseForSkeletonCalibration", "(J)Z", (void*)&Java_org_OpenNI_NativeMethods_xnNeedPoseForSkeletonCalibration },
+	{ "xnGetSkeletonCalibrationPose", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetSkeletonCalibrationPose },
+	{ "xnSetSkeletonSmoothing", "(JF)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetSkeletonSmoothing },
+	{ "xnRegisterToCalibrationStart", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToCalibrationStart },
+	{ "xnUnregisterFromCalibrationStart", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromCalibrationStart },
+	{ "xnRegisterToCalibrationInProgress", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToCalibrationInProgress },
+	{ "xnUnregisterFromCalibrationInProgress", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromCalibrationInProgress },
+	{ "xnRegisterToCalibrationComplete", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToCalibrationComplete },
+	{ "xnUnregisterFromCalibrationComplete", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromCalibrationComplete },
+	{ "xnGetNumberOfPoses", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetNumberOfPoses },
+	{ "xnGetAllAvailablePoses", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetAllAvailablePoses },
+	{ "xnStartPoseDetection", "(JLjava/lang/String;I)I", (void*)&Java_org_OpenNI_NativeMethods_xnStartPoseDetection },
+	{ "xnStopPoseDetection", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnStopPoseDetection },
+	{ "xnStopSinglePoseDetection", "(JILjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnStopSinglePoseDetection },
+	{ "xnRegisterToPoseDetected", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToPoseDetected },
+	{ "xnUnregisterFromPoseDetected", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromPoseDetected },
+	{ "xnRegisterToOutOfPose", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToOutOfPose },
+	{ "xnUnregisterFromOutOfPose", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromOutOfPose },
+	{ "xnRegisterToPoseDetectionInProgress", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToPoseDetectionInProgress },
+	{ "xnUnregisterFromPoseDetectionInProgress", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromPoseDetectionInProgress },
+	{ "xnIsPoseSupported", "(JLjava/lang/String;)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsPoseSupported },
+	{ "xnGetPoseStatus", "(JILjava/lang/String;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetPoseStatus },
+	{ "xnCreateHandsGenerator", "(JLorg/OpenNI/OutArg;JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateHandsGenerator },
+	{ "xnRegisterHandCallbacks", "(JLjava/lang/Object;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterHandCallbacks },
+	{ "xnUnregisterHandCallbacks", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterHandCallbacks },
+	{ "xnStopTracking", "(JI)I", (void*)&Java_org_OpenNI_NativeMethods_xnStopTracking },
+	{ "xnStopTrackingAll", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnStopTrackingAll },
+	{ "xnStartTracking", "(JFFF)I", (void*)&Java_org_OpenNI_NativeMethods_xnStartTracking },
+	{ "xnSetTrackingSmoothing", "(JF)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetTrackingSmoothing },
+	{ "xnRegisterToHandTouchingFOVEdge", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToHandTouchingFOVEdge },
+	{ "xnUnregisterFromHandTouchingFOVEdge", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromHandTouchingFOVEdge },
+	{ "xnCreateAudioGenerator", "(JLorg/OpenNI/OutArg;JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateAudioGenerator },
+	{ "xnGetAudioBuffer", "(J)J", (void*)&Java_org_OpenNI_NativeMethods_xnGetAudioBuffer },
+	{ "xnGetSupportedWaveOutputModesCount", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetSupportedWaveOutputModesCount },
+	{ "xnGetSupportedWaveOutputModes", "(J[Lorg/OpenNI/WaveOutputMode;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetSupportedWaveOutputModes },
+	{ "xnSetWaveOutputMode", "(JISB)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetWaveOutputMode },
+	{ "xnGetWaveOutputMode", "(JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetWaveOutputMode },
+	{ "xnRegisterToWaveOutputModeChanges", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToWaveOutputModeChanges },
+	{ "xnUnregisterFromWaveOutputModeChanges", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromWaveOutputModeChanges },
+	{ "xnGetAudioMetaData", "(JLorg/OpenNI/AudioMetaData;)V", (void*)&Java_org_OpenNI_NativeMethods_xnGetAudioMetaData },
+	{ "xnCreateCodec", "(JIJLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateCodec },
+	{ "xnGetCodecID", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetCodecID },
+	{ "xnEncodeData", "(JJIJILorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnEncodeData },
+	{ "xnDecodeData", "(JJIJILorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnDecodeData },
+	{ "xnCreateRecorder", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateRecorder },
+	{ "xnSetRecorderDestination", "(JILjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetRecorderDestination },
+	{ "xnGetRecorderDestination", "(JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetRecorderDestination },
+	{ "xnAddNodeToRecording", "(JJI)I", (void*)&Java_org_OpenNI_NativeMethods_xnAddNodeToRecording },
+	{ "xnRemoveNodeFromRecording", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnRemoveNodeFromRecording },
+	{ "xnRecord", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnRecord },
+	{ "xnGetRecorderFormat", "(J)Ljava/lang/String;", (void*)&Java_org_OpenNI_NativeMethods_xnGetRecorderFormat },
+	{ "xnCreatePlayer", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreatePlayer },
+	{ "xnSetPlayerRepeat", "(JZ)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetPlayerRepeat },
+	{ "xnSetPlayerSource", "(JILjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetPlayerSource },
+	{ "xnGetPlayerSource", "(JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetPlayerSource },
+	{ "xnPlayerReadNext", "(J)I", (void*)&Java_org_OpenNI_NativeMethods_xnPlayerReadNext },
+	{ "xnSeekPlayerToTimeStamp", "(JJI)I", (void*)&Java_org_OpenNI_NativeMethods_xnSeekPlayerToTimeStamp },
+	{ "xnSeekPlayerToFrame", "(JLjava/lang/String;II)I", (void*)&Java_org_OpenNI_NativeMethods_xnSeekPlayerToFrame },
+	{ "xnTellPlayerTimestamp", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnTellPlayerTimestamp },
+	{ "xnTellPlayerFrame", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnTellPlayerFrame },
+	{ "xnGetPlayerNumFrames", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetPlayerNumFrames },
+	{ "xnGetPlayerSupportedFormat", "(J)Ljava/lang/String;", (void*)&Java_org_OpenNI_NativeMethods_xnGetPlayerSupportedFormat },
+	{ "xnEnumeratePlayerNodes", "(JLorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnEnumeratePlayerNodes },
+	{ "xnIsPlayerAtEOF", "(J)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsPlayerAtEOF },
+	{ "xnRegisterToEndOfFileReached", "(JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnRegisterToEndOfFileReached },
+	{ "xnUnregisterFromEndOfFileReached", "(JJ)V", (void*)&Java_org_OpenNI_NativeMethods_xnUnregisterFromEndOfFileReached },
+	{ "xnSetPlaybackSpeed", "(JD)I", (void*)&Java_org_OpenNI_NativeMethods_xnSetPlaybackSpeed },
+	{ "xnGetPlaybackSpeed", "(J)D", (void*)&Java_org_OpenNI_NativeMethods_xnGetPlaybackSpeed },
+	{ "xnCreateScriptNode", "(JLjava/lang/String;Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnCreateScriptNode },
+	{ "xnScriptNodeGetSupportedFormat", "(J)Ljava/lang/String;", (void*)&Java_org_OpenNI_NativeMethods_xnScriptNodeGetSupportedFormat },
+	{ "xnLoadScriptFromFile", "(JLjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnLoadScriptFromFile },
+	{ "xnLoadScriptFromString", "(JLjava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnLoadScriptFromString },
+	{ "xnScriptNodeRun", "(JJ)I", (void*)&Java_org_OpenNI_NativeMethods_xnScriptNodeRun },
+	{ "xnProductionNodeTypeToString", "(I)Ljava/lang/String;", (void*)&Java_org_OpenNI_NativeMethods_xnProductionNodeTypeToString },
+	{ "xnResolutionGetXRes", "(I)I", (void*)&Java_org_OpenNI_NativeMethods_xnResolutionGetXRes },
+	{ "xnResolutionGetYRes", "(I)I", (void*)&Java_org_OpenNI_NativeMethods_xnResolutionGetYRes },
+	{ "xnResolutionGetFromXYRes", "(II)I", (void*)&Java_org_OpenNI_NativeMethods_xnResolutionGetFromXYRes },
+	{ "xnResolutionGetFromName", "(Ljava/lang/String;)I", (void*)&Java_org_OpenNI_NativeMethods_xnResolutionGetFromName },
+	{ "xnResolutionGetName", "(I)Ljava/lang/String;", (void*)&Java_org_OpenNI_NativeMethods_xnResolutionGetName },
+	{ "xnGetVersion", "(Lorg/OpenNI/OutArg;)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetVersion },
+	{ "xnIsTypeGenerator", "(I)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsTypeGenerator },
+	{ "xnIsTypeDerivedFrom", "(II)Z", (void*)&Java_org_OpenNI_NativeMethods_xnIsTypeDerivedFrom },
+	{ "xnGetBytesPerPixelForPixelFormat", "(I)I", (void*)&Java_org_OpenNI_NativeMethods_xnGetBytesPerPixelForPixelFormat },
+};
diff --git a/Wrappers/OpenNI.jni/org_OpenNI_NativeMethods.cpp b/Wrappers/OpenNI.jni/org_OpenNI_NativeMethods.cpp
new file mode 100644
index 0000000..7ba4b8e
--- /dev/null
+++ b/Wrappers/OpenNI.jni/org_OpenNI_NativeMethods.cpp
@@ -0,0 +1,2957 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+//---------------------------------------------------------------------------
+// Includes
+//---------------------------------------------------------------------------
+#include "org_OpenNI_NativeMethods.h"
+#include <XnOpenNI.h>
+#include <XnCppWrapper.h>
+
+//---------------------------------------------------------------------------
+// Global Variables
+//---------------------------------------------------------------------------
+JavaVM* g_pVM = NULL;
+
+//---------------------------------------------------------------------------
+// Types
+//---------------------------------------------------------------------------
+class JavaString
+{
+public:
+	JavaString(JNIEnv *env, jstring str) : m_env(env), m_str(str), m_utfString(env->GetStringUTFChars(str, NULL)) 
+	{
+	}
+
+	~JavaString()
+	{
+		m_env->ReleaseStringUTFChars(m_str, m_utfString);
+	}
+
+	operator const char*()
+	{
+		return m_utfString;
+	}
+
+private:
+	JNIEnv* m_env;
+	jstring m_str;
+	const char* m_utfString;
+};
+
+class JNIEnvSupplier
+{
+public:
+	JNIEnvSupplier() : m_pEnv(NULL), m_bShouldDetach(FALSE)
+	{
+		if (JNI_EDETACHED == g_pVM->GetEnv((void**)&m_pEnv, JNI_VERSION_1_2))
+		{
+			g_pVM->AttachCurrentThread((void**)&m_pEnv, NULL);
+			m_bShouldDetach = TRUE;
+		}
+	}
+
+	~JNIEnvSupplier()
+	{
+		if (m_bShouldDetach)
+		{
+			g_pVM->DetachCurrentThread();
+		}
+	}
+
+	JNIEnv* GetEnv() { return m_pEnv; }
+
+private:
+	JNIEnv* m_pEnv;
+	XnBool m_bShouldDetach;
+};
+
+class CallbackCookie
+{
+public:
+	CallbackCookie(JNIEnv *env, jobject obj, jstring cb, const char* sig)
+	{
+		this->cls = env->GetObjectClass(obj);
+		this->mid = env->GetMethodID(cls, JavaString(env, cb), sig);
+		this->env = env;
+		this->obj = env->NewGlobalRef(obj);
+		this->mid = mid;
+	}
+
+	~CallbackCookie()
+	{
+		env->DeleteGlobalRef(obj);
+	}
+
+	JNIEnv* env;
+	jclass cls; // need to store class so that method ID is still valid
+	jobject obj;
+	jmethodID mid;
+	XnCallbackHandle hCallback;
+};
+
+class StateChangedCallbackCookie : public CallbackCookie
+{
+public:
+	StateChangedCallbackCookie(JNIEnv *env, jobject obj, jstring cb) : CallbackCookie(env, obj, cb, "()V") {}
+};
+
+//---------------------------------------------------------------------------
+// Marshaling
+//---------------------------------------------------------------------------
+JNIEXPORT jbyte JNICALL 
+Java_org_OpenNI_NativeMethods_readByte(JNIEnv *, jclass, jlong ptr)
+{
+	return *(jbyte*)ptr;
+}
+
+JNIEXPORT jshort JNICALL 
+Java_org_OpenNI_NativeMethods_readShort(JNIEnv *, jclass, jlong ptr)
+{
+	return *(jshort*)ptr;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_readInt(JNIEnv *, jclass, jlong ptr)
+{
+	return *(jint*)ptr;
+}
+
+JNIEXPORT jlong JNICALL 
+Java_org_OpenNI_NativeMethods_readLong(JNIEnv *, jclass, jlong ptr)
+{
+	return *(jlong*)ptr;
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_copyToBuffer(JNIEnv *env, jclass, jobject buffer, jlong ptr, jint size)
+{
+	void* pDest = env->GetDirectBufferAddress(buffer);
+	memcpy(pDest, (const void*)ptr, size);
+}
+
+JNIEXPORT jlong JNICALL 
+Java_org_OpenNI_NativeMethods_createProductionNodeDescription(JNIEnv *env, jclass cls, jint type, jstring vendor, jstring name, jbyte major, jbyte minor, jshort maintenance, jint build)
+{
+	XnProductionNodeDescription* pDesc = (XnProductionNodeDescription*)xnOSMalloc(sizeof(XnProductionNodeDescription));
+	if (pDesc == NULL)
+		return 0;
+
+	pDesc->Type = type;
+	strcpy(pDesc->strVendor, JavaString(env, vendor));
+	strcpy(pDesc->strName, JavaString(env, name));
+	pDesc->Version.nMajor = major;
+	pDesc->Version.nMinor = minor;
+	pDesc->Version.nMaintenance = maintenance;
+	pDesc->Version.nBuild = build;
+
+	return (jlong)pDesc;
+}
+
+JNIEXPORT void JNICALL 
+Java_org_OpenNI_NativeMethods_freeProductionNodeDescription(JNIEnv *env, jclass cls, jlong pNative)
+{
+	xnOSFree((void*)pNative);
+}
+
+void CopyOutputMetaData(JNIEnv* env, jobject metaData, const XnOutputMetaData* pNative)
+{
+	jclass cls = env->FindClass("org/OpenNI/OutputMetaData");
+	jmethodID midTimestamp = env->GetMethodID(cls, "setTimestamp", "(J)V");
+	jmethodID midFrameID = env->GetMethodID(cls, "setFrameID", "(I)V");
+	jmethodID midDataSize = env->GetMethodID(cls, "setDataSize", "(I)V");
+	jmethodID midIsNew = env->GetMethodID(cls, "setIsNew", "(Z)V");
+
+	env->CallVoidMethod(metaData, midTimestamp, pNative->nTimestamp);
+	env->CallVoidMethod(metaData, midFrameID, pNative->nFrameID);
+	env->CallVoidMethod(metaData, midDataSize, pNative->nDataSize);
+	env->CallVoidMethod(metaData, midIsNew, (jboolean)pNative->bIsNew);
+}
+
+void CopyMapMetaData(JNIEnv* env, jobject metaData, const XnMapMetaData* pNative)
+{
+	CopyOutputMetaData(env, metaData, pNative->pOutput);
+
+	jclass cls = env->FindClass("org/OpenNI/MapMetaData");
+	jmethodID midXRes = env->GetMethodID(cls, "setXRes", "(I)V");
+	jmethodID midYRes = env->GetMethodID(cls, "setYRes", "(I)V");
+	jmethodID midXOffset = env->GetMethodID(cls, "setXOffset", "(I)V");
+	jmethodID midYOffset = env->GetMethodID(cls, "setYOffset", "(I)V");
+	jmethodID midFullXRes = env->GetMethodID(cls, "setFullXRes", "(I)V");
+	jmethodID midFullYRes = env->GetMethodID(cls, "setFullYRes", "(I)V");
+	jmethodID midFPS = env->GetMethodID(cls, "setFPS", "(I)V");
+
+	env->CallVoidMethod(metaData, midXRes, pNative->Res.X);
+	env->CallVoidMethod(metaData, midYRes, pNative->Res.Y);
+	env->CallVoidMethod(metaData, midXOffset, pNative->Offset.X);
+	env->CallVoidMethod(metaData, midYOffset, pNative->Offset.Y);
+	env->CallVoidMethod(metaData, midFullXRes, pNative->FullRes.X);
+	env->CallVoidMethod(metaData, midFullYRes, pNative->FullRes.Y);
+	env->CallVoidMethod(metaData, midFPS, pNative->nFPS);
+}
+
+void CopyDepthMetaData(JNIEnv* env, jobject metaData, const XnDepthMetaData* pNative)
+{
+	CopyMapMetaData(env, metaData, pNative->pMap);
+
+	jclass cls = env->FindClass("org/OpenNI/DepthMetaData");
+	jmethodID midZRes = env->GetMethodID(cls, "setZRes", "(I)V");
+	jmethodID midDataPtr = env->GetMethodID(cls, "setDataPtr", "(J)V");
+
+	env->CallVoidMethod(metaData, midZRes, pNative->nZRes);
+	env->CallVoidMethod(metaData, midDataPtr, (jlong)pNative->pData);
+}
+
+void CopySceneMetaData(JNIEnv* env, jobject metaData, const XnSceneMetaData* pNative)
+{
+	CopyMapMetaData(env, metaData, pNative->pMap);
+
+	jclass cls = env->FindClass("org/OpenNI/SceneMetaData");
+	jmethodID midDataPtr = env->GetMethodID(cls, "setDataPtr", "(J)V");
+
+	env->CallVoidMethod(metaData, midDataPtr, (jlong)pNative->pData);
+}
+
+void CopyIRMetaData(JNIEnv* env, jobject metaData, const XnIRMetaData* pNative)
+{
+	CopyMapMetaData(env, metaData, pNative->pMap);
+
+	jclass cls = env->FindClass("org/OpenNI/IRMetaData");
+	jmethodID midDataPtr = env->GetMethodID(cls, "setDataPtr", "(J)V");
+
+	env->CallVoidMethod(metaData, midDataPtr, (jlong)pNative->pData);
+}
+
+void CopyImageMetaData(JNIEnv* env, jobject metaData, const XnImageMetaData* pNative)
+{
+	CopyMapMetaData(env, metaData, pNative->pMap);
+
+	jclass cls = env->FindClass("org/OpenNI/ImageMetaData");
+	jmethodID midDataPtr = env->GetMethodID(cls, "setDataPtr", "(J)V");
+
+	env->CallVoidMethod(metaData, midDataPtr, (jlong)pNative->pData);
+}
+
+void CopyAudioMetaData(JNIEnv* env, jobject metaData, const XnAudioMetaData* pNative)
+{
+	CopyOutputMetaData(env, metaData, pNative->pOutput);
+
+	jclass cls = env->FindClass("org/OpenNI/AudioMetaData");
+	jmethodID midSampleRate = env->GetMethodID(cls, "setSampleRate", "(I)V");
+	jmethodID midBitsPerSample = env->GetMethodID(cls, "setBitsPerSample", "(S)V");
+	jmethodID midNumberOfChannels = env->GetMethodID(cls, "setNumberOfChannels", "(B)V");
+	jmethodID midDataPtr = env->GetMethodID(cls, "setDataPtr", "(J)V");
+
+	env->CallVoidMethod(metaData, midSampleRate, pNative->Wave.nSampleRate);
+	env->CallVoidMethod(metaData, midBitsPerSample, pNative->Wave.nBitsPerSample);
+	env->CallVoidMethod(metaData, midNumberOfChannels, pNative->Wave.nChannels);
+	env->CallVoidMethod(metaData, midDataPtr, (jlong)pNative->pData);
+}
+
+//---------------------------------------------------------------------------
+// Utilities
+//---------------------------------------------------------------------------
+jobject CreatePoint3D(JNIEnv* pEnv, const XnPoint3D* pPoint)
+{
+	jclass PointCls = pEnv->FindClass("org/OpenNI/Point3D");
+	jmethodID PointCtor = pEnv->GetMethodID(PointCls, "<init>", "(FFF)V");
+
+	return pEnv->NewObject(PointCls, PointCtor, pPoint->X, pPoint->Y, pPoint->Z);
+}
+void Point3DToNative(JNIEnv* env, jobject point, XnPoint3D* pPoint)
+{
+	jclass cls = env->FindClass("org/OpenNI/Point3D");
+	jmethodID midGetX = env->GetMethodID(cls, "getX", "()F");
+	jmethodID midGetY = env->GetMethodID(cls, "getY", "()F");
+	jmethodID midGetZ = env->GetMethodID(cls, "getZ", "()F");
+
+	pPoint->X = env->CallFloatMethod(point, midGetX);
+	pPoint->Y = env->CallFloatMethod(point, midGetY);
+	pPoint->Z = env->CallFloatMethod(point, midGetZ);
+}
+
+void JavaPointArrayToNative(JNIEnv* env, jobjectArray javaArray, XnPoint3D* nativeArray)
+{
+	int count = env->GetArrayLength(javaArray);
+	for (int i = 0; i < count; ++i)
+	{
+		jobject curr = env->GetObjectArrayElement(javaArray, i);
+		Point3DToNative(env, curr, &nativeArray[i]);
+	}
+}
+
+void NativePointArrayToJave(JNIEnv* env, const XnPoint3D* nativeArray, jobjectArray javaArray)
+{
+	int count = env->GetArrayLength(javaArray);
+	for (int i = 0; i < count; ++i)
+	{
+		jobject curr = CreatePoint3D(env, &nativeArray[i]);
+		env->SetObjectArrayElement(javaArray, i, curr);
+	}
+}
+
+jobject CreateJointPosition(JNIEnv* pEnv, const XnSkeletonJointPosition* pPosition)
+{
+	jclass cls = pEnv->FindClass("org/OpenNI/SkeletonJointPosition");
+	jmethodID ctor = pEnv->GetMethodID(cls, "<init>", "(Lorg/OpenNI/Point3D;F)V");
+
+	return pEnv->NewObject(cls, ctor, CreatePoint3D(pEnv, &pPosition->position), pPosition->fConfidence);
+}
+jobject CreateJointOrientation(JNIEnv* pEnv, const XnSkeletonJointOrientation* pOrientation)
+{
+	jclass cls = pEnv->FindClass("org/OpenNI/SkeletonJointOrientation");
+	jmethodID ctor = pEnv->GetMethodID(cls, "<init>", "(FFFFFFFFFF)V");
+
+	return pEnv->NewObject(cls, ctor, pOrientation->orientation.elements[0], pOrientation->orientation.elements[1], pOrientation->orientation.elements[2], pOrientation->orientation.elements[3], pOrientation->orientation.elements[4], pOrientation->orientation.elements[5], pOrientation->orientation.elements[6], pOrientation->orientation.elements[7], pOrientation->orientation.elements[8], pOrientation->fConfidence);
+}
+jobject CreateJointTransformation(JNIEnv* pEnv, const XnSkeletonJointTransformation* pTransformation)
+{
+	jclass cls = pEnv->FindClass("org/OpenNI/SkeletonJointTransformation");
+	jmethodID ctor = pEnv->GetMethodID(cls, "<init>", "(Lorg/OpenNI/SkeletonJointPosition;Lorg/OpenNi/SkeletonOrientation;)V");
+
+	return pEnv->NewObject(cls, ctor, CreateJointPosition(pEnv, &pTransformation->position), CreateJointOrientation(pEnv, &pTransformation->orientation));
+}
+
+jobject CreateBoundingBox3D(JNIEnv* env, const XnBoundingBox3D* pBox)
+{
+	jclass cls = env->FindClass("org/OpenNI/BoundingBox3D");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(Lorg/OpenNI/Point3D;Lorg/OpenNI/Point3D;)V");
+
+	jobject leftBottomNear = CreatePoint3D(env, &pBox->LeftBottomNear);
+	jobject rightTopFar = CreatePoint3D(env, &pBox->RightTopFar);
+	return env->NewObject(cls, ctor, leftBottomNear, rightTopFar);
+}
+
+void SetOutArgObjectValue(JNIEnv* env, jobject p, jobject value)
+{
+	jclass cls = env->GetObjectClass(p);
+	jfieldID fieldID = env->GetFieldID(cls, "value", "Ljava/lang/Object;");
+	env->SetObjectField(p, fieldID, value);
+}
+
+void SetOutArgDoubleValue(JNIEnv* env, jobject p, double value)
+{
+	jclass cls = env->FindClass("java/lang/Double");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(D)V");
+	SetOutArgObjectValue(env, p, env->NewObject(cls, ctor, value));
+}
+
+void SetOutArgLongValue(JNIEnv* env, jobject p, XnUInt64 value)
+{
+	jclass cls = env->FindClass("java/lang/Long");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(J)V");
+	SetOutArgObjectValue(env, p, env->NewObject(cls, ctor, value));
+}
+
+void SetOutArgPointerValue(JNIEnv* env, jobject p, const void* value)
+{
+	SetOutArgLongValue(env, p, (jlong)value);
+}
+
+void SetOutArgPoint3DValue(JNIEnv* env, jobject p, const XnPoint3D* pPoint)
+{
+	SetOutArgObjectValue(env, p, CreatePoint3D(env, pPoint));
+}
+
+void SetOutArgBoundingBox3DValue(JNIEnv* env, jobject p, const XnBoundingBox3D* pBox)
+{
+	SetOutArgObjectValue(env, p, CreateBoundingBox3D(env, pBox));
+}
+
+void SetOutArgIntValue(JNIEnv* env, jobject p, int value)
+{
+	jclass cls = env->FindClass("java/lang/Integer");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(I)V");
+	SetOutArgObjectValue(env, p, env->NewObject(cls, ctor, value));
+}
+
+void SetOutArgShortValue(JNIEnv* env, jobject p, short value)
+{
+	jclass cls = env->FindClass("java/lang/Short");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(S)V");
+	SetOutArgObjectValue(env, p, env->NewObject(cls, ctor, value));
+}
+
+void SetOutArgByteValue(JNIEnv* env, jobject p, XnUInt8 value)
+{
+	jclass cls = env->FindClass("java/lang/Byte");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(B)V");
+	SetOutArgObjectValue(env, p, env->NewObject(cls, ctor, value));
+}
+
+void SetOutArgStringValue(JNIEnv* env, jobject p, const XnChar* value)
+{
+	SetOutArgObjectValue(env, p, env->NewStringUTF(value));
+}
+
+typedef XnStatus XN_C_DECL StateChangedRegisterFunc(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
+typedef void XN_C_DECL StateChangedUnregisterFunc(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+
+static void XN_CALLBACK_TYPE StateChangedHandler(XnNodeHandle hNode, void* pCookie)
+{
+	StateChangedCallbackCookie* pCallback = (StateChangedCallbackCookie*)pCookie;
+	JNIEnvSupplier().GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid);
+}
+
+XnStatus RegisterToStateChangeEvent(StateChangedRegisterFunc func, JNIEnv *env, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	StateChangedCallbackCookie* pCookie = new StateChangedCallbackCookie(env, obj, cb);
+	XnStatus rc = func((XnNodeHandle)hNode, StateChangedHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+
+void UnregisterFromStateChangeEvent(StateChangedUnregisterFunc func, jlong hNode, jlong hCallback)
+{
+	StateChangedCallbackCookie* pCallback = (StateChangedCallbackCookie*)hCallback;
+	func((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+
+//---------------------------------------------------------------------------
+// General
+//---------------------------------------------------------------------------
+JNIEXPORT jstring JNICALL 
+Java_org_OpenNI_NativeMethods_xnGetStatusString(JNIEnv *env, jclass cls, jint status)
+{
+	const XnChar* errorMessage = xnGetStatusString(status);
+
+	return(env->NewStringUTF(errorMessage));
+}
+
+//---------------------------------------------------------------------------
+// Context
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnInit(JNIEnv *env, jclass cls, jobject cxt)
+{
+	XnContext* pContext = NULL;
+	XnStatus rc = xnInit(&pContext);
+	SetOutArgPointerValue(env, cxt, pContext);
+	return rc;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnContextRunXmlScriptFromFileEx(JNIEnv *env, jclass, jlong pContext, jstring fileName, jlong pErrors, jobject phScriptNode)
+{
+	XnNodeHandle hScript;
+	XnStatus nRetVal = xnContextRunXmlScriptFromFileEx((XnContext*)pContext, JavaString(env, fileName), (XnEnumerationErrors*)pErrors, &hScript);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phScriptNode, hScript);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnContextRunXmlScriptEx(JNIEnv *env, jclass, jlong pContext, jstring script, jlong pErrors, jobject phScriptNode)
+{
+	XnNodeHandle hScript;
+	XnStatus nRetVal = xnContextRunXmlScriptEx((XnContext*)pContext, JavaString(env, script), (XnEnumerationErrors*)pErrors, &hScript);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phScriptNode, hScript);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL
+Java_org_OpenNI_NativeMethods_xnInitFromXmlFileEx(JNIEnv *env, jclass cls, jstring xmlFile, jobject cxt, jlong errors, jobject scriptNode)
+{
+	XnContext* pContext = NULL;
+	XnInternalNodeData* pScriptNode = NULL;
+	XnStatus rc = xnInitFromXmlFileEx(JavaString(env, xmlFile), &pContext, NULL, &pScriptNode);
+
+	SetOutArgPointerValue(env, cxt, pContext);
+	SetOutArgPointerValue(env, scriptNode, pScriptNode);
+
+	return rc;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnContextOpenFileRecordingEx(JNIEnv *env, jclass, jlong pContext, jstring fileName, jobject phPlayer)
+{
+	XnNodeHandle hPlayer;
+	XnStatus nRetVal = xnContextOpenFileRecordingEx((XnContext*)pContext, JavaString(env, fileName), &hPlayer);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phPlayer, hPlayer);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnContextAddRef(JNIEnv *env, jclass cls, jlong pContext)
+{
+	return xnContextAddRef((XnContext*)pContext);
+}
+
+JNIEXPORT void JNICALL 
+Java_org_OpenNI_NativeMethods_xnContextRelease(JNIEnv *env, jclass cls, jlong pContext)
+{
+	xnContextRelease((XnContext*)pContext);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateProductionTrees(JNIEnv *env, jclass, jlong pContext, jint type, jlong pQuery, jobject ppList, jlong pErrors)
+{
+	XnNodeInfoList* pList = NULL;
+	XnStatus nRetVal = xnEnumerateProductionTrees((XnContext*)pContext, type, (XnNodeQuery*)pQuery, &pList, (XnEnumerationErrors*)pErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, ppList, pList);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateProductionTree(JNIEnv *env, jclass, jlong pContext, jlong pNodeInfo, jobject phNode)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateProductionTree((XnContext*)pContext, (XnNodeInfo*)pNodeInfo, &hNode);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateAnyProductionTree(JNIEnv *env, jclass, jlong pContext, jint type, jlong pQuery, jobject phNode, jlong pErrors)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateAnyProductionTree((XnContext*)pContext, type, (XnNodeQuery*)pQuery, &hNode, (XnEnumerationErrors*)pErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+static void XN_CALLBACK_TYPE ErrorStateChangedHandler(XnStatus errorState, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier().GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, errorState);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnRegisterToGlobalErrorStateChange(JNIEnv *env, jclass cls, jlong pContext, jobject obj, jstring cb, jobject hCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(I)V");
+	XnStatus rc = xnRegisterToGlobalErrorStateChange((XnContext*)pContext, ErrorStateChangedHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, hCallback, pCookie);
+	return rc;
+}
+
+JNIEXPORT void JNICALL 
+Java_org_OpenNI_NativeMethods_xnUnregisterFromGlobalErrorStateChange(JNIEnv *env, jclass cls, jlong pContext, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromGlobalErrorStateChange((XnContext*)pContext, pCallback->hCallback);
+	delete pCallback;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAddLicense(JNIEnv *env, jclass, jlong pContext, jstring vendor, jstring key)
+{
+	XnLicense license;
+	strcpy(license.strVendor, JavaString(env, vendor));
+	strcpy(license.strKey, JavaString(env, key));
+	return xnAddLicense((XnContext*)pContext, &license);
+}
+
+jobject CreateLicense(JNIEnv* env, const XnLicense* pLicense)
+{
+	jclass cls = env->FindClass("org/OpenNI/License");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(Ljava/lang/String;Ljava/lang/String;)V");
+	
+	jstring vendor = env->NewStringUTF(pLicense->strVendor);
+	jstring key = env->NewStringUTF(pLicense->strKey);
+	return env->NewObject(cls, ctor, vendor, key);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateLicenses(JNIEnv *env, jclass, jlong pContext, jobject pLicenses)
+{
+	XnLicense* aLicenses;
+	XnUInt32 nCount;
+	XnStatus nRetVal = xnEnumerateLicenses((XnContext*)pContext, &aLicenses, &nCount);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// create array
+	jclass cls = env->FindClass("org/OpenNI/License");
+	jobjectArray licenses = env->NewObjectArray(nCount, cls, NULL);
+
+	// fill it up
+	for (XnUInt32 i = 0; i < nCount; ++i)
+	{
+		jobject license = CreateLicense(env, &aLicenses[i]);
+		env->SetObjectArrayElement(licenses, i, license);
+	}
+
+	// now return the array
+	SetOutArgObjectValue(env, pLicenses, licenses);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnStartGeneratingAll(JNIEnv *, jclass, jlong hContext)
+{
+	return xnStartGeneratingAll((XnContext*)hContext);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnStopGeneratingAll(JNIEnv *, jclass, jlong hContext)
+{
+	return xnStopGeneratingAll((XnContext*)hContext);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetGlobalMirror(JNIEnv *, jclass, jlong pContext, jboolean bMirror)
+{
+	return xnSetGlobalMirror((XnContext*)pContext, bMirror);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnGetGlobalMirror(JNIEnv *, jclass, jlong pContext)
+{
+	return xnGetGlobalMirror((XnContext*)pContext);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetGlobalErrorState(JNIEnv *, jclass, jlong pContext)
+{
+	return xnGetGlobalErrorState((XnContext*)pContext);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateExistingNodes(JNIEnv *env, jclass, jlong pContext, jobject ppList)
+{
+	XnNodeInfoList* pList = NULL;
+	XnStatus nRetVal = xnEnumerateExistingNodes((XnContext*)pContext, &pList);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, ppList, pList);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateExistingNodesByType(JNIEnv *env, jclass, jlong pContext, jint type, jobject ppList)
+{
+	XnNodeInfoList* pList = NULL;
+	XnStatus nRetVal = xnEnumerateExistingNodesByType((XnContext*)pContext, type, &pList);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, ppList, pList);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnFindExistingRefNodeByType(JNIEnv *env, jclass, jlong pContext, jint type, jobject phNode)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnFindExistingRefNodeByType((XnContext*)pContext, (XnProductionNodeType)type, &hNode);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetRefNodeHandleByName(JNIEnv *env, jclass, jlong pContext, jstring name, jobject phNode)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnGetRefNodeHandleByName((XnContext*)pContext, JavaString(env, name), &hNode);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnWaitAndUpdateAll(JNIEnv *env, jclass cls, jlong hContext)
+{
+	return xnWaitAndUpdateAll((XnContext*)hContext);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnWaitOneUpdateAll(JNIEnv *env, jclass, jlong pContext, jlong hNode)
+{
+	return xnWaitOneUpdateAll((XnContext*)pContext, (XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnWaitAnyUpdateAll(JNIEnv *env, jclass cls, jlong hContext)
+{
+	return xnWaitAnyUpdateAll((XnContext*)hContext);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnWaitNoneUpdateAll(JNIEnv *env, jclass cls, jlong hContext)
+{
+	return xnWaitNoneUpdateAll((XnContext*)hContext);
+}
+
+//---------------------------------------------------------------------------
+// Version
+//---------------------------------------------------------------------------
+jobject CreateVersion(JNIEnv *env, const XnVersion* pVersion)
+{
+	jclass cls = env->FindClass("org/OpenNI/Version");
+	jmethodID clsCtor = env->GetMethodID(cls, "<init>", "(BBSI)V");
+	return env->NewObject(cls, clsCtor, pVersion->nMajor, pVersion->nMinor, pVersion->nMaintenance, pVersion->nBuild);
+}
+
+void SetOutArgVersionValue(JNIEnv* env, jobject pOut, XnVersion* pVersion)
+{
+	return SetOutArgObjectValue(env, pOut, CreateVersion(env, pVersion));
+}
+
+//---------------------------------------------------------------------------
+// ProductionNodeDescription
+//---------------------------------------------------------------------------
+jobject CreateProductionNodeDescription(JNIEnv *env, const XnProductionNodeDescription* pDesc)
+{
+	jclass cls = env->FindClass("org/OpenNI/ProductionNodeDescription");
+	jmethodID clsCtor = env->GetMethodID(cls, "<init>", "(ILjava/lang/String;Ljava/lang/String;Lorg/OpenNI/Version;)V");
+
+	jobject version = CreateVersion(env, &pDesc->Version);
+	return env->NewObject(cls, clsCtor, pDesc->Type, pDesc->strVendor, pDesc->strName, version);
+}
+
+//---------------------------------------------------------------------------
+// EnumerationErrors
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsAllocate(JNIEnv *env, jclass, jobject ppErrors)
+{
+	XnEnumerationErrors* pErrors = NULL;
+	XnStatus nRetVal = xnEnumerationErrorsAllocate(&pErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, ppErrors, pErrors);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsFree(JNIEnv *, jclass, jlong pErrors)
+{
+	xnEnumerationErrorsFree((XnEnumerationErrors*)pErrors);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsToString(JNIEnv *env, jclass, jlong pErrors, jobject result)
+{
+	XnChar strResult[2048];
+	XnStatus nRetVal = xnEnumerationErrorsToString((XnEnumerationErrors*)pErrors, strResult, 2048);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgStringValue(env, result, strResult);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsClear(JNIEnv *, jclass, jlong pErrors)
+{
+	return xnEnumerationErrorsClear((XnEnumerationErrors*)pErrors);
+}
+
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsGetFirst(JNIEnv *, jclass, jlong pErrors)
+{
+	return (jlong)xnEnumerationErrorsGetFirst((XnEnumerationErrors*)pErrors);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsIteratorIsValid(JNIEnv *, jclass, jlong it)
+{
+	return xnEnumerationErrorsIteratorIsValid((XnEnumerationErrorsIterator)it);
+}
+
+//---------------------------------------------------------------------------
+// NodeInfo
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoSetInstanceName(JNIEnv *env, jclass, jlong pNodeInfo, jstring name)
+{
+	return xnNodeInfoSetInstanceName((XnNodeInfo*)pNodeInfo, JavaString(env, name));
+}
+
+JNIEXPORT jobject JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoGetDescription(JNIEnv *env, jclass cls, jlong pNodeInfo)
+{
+	const XnProductionNodeDescription* pDesc = xnNodeInfoGetDescription((XnNodeInfo*)pNodeInfo);
+	return CreateProductionNodeDescription(env, pDesc);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoGetTreeStringRepresentation(JNIEnv *env, jclass , jlong pNodeInfo, jobject result)
+{
+	XnChar strResult[4096];
+	XnStatus nRetVal = xnNodeInfoGetTreeStringRepresentation((XnNodeInfo*)pNodeInfo, strResult, 4096);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgStringValue(env, result, strResult);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jstring JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoGetInstanceName(JNIEnv *env, jclass cls, jlong pNodeInfo)
+{
+	const XnChar* strName = xnNodeInfoGetInstanceName((XnNodeInfo*)pNodeInfo);
+	return env->NewStringUTF(strName);
+}
+
+JNIEXPORT jstring JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoGetCreationInfo(JNIEnv *env, jclass cls, jlong pNodeInfo)
+{
+	const XnChar* strCreationInfo = xnNodeInfoGetCreationInfo((XnNodeInfo*)pNodeInfo);
+	return env->NewStringUTF(strCreationInfo);
+}
+
+JNIEXPORT jlong JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoGetNeededNodes(JNIEnv *env, jclass cls, jlong pNodeInfo)
+{
+	return (jlong)xnNodeInfoGetNeededNodes((XnNodeInfo*)pNodeInfo);
+}
+
+JNIEXPORT jlong JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoGetRefHandle(JNIEnv *env, jclass cls, jlong pNodeInfo)
+{
+	return (jlong)xnNodeInfoGetRefHandle((XnNodeInfo*)pNodeInfo);
+}
+
+//---------------------------------------------------------------------------
+// NodeInfoList
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListAllocate(JNIEnv *env, jclass cls, jobject ppList)
+{
+	XnNodeInfoList* pList = NULL;
+	int rc = xnNodeInfoListAllocate(&pList);
+	SetOutArgPointerValue(env, ppList, pList);
+	return rc;
+}
+
+JNIEXPORT void JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListFree(JNIEnv *env, jclass cls, jlong pList)
+{
+	xnNodeInfoListFree((XnNodeInfoList*)pList);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListAdd(JNIEnv *env, jclass cls, jlong pList, jlong desc, jstring creationInfo, jlong pNeeded)
+{
+	return xnNodeInfoListAdd((XnNodeInfoList*)pList, (XnProductionNodeDescription*)desc, JavaString(env, creationInfo), (XnNodeInfoList*)pNeeded);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListAddNode(JNIEnv *, jclass, jlong pList, jlong pNode)
+{
+	return xnNodeInfoListAddNode((XnNodeInfoList*)pList, (XnNodeInfo*)pNode);
+}
+
+inline XnNodeInfoListIterator GetInfoListIterator(jlong it)
+{
+	XnNodeInfoListIterator result;
+	result.pCurrent = (XnNodeInfoListNode*)it;
+	return result;
+}
+
+inline jlong GetInfoListIteratorAsLong(XnNodeInfoListIterator it)
+{
+	return (jlong)it.pCurrent;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListAddNodeFromList(JNIEnv *, jclass, jlong pList, jlong it)
+{
+	return xnNodeInfoListAddNodeFromList((XnNodeInfoList*)pList, GetInfoListIterator(it));
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListRemove(JNIEnv *, jclass, jlong pList, jlong it)
+{
+	return xnNodeInfoListRemove((XnNodeInfoList*)pList, GetInfoListIterator(it));
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListClear(JNIEnv *, jclass, jlong pList)
+{
+	return xnNodeInfoListClear((XnNodeInfoList*)pList);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListAppend(JNIEnv *, jclass, jlong pList, jlong pOther)
+{
+	return xnNodeInfoListAppend((XnNodeInfoList*)pList, (XnNodeInfoList*)pOther);
+}
+
+JNIEXPORT jboolean JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListIsEmpty(JNIEnv *, jclass, jlong pList)
+{
+	return (jboolean)xnNodeInfoListIsEmpty((XnNodeInfoList*)pList);
+}
+
+JNIEXPORT jlong JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListGetFirst(JNIEnv *, jclass, jlong pList)
+{
+	return GetInfoListIteratorAsLong(xnNodeInfoListGetFirst((XnNodeInfoList*)pList));
+}
+
+JNIEXPORT jboolean JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListIteratorIsValid(JNIEnv *, jclass, jlong it)
+{
+	return xnNodeInfoListIteratorIsValid(GetInfoListIterator(it));
+}
+
+JNIEXPORT jlong JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListGetCurrent(JNIEnv *, jclass, jlong it)
+{
+	return (jlong)xnNodeInfoListGetCurrent(GetInfoListIterator(it));
+}
+
+JNIEXPORT jlong JNICALL 
+Java_org_OpenNI_NativeMethods_xnNodeInfoListGetNext(JNIEnv *, jclass, jlong it)
+{
+	return GetInfoListIteratorAsLong(xnNodeInfoListGetNext(GetInfoListIterator(it)));
+}
+
+//---------------------------------------------------------------------------
+// Query
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryAllocate(JNIEnv *env, jclass, jobject ppQuery)
+{
+	XnNodeQuery* pQuery;
+	XnStatus nRetVal = xnNodeQueryAllocate(&pQuery);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, ppQuery, pQuery);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryFree(JNIEnv *, jclass, jlong pQuery)
+{
+	xnNodeQueryFree((XnNodeQuery*)pQuery);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetVendor(JNIEnv *env, jclass, jlong pQuery, jstring vendor)
+{
+	return xnNodeQuerySetVendor((XnNodeQuery*)pQuery, JavaString(env, vendor));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetName(JNIEnv *env, jclass, jlong pQuery, jstring name)
+{
+	return xnNodeQuerySetName((XnNodeQuery*)pQuery, JavaString(env, name));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetMinVersion(JNIEnv *, jclass, jlong pQuery, jbyte major, jbyte minor, jshort maintenance, jint build)
+{
+	XnVersion version = { major, minor, maintenance, build };
+	return xnNodeQuerySetMinVersion((XnNodeQuery*)pQuery, &version);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetMaxVersion(JNIEnv *, jclass, jlong pQuery, jbyte major, jbyte minor, jshort maintenance, jint build)
+{
+	XnVersion version = { major, minor, maintenance, build };
+	return xnNodeQuerySetMaxVersion((XnNodeQuery*)pQuery, &version);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryAddSupportedCapability(JNIEnv *env, jclass, jlong pQuery, jstring cap)
+{
+	return xnNodeQueryAddSupportedCapability((XnNodeQuery*)pQuery, JavaString(env, cap));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryAddSupportedMapOutputMode(JNIEnv *env, jclass, jlong pQuery, jint xRes, jint yRes, jint FPS)
+{
+	XnMapOutputMode mode = { xRes, yRes, FPS };
+	return xnNodeQueryAddSupportedMapOutputMode((XnNodeQuery*)pQuery, &mode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetSupportedMinUserPositions(JNIEnv *, jclass, jlong pQuery, jint nCount)
+{
+	return xnNodeQuerySetSupportedMinUserPositions((XnNodeQuery*)pQuery, nCount);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetExistingNodeOnly(JNIEnv *, jclass, jlong pQuery, jboolean bExisting)
+{
+	return xnNodeQuerySetExistingNodeOnly((XnNodeQuery*)pQuery, bExisting);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetNonExistingNodeOnly(JNIEnv *, jclass, jlong pQuery, jboolean bNonExisting)
+{
+	return xnNodeQuerySetNonExistingNodeOnly((XnNodeQuery*)pQuery, bNonExisting);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryAddNeededNode(JNIEnv *env, jclass, jlong pQuery, jstring nodeName)
+{
+	return xnNodeQueryAddNeededNode((XnNodeQuery*)pQuery, JavaString(env, nodeName));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetCreationInfo(JNIEnv *env, jclass, jlong pQuery, jstring creationInfo)
+{
+	return xnNodeQuerySetCreationInfo((XnNodeQuery*)pQuery, JavaString(env, creationInfo));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryFilterList(JNIEnv *, jclass, jlong pContext, jlong pQuery, jlong pList)
+{
+	return xnNodeQueryFilterList((XnContext*)pContext, (XnNodeQuery*)pQuery, (XnNodeInfoList*)pList);
+}
+
+//---------------------------------------------------------------------------
+// ProductionNode
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnProductionNodeAddRef(JNIEnv *env, jclass cls, jlong hNode)
+{
+	return xnProductionNodeAddRef((XnNodeHandle)hNode);
+}
+
+JNIEXPORT void JNICALL 
+Java_org_OpenNI_NativeMethods_xnProductionNodeRelease(JNIEnv *env, jclass cls, jlong hNode)
+{
+	xnProductionNodeRelease((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jstring JNICALL 
+Java_org_OpenNI_NativeMethods_xnGetNodeName(JNIEnv *env, jclass, jlong hNode)
+{
+	return env->NewStringUTF(xnGetNodeName((XnNodeHandle)hNode));
+}
+
+JNIEXPORT jlong JNICALL 
+Java_org_OpenNI_NativeMethods_xnGetNodeInfo(JNIEnv *env, jclass, jlong hNode)
+{
+	return (jlong)xnGetNodeInfo((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jlong JNICALL 
+Java_org_OpenNI_NativeMethods_xnGetRefContextFromNodeHandle(JNIEnv *, jclass, jlong hNode)
+{
+	return (jlong)xnGetRefContextFromNodeHandle((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jboolean JNICALL 
+Java_org_OpenNI_NativeMethods_xnIsCapabilitySupported(JNIEnv *env, jclass, jlong hNode, jstring strName)
+{
+	return xnIsCapabilitySupported((XnNodeHandle)hNode, JavaString(env, strName));
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnSetIntProperty(JNIEnv *env, jclass, jlong hNode, jstring strName, jlong value)
+{
+	return xnSetIntProperty((XnNodeHandle)hNode, JavaString(env, strName), value);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnSetRealProperty(JNIEnv *env, jclass, jlong hNode, jstring strName, jdouble value)
+{
+	return xnSetRealProperty((XnNodeHandle)hNode, JavaString(env, strName), value);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnSetStringProperty(JNIEnv *env, jclass, jlong hNode, jstring strName, jstring value)
+{
+	return xnSetStringProperty((XnNodeHandle)hNode, JavaString(env, strName), JavaString(env, value));
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnSetGeneralProperty(JNIEnv *env, jclass, jlong hNode, jstring strName, jint size, jlong buffer)
+{
+	return xnSetGeneralProperty((XnNodeHandle)hNode, JavaString(env, strName), size, (const void*)buffer);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnSetGeneralPropertyArray(JNIEnv *env, jclass, jlong hNode, jstring strName, jbyteArray buffer)
+{
+	jboolean isCopy;
+	jbyte* cBuffer = env->GetByteArrayElements(buffer, &isCopy);
+	jsize length = env->GetArrayLength(buffer);
+
+	XnStatus rc = xnSetGeneralProperty((XnNodeHandle)hNode, JavaString(env, strName), length, cBuffer);
+
+	env->ReleaseByteArrayElements(buffer, cBuffer, 0);
+
+	return rc;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnGetIntProperty(JNIEnv *env, jclass, jlong hNode, jstring strName, jobject value)
+{
+	XnUInt64 nValue = 0;
+	XnStatus rc = xnGetIntProperty((XnNodeHandle)hNode, JavaString(env, strName), &nValue);
+	SetOutArgLongValue(env, value, nValue);
+	return rc;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnGetRealProperty(JNIEnv *env, jclass, jlong hNode, jstring strName, jobject value)
+{
+	XnDouble dValue = 0;
+	XnStatus rc = xnGetRealProperty((XnNodeHandle)hNode, JavaString(env, strName), &dValue);
+	SetOutArgDoubleValue(env, value, dValue);
+	return rc;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnGetStringProperty(JNIEnv *env, jclass, jlong hNode, jstring strName, jobject value)
+{
+	XnChar strValue[2048];
+	XnStatus rc = xnGetStringProperty((XnNodeHandle)hNode, JavaString(env, strName), strValue, 2048);
+	SetOutArgStringValue(env, value, strValue);
+	return rc;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnGetGeneralProperty(JNIEnv *env, jclass, jlong hNode, jstring strName, jint size, jlong buffer)
+{
+	return xnGetGeneralProperty((XnNodeHandle)hNode, JavaString(env, strName), size, (void*)buffer);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnGetGeneralPropertyArray(JNIEnv *env, jclass, jlong hNode, jstring strName, jbyteArray buffer)
+{
+	jboolean isCopy;
+	jbyte* cBuffer = env->GetByteArrayElements(buffer, &isCopy);
+	jsize length = env->GetArrayLength(buffer);
+
+	XnStatus rc = xnGetGeneralProperty((XnNodeHandle)hNode, JavaString(env, strName), length, cBuffer);
+
+	env->ReleaseByteArrayElements(buffer, cBuffer, 0);
+
+	return rc;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnLockNodeForChanges(JNIEnv *env, jclass, jlong hNode, jobject phLock)
+{
+	XnLockHandle hLock = 0;
+	XnStatus rc = xnLockNodeForChanges((XnNodeHandle)hNode, &hLock);
+	SetOutArgIntValue(env, phLock, hLock);
+	return rc;
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnUnlockNodeForChanges(JNIEnv *, jclass, jlong hNode, jint hLock)
+{
+	return xnUnlockNodeForChanges((XnNodeHandle)hNode, (XnLockHandle)hLock);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnLockedNodeStartChanges(JNIEnv *, jclass, jlong hNode, jint hLock)
+{
+	return xnLockedNodeStartChanges((XnNodeHandle)hNode, (XnLockHandle)hLock);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnLockedNodeEndChanges(JNIEnv *, jclass, jlong hNode, jint hLock)
+{
+	return xnLockedNodeEndChanges((XnNodeHandle)hNode, (XnLockHandle)hLock);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnAddNeededNode(JNIEnv *, jclass, jlong hNode, jlong hOther)
+{
+	return xnAddNeededNode((XnNodeHandle)hNode, (XnNodeHandle)hOther);
+}
+
+JNIEXPORT jint JNICALL 
+Java_org_OpenNI_NativeMethods_xnRemoveNeededNode(JNIEnv *, jclass, jlong hNode, jlong hOther)
+{
+	return xnRemoveNeededNode((XnNodeHandle)hNode, (XnNodeHandle)hOther);
+}
+
+//---------------------------------------------------------------------------
+// Device
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateDevice(JNIEnv *env, jclass, jlong pContext, jobject phNode, jlong pQuery, jlong pErrors)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateDevice((XnContext*)pContext, &hNode, (XnNodeQuery*)pQuery, (XnEnumerationErrors*)pErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+//---------------------------------------------------------------------------
+// Device Identification Capability
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetDeviceName(JNIEnv *env, jclass, jlong hNode, jobject pResult)
+{
+	XnChar strResult[1024];
+	XnUInt32 nLength = 1024;
+	XnStatus nRetVal = xnGetDeviceName((XnNodeHandle)hNode, strResult, &nLength);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgStringValue(env, pResult, strResult);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetVendorSpecificData(JNIEnv *env, jclass, jlong hNode, jobject pResult)
+{
+	XnChar strResult[1024];
+	XnUInt32 nLength = 1024;
+	XnStatus nRetVal = xnGetVendorSpecificData((XnNodeHandle)hNode, strResult, &nLength);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgStringValue(env, pResult, strResult);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSerialNumber(JNIEnv *env, jclass, jlong hNode, jobject pResult)
+{
+	XnChar strResult[1024];
+	XnUInt32 nLength = 1024;
+	XnStatus nRetVal = xnGetSerialNumber((XnNodeHandle)hNode, strResult, &nLength);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgStringValue(env, pResult, strResult);
+	return XN_STATUS_OK;
+}
+
+//---------------------------------------------------------------------------
+// ErrorState Capability
+//---------------------------------------------------------------------------
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetNodeErrorState(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetNodeErrorState((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToNodeErrorStateChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToNodeErrorStateChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromNodeErrorStateChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	return UnregisterFromStateChangeEvent(xnUnregisterFromNodeErrorStateChange, hNode, hCallback);
+}
+
+//---------------------------------------------------------------------------
+// GeneralInt Capability
+//---------------------------------------------------------------------------
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetGeneralIntRange(JNIEnv *env, jclass, jlong hNode, jstring capName, jobject pMin, jobject pMax, jobject pStep, jobject pDefault, jobject pAuto)
+{
+	XnInt32 nMin, nMax, nStep, nDefault;
+	XnBool bAuto;
+	XnStatus nRetVal = xnGetGeneralIntRange((XnNodeHandle)hNode, JavaString(env, capName), &nMin, &nMax, &nStep, &nDefault, &bAuto);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgIntValue(env, pMin, nMin);
+	SetOutArgIntValue(env, pMax, nMin);
+	SetOutArgIntValue(env, pStep, nStep);
+	SetOutArgIntValue(env, pDefault, nDefault);
+	SetOutArgIntValue(env, pAuto, bAuto);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetGeneralIntValue(JNIEnv *env, jclass, jlong hNode, jstring strCap, jobject pVal)
+{
+	XnInt32 nVal;
+	XnStatus nRetVal = xnGetGeneralIntValue((XnNodeHandle)hNode, JavaString(env, strCap), &nVal);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgIntValue(env, pVal, nVal);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetGeneralIntValue(JNIEnv *env, jclass, jlong hNode, jstring strCap, jint val)
+{
+	return xnSetGeneralIntValue((XnNodeHandle)hNode, JavaString(env, strCap), val);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToGeneralIntValueChange(JNIEnv *env, jclass, jlong hNode, jstring strCap, jobject obj, jstring cb, jobject phCallback)
+{
+	StateChangedCallbackCookie* pCookie = new StateChangedCallbackCookie(env, obj, cb);
+	XnStatus rc = xnRegisterToGeneralIntValueChange((XnNodeHandle)hNode, JavaString(env, strCap), StateChangedHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromGeneralIntValueChange(JNIEnv *env, jclass, jlong hNode, jstring strCap, jlong hCallback)
+{
+	StateChangedCallbackCookie* pCallback = (StateChangedCallbackCookie*)hCallback;
+	xnUnregisterFromGeneralIntValueChange((XnNodeHandle)hNode, JavaString(env, strCap), pCallback->hCallback);
+	delete pCallback;
+}
+
+//---------------------------------------------------------------------------
+// Generator
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL
+Java_org_OpenNI_NativeMethods_xnStartGenerating(JNIEnv *, jclass, jlong hNode)
+{
+	return xnStartGenerating((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jboolean JNICALL
+Java_org_OpenNI_NativeMethods_xnIsGenerating(JNIEnv *, jclass, jlong hNode)
+{
+	return xnIsGenerating((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL
+Java_org_OpenNI_NativeMethods_xnStopGenerating(JNIEnv *, jclass, jlong hNode)
+{
+	return xnStopGenerating((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL
+Java_org_OpenNI_NativeMethods_xnRegisterToGenerationRunningChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToGenerationRunningChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL
+Java_org_OpenNI_NativeMethods_xnUnregisterFromGenerationRunningChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromGenerationRunningChange, hNode, hCallback);
+}
+
+JNIEXPORT jint JNICALL
+Java_org_OpenNI_NativeMethods_xnRegisterToNewDataAvailable(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToNewDataAvailable, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL
+Java_org_OpenNI_NativeMethods_xnUnregisterFromNewDataAvailable(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromNewDataAvailable, hNode, hCallback);
+}
+
+JNIEXPORT jboolean JNICALL
+Java_org_OpenNI_NativeMethods_xnIsNewDataAvailable(JNIEnv *env, jclass, jlong hNode, jobject pnTimestamp)
+{
+	XnUInt64 nTimestamp = 0;
+	XnStatus rc = xnIsNewDataAvailable((XnNodeHandle)hNode, &nTimestamp);
+	SetOutArgLongValue(env, pnTimestamp, nTimestamp);
+	return rc;
+}
+
+JNIEXPORT jint JNICALL
+Java_org_OpenNI_NativeMethods_xnWaitAndUpdateData(JNIEnv *, jclass, jlong hNode)
+{
+	return xnWaitAndUpdateData((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jboolean JNICALL
+Java_org_OpenNI_NativeMethods_xnIsDataNew(JNIEnv *, jclass, jlong hNode)
+{
+	return xnIsDataNew((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jlong JNICALL
+Java_org_OpenNI_NativeMethods_xnGetData(JNIEnv *, jclass, jlong hNode)
+{
+	return (jlong)xnGetData((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL
+Java_org_OpenNI_NativeMethods_xnGetDataSize(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetDataSize((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jlong JNICALL
+Java_org_OpenNI_NativeMethods_xnGetTimestamp(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetTimestamp((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL
+Java_org_OpenNI_NativeMethods_xnGetFrameID(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetFrameID((XnNodeHandle)hNode);
+}
+
+//---------------------------------------------------------------------------
+// Mirror
+//---------------------------------------------------------------------------
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetMirror(JNIEnv *, jclass, jlong hNode, jboolean isMirror)
+{
+	return xnSetMirror((XnNodeHandle)hNode, isMirror);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsMirrored(JNIEnv *, jclass, jlong hNode)
+{
+	return xnIsMirrored((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToMirrorChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToMirrorChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromMirrorChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromMirrorChange, hNode, hCallback);
+}
+
+//---------------------------------------------------------------------------
+// ViewPoint
+//---------------------------------------------------------------------------
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsViewPointSupported(JNIEnv *, jclass, jlong hNode, jlong hOther)
+{
+	return xnIsViewPointSupported((XnNodeHandle)hNode, (XnNodeHandle)hOther);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetViewPoint(JNIEnv *, jclass, jlong hNode, jlong hOther)
+{
+	return xnSetViewPoint((XnNodeHandle)hNode, (XnNodeHandle)hOther);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResetViewPoint(JNIEnv *, jclass, jlong hNode)
+{
+	return xnResetViewPoint((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsViewPointAs(JNIEnv *, jclass, jlong hNode, jlong hOther)
+{
+	return xnIsViewPointAs((XnNodeHandle)hNode, (XnNodeHandle)hOther);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToViewPointChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToViewPointChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromViewPointChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromViewPointChange, hNode, hCallback);
+}
+
+//---------------------------------------------------------------------------
+// FrameSync
+//---------------------------------------------------------------------------
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnCanFrameSyncWith(JNIEnv *, jclass, jlong hNode, jlong hOther)
+{
+	return xnCanFrameSyncWith((XnNodeHandle)hNode, (XnNodeHandle)hOther);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnFrameSyncWith(JNIEnv *, jclass, jlong hNode, jlong hOther)
+{
+	return xnFrameSyncWith((XnNodeHandle)hNode, (XnNodeHandle)hOther);
+}
+  
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopFrameSyncWith(JNIEnv *, jclass, jlong hNode, jlong hOther)
+{
+	return xnStopFrameSyncWith((XnNodeHandle)hNode, (XnNodeHandle)hOther);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsFrameSyncedWith(JNIEnv *, jclass, jlong hNode, jlong hOther)
+{
+	return xnIsFrameSyncedWith((XnNodeHandle)hNode, (XnNodeHandle)hOther);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToFrameSyncChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToFrameSyncChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromFrameSyncChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromFrameSyncChange, hNode, hCallback);
+}
+
+//---------------------------------------------------------------------------
+// Map Generator
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSupportedMapOutputModesCount(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetSupportedMapOutputModesCount((XnNodeHandle)hNode);
+}
+
+jobject CreateMapOutputMode(JNIEnv *env, const XnMapOutputMode* pMode)
+{
+	jclass cls = env->FindClass("org/OpenNI/MapOutputMode");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(III)V");
+	return env->NewObject(cls, ctor, pMode->nXRes, pMode->nYRes, pMode->nFPS);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSupportedMapOutputModes(JNIEnv *env, jclass, jlong hNode, jobjectArray outputModes)
+{
+	int size = env->GetArrayLength(outputModes);
+	XnMapOutputMode* modes = new XnMapOutputMode[size];
+	XN_VALIDATE_ALLOC_PTR(modes);
+
+	XnUInt32 nCount = size;
+	XnStatus nRetVal = xnGetSupportedMapOutputModes((XnNodeHandle)hNode, modes, &nCount);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		delete[] modes;
+		return nRetVal;
+	}
+
+	XN_ASSERT(nCount == size);
+
+	// now copy to managed array
+	for (int i = 0; i < size; ++i)
+	{
+		env->SetObjectArrayElement(outputModes, i, CreateMapOutputMode(env, &modes[i]));
+	}
+
+	delete[] modes;
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetMapOutputMode(JNIEnv *, jclass, jlong hNode, jint xRes, jint yRes, jint fps)
+{
+	XnMapOutputMode mode = { xRes, yRes, fps };
+	return xnSetMapOutputMode((XnNodeHandle)hNode, &mode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetMapOutputMode(JNIEnv *env, jclass, jlong hNode, jobject xRes, jobject yRes, jobject fps)
+{
+	XnMapOutputMode mode;
+	XnStatus nRetVal = xnGetMapOutputMode((XnNodeHandle)hNode, &mode);
+	XN_IS_STATUS_OK(nRetVal);
+
+	SetOutArgIntValue(env, xRes, mode.nXRes);
+	SetOutArgIntValue(env, yRes, mode.nYRes);
+	SetOutArgIntValue(env, fps, mode.nFPS);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToMapOutputModeChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToMapOutputModeChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromMapOutputModeChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromMapOutputModeChange, hNode, hCallback);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetBytesPerPixel(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetBytesPerPixel((XnNodeHandle)hNode);
+}
+
+//---------------------------------------------------------------------------
+// Cropping Capability
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetCropping(JNIEnv *, jclass, jlong hNode, jint xOffset, jint yOffset, jint xSize, jint ySize, jboolean isEnabled)
+{
+	XnCropping cropping = { isEnabled, (XnUInt16)xOffset, (XnUInt16)yOffset, (XnUInt16)xSize, (XnUInt16)ySize };
+	return xnSetCropping((XnNodeHandle)hNode, &cropping);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetCropping(JNIEnv *env, jclass, jlong hNode, jobject pxOffset, jobject pyOffset, jobject pxSize, jobject pySize, jobject pEnabled)
+{
+	XnCropping cropping = {0};
+	XnStatus nRetVal = xnGetCropping((XnNodeHandle)hNode, &cropping);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgIntValue(env, pxOffset, cropping.nXOffset);
+	SetOutArgIntValue(env, pyOffset, cropping.nYOffset);
+	SetOutArgIntValue(env, pxSize, cropping.nXSize);
+	SetOutArgIntValue(env, pySize, cropping.nYSize);
+	SetOutArgIntValue(env, pEnabled, cropping.bEnabled);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToCroppingChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToCroppingChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromCroppingChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromCroppingChange, hNode, hCallback);
+}
+
+//---------------------------------------------------------------------------
+// AntiFlicker
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetPowerLineFrequency(JNIEnv *, jclass, jlong hNode, jint frequency)
+{
+	return xnSetPowerLineFrequency((XnNodeHandle)hNode, (XnPowerLineFrequency)frequency);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetPowerLineFrequency(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetPowerLineFrequency((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToPowerLineFrequencyChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToPowerLineFrequencyChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromPowerLineFrequencyChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromPowerLineFrequencyChange, hNode, hCallback);
+}
+
+//---------------------------------------------------------------------------
+// Depth
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateDepthGenerator(JNIEnv *env, jclass, jlong pContext, jobject phNode, jlong pQuery, jlong pEnumerationErrors)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateDepthGenerator((XnContext*)pContext, &hNode, (XnNodeQuery*)pQuery, (XnEnumerationErrors*)pEnumerationErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jshort JNICALL Java_org_OpenNI_NativeMethods_xnGetDeviceMaxDepth(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetDeviceMaxDepth((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetDepthFieldOfView(JNIEnv *env, jclass, jlong hNode, jobject phFOV, jobject pvFOV)
+{
+	XnFieldOfView FOV;
+	XnStatus nRetVal = xnGetDepthFieldOfView((XnNodeHandle)hNode, &FOV);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgDoubleValue(env, phFOV, FOV.fHFOV);
+	SetOutArgDoubleValue(env, pvFOV, FOV.fVFOV);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToDepthFieldOfViewChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToDepthFieldOfViewChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromDepthFieldOfViewChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromDepthFieldOfViewChange, hNode, hCallback);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnConvertProjectiveToRealWorld(JNIEnv *env, jclass, jlong hNode, jobjectArray projective, jobjectArray realWorld)
+{
+	int count = env->GetArrayLength(projective);
+	XnPoint3D* aProjective = new XnPoint3D[count];
+	XnPoint3D* aRealWorld = new XnPoint3D[count];
+
+	JavaPointArrayToNative(env, projective, aProjective);
+
+	XnStatus nRetVal = xnConvertProjectiveToRealWorld((XnNodeHandle)hNode, count, aProjective, aRealWorld);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		delete[] aProjective;
+		delete[] aRealWorld;
+		return (nRetVal);
+	}
+
+	NativePointArrayToJave(env, aRealWorld, realWorld);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnConvertRealWorldToProjective(JNIEnv *env, jclass, jlong hNode, jobjectArray realWorld, jobjectArray projective)
+{
+	int count = env->GetArrayLength(realWorld);
+	XnPoint3D* aRealWorld = new XnPoint3D[count];
+	XnPoint3D* aProjective = new XnPoint3D[count];
+
+	JavaPointArrayToNative(env, realWorld, aRealWorld);
+
+	XnStatus nRetVal = xnConvertRealWorldToProjective((XnNodeHandle)hNode, count, aRealWorld, aProjective);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		delete[] aRealWorld;
+		delete[] aProjective;
+		return (nRetVal);
+	}
+
+	NativePointArrayToJave(env, aProjective, projective);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetDepthMap(JNIEnv *, jclass, jlong hNode)
+{
+	return (jlong)xnGetDepthMap((XnNodeHandle)hNode);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnGetDepthMetaData(JNIEnv *env, jclass, jlong hNode, jobject metaData)
+{
+	static XnDepthMetaData* pNativeMD = xnAllocateDepthMetaData();
+	xnGetDepthMetaData((XnNodeHandle)hNode, pNativeMD);
+	CopyDepthMetaData(env, metaData, pNativeMD);
+}
+
+//---------------------------------------------------------------------------
+// UserPosition
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSupportedUserPositionsCount(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetSupportedUserPositionsCount((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetUserPosition(JNIEnv *env, jclass, jlong hNode, jint index, jfloat xMin, jfloat yMin, jfloat zMin, jfloat xMax, jfloat yMax, jfloat zMax)
+{
+	XnBoundingBox3D box = {
+		{ xMin, yMin, zMin },
+		{ xMax, yMax, zMax }
+	};
+	return xnSetUserPosition((XnNodeHandle)hNode, index, &box);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetUserPosition(JNIEnv *env, jclass, jlong hNode, jint index, jobject pBox)
+{
+	XnBoundingBox3D box;
+	XnStatus nRetVal = xnGetUserPosition((XnNodeHandle)hNode, index, &box);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgBoundingBox3DValue(env, pBox, &box);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToUserPositionChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToUserPositionChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromUserPositionChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromUserPositionChange, hNode, hCallback);
+}
+
+//---------------------------------------------------------------------------
+// Image
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateImageGenerator(JNIEnv *env, jclass, jlong pContext, jobject phNode, jlong pQuery, jlong pEnumerationErrors)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateImageGenerator((XnContext*)pContext, &hNode, (XnNodeQuery*)pQuery, (XnEnumerationErrors*)pEnumerationErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetImageMap(JNIEnv *, jclass, jlong hNode)
+{
+	return (jlong)xnGetImageMap((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsPixelFormatSupported(JNIEnv *, jclass, jlong hNode, jint format)
+{
+	return xnIsPixelFormatSupported((XnNodeHandle)hNode, (XnPixelFormat)format);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetPixelFormat(JNIEnv *, jclass, jlong hNode, jint format)
+{
+	return xnSetPixelFormat((XnNodeHandle)hNode, (XnPixelFormat)format);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetPixelFormat(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetPixelFormat((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToPixelFormatChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToPixelFormatChange, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromPixelFormatChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromPixelFormatChange, hNode, hCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnGetImageMetaData(JNIEnv *env, jclass, jlong hNode, jobject metaData)
+{
+	static XnImageMetaData* pNativeMD = xnAllocateImageMetaData();
+	xnGetImageMetaData((XnNodeHandle)hNode, pNativeMD);
+	CopyImageMetaData(env, metaData, pNativeMD);
+}
+
+//---------------------------------------------------------------------------
+// IR
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateIRGenerator(JNIEnv *env, jclass, jlong pContext, jobject phNode, jlong pQuery, jlong pEnumerationErrors)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateIRGenerator((XnContext*)pContext, &hNode, (XnNodeQuery*)pQuery, (XnEnumerationErrors*)pEnumerationErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetIRMap(JNIEnv *, jclass, jlong hNode)
+{
+	return (jlong)xnGetIRMap((XnNodeHandle)hNode);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnGetIRMetaData(JNIEnv *env, jclass, jlong hNode, jobject metaData)
+{
+	static XnIRMetaData* pNativeMD = xnAllocateIRMetaData();
+	xnGetIRMetaData((XnNodeHandle)hNode, pNativeMD);
+	CopyIRMetaData(env, metaData, pNativeMD);
+}
+
+//---------------------------------------------------------------------------
+// GestureGenerator
+//---------------------------------------------------------------------------
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateGestureGenerator(JNIEnv *env, jclass, jlong pContext, jobject phNode, jlong pQuery, jlong pEnumerationErrors)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateGestureGenerator((XnContext*)pContext, &hNode, (XnNodeQuery*)pQuery, (XnEnumerationErrors*)pEnumerationErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAddGesture__JLjava_lang_String_2(JNIEnv *env, jclass, jlong hNode, jstring strGesture)
+{
+	JavaString jName(env, strGesture);
+	return xnAddGesture((XnNodeHandle)hNode, jName, NULL);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAddGesture__JLjava_lang_String_2FFFFFF(JNIEnv *env, jclass, jlong hNode, jstring strGesture, jfloat minx, jfloat miny, jfloat minz, jfloat maxx, jfloat maxy, jfloat maxz)
+{
+	XnBoundingBox3D area;
+	area.LeftBottomNear = xnCreatePoint3D(minx, miny, minz);
+	area.RightTopFar = xnCreatePoint3D(maxx, maxy, maxz);
+	JavaString jName(env, strGesture);
+	return xnAddGesture((XnNodeHandle)hNode, jName, &area);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRemoveGesture(JNIEnv *env, jclass, jlong hNode, jstring strGesture)
+{
+	JavaString jName(env, strGesture);
+	return xnRemoveGesture((XnNodeHandle)hNode, jName);
+}
+typedef XnChar* XnCharPtr;
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetAllActiveGestures(JNIEnv *env, jclass, jlong hNode, jobject pGestures)
+{
+	XnChar** nativeGestures = NULL;
+	nativeGestures = new XnCharPtr[20];
+	for (int i = 0; i < 20; ++i)
+	{
+		nativeGestures[i] = new XnChar[80];
+		xnOSMemSet(nativeGestures[i], 0, 80);
+	}
+	XnUInt16 nCount = 20;
+
+	XnStatus nRetVal = xnGetAllActiveGestures((XnNodeHandle)hNode, nativeGestures, 80, &nCount);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// Create array
+	jclass cls = env->FindClass("java/lang/String");
+	jobjectArray gestures = env->NewObjectArray(nCount, cls, NULL);
+
+	jstring* jGestures = new jstring[nCount];
+
+	// Fill it up
+	for (XnUInt32 i = 0; i < nCount; ++i)
+	{
+		jGestures[i] = env->NewStringUTF(nativeGestures[i]);
+		env->SetObjectArrayElement(gestures, i, jGestures[i]);
+	}
+
+	// now return the array
+	SetOutArgObjectValue(env, pGestures, gestures);
+
+	for (int i = 0; i < nCount; ++i)
+	{
+		delete []nativeGestures[i];
+	}
+	delete []jGestures;
+	delete []nativeGestures;
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateAllGestures(JNIEnv *env, jclass, jlong hNode, jobject pGestures)
+{
+	XnChar** nativeGestures = NULL;
+	nativeGestures = new XnCharPtr[20];
+	for (int i = 0; i < 20; ++i)
+	{
+		nativeGestures[i] = new XnChar[80];
+		xnOSMemSet(nativeGestures[i], 0, 80);
+	}
+	XnUInt16 nCount = 20;
+
+	XnStatus nRetVal = xnEnumerateAllGestures((XnNodeHandle)hNode, nativeGestures, 80, &nCount);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// Create array
+	jclass cls = env->FindClass("java/lang/String");
+	jobjectArray gestures = env->NewObjectArray(nCount, cls, NULL);
+
+	jstring* jGestures = new jstring[nCount];
+
+	// Fill it up
+	for (XnUInt32 i = 0; i < nCount; ++i)
+	{
+		jGestures[i] = env->NewStringUTF(nativeGestures[i]);
+		env->SetObjectArrayElement(gestures, i, jGestures[i]);
+	}
+
+	// now return the array
+	SetOutArgObjectValue(env, pGestures, gestures);
+
+	delete [] jGestures;
+	for (int i = 0; i < 20; ++i)
+	{
+		delete[] nativeGestures[i];
+	}
+	delete[] nativeGestures;
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetNumberOfAvailableGestures(JNIEnv *env, jclass, jlong hNode)
+{
+    return xnGetNumberOfAvailableGestures((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsGestureAvailable(JNIEnv *env, jclass, jlong hNode, jstring strGesture)
+{
+	JavaString jName(env, strGesture);
+	return xnIsGestureAvailable((XnNodeHandle)hNode, jName);
+}
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsGestureProgressSupported(JNIEnv *env, jclass, jlong hNode, jstring strGesture)
+{
+	JavaString jName(env, strGesture);
+	return xnIsGestureProgressSupported((XnNodeHandle)hNode, jName);
+}
+
+void XN_CALLBACK_TYPE GestureRecognizedHandler(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pIDPosition, const XnPoint3D* pEndPosition, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier supplier;
+	jstring gestureName = supplier.GetEnv()->NewStringUTF(strGesture);
+	supplier.GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, gestureName, CreatePoint3D(supplier.GetEnv(), pIDPosition), CreatePoint3D(supplier.GetEnv(), pEndPosition));
+}
+void XN_CALLBACK_TYPE GestureProgressHandler(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, XnFloat fProgress, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier supplier;
+	jstring gestureName = supplier.GetEnv()->NewStringUTF(strGesture);
+	supplier.GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, gestureName, CreatePoint3D(supplier.GetEnv(), pPosition), fProgress);
+}
+jint RegisterGestureRecognized(JNIEnv* env, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(Ljava/lang/String;Lorg/OpenNI/Point3D;Lorg/OpenNI/Point3D;)V");
+	XnStatus rc = xnRegisterGestureCallbacks((XnNodeHandle)hNode, GestureRecognizedHandler, NULL, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+jint RegisterGestureProgress(JNIEnv* env, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(Ljava/lang/String;Lorg/OpenNI/Point3D;F)V");
+	XnStatus rc = xnRegisterGestureCallbacks((XnNodeHandle)hNode, NULL, GestureProgressHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterGestureCallbacks(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring recognizedCB, jstring progressCB, jobject phCallback)
+{
+	if (recognizedCB != NULL)
+	{
+		return RegisterGestureRecognized(env, hNode, obj, recognizedCB, phCallback);
+	}
+	else if (progressCB != NULL)
+	{
+		return RegisterGestureProgress(env, hNode, obj, progressCB, phCallback);
+	}
+	return -1;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterGestureCallbacks(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterGestureCallbacks((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToGestureChange(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToGestureChange, env, hNode, obj, cb, phCallback);
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromGestureChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	return UnregisterFromStateChangeEvent(xnUnregisterFromGestureChange, hNode, hCallback);
+}
+void XN_CALLBACK_TYPE GesturePositionRecognizedHandler(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier supplier;
+	jstring gestureName = supplier.GetEnv()->NewStringUTF(strGesture);
+	supplier.GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, gestureName, CreatePoint3D(supplier.GetEnv(), pPosition));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToGestureIntermediateStageCompleted(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(Ljava/lang/String;Lorg/OpenNI/Point3D;)V");
+	XnStatus rc = xnRegisterToGestureIntermediateStageCompleted((XnNodeHandle)hNode, GesturePositionRecognizedHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromGestureIntermediateStageCompleted(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromGestureIntermediateStageCompleted((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToGestureReadyForNextIntermediateStage(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(Ljava/lang/String;Lorg/OpenNI/Point3D;)V");
+	XnStatus rc = xnRegisterToGestureReadyForNextIntermediateStage((XnNodeHandle)hNode, GesturePositionRecognizedHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromGestureReadyForNextIntermediateStage(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromGestureReadyForNextIntermediateStage((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+
+//---------------------------------------------------------------------------
+// Scene Analyzer
+//---------------------------------------------------------------------------
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateSceneAnalyzer(JNIEnv *env, jclass, jlong pContext, jobject phNode, jlong pQuery, jlong pEnumerationErrors)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateSceneAnalyzer((XnContext*)pContext, &hNode, (XnNodeQuery*)pQuery, (XnEnumerationErrors*)pEnumerationErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetLabelMap(JNIEnv *, jclass, jlong hNode)
+{
+	return (jlong)xnGetLabelMap((XnNodeHandle)hNode);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetFloor(JNIEnv *env, jclass, jlong hNode, jobject pPlaneNormal, jobject pPlanePoint)
+{
+	XnPlane3D plane;
+	XnStatus nRetVal = xnGetFloor((XnNodeHandle)hNode, &plane);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPoint3DValue(env, pPlaneNormal, &plane.vNormal);
+	SetOutArgPoint3DValue(env, pPlanePoint, &plane.ptPoint);
+	return XN_STATUS_OK;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnGetSceneMetaData(JNIEnv *env, jclass, jlong hNode, jobject metaData)
+{
+	static XnSceneMetaData* pNativeMD = xnAllocateSceneMetaData();
+	xnGetSceneMetaData((XnNodeHandle)hNode, pNativeMD);
+	CopySceneMetaData(env, metaData, pNativeMD);
+}
+
+//---------------------------------------------------------------------------
+// User Generator
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateUserGenerator(JNIEnv *env, jclass, jlong pContext, jobject phNode, jlong pQuery, jlong pEnumerationErrors)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateUserGenerator((XnContext*)pContext, &hNode, (XnNodeQuery*)pQuery, (XnEnumerationErrors*)pEnumerationErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetNumberOfUsers(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetNumberOfUsers((XnNodeHandle)hNode);
+}
+
+jobject CreateObjectFromInteger(JNIEnv* env, XnUserID id)
+{
+	jclass cls = env->FindClass("java/lang/Integer");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(I)V");
+	return env->NewObject(cls, ctor, id);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetUsers(JNIEnv *env, jclass, jlong hNode, jobject pUsers)
+{
+	XnUInt16 nCount = xnGetNumberOfUsers((XnNodeHandle)hNode);
+
+	XnUserID* aUsers = new XnUserID[nCount];
+
+	XnStatus nRetVal = xnGetUsers((XnNodeHandle)hNode, aUsers, &nCount);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// Create array
+	jclass cls = env->FindClass("java/lang/Integer");
+	jobjectArray users = env->NewObjectArray(nCount, cls, NULL);
+
+	// Fill it up
+	for (XnUInt32 i = 0; i < nCount; ++i)
+	{
+		env->SetObjectArrayElement(users, i, CreateObjectFromInteger(env, aUsers[i]));
+	}
+
+	// now return the array
+	SetOutArgObjectValue(env, pUsers, users);
+
+	delete []aUsers;
+	return XN_STATUS_OK;	
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetUserCoM(JNIEnv *env, jclass, jlong hNode, jint nId, jobject pCoM)
+{
+	XnPoint3D com;
+	XnStatus nRetVal = xnGetUserCoM((XnNodeHandle)hNode, nId, &com);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPoint3DValue(env, pCoM, &com);
+	return XN_STATUS_OK;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetUserPixels(JNIEnv *env, jclass, jlong hNode, jint id, jobject metaData)
+{
+	static XnSceneMetaData* pNativeMD = xnAllocateSceneMetaData();
+	XnStatus nRetVal = xnGetUserPixels((XnNodeHandle)hNode, id, pNativeMD);
+	XN_IS_STATUS_OK(nRetVal);
+	xnGetSceneMetaData((XnNodeHandle)hNode, pNativeMD);
+	CopySceneMetaData(env, metaData, pNativeMD);
+	return XN_STATUS_OK;
+}
+
+void XN_CALLBACK_TYPE UserEventHandler(XnNodeHandle hNode, XnUserID id, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier().GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, id);
+}
+jint RegisterNewUserCallback(JNIEnv* env, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(I)V");
+	XnStatus rc = xnRegisterUserCallbacks((XnNodeHandle)hNode, UserEventHandler, NULL, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+jint RegisterLostUserCallback(JNIEnv* env, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(I)V");
+	XnStatus rc = xnRegisterUserCallbacks((XnNodeHandle)hNode, NULL, UserEventHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterUserCallbacks(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring newUserCB, jstring lostUserCB, jobject phCallback)
+{
+	if (newUserCB != NULL)
+	{
+		return RegisterNewUserCallback(env, hNode, obj, newUserCB, phCallback);
+	}
+	else if (lostUserCB != NULL)
+	{
+		return RegisterLostUserCallback(env, hNode, obj, lostUserCB, phCallback);
+	}
+	return -1;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterUserCallbacks(JNIEnv * env, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterUserCallbacks((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToUserExit(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(I)V");
+	XnStatus rc = xnRegisterToUserExit((XnNodeHandle)hNode, UserEventHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromUserExit(JNIEnv * env, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromUserExit((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToUserReEnter(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(I)V");
+	XnStatus rc = xnRegisterToUserReEnter((XnNodeHandle)hNode, UserEventHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromUserReEnter(JNIEnv * env, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromUserReEnter((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+
+//---------------------------------------------------------------------------
+// Skeleton Capability
+//---------------------------------------------------------------------------
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsJointAvailable(JNIEnv *, jclass, jlong hNode, jint eJoint)
+{
+	return xnIsJointAvailable((XnNodeHandle)hNode, XnSkeletonJoint(eJoint));
+}
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsProfileAvailable(JNIEnv *, jclass, jlong hNode, jint eProfile)
+{
+	return xnIsProfileAvailable((XnNodeHandle)hNode, XnSkeletonProfile(eProfile));
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetSkeletonProfile(JNIEnv *, jclass, jlong hNode, jint eProfile)
+{
+	return xnSetSkeletonProfile((XnNodeHandle)hNode, XnSkeletonProfile(eProfile));
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetJointActive(JNIEnv *, jclass, jlong hNode, jint eJoint, jboolean bActive)
+{
+	return xnSetJointActive((XnNodeHandle)hNode, XnSkeletonJoint(eJoint), bActive);
+}
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsJointActive(JNIEnv *, jclass, jlong hNode, jint eJoint)
+{
+	return xnIsJointActive((XnNodeHandle)hNode, XnSkeletonJoint(eJoint));
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToJointConfigurationChange(JNIEnv* env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToJointConfigurationChange, env, hNode, obj, cb, phCallback);
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromJointConfigurationChange(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromJointConfigurationChange, hNode, hCallback);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateActiveJoints(JNIEnv* env, jclass, jlong hNode, jobject pJoints)
+{
+	XnUInt16 nCount = 40;
+
+	XnSkeletonJoint* aJoints = new XnSkeletonJoint[nCount];
+
+	XnStatus nRetVal = xnEnumerateActiveJoints((XnNodeHandle)hNode, aJoints, &nCount);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// Create array
+	jclass cls = env->FindClass("java/lang/Integer");
+	jobjectArray joints = env->NewObjectArray(nCount, cls, NULL);
+
+	// Fill it up
+	for (XnUInt32 i = 0; i < nCount; ++i)
+	{
+		env->SetObjectArrayElement(joints, i, CreateObjectFromInteger(env, aJoints[i]));
+	}
+
+	// now return the array
+	SetOutArgObjectValue(env, pJoints, joints);
+
+	delete []aJoints;
+	return XN_STATUS_OK;	
+
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSkeletonJoint(JNIEnv* env, jclass, jlong hNode, jint user, jint eJoint, jobject pJoint)
+{
+	XnSkeletonJointTransformation transformation;
+	XnStatus nRetVal = xnGetSkeletonJoint((XnNodeHandle)hNode, user, (XnSkeletonJoint)eJoint, &transformation);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgObjectValue(env, pJoint, CreateJointTransformation(env, &transformation));
+	return XN_STATUS_OK;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSkeletonJointPosition(JNIEnv* env, jclass, jlong hNode, jint user, jint eJoint, jobject pPosition)
+{
+	XnSkeletonJointPosition position;
+	XnStatus nRetVal = xnGetSkeletonJointPosition((XnNodeHandle)hNode, user, (XnSkeletonJoint)eJoint, &position);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgObjectValue(env, pPosition, CreateJointPosition(env, &position));
+	return XN_STATUS_OK;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSkeletonJointOrientation(JNIEnv* env, jclass, jlong hNode, jint user, jint eJoint, jobject pOrientation)
+{
+	XnSkeletonJointOrientation orientation;
+	XnStatus nRetVal = xnGetSkeletonJointOrientation((XnNodeHandle)hNode, user, (XnSkeletonJoint)eJoint, &orientation);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgObjectValue(env, pOrientation, CreateJointOrientation(env, &orientation));
+	return XN_STATUS_OK;
+}
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsSkeletonTracking(JNIEnv *, jclass, jlong hNode, jint user)
+{
+	return xnIsSkeletonTracking((XnNodeHandle)hNode, user);
+}
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsSkeletonCalibrated(JNIEnv *, jclass, jlong hNode, jint user)
+{
+	return xnIsSkeletonCalibrated((XnNodeHandle)hNode, user);
+}
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsSkeletonCalibrating(JNIEnv *, jclass, jlong hNode, jint user)
+{
+	return xnIsSkeletonCalibrating((XnNodeHandle)hNode, user);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRequestSkeletonCalibration(JNIEnv *, jclass, jlong hNode, jint user, jboolean bForce)
+{
+	return xnRequestSkeletonCalibration((XnNodeHandle)hNode, user, bForce);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAbortSkeletonCalibration(JNIEnv *, jclass, jlong hNode, jint user)
+{
+	return xnAbortSkeletonCalibration((XnNodeHandle)hNode, user);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSaveSkeletonCalibrationDataToFile(JNIEnv* env, jclass, jlong hNode, jint user, jstring fileName)
+{
+	JavaString jName(env, fileName);
+	return xnSaveSkeletonCalibrationDataToFile((XnNodeHandle)hNode, user, jName);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLoadSkeletonCalibrationDataFromFile(JNIEnv* env, jclass, jlong hNode, jint user, jstring fileName)
+{
+	JavaString jName(env, fileName);
+	return xnLoadSkeletonCalibrationDataFromFile((XnNodeHandle)hNode, user, jName);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSaveSkeletonCalibrationData(JNIEnv *, jclass, jlong hNode, jint user, jint nSlot)
+{
+	return xnSaveSkeletonCalibrationData((XnNodeHandle)hNode, user, nSlot);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLoadSkeletonCalibrationData(JNIEnv *, jclass, jlong hNode, jint user, jint nSlot)
+{
+	return xnLoadSkeletonCalibrationData((XnNodeHandle)hNode, user, nSlot);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnClearSkeletonCalibrationData(JNIEnv *, jclass, jlong hNode, jint nSlot)
+{
+	return xnClearSkeletonCalibrationData((XnNodeHandle)hNode, nSlot);
+}
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsSkeletonCalibrationData(JNIEnv *, jclass, jlong hNode, jint nSlot)
+{
+	return xnIsSkeletonCalibrationData((XnNodeHandle)hNode, nSlot);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStartSkeletonTracking(JNIEnv *, jclass, jlong hNode, jint user)
+{
+	return xnStartSkeletonTracking((XnNodeHandle)hNode, user);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopSkeletonTracking(JNIEnv *, jclass, jlong hNode, jint user)
+{
+	return xnStopSkeletonTracking((XnNodeHandle)hNode, user);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResetSkeleton(JNIEnv *, jclass, jlong hNode, jint user)
+{
+	return xnResetSkeleton((XnNodeHandle)hNode, user);
+}
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnNeedPoseForSkeletonCalibration(JNIEnv *, jclass, jlong hNode)
+{
+	return xnNeedPoseForSkeletonCalibration((XnNodeHandle)hNode);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSkeletonCalibrationPose(JNIEnv* env, jclass, jlong hNode, jobject pPose)
+{
+	XnChar* poseName = new XnChar[80];
+	XnStatus rc = xnGetSkeletonCalibrationPose((XnNodeHandle)hNode, poseName);
+	jstring pose = env->NewStringUTF(poseName);
+	if (rc == XN_STATUS_OK)
+	{
+		SetOutArgStringValue(env, pPose, poseName);
+	}
+	delete []poseName;
+	return rc;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetSkeletonSmoothing(JNIEnv *, jclass, jlong hNode, jfloat factor)
+{
+	return xnSetSkeletonSmoothing((XnNodeHandle)hNode, factor);
+}
+void XN_CALLBACK_TYPE CalibrationStartHandler(XnNodeHandle hNode, XnUserID user, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier().GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, user);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToCalibrationStart(JNIEnv* env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(I)V");
+	XnStatus rc = xnRegisterToCalibrationStart((XnNodeHandle)hNode, CalibrationStartHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromCalibrationStart(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromCalibrationStart((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+void XN_CALLBACK_TYPE CalibrationProgressHandler(XnNodeHandle hNode, XnUserID user, XnCalibrationStatus state, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier().GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, user, state);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToCalibrationInProgress(JNIEnv* env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(II)V");
+	XnStatus rc = xnRegisterToCalibrationInProgress((XnNodeHandle)hNode, CalibrationProgressHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromCalibrationInProgress(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromCalibrationInProgress((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToCalibrationComplete(JNIEnv* env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(II)V");
+	XnStatus rc = xnRegisterToCalibrationComplete((XnNodeHandle)hNode, CalibrationProgressHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromCalibrationComplete(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromCalibrationComplete((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+//---------------------------------------------------------------------------
+// Pose Detection Capability
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetNumberOfPoses(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetNumberOfPoses((XnNodeHandle)hNode);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetAllAvailablePoses(JNIEnv *env, jclass, jlong hNode, jobject pPoses)
+{
+	XnChar** nativePoses = NULL;
+	XnUInt32 nCount = xnGetNumberOfPoses((XnNodeHandle)hNode);
+
+	nativePoses = new XnCharPtr[nCount];
+	for (XnUInt32 i = 0; i < nCount; ++i)
+	{
+		nativePoses[i] = new XnChar[80];
+		xnOSMemSet(nativePoses[i], 0, 80);
+	}
+
+	XnStatus nRetVal = xnGetAllAvailablePoses((XnNodeHandle)hNode, nativePoses, 80, &nCount);
+	XN_IS_STATUS_OK(nRetVal);
+
+	// Create array
+	jclass cls = env->FindClass("java/lang/String");
+	jobjectArray poses = env->NewObjectArray(nCount, cls, NULL);
+
+	jstring* jPoses = new jstring[nCount];
+
+	// Fill it up
+	for (XnUInt32 i = 0; i < nCount; ++i)
+	{
+		jPoses[i] = env->NewStringUTF(nativePoses[i]);
+		env->SetObjectArrayElement(poses, i, jPoses[i]);
+	}
+
+	// now return the array
+	SetOutArgObjectValue(env, pPoses, poses);
+
+	for (XnUInt32 i = 0; i < nCount; ++i)
+	{
+		delete []nativePoses[i];
+	}
+	delete []jPoses;
+	delete []nativePoses;
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsPoseSupported(JNIEnv* env, jclass, jlong hNode, jstring strPose)
+{
+    JavaString jPose(env, strPose);
+    return xnIsPoseSupported((XnNodeHandle)hNode, jPose);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetPoseStatus(JNIEnv* env, jclass, jlong hNode, jint user, jstring strPose, jobject pTime, jobject eStatus, jobject eState)
+{
+    
+    JavaString jPose(env, strPose);
+    XnUInt64 nTimestamp;
+    XnPoseDetectionStatus tmpStatus;
+    XnPoseDetectionState tmpState;
+    XnStatus nRetVal = xnGetPoseStatus((XnNodeHandle)hNode,user,jPose,&nTimestamp,&tmpStatus,&tmpState);
+    XN_IS_STATUS_OK(nRetVal);
+    SetOutArgLongValue(env, pTime, nTimestamp);
+    SetOutArgIntValue(env, eState, tmpState);
+    SetOutArgIntValue(env, eStatus, tmpStatus);
+    return XN_STATUS_OK;
+
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStartPoseDetection(JNIEnv* env, jclass, jlong hNode, jstring strPose, jint user)
+{
+	JavaString jPose(env, strPose);
+	return xnStartPoseDetection((XnNodeHandle)hNode, jPose, user);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopPoseDetection(JNIEnv *, jclass, jlong hNode, jint user)
+{
+	return xnStopPoseDetection((XnNodeHandle)hNode, user);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopSinglePoseDetection(JNIEnv * env, jclass, jlong hNode, jint user, jstring strPose)
+{
+	JavaString jPose(env, strPose);
+	return xnStopSinglePoseDetection((XnNodeHandle)hNode, user, jPose);
+}
+void XN_CALLBACK_TYPE PoseDetectionHandler(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier supplier;
+	jstring jPose = supplier.GetEnv()->NewStringUTF(strPose);
+	supplier.GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, jPose, user);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToPoseDetected(JNIEnv* env, jclass, jlong hNode, jobject obj, jstring cb,jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(Ljava/lang/String;I)V");
+	XnStatus rc = xnRegisterToPoseDetected((XnNodeHandle)hNode, PoseDetectionHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromPoseDetected(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromPoseDetected((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToOutOfPose(JNIEnv* env, jclass, jlong hNode, jobject obj, jstring cb,jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(Ljava/lang/String;I)V");
+	XnStatus rc = xnRegisterToOutOfPose((XnNodeHandle)hNode, PoseDetectionHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromOutOfPose(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromOutOfPose((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+
+void XN_CALLBACK_TYPE PoseDetectionInProgressHandler(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, XnPoseDetectionStatus eStatus, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier supplier;
+	jstring jPose = supplier.GetEnv()->NewStringUTF(strPose);
+	supplier.GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, jPose, user, eStatus);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToPoseDetectionInProgress(JNIEnv* env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(Ljava/lang/String;II)V");
+	XnStatus rc = xnRegisterToPoseDetectionInProgress((XnNodeHandle)hNode, PoseDetectionInProgressHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, phCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromPoseDetectionInProgress(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromPoseDetectionInProgress((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+
+//---------------------------------------------------------------------------
+// Hands Generator
+//---------------------------------------------------------------------------
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateHandsGenerator(JNIEnv *env, jclass, jlong pContext, jobject phNode, jlong pQuery, jlong pEnumerationErrors)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateHandsGenerator((XnContext*)pContext, &hNode, (XnNodeQuery*)pQuery, (XnEnumerationErrors*)pEnumerationErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+void XN_CALLBACK_TYPE ActiveHandHandler(XnNodeHandle hNode, XnUserID nId, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier().GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, nId, CreatePoint3D(JNIEnvSupplier().GetEnv(), pPosition), fTime);
+}
+void XN_CALLBACK_TYPE InactiveHandHandler(XnNodeHandle hNode, XnUserID nId, XnFloat fTime, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier().GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, nId, fTime);
+}
+jint RegisterHandCreateCallback(JNIEnv* env, XnNodeHandle hNode, jobject obj, jstring cb, jobject hCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(ILorg/OpenNI/Point3D;F)V");
+	XnStatus rc = xnRegisterHandCallbacks((XnNodeHandle)hNode, ActiveHandHandler, NULL, NULL, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, hCallback, pCookie);
+	return rc;
+}
+jint RegisterHandUpdateCallback(JNIEnv* env, XnNodeHandle hNode, jobject obj, jstring cb, jobject hCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(ILorg/OpenNI/Point3D;F)V");
+	XnStatus rc = xnRegisterHandCallbacks((XnNodeHandle)hNode, NULL, ActiveHandHandler, NULL, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, hCallback, pCookie);
+	return rc;
+}
+jint RegisterHandDestroyCallback(JNIEnv* env, XnNodeHandle hNode, jobject obj, jstring cb, jobject hCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(IF)V");
+	XnStatus rc = xnRegisterHandCallbacks((XnNodeHandle)hNode, NULL, NULL, InactiveHandHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, hCallback, pCookie);
+	return rc;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterHandCallbacks(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring handCreateCB, jstring handUpdateCB, jstring handDestroyCB, jobject hCallback)
+{
+	if (handCreateCB != NULL)
+	{
+		return RegisterHandCreateCallback(env, (XnNodeHandle)hNode, obj, handCreateCB, hCallback);
+	}
+	else if (handUpdateCB != NULL)
+	{
+		return RegisterHandUpdateCallback(env, (XnNodeHandle)hNode, obj, handUpdateCB, hCallback);
+	}
+	else if (handDestroyCB != NULL)
+	{
+		return RegisterHandDestroyCallback(env, (XnNodeHandle)hNode, obj, handDestroyCB, hCallback);
+	}
+	return -1;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterHandCallbacks(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterHandCallbacks((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopTracking(JNIEnv *, jclass, jlong hNode, jint nId)
+{
+	return xnStopTracking((XnNodeHandle)hNode, nId);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopTrackingAll(JNIEnv *, jclass, jlong hNode)
+{
+	return xnStopTrackingAll((XnNodeHandle)hNode);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStartTracking(JNIEnv *, jclass, jlong hNode, jfloat x, jfloat y, jfloat z)
+{
+	XnPoint3D point = xnCreatePoint3D(x, y, z);
+	return xnStartTracking((XnNodeHandle)hNode, &point);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetTrackingSmoothing(JNIEnv *, jclass, jlong hNode, jfloat fFactor)
+{
+	return xnSetTrackingSmoothing((XnNodeHandle)hNode, fFactor);
+}
+void XN_CALLBACK_TYPE HandTouchingFOVEdgeHandler(XnNodeHandle hNode, XnUserID nId, const XnPoint3D* pPosition, XnFloat fTime, XnDirection eDirection, void* pCookie)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)pCookie;
+	JNIEnvSupplier().GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, nId, pPosition, fTime, eDirection);
+}
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToHandTouchingFOVEdge(JNIEnv *env, jclass cls, jlong hNode, jobject obj, jstring cb, jobject hCallback)
+{
+	CallbackCookie* pCookie = new CallbackCookie(env, obj, cb, "(ILorg/OpenNI/Point3D;FI)V");
+	XnStatus rc = xnRegisterToHandTouchingFOVEdge((XnNodeHandle)hNode, HandTouchingFOVEdgeHandler, pCookie, &pCookie->hCallback);
+	SetOutArgPointerValue(env, hCallback, pCookie);
+	return rc;
+}
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromHandTouchingFOVEdge(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	CallbackCookie* pCallback = (CallbackCookie*)hCallback;
+	xnUnregisterFromHandTouchingFOVEdge((XnNodeHandle)hNode, pCallback->hCallback);
+	delete pCallback;
+}
+//---------------------------------------------------------------------------
+// Audio
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateAudioGenerator(JNIEnv *env, jclass, jlong pContext, jobject phNode, jlong pQuery, jlong pErrors)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateAudioGenerator((XnContext*)pContext, &hNode, (XnNodeQuery*)pQuery, (XnEnumerationErrors*)pErrors);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetAudioBuffer(JNIEnv *, jclass, jlong hNode)
+{
+	return (jlong)xnGetAudioBuffer((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSupportedWaveOutputModesCount(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetSupportedWaveOutputModesCount((XnNodeHandle)hNode);
+}
+
+jobject CreateWaveOutputMode(JNIEnv *env, const XnWaveOutputMode* pMode)
+{
+	jclass cls = env->FindClass("org/OpenNI/WaveOutputMode");
+	jmethodID ctor = env->GetMethodID(cls, "<init>", "(ISB)V");
+	return env->NewObject(cls, ctor, pMode->nSampleRate, pMode->nBitsPerSample, pMode->nChannels);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSupportedWaveOutputModes(JNIEnv *env, jclass, jlong hNode, jobjectArray outputModes)
+{
+	int size = env->GetArrayLength(outputModes);
+	XnWaveOutputMode* modes = new XnWaveOutputMode[size];
+	XN_VALIDATE_ALLOC_PTR(modes);
+
+	XnUInt32 nCount = size;
+	XnStatus nRetVal = xnGetSupportedWaveOutputModes((XnNodeHandle)hNode, modes, &nCount);
+	if (nRetVal != XN_STATUS_OK)
+	{
+		delete[] modes;
+		return nRetVal;
+	}
+
+	XN_ASSERT(nCount == size);
+
+	// now copy to managed array
+	for (int i = 0; i < size; ++i)
+	{
+		env->SetObjectArrayElement(outputModes, i, CreateWaveOutputMode(env, &modes[i]));
+	}
+
+	delete[] modes;
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetWaveOutputMode(JNIEnv *, jclass, jlong hNode, jint nSampleRate, jshort nBitsPerSample, jbyte nChannels)
+{
+	XnWaveOutputMode mode = { nSampleRate, nBitsPerSample, nChannels };
+	return xnSetWaveOutputMode((XnNodeHandle)hNode, &mode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetWaveOutputMode(JNIEnv *env, jclass, jlong hNode, jobject pnSampleRate, jobject pnBitsPerSample, jobject pnChannels)
+{
+	XnWaveOutputMode mode;
+	XnStatus nRetVal = xnGetWaveOutputMode((XnNodeHandle)hNode, &mode);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgIntValue(env, pnSampleRate, mode.nSampleRate);
+	SetOutArgShortValue(env, pnBitsPerSample, mode.nBitsPerSample);
+	SetOutArgByteValue(env, pnChannels, mode.nChannels);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToWaveOutputModeChanges(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToWaveOutputModeChanges, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromWaveOutputModeChanges(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromWaveOutputModeChanges, hNode, hCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnGetAudioMetaData(JNIEnv *env, jclass, jlong hNode, jobject metaData)
+{
+	static XnAudioMetaData* pNativeMD = xnAllocateAudioMetaData();
+	xnGetAudioMetaData((XnNodeHandle)hNode, pNativeMD);
+	CopyAudioMetaData(env, metaData, pNativeMD);
+}
+
+//---------------------------------------------------------------------------
+// Codec
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateCodec(JNIEnv *env, jclass, jlong pContext, jint codecID, jlong hInitializer, jobject phNode)
+{
+	XnNodeHandle hNode = NULL;
+	XnStatus nRetVal = xnCreateCodec((XnContext*)pContext, codecID, (XnNodeHandle)hInitializer, &hNode);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetCodecID(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetCodecID((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEncodeData(JNIEnv *env, jclass, jlong hNode, jlong pSrc, jint nSrcSize, jlong pDst, jint nDstSize, jobject pnWritten)
+{
+	XnUInt32 nWritten = 0;
+	XnStatus nRetVal = xnEncodeData((XnNodeHandle)hNode, (const void*)pSrc, nSrcSize, (void*)pDst, nDstSize, &nWritten);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgIntValue(env, pnWritten, nWritten);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnDecodeData(JNIEnv *env, jclass, jlong hNode, jlong pSrc, jint nSrcSize, jlong pDst, jint nDstSize, jobject pnWritten)
+{
+	XnUInt32 nWritten = 0;
+	XnStatus nRetVal = xnDecodeData((XnNodeHandle)hNode, (const void*)pSrc, nSrcSize, (void*)pDst, nDstSize, &nWritten);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgIntValue(env, pnWritten, nWritten);
+	return XN_STATUS_OK;
+}
+
+//---------------------------------------------------------------------------
+// Recorder
+//---------------------------------------------------------------------------
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateRecorder(JNIEnv *env, jclass, jlong pContext, jstring strFormat, jobject phNode)
+{
+	XnNodeHandle hNode;
+	XnStatus nRetVal = xnCreateRecorder((XnContext*)pContext, JavaString(env, strFormat), &hNode);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetRecorderDestination(JNIEnv *env, jclass, jlong hNode, jint medium, jstring name)
+{
+	return xnSetRecorderDestination((XnNodeHandle)hNode, (XnRecordMedium)medium, JavaString(env, name));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetRecorderDestination(JNIEnv *env, jclass, jlong hNode, jobject pMedium, jobject pName)
+{
+	XnRecordMedium medium;
+	XnChar strName[1024];
+	XnStatus nRetVal = xnGetRecorderDestination((XnNodeHandle)hNode, &medium, strName, 1024);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgIntValue(env, pMedium, medium);
+	SetOutArgStringValue(env, pName, strName);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAddNodeToRecording(JNIEnv *env, jclass, jlong hNode, jlong hOther, jint codecID)
+{
+	return xnAddNodeToRecording((XnNodeHandle)hNode, (XnNodeHandle)hOther, (XnCodecID)codecID);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRemoveNodeFromRecording(JNIEnv *, jclass, jlong hNode, jlong hOther)
+{
+	return xnRemoveNodeFromRecording((XnNodeHandle)hNode, (XnNodeHandle)hOther);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRecord(JNIEnv *, jclass, jlong hNode)
+{
+	return xnRecord((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnGetRecorderFormat(JNIEnv *env, jclass, jlong hNode)
+{
+	return env->NewStringUTF(xnGetRecorderFormat((XnNodeHandle)hNode));
+}
+
+//---------------------------------------------------------------------------
+// Player
+//---------------------------------------------------------------------------
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreatePlayer(JNIEnv *env, jclass, jlong pContext, jstring strFormat, jobject phNode)
+{
+	XnNodeHandle hNode;
+	XnStatus nRetVal = xnCreatePlayer((XnContext*)pContext, JavaString(env, strFormat), &hNode);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetPlayerRepeat(JNIEnv *, jclass, jlong hNode, jboolean bRepeat)
+{
+	return xnSetPlayerRepeat((XnNodeHandle)hNode, bRepeat);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetPlayerSource(JNIEnv *env, jclass, jlong hNode, jint medium, jstring name)
+{
+	return xnSetPlayerSource((XnNodeHandle)hNode, (XnRecordMedium)medium, JavaString(env, name));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetPlayerSource(JNIEnv *env, jclass, jlong hNode, jobject pMedium, jobject pName)
+{
+	XnRecordMedium medium;
+	XnChar strName[1024];
+	XnStatus nRetVal = xnGetPlayerSource((XnNodeHandle)hNode, &medium, strName, 1024);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgIntValue(env, pMedium, medium);
+	SetOutArgStringValue(env, pName, strName);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnPlayerReadNext(JNIEnv *, jclass, jlong hNode)
+{
+	return xnPlayerReadNext((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSeekPlayerToTimeStamp(JNIEnv *, jclass, jlong hNode, jlong offset, jint origin)
+{
+	return xnSeekPlayerToTimeStamp((XnNodeHandle)hNode, offset, (XnPlayerSeekOrigin)origin);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSeekPlayerToFrame(JNIEnv *env, jclass, jlong hNode, jstring strNode, jint offset, jint origin)
+{
+	return xnSeekPlayerToFrame((XnNodeHandle)hNode, JavaString(env, strNode), offset, (XnPlayerSeekOrigin)origin);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnTellPlayerTimestamp(JNIEnv *env, jclass, jlong hNode, jobject pnTimestamp)
+{
+	XnUInt64 nTimestamp;
+	XnStatus nRetVal = xnTellPlayerTimestamp((XnNodeHandle)hNode, &nTimestamp);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgLongValue(env, pnTimestamp, nTimestamp);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnTellPlayerFrame(JNIEnv *env, jclass, jlong hNode, jstring strName, jobject pnFrameID)
+{
+	XnUInt32 nFrameID;
+	XnStatus nRetVal = xnTellPlayerFrame((XnNodeHandle)hNode, JavaString(env, strName), &nFrameID);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgIntValue(env, pnFrameID, nFrameID);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetPlayerNumFrames(JNIEnv *env, jclass, jlong hNode, jstring strName, jobject pnFrameID)
+{
+	XnUInt32 nFrameID;
+	XnStatus nRetVal = xnGetPlayerNumFrames((XnNodeHandle)hNode, JavaString(env, strName), &nFrameID);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgIntValue(env, pnFrameID, nFrameID);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnGetPlayerSupportedFormat(JNIEnv *env, jclass, jlong hNode)
+{
+	return env->NewStringUTF(xnGetPlayerSupportedFormat((XnNodeHandle)hNode));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumeratePlayerNodes(JNIEnv *env, jclass, jlong hNode, jobject ppList)
+{
+	XnNodeInfoList* pList;
+	XnStatus nRetVal = xnEnumeratePlayerNodes((XnNodeHandle)hNode, &pList);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, ppList, pList);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsPlayerAtEOF(JNIEnv *, jclass, jlong hNode)
+{
+	return xnIsPlayerAtEOF((XnNodeHandle)hNode);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToEndOfFileReached(JNIEnv *env, jclass, jlong hNode, jobject obj, jstring cb, jobject phCallback)
+{
+	return RegisterToStateChangeEvent(xnRegisterToEndOfFileReached, env, hNode, obj, cb, phCallback);
+}
+
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromEndOfFileReached(JNIEnv *, jclass, jlong hNode, jlong hCallback)
+{
+	UnregisterFromStateChangeEvent(xnUnregisterFromEndOfFileReached, hNode, hCallback);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetPlaybackSpeed(JNIEnv *, jclass, jlong hNode, jdouble dSpeed)
+{
+	return xnSetPlaybackSpeed((XnNodeHandle)hNode, dSpeed);
+}
+
+JNIEXPORT jdouble JNICALL Java_org_OpenNI_NativeMethods_xnGetPlaybackSpeed(JNIEnv *, jclass, jlong hNode)
+{
+	return xnGetPlaybackSpeed((XnNodeHandle)hNode);
+}
+
+
+//---------------------------------------------------------------------------
+// ScriptNode
+//---------------------------------------------------------------------------
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateScriptNode(JNIEnv *env, jclass, jlong pContext, jstring strFormat, jobject phNode)
+{
+	XnNodeHandle hNode;
+	XnStatus nRetVal = xnCreateScriptNode((XnContext*)pContext, JavaString(env, strFormat), &hNode);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgPointerValue(env, phNode, hNode);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnScriptNodeGetSupportedFormat(JNIEnv *env, jclass, jlong hNode)
+{
+	return env->NewStringUTF(xnScriptNodeGetSupportedFormat((XnNodeHandle)hNode));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLoadScriptFromFile(JNIEnv *env, jclass, jlong hNode, jstring strFile)
+{
+	return xnLoadScriptFromFile((XnNodeHandle)hNode, JavaString(env, strFile));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLoadScriptFromString(JNIEnv *env, jclass, jlong hNode, jstring strScript)
+{
+	return xnLoadScriptFromString((XnNodeHandle)hNode, JavaString(env, strScript));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnScriptNodeRun(JNIEnv *, jclass, jlong hNode, jlong pErrors)
+{
+	return xnScriptNodeRun((XnNodeHandle)hNode, (XnEnumerationErrors*)pErrors);
+}
+
+//---------------------------------------------------------------------------
+// Utils
+//---------------------------------------------------------------------------
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnProductionNodeTypeToString(JNIEnv *env, jclass, jint type)
+{
+	return env->NewStringUTF(xnProductionNodeTypeToString(type));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResolutionGetXRes(JNIEnv *, jclass, jint res)
+{
+	return xnResolutionGetXRes((XnResolution)res);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResolutionGetYRes(JNIEnv *, jclass, jint res)
+{
+	return xnResolutionGetYRes((XnResolution)res);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResolutionGetFromXYRes(JNIEnv *, jclass, jint xRes, jint yRes)
+{
+	return xnResolutionGetFromXYRes(xRes, yRes);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResolutionGetFromName(JNIEnv *env, jclass, jstring strName)
+{
+	return xnResolutionGetFromName(JavaString(env, strName));
+}
+
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnResolutionGetName(JNIEnv *env, jclass, jint res)
+{
+	return env->NewStringUTF(xnResolutionGetName((XnResolution)res));
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetVersion(JNIEnv *env, jclass, jobject pVersion)
+{
+	XnVersion version;
+	XnStatus nRetVal = xnGetVersion(&version);
+	XN_IS_STATUS_OK(nRetVal);
+	SetOutArgVersionValue(env, pVersion, &version);
+	return XN_STATUS_OK;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsTypeGenerator(JNIEnv *, jclass, jint type)
+{
+	return xnIsTypeGenerator(type);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsTypeDerivedFrom(JNIEnv *, jclass, jint type, jint base)
+{
+	return xnIsTypeDerivedFrom(type, base);
+}
+
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetBytesPerPixelForPixelFormat(JNIEnv *, jclass, jint format)
+{
+	return xnGetBytesPerPixelForPixelFormat((XnPixelFormat)format);
+}
diff --git a/Wrappers/OpenNI.jni/org_OpenNI_NativeMethods.h b/Wrappers/OpenNI.jni/org_OpenNI_NativeMethods.h
new file mode 100644
index 0000000..0a55673
--- /dev/null
+++ b/Wrappers/OpenNI.jni/org_OpenNI_NativeMethods.h
@@ -0,0 +1,2565 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_OpenNI_NativeMethods */
+
+#ifndef _Included_org_OpenNI_NativeMethods
+#define _Included_org_OpenNI_NativeMethods
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    readByte
+ * Signature: (J)B
+ */
+JNIEXPORT jbyte JNICALL Java_org_OpenNI_NativeMethods_readByte
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    readShort
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_OpenNI_NativeMethods_readShort
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    readInt
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_readInt
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    readLong
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_readLong
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    copyToBuffer
+ * Signature: (Ljava/nio/ByteBuffer;JI)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_copyToBuffer
+  (JNIEnv *, jclass, jobject, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    createProductionNodeDescription
+ * Signature: (ILjava/lang/String;Ljava/lang/String;BBSI)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_createProductionNodeDescription
+  (JNIEnv *, jclass, jint, jstring, jstring, jbyte, jbyte, jshort, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    freeProductionNodeDescription
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_freeProductionNodeDescription
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetStatusString
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnGetStatusString
+  (JNIEnv *, jclass, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnInit
+ * Signature: (Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnInit
+  (JNIEnv *, jclass, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnContextRunXmlScriptFromFileEx
+ * Signature: (JLjava/lang/String;JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnContextRunXmlScriptFromFileEx
+  (JNIEnv *, jclass, jlong, jstring, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnContextRunXmlScriptEx
+ * Signature: (JLjava/lang/String;JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnContextRunXmlScriptEx
+  (JNIEnv *, jclass, jlong, jstring, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnInitFromXmlFileEx
+ * Signature: (Ljava/lang/String;Lorg/OpenNI/OutArg;JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnInitFromXmlFileEx
+  (JNIEnv *, jclass, jstring, jobject, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnContextOpenFileRecordingEx
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnContextOpenFileRecordingEx
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnContextAddRef
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnContextAddRef
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnContextRelease
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnContextRelease
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerateProductionTrees
+ * Signature: (JIJLorg/OpenNI/OutArg;J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateProductionTrees
+  (JNIEnv *, jclass, jlong, jint, jlong, jobject, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateProductionTree
+ * Signature: (JJLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateProductionTree
+  (JNIEnv *, jclass, jlong, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateAnyProductionTree
+ * Signature: (JIJLorg/OpenNI/OutArg;J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateAnyProductionTree
+  (JNIEnv *, jclass, jlong, jint, jlong, jobject, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerateExistingNodes
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateExistingNodes
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerateExistingNodesByType
+ * Signature: (JILorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateExistingNodesByType
+  (JNIEnv *, jclass, jlong, jint, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnFindExistingRefNodeByType
+ * Signature: (JILorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnFindExistingRefNodeByType
+  (JNIEnv *, jclass, jlong, jint, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetRefNodeHandleByName
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetRefNodeHandleByName
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnWaitAndUpdateAll
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnWaitAndUpdateAll
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnWaitOneUpdateAll
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnWaitOneUpdateAll
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnWaitAnyUpdateAll
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnWaitAnyUpdateAll
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnWaitNoneUpdateAll
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnWaitNoneUpdateAll
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStartGeneratingAll
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStartGeneratingAll
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStopGeneratingAll
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopGeneratingAll
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetGlobalMirror
+ * Signature: (JZ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetGlobalMirror
+  (JNIEnv *, jclass, jlong, jboolean);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetGlobalMirror
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnGetGlobalMirror
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetGlobalErrorState
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetGlobalErrorState
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToGlobalErrorStateChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToGlobalErrorStateChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromGlobalErrorStateChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromGlobalErrorStateChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnAddLicense
+ * Signature: (JLjava/lang/String;Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAddLicense
+  (JNIEnv *, jclass, jlong, jstring, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerateLicenses
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateLicenses
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerationErrorsAllocate
+ * Signature: (Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsAllocate
+  (JNIEnv *, jclass, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerationErrorsFree
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsFree
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerationErrorsToString
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsToString
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerationErrorsClear
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsClear
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerationErrorsGetFirst
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsGetFirst
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerationErrorsIteratorIsValid
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnEnumerationErrorsIteratorIsValid
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoSetInstanceName
+ * Signature: (JLjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoSetInstanceName
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoGetDescription
+ * Signature: (J)Lorg/OpenNI/ProductionNodeDescription;
+ */
+JNIEXPORT jobject JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoGetDescription
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoGetTreeStringRepresentation
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoGetTreeStringRepresentation
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoGetInstanceName
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoGetInstanceName
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoGetCreationInfo
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoGetCreationInfo
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoGetNeededNodes
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoGetNeededNodes
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoGetRefHandle
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoGetRefHandle
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListAllocate
+ * Signature: (Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListAllocate
+  (JNIEnv *, jclass, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListFree
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListFree
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListAdd
+ * Signature: (JJLjava/lang/String;J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListAdd
+  (JNIEnv *, jclass, jlong, jlong, jstring, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListAddNode
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListAddNode
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListAddNodeFromList
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListAddNodeFromList
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListRemove
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListRemove
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListClear
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListClear
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListAppend
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListAppend
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListIsEmpty
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListIsEmpty
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListGetFirst
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListGetFirst
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListIteratorIsValid
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListIteratorIsValid
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListGetCurrent
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListGetCurrent
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeInfoListGetNext
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnNodeInfoListGetNext
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQueryAllocate
+ * Signature: (Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryAllocate
+  (JNIEnv *, jclass, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQueryFree
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryFree
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQuerySetVendor
+ * Signature: (JLjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetVendor
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQuerySetName
+ * Signature: (JLjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetName
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQuerySetMinVersion
+ * Signature: (JBBSI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetMinVersion
+  (JNIEnv *, jclass, jlong, jbyte, jbyte, jshort, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQuerySetMaxVersion
+ * Signature: (JBBSI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetMaxVersion
+  (JNIEnv *, jclass, jlong, jbyte, jbyte, jshort, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQueryAddSupportedCapability
+ * Signature: (JLjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryAddSupportedCapability
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQueryAddSupportedMapOutputMode
+ * Signature: (JIII)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryAddSupportedMapOutputMode
+  (JNIEnv *, jclass, jlong, jint, jint, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQuerySetSupportedMinUserPositions
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetSupportedMinUserPositions
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQuerySetExistingNodeOnly
+ * Signature: (JZ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetExistingNodeOnly
+  (JNIEnv *, jclass, jlong, jboolean);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQuerySetNonExistingNodeOnly
+ * Signature: (JZ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetNonExistingNodeOnly
+  (JNIEnv *, jclass, jlong, jboolean);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQueryAddNeededNode
+ * Signature: (JLjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryAddNeededNode
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQuerySetCreationInfo
+ * Signature: (JLjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQuerySetCreationInfo
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNodeQueryFilterList
+ * Signature: (JJJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnNodeQueryFilterList
+  (JNIEnv *, jclass, jlong, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnProductionNodeAddRef
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnProductionNodeAddRef
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnProductionNodeRelease
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnProductionNodeRelease
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetNodeInfo
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetNodeInfo
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetNodeName
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnGetNodeName
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetRefContextFromNodeHandle
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetRefContextFromNodeHandle
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsCapabilitySupported
+ * Signature: (JLjava/lang/String;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsCapabilitySupported
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetIntProperty
+ * Signature: (JLjava/lang/String;J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetIntProperty
+  (JNIEnv *, jclass, jlong, jstring, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetRealProperty
+ * Signature: (JLjava/lang/String;D)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetRealProperty
+  (JNIEnv *, jclass, jlong, jstring, jdouble);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetStringProperty
+ * Signature: (JLjava/lang/String;Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetStringProperty
+  (JNIEnv *, jclass, jlong, jstring, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetGeneralProperty
+ * Signature: (JLjava/lang/String;IJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetGeneralProperty
+  (JNIEnv *, jclass, jlong, jstring, jint, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetGeneralPropertyArray
+ * Signature: (JLjava/lang/String;[B)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetGeneralPropertyArray
+  (JNIEnv *, jclass, jlong, jstring, jbyteArray);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetIntProperty
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetIntProperty
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetRealProperty
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetRealProperty
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetStringProperty
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetStringProperty
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetGeneralProperty
+ * Signature: (JLjava/lang/String;IJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetGeneralProperty
+  (JNIEnv *, jclass, jlong, jstring, jint, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetGeneralPropertyArray
+ * Signature: (JLjava/lang/String;[B)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetGeneralPropertyArray
+  (JNIEnv *, jclass, jlong, jstring, jbyteArray);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnLockNodeForChanges
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLockNodeForChanges
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnlockNodeForChanges
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnUnlockNodeForChanges
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnLockedNodeStartChanges
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLockedNodeStartChanges
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnLockedNodeEndChanges
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLockedNodeEndChanges
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnAddNeededNode
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAddNeededNode
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRemoveNeededNode
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRemoveNeededNode
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateDevice
+ * Signature: (JLorg/OpenNI/OutArg;JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateDevice
+  (JNIEnv *, jclass, jlong, jobject, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetDeviceName
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetDeviceName
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetVendorSpecificData
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetVendorSpecificData
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSerialNumber
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSerialNumber
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetNodeErrorState
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetNodeErrorState
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToNodeErrorStateChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToNodeErrorStateChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromNodeErrorStateChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromNodeErrorStateChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetGeneralIntRange
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetGeneralIntRange
+  (JNIEnv *, jclass, jlong, jstring, jobject, jobject, jobject, jobject, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetGeneralIntValue
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetGeneralIntValue
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetGeneralIntValue
+ * Signature: (JLjava/lang/String;I)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetGeneralIntValue
+  (JNIEnv *, jclass, jlong, jstring, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToGeneralIntValueChange
+ * Signature: (JLjava/lang/String;Ljava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToGeneralIntValueChange
+  (JNIEnv *, jclass, jlong, jstring, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromGeneralIntValueChange
+ * Signature: (JLjava/lang/String;J)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromGeneralIntValueChange
+  (JNIEnv *, jclass, jlong, jstring, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStartGenerating
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStartGenerating
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsGenerating
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsGenerating
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStopGenerating
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopGenerating
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToGenerationRunningChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToGenerationRunningChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromGenerationRunningChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromGenerationRunningChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToNewDataAvailable
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToNewDataAvailable
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromNewDataAvailable
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromNewDataAvailable
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsNewDataAvailable
+ * Signature: (JLorg/OpenNI/OutArg;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsNewDataAvailable
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnWaitAndUpdateData
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnWaitAndUpdateData
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsDataNew
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsDataNew
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetData
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetData
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetDataSize
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetDataSize
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetTimestamp
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetTimestamp
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetFrameID
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetFrameID
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetMirror
+ * Signature: (JZ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetMirror
+  (JNIEnv *, jclass, jlong, jboolean);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsMirrored
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsMirrored
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToMirrorChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToMirrorChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromMirrorChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromMirrorChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsViewPointSupported
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsViewPointSupported
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetViewPoint
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetViewPoint
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnResetViewPoint
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResetViewPoint
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsViewPointAs
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsViewPointAs
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToViewPointChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToViewPointChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromViewPointChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromViewPointChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCanFrameSyncWith
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnCanFrameSyncWith
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnFrameSyncWith
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnFrameSyncWith
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStopFrameSyncWith
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopFrameSyncWith
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsFrameSyncedWith
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsFrameSyncedWith
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToFrameSyncChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToFrameSyncChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromFrameSyncChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromFrameSyncChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSupportedMapOutputModesCount
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSupportedMapOutputModesCount
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSupportedMapOutputModes
+ * Signature: (J[Lorg/OpenNI/MapOutputMode;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSupportedMapOutputModes
+  (JNIEnv *, jclass, jlong, jobjectArray);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetMapOutputMode
+ * Signature: (JIII)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetMapOutputMode
+  (JNIEnv *, jclass, jlong, jint, jint, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetMapOutputMode
+ * Signature: (JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetMapOutputMode
+  (JNIEnv *, jclass, jlong, jobject, jobject, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToMapOutputModeChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToMapOutputModeChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromMapOutputModeChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromMapOutputModeChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetBytesPerPixel
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetBytesPerPixel
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetCropping
+ * Signature: (JIIIIZ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetCropping
+  (JNIEnv *, jclass, jlong, jint, jint, jint, jint, jboolean);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetCropping
+ * Signature: (JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetCropping
+  (JNIEnv *, jclass, jlong, jobject, jobject, jobject, jobject, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToCroppingChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToCroppingChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromCroppingChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromCroppingChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetPowerLineFrequency
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetPowerLineFrequency
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetPowerLineFrequency
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetPowerLineFrequency
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToPowerLineFrequencyChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToPowerLineFrequencyChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromPowerLineFrequencyChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromPowerLineFrequencyChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateDepthGenerator
+ * Signature: (JLorg/OpenNI/OutArg;JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateDepthGenerator
+  (JNIEnv *, jclass, jlong, jobject, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetDeviceMaxDepth
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_OpenNI_NativeMethods_xnGetDeviceMaxDepth
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetDepthFieldOfView
+ * Signature: (JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetDepthFieldOfView
+  (JNIEnv *, jclass, jlong, jobject, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToDepthFieldOfViewChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToDepthFieldOfViewChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromDepthFieldOfViewChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromDepthFieldOfViewChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnConvertProjectiveToRealWorld
+ * Signature: (J[Lorg/OpenNI/Point3D;[Lorg/OpenNI/Point3D;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnConvertProjectiveToRealWorld
+  (JNIEnv *, jclass, jlong, jobjectArray, jobjectArray);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnConvertRealWorldToProjective
+ * Signature: (J[Lorg/OpenNI/Point3D;[Lorg/OpenNI/Point3D;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnConvertRealWorldToProjective
+  (JNIEnv *, jclass, jlong, jobjectArray, jobjectArray);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetDepthMap
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetDepthMap
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetDepthMetaData
+ * Signature: (JLorg/OpenNI/DepthMetaData;)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnGetDepthMetaData
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSupportedUserPositionsCount
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSupportedUserPositionsCount
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetUserPosition
+ * Signature: (JIFFFFFF)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetUserPosition
+  (JNIEnv *, jclass, jlong, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetUserPosition
+ * Signature: (JILorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetUserPosition
+  (JNIEnv *, jclass, jlong, jint, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToUserPositionChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToUserPositionChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromUserPositionChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromUserPositionChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateImageGenerator
+ * Signature: (JLorg/OpenNI/OutArg;JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateImageGenerator
+  (JNIEnv *, jclass, jlong, jobject, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetImageMap
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetImageMap
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsPixelFormatSupported
+ * Signature: (JI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsPixelFormatSupported
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetPixelFormat
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetPixelFormat
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetPixelFormat
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetPixelFormat
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToPixelFormatChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToPixelFormatChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromPixelFormatChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromPixelFormatChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetImageMetaData
+ * Signature: (JLorg/OpenNI/ImageMetaData;)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnGetImageMetaData
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateIRGenerator
+ * Signature: (JLorg/OpenNI/OutArg;JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateIRGenerator
+  (JNIEnv *, jclass, jlong, jobject, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetIRMap
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetIRMap
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetIRMetaData
+ * Signature: (JLorg/OpenNI/IRMetaData;)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnGetIRMetaData
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateGestureGenerator
+ * Signature: (JLorg/OpenNI/OutArg;JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateGestureGenerator
+  (JNIEnv *, jclass, jlong, jobject, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnAddGesture
+ * Signature: (JLjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAddGesture__JLjava_lang_String_2
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnAddGesture
+ * Signature: (JLjava/lang/String;FFFFFF)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAddGesture__JLjava_lang_String_2FFFFFF
+  (JNIEnv *, jclass, jlong, jstring, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRemoveGesture
+ * Signature: (JLjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRemoveGesture
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetAllActiveGestures
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetAllActiveGestures
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetNumberOfAvailableGestures
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetNumberOfAvailableGestures
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerateAllGestures
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateAllGestures
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsGestureAvailable
+ * Signature: (JLjava/lang/String;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsGestureAvailable
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsGestureProgressSupported
+ * Signature: (JLjava/lang/String;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsGestureProgressSupported
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterGestureCallbacks
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterGestureCallbacks
+  (JNIEnv *, jclass, jlong, jobject, jstring, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterGestureCallbacks
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterGestureCallbacks
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToGestureChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToGestureChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromGestureChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromGestureChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToGestureIntermediateStageCompleted
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToGestureIntermediateStageCompleted
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromGestureIntermediateStageCompleted
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromGestureIntermediateStageCompleted
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToGestureReadyForNextIntermediateStage
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToGestureReadyForNextIntermediateStage
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromGestureReadyForNextIntermediateStage
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromGestureReadyForNextIntermediateStage
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateSceneAnalyzer
+ * Signature: (JLorg/OpenNI/OutArg;JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateSceneAnalyzer
+  (JNIEnv *, jclass, jlong, jobject, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetLabelMap
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetLabelMap
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetFloor
+ * Signature: (JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetFloor
+  (JNIEnv *, jclass, jlong, jobject, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSceneMetaData
+ * Signature: (JLorg/OpenNI/SceneMetaData;)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnGetSceneMetaData
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateUserGenerator
+ * Signature: (JLorg/OpenNI/OutArg;JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateUserGenerator
+  (JNIEnv *, jclass, jlong, jobject, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetNumberOfUsers
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetNumberOfUsers
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetUsers
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetUsers
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetUserCoM
+ * Signature: (JILorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetUserCoM
+  (JNIEnv *, jclass, jlong, jint, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetUserPixels
+ * Signature: (JILorg/OpenNI/SceneMetaData;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetUserPixels
+  (JNIEnv *, jclass, jlong, jint, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterUserCallbacks
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterUserCallbacks
+  (JNIEnv *, jclass, jlong, jobject, jstring, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterUserCallbacks
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterUserCallbacks
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToUserExit
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToUserExit
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromUserExit
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromUserExit
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToUserReEnter
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToUserReEnter
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromUserReEnter
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromUserReEnter
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsJointAvailable
+ * Signature: (JI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsJointAvailable
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsProfileAvailable
+ * Signature: (JI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsProfileAvailable
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetSkeletonProfile
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetSkeletonProfile
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetJointActive
+ * Signature: (JIZ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetJointActive
+  (JNIEnv *, jclass, jlong, jint, jboolean);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsJointActive
+ * Signature: (JI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsJointActive
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToJointConfigurationChange
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToJointConfigurationChange
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromJointConfigurationChange
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromJointConfigurationChange
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumerateActiveJoints
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumerateActiveJoints
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSkeletonJoint
+ * Signature: (JIILorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSkeletonJoint
+  (JNIEnv *, jclass, jlong, jint, jint, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSkeletonJointPosition
+ * Signature: (JIILorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSkeletonJointPosition
+  (JNIEnv *, jclass, jlong, jint, jint, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSkeletonJointOrientation
+ * Signature: (JIILorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSkeletonJointOrientation
+  (JNIEnv *, jclass, jlong, jint, jint, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsSkeletonTracking
+ * Signature: (JI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsSkeletonTracking
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsSkeletonCalibrated
+ * Signature: (JI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsSkeletonCalibrated
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsSkeletonCalibrating
+ * Signature: (JI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsSkeletonCalibrating
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRequestSkeletonCalibration
+ * Signature: (JIZ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRequestSkeletonCalibration
+  (JNIEnv *, jclass, jlong, jint, jboolean);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnAbortSkeletonCalibration
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAbortSkeletonCalibration
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSaveSkeletonCalibrationDataToFile
+ * Signature: (JILjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSaveSkeletonCalibrationDataToFile
+  (JNIEnv *, jclass, jlong, jint, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnLoadSkeletonCalibrationDataFromFile
+ * Signature: (JILjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLoadSkeletonCalibrationDataFromFile
+  (JNIEnv *, jclass, jlong, jint, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSaveSkeletonCalibrationData
+ * Signature: (JII)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSaveSkeletonCalibrationData
+  (JNIEnv *, jclass, jlong, jint, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnLoadSkeletonCalibrationData
+ * Signature: (JII)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLoadSkeletonCalibrationData
+  (JNIEnv *, jclass, jlong, jint, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnClearSkeletonCalibrationData
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnClearSkeletonCalibrationData
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsSkeletonCalibrationData
+ * Signature: (JI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsSkeletonCalibrationData
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStartSkeletonTracking
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStartSkeletonTracking
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStopSkeletonTracking
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopSkeletonTracking
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnResetSkeleton
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResetSkeleton
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnNeedPoseForSkeletonCalibration
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnNeedPoseForSkeletonCalibration
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSkeletonCalibrationPose
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSkeletonCalibrationPose
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetSkeletonSmoothing
+ * Signature: (JF)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetSkeletonSmoothing
+  (JNIEnv *, jclass, jlong, jfloat);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToCalibrationStart
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToCalibrationStart
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromCalibrationStart
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromCalibrationStart
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToCalibrationInProgress
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToCalibrationInProgress
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromCalibrationInProgress
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromCalibrationInProgress
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToCalibrationComplete
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToCalibrationComplete
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromCalibrationComplete
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromCalibrationComplete
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetNumberOfPoses
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetNumberOfPoses
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetAllAvailablePoses
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetAllAvailablePoses
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStartPoseDetection
+ * Signature: (JLjava/lang/String;I)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStartPoseDetection
+  (JNIEnv *, jclass, jlong, jstring, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStopPoseDetection
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopPoseDetection
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStopSinglePoseDetection
+ * Signature: (JILjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopSinglePoseDetection
+  (JNIEnv *, jclass, jlong, jint, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToPoseDetected
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToPoseDetected
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromPoseDetected
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromPoseDetected
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToOutOfPose
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToOutOfPose
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromOutOfPose
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromOutOfPose
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToPoseDetectionInProgress
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToPoseDetectionInProgress
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromPoseDetectionInProgress
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromPoseDetectionInProgress
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsPoseSupported
+ * Signature: (JLjava/lang/String;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsPoseSupported
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetPoseStatus
+ * Signature: (JILjava/lang/String;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetPoseStatus
+  (JNIEnv *, jclass, jlong, jint, jstring, jobject, jobject, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateHandsGenerator
+ * Signature: (JLorg/OpenNI/OutArg;JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateHandsGenerator
+  (JNIEnv *, jclass, jlong, jobject, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterHandCallbacks
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterHandCallbacks
+  (JNIEnv *, jclass, jlong, jobject, jstring, jstring, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterHandCallbacks
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterHandCallbacks
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStopTracking
+ * Signature: (JI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopTracking
+  (JNIEnv *, jclass, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStopTrackingAll
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStopTrackingAll
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnStartTracking
+ * Signature: (JFFF)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnStartTracking
+  (JNIEnv *, jclass, jlong, jfloat, jfloat, jfloat);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetTrackingSmoothing
+ * Signature: (JF)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetTrackingSmoothing
+  (JNIEnv *, jclass, jlong, jfloat);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToHandTouchingFOVEdge
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToHandTouchingFOVEdge
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromHandTouchingFOVEdge
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromHandTouchingFOVEdge
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateAudioGenerator
+ * Signature: (JLorg/OpenNI/OutArg;JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateAudioGenerator
+  (JNIEnv *, jclass, jlong, jobject, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetAudioBuffer
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_OpenNI_NativeMethods_xnGetAudioBuffer
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSupportedWaveOutputModesCount
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSupportedWaveOutputModesCount
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetSupportedWaveOutputModes
+ * Signature: (J[Lorg/OpenNI/WaveOutputMode;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetSupportedWaveOutputModes
+  (JNIEnv *, jclass, jlong, jobjectArray);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetWaveOutputMode
+ * Signature: (JISB)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetWaveOutputMode
+  (JNIEnv *, jclass, jlong, jint, jshort, jbyte);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetWaveOutputMode
+ * Signature: (JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetWaveOutputMode
+  (JNIEnv *, jclass, jlong, jobject, jobject, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToWaveOutputModeChanges
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToWaveOutputModeChanges
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromWaveOutputModeChanges
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromWaveOutputModeChanges
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetAudioMetaData
+ * Signature: (JLorg/OpenNI/AudioMetaData;)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnGetAudioMetaData
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateCodec
+ * Signature: (JIJLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateCodec
+  (JNIEnv *, jclass, jlong, jint, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetCodecID
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetCodecID
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEncodeData
+ * Signature: (JJIJILorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEncodeData
+  (JNIEnv *, jclass, jlong, jlong, jint, jlong, jint, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnDecodeData
+ * Signature: (JJIJILorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnDecodeData
+  (JNIEnv *, jclass, jlong, jlong, jint, jlong, jint, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateRecorder
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateRecorder
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetRecorderDestination
+ * Signature: (JILjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetRecorderDestination
+  (JNIEnv *, jclass, jlong, jint, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetRecorderDestination
+ * Signature: (JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetRecorderDestination
+  (JNIEnv *, jclass, jlong, jobject, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnAddNodeToRecording
+ * Signature: (JJI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnAddNodeToRecording
+  (JNIEnv *, jclass, jlong, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRemoveNodeFromRecording
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRemoveNodeFromRecording
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRecord
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRecord
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetRecorderFormat
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnGetRecorderFormat
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreatePlayer
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreatePlayer
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetPlayerRepeat
+ * Signature: (JZ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetPlayerRepeat
+  (JNIEnv *, jclass, jlong, jboolean);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetPlayerSource
+ * Signature: (JILjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetPlayerSource
+  (JNIEnv *, jclass, jlong, jint, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetPlayerSource
+ * Signature: (JLorg/OpenNI/OutArg;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetPlayerSource
+  (JNIEnv *, jclass, jlong, jobject, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnPlayerReadNext
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnPlayerReadNext
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSeekPlayerToTimeStamp
+ * Signature: (JJI)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSeekPlayerToTimeStamp
+  (JNIEnv *, jclass, jlong, jlong, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSeekPlayerToFrame
+ * Signature: (JLjava/lang/String;II)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSeekPlayerToFrame
+  (JNIEnv *, jclass, jlong, jstring, jint, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnTellPlayerTimestamp
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnTellPlayerTimestamp
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnTellPlayerFrame
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnTellPlayerFrame
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetPlayerNumFrames
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetPlayerNumFrames
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetPlayerSupportedFormat
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnGetPlayerSupportedFormat
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnEnumeratePlayerNodes
+ * Signature: (JLorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnEnumeratePlayerNodes
+  (JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsPlayerAtEOF
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsPlayerAtEOF
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnRegisterToEndOfFileReached
+ * Signature: (JLjava/lang/Object;Ljava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnRegisterToEndOfFileReached
+  (JNIEnv *, jclass, jlong, jobject, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnUnregisterFromEndOfFileReached
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_OpenNI_NativeMethods_xnUnregisterFromEndOfFileReached
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnSetPlaybackSpeed
+ * Signature: (JD)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnSetPlaybackSpeed
+  (JNIEnv *, jclass, jlong, jdouble);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetPlaybackSpeed
+ * Signature: (J)D
+ */
+JNIEXPORT jdouble JNICALL Java_org_OpenNI_NativeMethods_xnGetPlaybackSpeed
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnCreateScriptNode
+ * Signature: (JLjava/lang/String;Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnCreateScriptNode
+  (JNIEnv *, jclass, jlong, jstring, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnScriptNodeGetSupportedFormat
+ * Signature: (J)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnScriptNodeGetSupportedFormat
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnLoadScriptFromFile
+ * Signature: (JLjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLoadScriptFromFile
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnLoadScriptFromString
+ * Signature: (JLjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnLoadScriptFromString
+  (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnScriptNodeRun
+ * Signature: (JJ)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnScriptNodeRun
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnProductionNodeTypeToString
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnProductionNodeTypeToString
+  (JNIEnv *, jclass, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnResolutionGetXRes
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResolutionGetXRes
+  (JNIEnv *, jclass, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnResolutionGetYRes
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResolutionGetYRes
+  (JNIEnv *, jclass, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnResolutionGetFromXYRes
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResolutionGetFromXYRes
+  (JNIEnv *, jclass, jint, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnResolutionGetFromName
+ * Signature: (Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnResolutionGetFromName
+  (JNIEnv *, jclass, jstring);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnResolutionGetName
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_OpenNI_NativeMethods_xnResolutionGetName
+  (JNIEnv *, jclass, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetVersion
+ * Signature: (Lorg/OpenNI/OutArg;)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetVersion
+  (JNIEnv *, jclass, jobject);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsTypeGenerator
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsTypeGenerator
+  (JNIEnv *, jclass, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnIsTypeDerivedFrom
+ * Signature: (II)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_OpenNI_NativeMethods_xnIsTypeDerivedFrom
+  (JNIEnv *, jclass, jint, jint);
+
+/*
+ * Class:     org_OpenNI_NativeMethods
+ * Method:    xnGetBytesPerPixelForPixelFormat
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_OpenNI_NativeMethods_xnGetBytesPerPixelForPixelFormat
+  (JNIEnv *, jclass, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/Wrappers/OpenNI.net/AlternativeViewPointCapability.cs b/Wrappers/OpenNI.net/AlternativeViewPointCapability.cs
index 3e3776a..a1921e1 100644
--- a/Wrappers/OpenNI.net/AlternativeViewPointCapability.cs
+++ b/Wrappers/OpenNI.net/AlternativeViewPointCapability.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/AntiFlickerCapability.cs b/Wrappers/OpenNI.net/AntiFlickerCapability.cs
index f3b1cbc..0271789 100644
--- a/Wrappers/OpenNI.net/AntiFlickerCapability.cs
+++ b/Wrappers/OpenNI.net/AntiFlickerCapability.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Text;
diff --git a/Wrappers/OpenNI.net/AssemblyInfo.cs b/Wrappers/OpenNI.net/AssemblyInfo.cs
index 535aa78..32a45cc 100644
--- a/Wrappers/OpenNI.net/AssemblyInfo.cs
+++ b/Wrappers/OpenNI.net/AssemblyInfo.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Reflection;
 using System.Runtime.CompilerServices;
diff --git a/Wrappers/OpenNI.net/AudioGenerator.cs b/Wrappers/OpenNI.net/AudioGenerator.cs
index 268a364..b734b5a 100644
--- a/Wrappers/OpenNI.net/AudioGenerator.cs
+++ b/Wrappers/OpenNI.net/AudioGenerator.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/AudioMetaData.cs b/Wrappers/OpenNI.net/AudioMetaData.cs
index 2e7d6f8..e6ca043 100644
--- a/Wrappers/OpenNI.net/AudioMetaData.cs
+++ b/Wrappers/OpenNI.net/AudioMetaData.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/Codec.cs b/Wrappers/OpenNI.net/Codec.cs
index 0d126d4..81f0bbe 100644
--- a/Wrappers/OpenNI.net/Codec.cs
+++ b/Wrappers/OpenNI.net/Codec.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/Context.cs b/Wrappers/OpenNI.net/Context.cs
index 94ced7f..2c78b8a 100644
--- a/Wrappers/OpenNI.net/Context.cs
+++ b/Wrappers/OpenNI.net/Context.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
@@ -29,7 +50,7 @@ namespace OpenNI
 
 	public class Context : ObjectWrapper
 	{
-		private Context(IntPtr pContext) : 
+		private Context(IntPtr pContext, bool addRef) : 
 			base(pContext)
 		{
 			this.errorStateChangedHandler = this.ErrorStateChangedCallback;
@@ -42,16 +63,38 @@ namespace OpenNI
 				}
 				Context.allContexts.Add(pContext, this);
 			}
+
+			if (addRef)
+			{
+				WrapperUtils.ThrowOnError(SafeNativeMethods.xnContextAddRef(pContext));
+			}
+
+			this.shutdownHandler = OnContextShuttingDown;
+
+			WrapperUtils.ThrowOnError(SafeNativeMethods.xnContextRegisterForShutdown(pContext, this.shutdownHandler, IntPtr.Zero, out this.shutdownCallbackHandle));
 		}
 
+		private Context(IntPtr pContext) : this(pContext, true) { }
+
 		public Context() :
-			this(Init())
+			this(Init(), false)
 		{
 		}
 
+		[Obsolete("use Context.CreateFromXmlFile() instead")]
 		public Context(string xmlFile) :
-			this(InitFromXml(xmlFile))
+			this(InitFromXml(xmlFile), false)
 		{
+			this.usingDeprecatedAPI = true;
+		}
+
+		public static Context CreateFromXmlFile(string xmlFile, out ScriptNode scriptNode)
+		{
+			IntPtr hScriptNode;
+			IntPtr pContext = InitFromXmlEx(xmlFile, out hScriptNode);
+			Context context = new Context(pContext, false);
+			scriptNode = new ScriptNode(context, hScriptNode, false);
+			return context;
 		}
 
 		/// <summary>
@@ -76,40 +119,89 @@ namespace OpenNI
 
 		static public ProductionNode CreateProductionNodeFromNative(IntPtr nodeHandle)
 		{
-			IntPtr pContext = SafeNativeMethods.xnGetContextFromNodeHandle(nodeHandle);
+			IntPtr pContext = SafeNativeMethods.xnGetRefContextFromNodeHandle(nodeHandle);
 			Context context = Context.FromNative(pContext);
+			SafeNativeMethods.xnContextRelease(pContext);
 			return context.CreateProductionNodeObject(nodeHandle);
 		}
 
+		[Obsolete("Use RunXmlScriptEx() instead")]
 		public void RunXmlScript(string xml)
 		{
+			this.usingDeprecatedAPI = true;
 			EnumerationErrors errors = new EnumerationErrors();
 			int status = SafeNativeMethods.xnContextRunXmlScript(this.InternalObject, xml, errors.InternalObject);
 			WrapperUtils.CheckEnumeration(status, errors);
 		}
 
+		public ScriptNode RunXmlScriptEx(string xml)
+		{
+			EnumerationErrors errors = new EnumerationErrors();
+			IntPtr hScriptNode;
+			int status = SafeNativeMethods.xnContextRunXmlScriptEx(this.InternalObject, xml, errors.InternalObject, out hScriptNode);
+			WrapperUtils.CheckEnumeration(status, errors);
+			return new ScriptNode(this, hScriptNode, false);
+		}
+
+		[Obsolete("Use RunXmlScriptFromFileEx() instead")]
 		public void RunXmlScriptFromFile(string xmlFile)
 		{
+			this.usingDeprecatedAPI = true;
 			EnumerationErrors errors = new EnumerationErrors();
 			int status = SafeNativeMethods.xnContextRunXmlScriptFromFile(this.InternalObject, xmlFile, errors.InternalObject);
 			WrapperUtils.CheckEnumeration(status, errors);
 		}
 
+		public ProductionNode RunXmlScriptFromFileEx(string xmlFile)
+		{
+			EnumerationErrors errors = new EnumerationErrors();
+			IntPtr hScriptNode;
+			int status = SafeNativeMethods.xnContextRunXmlScriptFromFileEx(this.InternalObject, xmlFile, errors.InternalObject, out hScriptNode);
+			WrapperUtils.CheckEnumeration(status, errors);
+			return new ScriptNode(this, hScriptNode, false);
+		}
+
+		[Obsolete("Use OpenFileRecordingEx() instead")]
 		public void OpenFileRecording(string fileName)
 		{
+			this.usingDeprecatedAPI = true;
 			int status = SafeNativeMethods.xnContextOpenFileRecording(this.InternalObject, fileName);
 			WrapperUtils.ThrowOnError(status);
 		}
 
+		public ProductionNode OpenFileRecordingEx(string fileName)
+		{
+			IntPtr hScriptNode;
+			int status = SafeNativeMethods.xnContextOpenFileRecordingEx(this.InternalObject, fileName, out hScriptNode);
+			WrapperUtils.ThrowOnError(status);
+			return CreateProductionNodeFromNative(hScriptNode);
+		}
+
+		[Obsolete("Do not use this function. You may use Release() instead, or count on GC.")]
 		public void Shutdown()
 		{
+			SafeNativeMethods.xnShutdown(this.InternalObject);
+			UnsafeReplaceInternalObject(IntPtr.Zero);
+			Dispose();
+		}
+
+		public void Release()
+		{
 			Dispose();
 		}
 
 		public void AddLicense(License license)
 		{
-			int status = SafeNativeMethods.xnAddLicense(this.InternalObject, license);
-			WrapperUtils.ThrowOnError(status);
+            IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(license));
+            try
+            {
+                int status = SafeNativeMethods.xnAddLicense(this.InternalObject, ptr);
+                WrapperUtils.ThrowOnError(status);
+            }
+            finally
+            {
+                Marshal.FreeHGlobal(ptr);
+            }
 		}
 
 		public License[] EnumerateLicenses()
@@ -159,7 +251,10 @@ namespace OpenNI
 		public ProductionNode CreateAnyProductionTree(NodeType type, Query query)
 		{
 			IntPtr nodeHandle = CreateAnyProductionTreeImpl(type, query);
-			return CreateProductionNodeObject(nodeHandle, type);
+			ProductionNode result = CreateProductionNodeObject(nodeHandle, type);
+			// release the handle (result now owns it)
+			SafeNativeMethods.xnProductionNodeRelease(nodeHandle);
+			return result;
 		}
 
 		public ProductionNode CreateProductionTree(NodeInfo nodeInfo)
@@ -189,25 +284,41 @@ namespace OpenNI
 		public ProductionNode FindExistingNode(NodeType type)
 		{
 			IntPtr nodeHandle;
-			int status = SafeNativeMethods.xnFindExistingNodeByType(this.InternalObject, type, out nodeHandle);
-			WrapperUtils.ThrowOnError(status);
-			return CreateProductionNodeObject(nodeHandle, type);
+			int status = SafeNativeMethods.xnFindExistingRefNodeByType(this.InternalObject, type, out nodeHandle);
+            if (status != 0)
+            {
+                return null;
+            }
+
+			ProductionNode node = CreateProductionNodeObject(nodeHandle, type);
+
+			// release the handle
+			SafeNativeMethods.xnProductionNodeRelease(nodeHandle);
+
+			return node;
 		}
 
 		public ProductionNode GetProductionNodeByName(string name)
 		{
 			IntPtr nodeHandle;
-			int status = SafeNativeMethods.xnGetNodeHandleByName(this.InternalObject, name, out nodeHandle);
+			int status = SafeNativeMethods.xnGetRefNodeHandleByName(this.InternalObject, name, out nodeHandle);
 			WrapperUtils.ThrowOnError(status);
-			return CreateProductionNodeObject(nodeHandle);
+
+			ProductionNode node = CreateProductionNodeObject(nodeHandle);
+
+			// release the handle
+			SafeNativeMethods.xnProductionNodeRelease(nodeHandle);
+
+			return node;
 		}
 
 		public NodeInfo GetProductionNodeInfoByName(string name)
 		{
 			IntPtr nodeHandle;
-			int status = SafeNativeMethods.xnGetNodeHandleByName(this.InternalObject, name, out nodeHandle);
+			int status = SafeNativeMethods.xnGetRefNodeHandleByName(this.InternalObject, name, out nodeHandle);
 			WrapperUtils.ThrowOnError(status);
 			IntPtr nodeInfo = SafeNativeMethods.xnGetNodeInfo(nodeHandle);
+			SafeNativeMethods.xnProductionNodeRelease(nodeHandle);
 			return new NodeInfo(nodeInfo);
 		}
 
@@ -321,11 +432,6 @@ namespace OpenNI
 		{
 			if (disposing)
 			{
-				foreach (ProductionNode node in this.allNodes.Values)
-				{
-					node.MarkAlreadyFreed();
-				}
-
 				// remove it from the list
 				lock (Context.allContexts)
 				{
@@ -333,7 +439,15 @@ namespace OpenNI
 				}
 			}
 
-			SafeNativeMethods.xnShutdown(ptr);
+			if (this.usingDeprecatedAPI)
+			{
+				SafeNativeMethods.xnForceShutdown(ptr);
+			}
+			else
+			{
+				SafeNativeMethods.xnContextUnregisterFromShutdown(ptr, this.shutdownCallbackHandle);
+				SafeNativeMethods.xnContextRelease(ptr);
+			}
 		}
 
 		private static IntPtr Init()
@@ -348,7 +462,18 @@ namespace OpenNI
 		{
 			IntPtr pContext;
 			EnumerationErrors errors = new EnumerationErrors();
+			#pragma warning disable 612
 			int status = SafeNativeMethods.xnInitFromXmlFile(xmlFile, out pContext, errors.InternalObject);
+			#pragma warning restore 612
+			WrapperUtils.CheckEnumeration(status, errors);
+			return pContext;
+		}
+
+		private static IntPtr InitFromXmlEx(string xmlFile, out IntPtr hScriptNode)
+		{
+			IntPtr pContext;
+			EnumerationErrors errors = new EnumerationErrors();
+			int status = SafeNativeMethods.xnInitFromXmlFileEx(xmlFile, out pContext, errors.InternalObject, out hScriptNode);
 			WrapperUtils.CheckEnumeration(status, errors);
 			return pContext;
 		}
@@ -362,48 +487,60 @@ namespace OpenNI
 					if (type == null)
 					{
 						IntPtr pNodeInfo = SafeNativeMethods.xnGetNodeInfo(nodeHandle);
-						type = SafeNativeMethods.xnNodeInfoGetDescription(pNodeInfo).Type;
+                        type = NodeInfo.FromNative(pNodeInfo).Description.Type;
 					}
 
 					ProductionNode node;
 
 					switch (type)
 					{
-						case NodeType.Audio:
-							node = new AudioGenerator(this, nodeHandle, true);
-							break;
-						case NodeType.Codec:
-							node = new Codec(this, nodeHandle, true);
-							break;
-						case NodeType.Depth:
-							node = new DepthGenerator(this, nodeHandle, true);
-							break;
 						case NodeType.Device:
 							node = new Device(this, nodeHandle, true);
 							break;
-						case NodeType.Gesture:
-							node = new GestureGenerator(this, nodeHandle, true);
-							break;
-						case NodeType.Hands:
-							node = new HandsGenerator(this, nodeHandle, true);
+						case NodeType.Depth:
+							node = new DepthGenerator(this, nodeHandle, true);
 							break;
 						case NodeType.Image:
 							node = new ImageGenerator(this, nodeHandle, true);
 							break;
+						case NodeType.Audio:
+							node = new AudioGenerator(this, nodeHandle, true);
+							break;
 						case NodeType.IR:
 							node = new IRGenerator(this, nodeHandle, true);
 							break;
-						case NodeType.Player:
-							node = new Player(this, nodeHandle, true);
+						case NodeType.User:
+							node = new UserGenerator(this, nodeHandle, true);
 							break;
 						case NodeType.Recorder:
 							node = new Recorder(this, nodeHandle, true);
 							break;
+						case NodeType.Player:
+							node = new Player(this, nodeHandle, true);
+							break;
+						case NodeType.Gesture:
+							node = new GestureGenerator(this, nodeHandle, true);
+							break;
 						case NodeType.Scene:
 							node = new SceneAnalyzer(this, nodeHandle, true);
 							break;
-						case NodeType.User:
-							node = new UserGenerator(this, nodeHandle, true);
+						case NodeType.Hands:
+							node = new HandsGenerator(this, nodeHandle, true);
+							break;
+						case NodeType.Codec:
+							node = new Codec(this, nodeHandle, true);
+							break;
+						case NodeType.ProductionNode:
+							node = new ProductionNode(this, nodeHandle, true);
+							break;
+						case NodeType.Generator:
+							node = new Generator(this, nodeHandle, true);
+							break;
+						case NodeType.MapGenerator:
+							node = new MapGenerator(this, nodeHandle, true);
+							break;
+						case NodeType.ScriptNode:
+							node = new ScriptNode(this, nodeHandle, true);
 							break;
 						default:
 							throw new NotImplementedException("C# wrapper: Unknown generator type!");
@@ -430,9 +567,21 @@ namespace OpenNI
 			}
 		}
 
+		private void OnContextShuttingDown(IntPtr pContext, IntPtr pCookie)
+		{
+			// context is shutting down. This object is no longer valid
+			// no need to unregister from event, the event is destroyed anyway
+			UnsafeReplaceInternalObject(IntPtr.Zero);
+
+			Dispose();
+		}
+
+		private bool usingDeprecatedAPI;
 		private IntPtr errorStateCallbackHandle;
 		private event EventHandler<ErrorStateEventArgs> errorStateChanged;
 		private SafeNativeMethods.XnErrorStateChangedHandler errorStateChangedHandler;
+		private IntPtr shutdownCallbackHandle;
+		private SafeNativeMethods.XnContextShuttingDownHandler shutdownHandler;
 		private Dictionary<IntPtr, ProductionNode> allNodes = new Dictionary<IntPtr, ProductionNode>();
 
 		private static object staticLock = new object();
diff --git a/Wrappers/OpenNI.net/CroppingCapability.cs b/Wrappers/OpenNI.net/CroppingCapability.cs
index b88c3b7..44181b1 100644
--- a/Wrappers/OpenNI.net/CroppingCapability.cs
+++ b/Wrappers/OpenNI.net/CroppingCapability.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/DepthGenerator.cs b/Wrappers/OpenNI.net/DepthGenerator.cs
index ccb4cd9..d4754f2 100644
--- a/Wrappers/OpenNI.net/DepthGenerator.cs
+++ b/Wrappers/OpenNI.net/DepthGenerator.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
@@ -12,6 +33,10 @@ namespace OpenNI
 			this.fovChanged = new StateChangedEvent(this,
 				SafeNativeMethods.xnRegisterToDepthFieldOfViewChange,
 				SafeNativeMethods.xnUnregisterFromDepthFieldOfViewChange);
+            if (IsCapabilitySupported(Capabilities.UserPosition))
+                m_userPositionCapability = new UserPositionCapability(this);
+            else
+                m_userPositionCapability = null;
 		}
 
 		public DepthGenerator(Context context, Query query, EnumerationErrors errors) :
@@ -68,11 +93,21 @@ namespace OpenNI
 			remove { this.fovChanged.Event -= value; }
 		}
 
+        public void ConvertProjectiveToRealWorld(Point3D[] projectivePoints, Point3D[] realWorldPoints)
+        {
+            if (realWorldPoints.Length < projectivePoints.Length)
+            {
+                throw new ArgumentException("Destination array is too small", "realWorldPoints");
+            }
+
+            int status = SafeNativeMethods.xnConvertProjectiveToRealWorld(this.InternalObject, (uint)projectivePoints.Length, projectivePoints, realWorldPoints);
+            WrapperUtils.ThrowOnError(status);
+        }
+
 		public Point3D[] ConvertProjectiveToRealWorld(Point3D[] projectivePoints)
 		{
 			Point3D[] realWorld = new Point3D[projectivePoints.Length];
-			int status = SafeNativeMethods.xnConvertProjectiveToRealWorld(this.InternalObject, (uint)projectivePoints.Length, projectivePoints, realWorld);
-			WrapperUtils.ThrowOnError(status);
+            ConvertProjectiveToRealWorld(projectivePoints, realWorld);
 			return realWorld;
 		}
 
@@ -84,11 +119,21 @@ namespace OpenNI
             return ConvertProjectiveToRealWorld(projectivePoints)[0];
         }
 
+        public void ConvertRealWorldToProjective(Point3D[] realWorldPoints, Point3D[] projectivePoints)
+        {
+            if (projectivePoints.Length < realWorldPoints.Length)
+            {
+                throw new ArgumentException("Destination array is too small", "projectivePoints");
+            }
+
+            int status = SafeNativeMethods.xnConvertRealWorldToProjective(this.InternalObject, (uint)realWorldPoints.Length, realWorldPoints, projectivePoints);
+            WrapperUtils.ThrowOnError(status);
+        }
+
         public Point3D[] ConvertRealWorldToProjective(Point3D[] realWorldPoints)
         {
             Point3D[] projective = new Point3D[realWorldPoints.Length];
-            int status = SafeNativeMethods.xnConvertRealWorldToProjective(this.InternalObject, (uint)realWorldPoints.Length, realWorldPoints, projective);
-            WrapperUtils.ThrowOnError(status);
+            ConvertRealWorldToProjective(realWorldPoints, projective);
             return projective;
         }
         
@@ -102,10 +147,7 @@ namespace OpenNI
 
 		public UserPositionCapability UserPositionCapability
 		{
-			get
-			{
-				return new UserPositionCapability(this);
-			}
+			get	{ return m_userPositionCapability; }
 		}
 
 		public void GetMetaData(DepthMetaData depthMD)
@@ -133,6 +175,16 @@ namespace OpenNI
 			return handle;
 		}
 
+
+        public override void Dispose()
+        {
+            if(m_userPositionCapability!=null)
+                m_userPositionCapability.InternalDispose();
+            m_userPositionCapability = null;
+            base.Dispose();
+        }
+
 		private StateChangedEvent fovChanged;
+        protected UserPositionCapability m_userPositionCapability;
 	}
 }
\ No newline at end of file
diff --git a/Wrappers/OpenNI.net/DepthMetaData.cs b/Wrappers/OpenNI.net/DepthMetaData.cs
index 35e12e7..a17beda 100644
--- a/Wrappers/OpenNI.net/DepthMetaData.cs
+++ b/Wrappers/OpenNI.net/DepthMetaData.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/Device.cs b/Wrappers/OpenNI.net/Device.cs
index 940816b..f8c40a9 100644
--- a/Wrappers/OpenNI.net/Device.cs
+++ b/Wrappers/OpenNI.net/Device.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
@@ -9,21 +30,50 @@ namespace OpenNI
 		internal Device(Context context, IntPtr nodeHandle, bool addRef) :
 			base(context, nodeHandle, addRef)
 		{
+            if (IsCapabilitySupported(Capabilities.DeviceIdentification))
+                m_deviceIdentification = new DeviceIdentificationCapability(this);
+            else
+                m_deviceIdentification = null;
 		}
 
-		public Device(Context context, Query query) :
-			this(context, Create(context, query), false)
+        public Device(Context context, Query query, EnumerationErrors errors) :
+			this(context, Create(context, query, errors), false)
 		{
 		}
 
-		public Device(Context context) :
-			this(context, null)
+		public Device(Context context, Query query) :
+			this(context, query, null)
 		{
 		}
 
-		private static IntPtr Create(Context context, Query query)
+        public Device(Context context) :
+			this(context, null, null)
 		{
-			return context.CreateAnyProductionTreeImpl(NodeType.Device, query);
 		}
+
+        public DeviceIdentificationCapability DeviceIdentificationCapability
+        {
+            get { return m_deviceIdentification; }
+        }
+
+        public override void Dispose()
+        {
+            if (m_deviceIdentification != null)
+                m_deviceIdentification.InternalDispose();
+            m_deviceIdentification = null;
+            base.Dispose();
+        }
+
+		private static IntPtr Create(Context context, Query query, EnumerationErrors errors)
+		{
+            IntPtr handle;
+            int status = SafeNativeMethods.xnCreateDevice(context.InternalObject, out handle,
+                query == null ? IntPtr.Zero : query.InternalObject,
+                errors == null ? IntPtr.Zero : errors.InternalObject);
+            WrapperUtils.ThrowOnError(status);
+            return handle;
+        }
+
+        private DeviceIdentificationCapability m_deviceIdentification;
 	}
 }
\ No newline at end of file
diff --git a/Wrappers/OpenNI.net/DeviceIdentificationCapability.cs b/Wrappers/OpenNI.net/DeviceIdentificationCapability.cs
new file mode 100644
index 0000000..8ed86af
--- /dev/null
+++ b/Wrappers/OpenNI.net/DeviceIdentificationCapability.cs
@@ -0,0 +1,72 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace OpenNI
+{
+    public class DeviceIdentificationCapability : Capability
+    {
+        internal DeviceIdentificationCapability(ProductionNode node) :
+            base(node)
+        {
+        }
+
+        public string DeviceName
+        {
+            get
+            {
+                uint size = 1024;
+                StringBuilder sb = new StringBuilder((int)size);
+                int status = SafeNativeMethods.xnGetDeviceName(this.InternalObject, sb, ref size);
+                WrapperUtils.ThrowOnError(status);
+                return sb.ToString();
+            }
+        }
+
+        public string VendorSpecificData
+        {
+            get
+            {
+                uint size = 1024;
+                StringBuilder sb = new StringBuilder((int)size);
+                int status = SafeNativeMethods.xnGetVendorSpecificData(this.InternalObject, sb, ref size);
+                WrapperUtils.ThrowOnError(status);
+                return sb.ToString();
+            }
+        }
+
+        public string SerialNumber
+        {
+            get
+            {
+                uint size = 1024;
+                StringBuilder sb = new StringBuilder((int)size);
+                int status = SafeNativeMethods.xnGetSerialNumber(this.InternalObject, sb, ref size);
+                WrapperUtils.ThrowOnError(status);
+                return sb.ToString();
+            }
+        }
+   }
+}
\ No newline at end of file
diff --git a/Wrappers/OpenNI.net/EnumerationErrors.cs b/Wrappers/OpenNI.net/EnumerationErrors.cs
index eb36b5b..374c695 100644
--- a/Wrappers/OpenNI.net/EnumerationErrors.cs
+++ b/Wrappers/OpenNI.net/EnumerationErrors.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/FrameSyncCapability.cs b/Wrappers/OpenNI.net/FrameSyncCapability.cs
index 17a04c1..57fb673 100644
--- a/Wrappers/OpenNI.net/FrameSyncCapability.cs
+++ b/Wrappers/OpenNI.net/FrameSyncCapability.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/GeneralIntCapability.cs b/Wrappers/OpenNI.net/GeneralIntCapability.cs
index 2440802..b7e255c 100644
--- a/Wrappers/OpenNI.net/GeneralIntCapability.cs
+++ b/Wrappers/OpenNI.net/GeneralIntCapability.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Text;
diff --git a/Wrappers/OpenNI.net/Generator.cs b/Wrappers/OpenNI.net/Generator.cs
index 1a18c47..d3f6ddf 100644
--- a/Wrappers/OpenNI.net/Generator.cs
+++ b/Wrappers/OpenNI.net/Generator.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
@@ -16,6 +37,19 @@ namespace OpenNI
 			this.newDataAvailable = new StateChangedEvent(this,
 				SafeNativeMethods.xnRegisterToNewDataAvailable,
 				SafeNativeMethods.xnUnregisterFromNewDataAvailable);
+            if(IsCapabilitySupported(Capabilities.AlternativeViewPoint))
+                m_alternativeViewpointCapability = new AlternativeViewpointCapability(this);
+            else
+                m_alternativeViewpointCapability = null;
+            if(IsCapabilitySupported(Capabilities.FrameSync))
+                m_frameSyncCapability = new FrameSyncCapability(this);
+            else
+                m_frameSyncCapability = null;
+
+            if (IsCapabilitySupported(Capabilities.Mirror))
+                m_mirrorCapability = new MirrorCapability(this);
+            else
+                m_mirrorCapability = null;
 		}
 
 		public void StartGenerating()
@@ -83,6 +117,14 @@ namespace OpenNI
 			}
 		}
 
+        public IntPtr DataPtr
+        {
+            get
+            {
+                return SafeNativeMethods.xnGetData(this.InternalObject);
+            }
+        }
+
 		public Int32 DataSize
 		{
 			get
@@ -109,30 +151,51 @@ namespace OpenNI
 
 		public MirrorCapability MirrorCapability
 		{
-			get
-			{
-				return new MirrorCapability(this);
-			}
+            get { return m_mirrorCapability; }
 		}
 
 		public AlternativeViewpointCapability AlternativeViewpointCapability
 		{
 			get
 			{
-				return new AlternativeViewpointCapability(this);
+				return m_alternativeViewpointCapability;
 			}
 		}
 
 		public FrameSyncCapability FrameSyncCapability
 		{
-			get
-			{
-				return new FrameSyncCapability(this);
-			}
+			get { return m_frameSyncCapability; }
 		}
 
+
+        ///  @todo this is a temporary solution for capability not being disposed by anyone external
+        public override void Dispose()
+        {
+            if (m_alternativeViewpointCapability != null)
+            {
+                m_alternativeViewpointCapability.InternalDispose();
+                m_alternativeViewpointCapability = null;
+            }
+            if (m_frameSyncCapability != null)
+            {
+                m_frameSyncCapability.InternalDispose();
+                m_frameSyncCapability = null;
+            }
+            if (m_mirrorCapability != null)
+            {
+                m_mirrorCapability.InternalDispose();
+                m_mirrorCapability = null;
+            }
+            base.Dispose();
+        }
+
+
+
 		private StateChangedEvent generationRunningChanged;
 		private StateChangedEvent newDataAvailable;
+        protected AlternativeViewpointCapability m_alternativeViewpointCapability;
+        protected FrameSyncCapability m_frameSyncCapability;
+        protected MirrorCapability m_mirrorCapability;
 	}
 
 }
\ No newline at end of file
diff --git a/Wrappers/OpenNI.net/GestureGenerator.cs b/Wrappers/OpenNI.net/GestureGenerator.cs
index 9970550..4841c44 100644
--- a/Wrappers/OpenNI.net/GestureGenerator.cs
+++ b/Wrappers/OpenNI.net/GestureGenerator.cs
@@ -1,285 +1,429 @@
-using System;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-
-namespace OpenNI
-{
-	public class GestureRecognizedEventArgs : EventArgs
-	{
-		public GestureRecognizedEventArgs(string gesture, Point3D identifiedPosition, Point3D endPosition)
-		{
-			this.gesture = gesture;
-			this.identifiedPosition = identifiedPosition;
-			this.endPosition = endPosition;
-		}
-
-		public string Gesture
-		{
-			get { return gesture; }
-			set { gesture = value; }
-		}
-		public Point3D IdentifiedPosition
-		{
-			get { return identifiedPosition; }
-			set { identifiedPosition = value; }
-		}
-		public Point3D EndPosition
-		{
-			get { return endPosition; }
-			set { endPosition = value; }
-		}
-
-		private string gesture;
-		private Point3D identifiedPosition;
-		private Point3D endPosition;
-	}
-
-	public class GestureProgressEventArgs : EventArgs
-	{
-		public GestureProgressEventArgs(string gesture, Point3D position, float progress)
-		{
-			this.gesture = gesture;
-			this.position = position;
-			this.progress = progress;
-		}
-
-		public string Gesture
-		{
-			get { return gesture; }
-			set { gesture = value; }
-		}
-		public Point3D Position
-		{
-			get { return position; }
-			set { position = value; }
-		}
-		public float Progress
-		{
-			get { return progress; }
-			set { progress = value; }
-		}
-
-		private string gesture;
-		private Point3D position;
-		private float progress;
-	}
-
-    public class GestureGenerator : Generator
-    {
-		internal GestureGenerator(Context context, IntPtr nodeHandle, bool addRef)
-			: base(context, nodeHandle, addRef)
-        {
-            this.gestureChanged = new StateChangedEvent(this,
-                SafeNativeMethods.xnRegisterToGestureChange,
-                SafeNativeMethods.xnUnregisterFromGestureChange);
-
-            this.internalGestureRecognized = new SafeNativeMethods.XnGestureRecognized(this.InternalGestureRecognized);
-            this.internalGestureProgress = new SafeNativeMethods.XnGestureProgress(this.InternalGestureProgress);
-        }
-
-        public GestureGenerator(Context context, Query query, EnumerationErrors errors) :
-			this(context, Create(context, query, errors), false)
-        {
-        }
-
-        public GestureGenerator(Context context, Query query)
-            : this(context, query, null)
-        {
-        }
-
-        public GestureGenerator(Context context)
-            : this(context, null, null)
-        {
-        }
-
-        private static IntPtr Create(Context context, Query query, EnumerationErrors errors)
-        {
-            IntPtr handle;
-            int status =
-                SafeNativeMethods.xnCreateGestureGenerator(context.InternalObject,
-                                                        out handle,
-                                                        query == null ? IntPtr.Zero : query.InternalObject,
-                                                        errors == null ? IntPtr.Zero : errors.InternalObject);
-            WrapperUtils.ThrowOnError(status);
-            return handle;
-        }
-
-        public void AddGesture(string gesture, BoundingBox3D area)
-        {
-			int status = SafeNativeMethods.xnAddGesture(InternalObject, gesture, ref area);
-            WrapperUtils.ThrowOnError(status);
-        }
-
-		public void AddGesture(string gesture)
-		{
-			int status = SafeNativeMethods.xnAddGesture(InternalObject, gesture, IntPtr.Zero);
-			WrapperUtils.ThrowOnError(status);
-		}
-
-		public void RemoveGesture(string gesture)
-        {
-			int status = SafeNativeMethods.xnRemoveGesture(InternalObject, gesture);
-            WrapperUtils.ThrowOnError(status);
-        }
-
-        public string[] GetAllActiveGestures()
-        {
-            ushort count = 20;
-            IntPtr[] arr = new IntPtr[count];
-            const int nameSize = 80;
-            string[] poses;
-
-            try
-            {
-                for (int i = 0; i < count; ++i)
-                {
-                    arr[i] = Marshal.AllocHGlobal(nameSize);
-                }
-
-                int status = SafeNativeMethods.xnGetAllActiveGestures(this.InternalObject, arr, nameSize, ref count);
-                WrapperUtils.ThrowOnError(status);
-
-                poses = new string[count];
-                for (int i = 0; i < count; ++i)
-                {
-                    poses[i] = Marshal.PtrToStringAnsi(arr[i]);
-                }
-            }
-            finally
-            {
-                for (int i = 0; i < count; ++i)
-                {
-                    if (arr[i] != IntPtr.Zero)
-                        Marshal.FreeHGlobal(arr[i]);
-                }
-            }
-
-            return poses;
-        }
-
-        public string[] EnumerateAllGestures()
-        {
-            ushort count = 20;
-            IntPtr[] arr = new IntPtr[count];
-            const int nameSize = 80;
-            string[] poses;
-
-            try
-            {
-                for (int i = 0; i < count; ++i)
-                {
-                    arr[i] = Marshal.AllocHGlobal(nameSize);
-                }
-
-                int status = SafeNativeMethods.xnEnumerateAllGestures(this.InternalObject, arr, nameSize, ref count);
-                WrapperUtils.ThrowOnError(status);
-
-                poses = new string[count];
-                for (int i = 0; i < count; ++i)
-                {
-                    poses[i] = Marshal.PtrToStringAnsi(arr[i]);
-                }
-            }
-            finally
-            {
-                for (int i = 0; i < count; ++i)
-                {
-                    if (arr[i] != IntPtr.Zero)
-                        Marshal.FreeHGlobal(arr[i]);
-                }
-            }
-
-            return poses;
-        }
-
-		public bool IsGestureAvailable(string gesture)
-        {
-			return SafeNativeMethods.xnIsGestureAvailable(InternalObject, gesture);
-        }
-
-		public bool IsGestureProgressSupported(string gesture)
-        {
-			return SafeNativeMethods.xnIsGestureProgressSupported(InternalObject, gesture);
-        }
-
-		public event EventHandler GestureChanged
-        {
-            add
-            {
-                gestureChanged.Event += value;
-            }
-            remove
-            {
-                gestureChanged.Event -= value;
-            }
-        }
-
-        private StateChangedEvent gestureChanged;
-
-        #region Gesture Recognized
-        private event EventHandler<GestureRecognizedEventArgs> gestureRecognizedEvent;
-		public event EventHandler<GestureRecognizedEventArgs> GestureRecognized
-        {
-            add
-            {
-                if (this.gestureRecognizedEvent == null)
-                {
-                    int status = SafeNativeMethods.xnRegisterGestureCallbacks(this.InternalObject, this.internalGestureRecognized, null, IntPtr.Zero, out gestureRecognizedHandle);
-                    WrapperUtils.ThrowOnError(status);
-                }
-                this.gestureRecognizedEvent += value;
-            }
-            remove
-            {
-                this.gestureRecognizedEvent -= value;
-
-                if (this.gestureRecognizedEvent == null)
-                {
-                    SafeNativeMethods.xnUnregisterGestureCallbacks(this.InternalObject, this.gestureRecognizedHandle);
-                }
-            }
-        }
-        private void InternalGestureRecognized(IntPtr hNode, string strGesture, ref Point3D idPosition, ref Point3D endPosition, IntPtr pCookie)
-        {
-			EventHandler<GestureRecognizedEventArgs> handlers = this.gestureRecognizedEvent;
-			if (handlers != null)
-				handlers(this, new GestureRecognizedEventArgs(strGesture, idPosition, endPosition));
-        }
-        private SafeNativeMethods.XnGestureRecognized internalGestureRecognized;
-        private IntPtr gestureRecognizedHandle;
-        #endregion
-
-        #region Gesture Progress
-		private event EventHandler<GestureProgressEventArgs> gestureProgressEvent;
-		public event EventHandler<GestureProgressEventArgs> GestureProgress
-        {
-            add
-            {
-                if (this.gestureProgressEvent == null)
-                {
-                    int status = SafeNativeMethods.xnRegisterGestureCallbacks(this.InternalObject, null, this.internalGestureProgress, IntPtr.Zero, out gestureProgressHandle);
-                    WrapperUtils.ThrowOnError(status);
-                }
-                this.gestureProgressEvent += value;
-            }
-            remove
-            {
-                this.gestureProgressEvent -= value;
-
-                if (this.gestureProgressEvent == null)
-                {
-                    SafeNativeMethods.xnUnregisterGestureCallbacks(this.InternalObject, this.gestureProgressHandle);
-                }
-            }
-        }
-        private void InternalGestureProgress(IntPtr hNode, string strGesture, ref Point3D position, float progress, IntPtr pCookie)
-        {
-			EventHandler<GestureProgressEventArgs> handlers = this.gestureProgressEvent;
-			if (handlers != null)
-				handlers(this, new GestureProgressEventArgs(strGesture, position, progress));
-        }
-        private SafeNativeMethods.XnGestureProgress internalGestureProgress;
-        private IntPtr gestureProgressHandle;
-        #endregion
-    }
-}
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace OpenNI
+{
+	public class GestureRecognizedEventArgs : EventArgs
+	{
+		public GestureRecognizedEventArgs(string gesture, Point3D identifiedPosition, Point3D endPosition)
+		{
+			this.gesture = gesture;
+			this.identifiedPosition = identifiedPosition;
+			this.endPosition = endPosition;
+		}
+
+		public string Gesture
+		{
+			get { return gesture; }
+			set { gesture = value; }
+		}
+		public Point3D IdentifiedPosition
+		{
+			get { return identifiedPosition; }
+			set { identifiedPosition = value; }
+		}
+		public Point3D EndPosition
+		{
+			get { return endPosition; }
+			set { endPosition = value; }
+		}
+
+		private string gesture;
+		private Point3D identifiedPosition;
+		private Point3D endPosition;
+	}
+
+	public class GestureProgressEventArgs : EventArgs
+	{
+		public GestureProgressEventArgs(string gesture, Point3D position, float progress)
+		{
+			this.gesture = gesture;
+			this.position = position;
+			this.progress = progress;
+		}
+
+		public string Gesture
+		{
+			get { return gesture; }
+			set { gesture = value; }
+		}
+		public Point3D Position
+		{
+			get { return position; }
+			set { position = value; }
+		}
+		public float Progress
+		{
+			get { return progress; }
+			set { progress = value; }
+		}
+
+		private string gesture;
+		private Point3D position;
+		private float progress;
+	}
+
+    public class GestureIntermediateStageCompletedEventArgs : EventArgs
+    {
+        public GestureIntermediateStageCompletedEventArgs(string gesture, Point3D position)
+        {
+            this.gesture = gesture;
+            this.position = position;
+        }
+
+        public string Gesture
+        {
+            get { return gesture; }
+            set { gesture = value; }
+        }
+        public Point3D Position
+        {
+            get { return position; }
+            set { position = value; }
+        }
+
+        private string gesture;
+        private Point3D position;
+    }
+
+    public class GestureReadyForNextIntermediateStageEventArgs : EventArgs
+    {
+        public GestureReadyForNextIntermediateStageEventArgs(string gesture, Point3D position)
+        {
+            this.gesture = gesture;
+            this.position = position;
+        }
+
+        public string Gesture
+        {
+            get { return gesture; }
+            set { gesture = value; }
+        }
+        public Point3D Position
+        {
+            get { return position; }
+            set { position = value; }
+        }
+
+        private string gesture;
+        private Point3D position;
+    }
+
+    public class GestureGenerator : Generator
+    {
+		internal GestureGenerator(Context context, IntPtr nodeHandle, bool addRef)
+			: base(context, nodeHandle, addRef)
+        {
+            this.gestureChanged = new StateChangedEvent(this,
+                SafeNativeMethods.xnRegisterToGestureChange,
+                SafeNativeMethods.xnUnregisterFromGestureChange);
+
+            this.internalGestureRecognized = new SafeNativeMethods.XnGestureRecognized(this.InternalGestureRecognized);
+            this.internalGestureProgress = new SafeNativeMethods.XnGestureProgress(this.InternalGestureProgress);
+            this.internalGestureIntermediateStageCompleted = new SafeNativeMethods.XnGestureIntermediateStageCompleted(this.InternalGestureIntermediateStageCompleted);
+            this.internalGestureReadyForNextIntermediateStage = new SafeNativeMethods.XnGestureReadyForNextIntermediateStage(this.InternalGestureReadyForNextIntermediateStage);
+        }
+
+        public GestureGenerator(Context context, Query query, EnumerationErrors errors) :
+			this(context, Create(context, query, errors), false)
+        {
+        }
+
+        public GestureGenerator(Context context, Query query)
+            : this(context, query, null)
+        {
+        }
+
+        public GestureGenerator(Context context)
+            : this(context, null, null)
+        {
+        }
+
+        private static IntPtr Create(Context context, Query query, EnumerationErrors errors)
+        {
+            IntPtr handle;
+            int status =
+                SafeNativeMethods.xnCreateGestureGenerator(context.InternalObject,
+                                                        out handle,
+                                                        query == null ? IntPtr.Zero : query.InternalObject,
+                                                        errors == null ? IntPtr.Zero : errors.InternalObject);
+            WrapperUtils.ThrowOnError(status);
+            return handle;
+        }
+
+        public void AddGesture(string gesture, BoundingBox3D area)
+        {
+			int status = SafeNativeMethods.xnAddGesture(InternalObject, gesture, ref area);
+            WrapperUtils.ThrowOnError(status);
+        }
+
+		public void AddGesture(string gesture)
+		{
+			int status = SafeNativeMethods.xnAddGesture(InternalObject, gesture, IntPtr.Zero);
+			WrapperUtils.ThrowOnError(status);
+		}
+
+		public void RemoveGesture(string gesture)
+        {
+			int status = SafeNativeMethods.xnRemoveGesture(InternalObject, gesture);
+            WrapperUtils.ThrowOnError(status);
+        }
+
+        public string[] GetAllActiveGestures()
+        {
+            ushort count = 20;
+            IntPtr[] arr = new IntPtr[count];
+            const int nameSize = 80;
+            string[] poses;
+
+            try
+            {
+                for (int i = 0; i < count; ++i)
+                {
+                    arr[i] = Marshal.AllocHGlobal(nameSize);
+                }
+
+                int status = SafeNativeMethods.xnGetAllActiveGestures(this.InternalObject, arr, nameSize, ref count);
+                WrapperUtils.ThrowOnError(status);
+
+                poses = new string[count];
+                for (int i = 0; i < count; ++i)
+                {
+                    poses[i] = Marshal.PtrToStringAnsi(arr[i]);
+                }
+            }
+            finally
+            {
+                for (int i = 0; i < count; ++i)
+                {
+                    if (arr[i] != IntPtr.Zero)
+                        Marshal.FreeHGlobal(arr[i]);
+                }
+            }
+
+            return poses;
+        }
+
+        public string[] EnumerateAllGestures()
+        {
+            ushort count = 20;
+            IntPtr[] arr = new IntPtr[count];
+            const int nameSize = 80;
+            string[] poses;
+
+            try
+            {
+                for (int i = 0; i < count; ++i)
+                {
+                    arr[i] = Marshal.AllocHGlobal(nameSize);
+                }
+
+                int status = SafeNativeMethods.xnEnumerateAllGestures(this.InternalObject, arr, nameSize, ref count);
+                WrapperUtils.ThrowOnError(status);
+
+                poses = new string[count];
+                for (int i = 0; i < count; ++i)
+                {
+                    poses[i] = Marshal.PtrToStringAnsi(arr[i]);
+                }
+            }
+            finally
+            {
+                for (int i = 0; i < count; ++i)
+                {
+                    if (arr[i] != IntPtr.Zero)
+                        Marshal.FreeHGlobal(arr[i]);
+                }
+            }
+
+            return poses;
+        }
+
+        public int NumberOfEnumeratedGestures
+        {
+            get
+            {
+                return (Int32)SafeNativeMethods.xnGetNumberOfAvailableGestures(this.InternalObject);
+            }
+            
+        }
+
+		public bool IsGestureAvailable(string gesture)
+        {
+			return SafeNativeMethods.xnIsGestureAvailable(InternalObject, gesture);
+        }
+
+		public bool IsGestureProgressSupported(string gesture)
+        {
+			return SafeNativeMethods.xnIsGestureProgressSupported(InternalObject, gesture);
+        }
+
+		public event EventHandler GestureChanged
+        {
+            add
+            {
+                gestureChanged.Event += value;
+            }
+            remove
+            {
+                gestureChanged.Event -= value;
+            }
+        }
+
+        private StateChangedEvent gestureChanged;
+
+        #region Gesture Recognized
+        private event EventHandler<GestureRecognizedEventArgs> gestureRecognizedEvent;
+		public event EventHandler<GestureRecognizedEventArgs> GestureRecognized
+        {
+            add
+            {
+                if (this.gestureRecognizedEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterGestureCallbacks(this.InternalObject, this.internalGestureRecognized, null, IntPtr.Zero, out gestureRecognizedHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.gestureRecognizedEvent += value;
+            }
+            remove
+            {
+                this.gestureRecognizedEvent -= value;
+
+                if (this.gestureRecognizedEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterGestureCallbacks(this.InternalObject, this.gestureRecognizedHandle);
+                }
+            }
+        }
+        private void InternalGestureRecognized(IntPtr hNode, string strGesture, ref Point3D idPosition, ref Point3D endPosition, IntPtr pCookie)
+        {
+			EventHandler<GestureRecognizedEventArgs> handlers = this.gestureRecognizedEvent;
+			if (handlers != null)
+				handlers(this, new GestureRecognizedEventArgs(strGesture, idPosition, endPosition));
+        }
+        private SafeNativeMethods.XnGestureRecognized internalGestureRecognized;
+        private IntPtr gestureRecognizedHandle;
+        #endregion
+
+        #region Gesture Progress
+		private event EventHandler<GestureProgressEventArgs> gestureProgressEvent;
+		public event EventHandler<GestureProgressEventArgs> GestureProgress
+        {
+            add
+            {
+                if (this.gestureProgressEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterGestureCallbacks(this.InternalObject, null, this.internalGestureProgress, IntPtr.Zero, out gestureProgressHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.gestureProgressEvent += value;
+            }
+            remove
+            {
+                this.gestureProgressEvent -= value;
+
+                if (this.gestureProgressEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterGestureCallbacks(this.InternalObject, this.gestureProgressHandle);
+                }
+            }
+        }
+        private void InternalGestureProgress(IntPtr hNode, string strGesture, ref Point3D position, float progress, IntPtr pCookie)
+        {
+			EventHandler<GestureProgressEventArgs> handlers = this.gestureProgressEvent;
+			if (handlers != null)
+				handlers(this, new GestureProgressEventArgs(strGesture, position, progress));
+        }
+        private SafeNativeMethods.XnGestureProgress internalGestureProgress;
+        private IntPtr gestureProgressHandle;
+        #endregion
+
+        #region Gesture intermediate stage completed
+        private event EventHandler<GestureIntermediateStageCompletedEventArgs> gestureIntermediateStageCompletedEvent;
+        public event EventHandler<GestureIntermediateStageCompletedEventArgs> GestureIntermediateStageCompleted
+        {
+            add
+            {
+                if (this.gestureIntermediateStageCompletedEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterToGestureIntermediateStageCompleted(this.InternalObject, this.internalGestureIntermediateStageCompleted, IntPtr.Zero, out gestureIntermediateStageCompletedHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.gestureIntermediateStageCompletedEvent += value;
+            }
+            remove
+            {
+                this.gestureIntermediateStageCompletedEvent -= value;
+
+                if (this.gestureIntermediateStageCompletedEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterFromGestureIntermediateStageCompleted(this.InternalObject, this.gestureIntermediateStageCompletedHandle);
+                }
+            }
+        }
+        private void InternalGestureIntermediateStageCompleted(IntPtr hNode, string strGesture, ref Point3D position, IntPtr pCookie)
+        {
+            EventHandler<GestureIntermediateStageCompletedEventArgs> handlers = this.gestureIntermediateStageCompletedEvent;
+            if (handlers != null)
+                handlers(this, new GestureIntermediateStageCompletedEventArgs(strGesture, position));
+        }
+        private SafeNativeMethods.XnGestureIntermediateStageCompleted internalGestureIntermediateStageCompleted;
+        private IntPtr gestureIntermediateStageCompletedHandle;
+        #endregion
+
+        #region Gesture Ready for Next Intermediate Stage
+        private event EventHandler<GestureReadyForNextIntermediateStageEventArgs> gestureReadyForNextIntermediateStageEvent;
+        public event EventHandler<GestureReadyForNextIntermediateStageEventArgs> GestureReadyForNextIntermediateStage
+        {
+            add
+            {
+                if (this.gestureReadyForNextIntermediateStageEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterToGestureReadyForNextIntermediateStage(this.InternalObject, this.internalGestureReadyForNextIntermediateStage, IntPtr.Zero, out gestureReadyForNextIntermediateStageHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.gestureReadyForNextIntermediateStageEvent += value;
+            }
+            remove
+            {
+                this.gestureReadyForNextIntermediateStageEvent -= value;
+
+                if (this.gestureReadyForNextIntermediateStageEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterFromGestureReadyForNextIntermediateStage(this.InternalObject, this.gestureReadyForNextIntermediateStageHandle);
+                }
+            }
+        }
+        private void InternalGestureReadyForNextIntermediateStage(IntPtr hNode, string strGesture, ref Point3D position, IntPtr pCookie)
+        {
+            EventHandler<GestureReadyForNextIntermediateStageEventArgs> handlers = this.gestureReadyForNextIntermediateStageEvent;
+            if (handlers != null)
+                handlers(this, new GestureReadyForNextIntermediateStageEventArgs(strGesture, position));
+        }
+        private SafeNativeMethods.XnGestureReadyForNextIntermediateStage internalGestureReadyForNextIntermediateStage;
+        private IntPtr gestureReadyForNextIntermediateStageHandle;
+        #endregion
+    }
+}
diff --git a/Wrappers/OpenNI.net/HandTouchingFOVEdgeCapability.cs b/Wrappers/OpenNI.net/HandTouchingFOVEdgeCapability.cs
new file mode 100644
index 0000000..affd0fc
--- /dev/null
+++ b/Wrappers/OpenNI.net/HandTouchingFOVEdgeCapability.cs
@@ -0,0 +1,109 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System;
+using System.Text;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using UserID = System.Int32;
+
+namespace OpenNI
+{
+    public class HandTouchingFOVEdgeEventArgs : EventArgs
+    {
+        public HandTouchingFOVEdgeEventArgs(UserID id, Point3D position, float time, Direction dir)
+        {
+            this.id = id;
+            this.position = position;
+            this.time = time;
+            this.dir = dir;
+        }
+
+        public UserID UserID
+        {
+            get { return id; }
+            set { id = value; }
+        }
+
+        public OpenNI.Point3D Position
+        {
+            get { return position; }
+            set { position = value; }
+        }
+
+        public float Time
+        {
+            get { return time; }
+            set { time = value; }
+        }
+        public Direction Direction
+        {
+            get { return dir; }
+            set { dir = value; }
+        }
+
+        private UserID id;
+        private Point3D position;
+        private float time;
+        private Direction dir;
+    }
+
+    public class HandTouchingFOVEdgeCapability : Capability
+    {
+        internal HandTouchingFOVEdgeCapability(ProductionNode node)
+            : base(node)
+        {
+            this.internalHandTouchingFOVEdge = new SafeNativeMethods.XnHandTouchingFOVEdge(this.InternalHandTouchingFOVEdge);
+        }
+        #region Hand Touching FOV
+        private event EventHandler<HandTouchingFOVEdgeEventArgs> handTouchingFOVEdgeEvent;
+        public event EventHandler<HandTouchingFOVEdgeEventArgs> HandTouchingFOVEdge
+        {
+            add
+            {
+                if (this.handTouchingFOVEdgeEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterToHandTouchingFOVEdge(this.InternalObject, this.internalHandTouchingFOVEdge, IntPtr.Zero, out handTouchingFOVEdgeHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.handTouchingFOVEdgeEvent += value;
+            }
+            remove
+            {
+                this.handTouchingFOVEdgeEvent -= value;
+
+                if (this.handTouchingFOVEdgeEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterFromHandTouchingFOVEdge(this.InternalObject, this.handTouchingFOVEdgeHandle);
+                }
+            }
+        }
+        private void InternalHandTouchingFOVEdge(IntPtr hNode, UserID id, ref Point3D position, float fTime, Direction dir, IntPtr pCookie)
+        {
+            EventHandler<HandTouchingFOVEdgeEventArgs> handlers = this.handTouchingFOVEdgeEvent;
+            if (handlers != null)
+                handlers(this, new HandTouchingFOVEdgeEventArgs(id, position, fTime, dir));
+        }
+        private SafeNativeMethods.XnHandTouchingFOVEdge internalHandTouchingFOVEdge;
+        private IntPtr handTouchingFOVEdgeHandle;
+        #endregion
+    }
+}
diff --git a/Wrappers/OpenNI.net/HandsGenerator.cs b/Wrappers/OpenNI.net/HandsGenerator.cs
index f52ecb5..11a0417 100644
--- a/Wrappers/OpenNI.net/HandsGenerator.cs
+++ b/Wrappers/OpenNI.net/HandsGenerator.cs
@@ -1,4 +1,25 @@
-using System;
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using UserID = System.Int32;
@@ -101,6 +122,10 @@ namespace OpenNI
             this.internalHandCreate = new SafeNativeMethods.XnHandCreate(this.InternalHandCreate);
             this.internalHandUpdate = new SafeNativeMethods.XnHandUpdate(this.InternalHandUpdate);
             this.internalHandDestroy = new SafeNativeMethods.XnHandDestroy(this.InternalHandDestroy);
+            if (IsCapabilitySupported(Capabilities.HandTouchingFOVEdge))
+                m_HandTouchingFOVEdgeCapability = new HandTouchingFOVEdgeCapability(this);
+            else
+                m_HandTouchingFOVEdgeCapability = null;
         }
 
         public HandsGenerator(Context context, Query query, EnumerationErrors errors) :
@@ -152,6 +177,22 @@ namespace OpenNI
             WrapperUtils.ThrowOnError(status);
         }
 
+        public HandTouchingFOVEdgeCapability HandTouchingFOVEdgeCapability
+        {
+            get { return m_HandTouchingFOVEdgeCapability; }
+        }
+
+        public override void Dispose()
+        {
+            if (m_HandTouchingFOVEdgeCapability != null)
+            {
+                m_HandTouchingFOVEdgeCapability.InternalDispose();
+                m_HandTouchingFOVEdgeCapability = null;
+            }
+            base.Dispose();
+        }
+        protected HandTouchingFOVEdgeCapability m_HandTouchingFOVEdgeCapability;
+
         #region Hand Create
         private event EventHandler<HandCreateEventArgs> handCreateEvent;
 		public event EventHandler<HandCreateEventArgs> HandCreate
@@ -250,6 +291,5 @@ namespace OpenNI
         private SafeNativeMethods.XnHandDestroy internalHandDestroy;
         private IntPtr handDestroyHandle;
         #endregion
-
     }
 }
diff --git a/Wrappers/OpenNI.net/IMapData.cs b/Wrappers/OpenNI.net/IMapData.cs
index ec9f98e..3fd26f0 100644
--- a/Wrappers/OpenNI.net/IMapData.cs
+++ b/Wrappers/OpenNI.net/IMapData.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 
 namespace OpenNI
diff --git a/Wrappers/OpenNI.net/IRGenerator.cs b/Wrappers/OpenNI.net/IRGenerator.cs
index 4307f8e..e96f5ac 100644
--- a/Wrappers/OpenNI.net/IRGenerator.cs
+++ b/Wrappers/OpenNI.net/IRGenerator.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/IRMetaData.cs b/Wrappers/OpenNI.net/IRMetaData.cs
index 33a937e..ccc94fa 100644
--- a/Wrappers/OpenNI.net/IRMetaData.cs
+++ b/Wrappers/OpenNI.net/IRMetaData.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/ImageGenerator.cs b/Wrappers/OpenNI.net/ImageGenerator.cs
index 001a250..8b8aa25 100644
--- a/Wrappers/OpenNI.net/ImageGenerator.cs
+++ b/Wrappers/OpenNI.net/ImageGenerator.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/ImageMetaData.cs b/Wrappers/OpenNI.net/ImageMetaData.cs
index 91ee6a8..50d4b50 100644
--- a/Wrappers/OpenNI.net/ImageMetaData.cs
+++ b/Wrappers/OpenNI.net/ImageMetaData.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/Log.cs b/Wrappers/OpenNI.net/Log.cs
index 65ef9f9..159e875 100644
--- a/Wrappers/OpenNI.net/Log.cs
+++ b/Wrappers/OpenNI.net/Log.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/MapData.cs b/Wrappers/OpenNI.net/MapData.cs
index 3dffc3e..c4d9570 100644
--- a/Wrappers/OpenNI.net/MapData.cs
+++ b/Wrappers/OpenNI.net/MapData.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/MapGenerator.cs b/Wrappers/OpenNI.net/MapGenerator.cs
index c8689a5..98891ac 100644
--- a/Wrappers/OpenNI.net/MapGenerator.cs
+++ b/Wrappers/OpenNI.net/MapGenerator.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
@@ -12,6 +33,82 @@ namespace OpenNI
 			this.mapOutputModeChanged = new StateChangedEvent(this,
 				SafeNativeMethods.xnRegisterToMapOutputModeChange,
 				SafeNativeMethods.xnUnregisterFromMapOutputModeChange);
+            if(IsCapabilitySupported(Capabilities.AntiFlicker))
+                m_antiFlickerCapability = new AntiFlickerCapability(this);
+            else
+                m_antiFlickerCapability = null;
+            if (IsCapabilitySupported(Capabilities.Cropping))
+                m_croppingCapablity = new CroppingCapability(this);
+            else
+                m_croppingCapablity = null;
+            if (IsCapabilitySupported(Capabilities.Brightness))
+                m_brightnessCapability = new GeneralIntCapability(this, Capabilities.Brightness);
+            else
+                m_brightnessCapability = null;
+            if (IsCapabilitySupported(Capabilities.Contrast))
+                m_contractCapability = new GeneralIntCapability(this, Capabilities.Contrast);
+            else
+                m_contractCapability = null;
+            if (IsCapabilitySupported(Capabilities.Saturation))
+                m_saturationCapability = new GeneralIntCapability(this, Capabilities.Saturation);
+            else
+                m_saturationCapability = null;
+            if (IsCapabilitySupported(Capabilities.Hue))
+                m_heuCapability = new GeneralIntCapability(this, Capabilities.Hue);
+            else
+                m_heuCapability = null;
+            if (IsCapabilitySupported(Capabilities.Sharpness))
+                m_sharpnessCapability = new GeneralIntCapability(this, Capabilities.Sharpness);
+            else
+                m_sharpnessCapability = null;
+            if (IsCapabilitySupported(Capabilities.Gamma))
+                m_gammaCapability = new GeneralIntCapability(this, Capabilities.Gamma);
+            else
+                m_gammaCapability = null;
+            if (IsCapabilitySupported(Capabilities.WhiteBalance))
+                m_whiteBalanceCapability = new GeneralIntCapability(this, Capabilities.WhiteBalance);
+            else
+                m_whiteBalanceCapability = null;
+            if (IsCapabilitySupported(Capabilities.BacklightCompensation))
+                m_backlightCompensationCapability = new GeneralIntCapability(this, Capabilities.BacklightCompensation);
+            else
+                m_backlightCompensationCapability = null;
+            if (IsCapabilitySupported(Capabilities.Gain))
+                m_gainCapability = new GeneralIntCapability(this, Capabilities.Gain);
+            else
+                m_gainCapability = null;
+            if (IsCapabilitySupported(Capabilities.Pan))
+                m_panCapability = new GeneralIntCapability(this, Capabilities.Pan);
+            else
+                m_panCapability = null;
+            if (IsCapabilitySupported(Capabilities.Tilt))
+                m_tiltCapability = new GeneralIntCapability(this, Capabilities.Tilt);
+            else
+                m_tiltCapability = null;
+            if (IsCapabilitySupported(Capabilities.Roll))
+                m_rollCapability = new GeneralIntCapability(this, Capabilities.Roll);
+            else
+                m_rollCapability = null;
+            if (IsCapabilitySupported(Capabilities.Zoom))
+                m_zoomCapability = new GeneralIntCapability(this, Capabilities.Zoom);
+            else
+                m_zoomCapability = null;
+            if (IsCapabilitySupported(Capabilities.Exposure))
+                m_exposureCapability = new GeneralIntCapability(this, Capabilities.Exposure);
+            else
+                m_exposureCapability = null;
+            if (IsCapabilitySupported(Capabilities.Iris))
+                m_irisCapability = new GeneralIntCapability(this, Capabilities.Iris);
+            else
+                m_irisCapability = null;
+            if (IsCapabilitySupported(Capabilities.Focus))
+                m_focusCapability = new GeneralIntCapability(this, Capabilities.Focus);
+            else
+                m_focusCapability = null;
+            if (IsCapabilitySupported(Capabilities.LowLightCompensation))
+                m_lowLightCompensationCapability = new GeneralIntCapability(this, Capabilities.LowLightCompensation);
+            else
+                m_lowLightCompensationCapability = null;
 		}
 
 		public MapOutputMode[] GetSupportedMapOutputModes()
@@ -45,156 +142,110 @@ namespace OpenNI
 			remove { this.mapOutputModeChanged.Event -= value; }
 		}
 
+        public int BytesPerPixel
+        {
+            get
+            {
+                return (int)SafeNativeMethods.xnGetBytesPerPixel(this.InternalObject);
+            }
+        }
+
 		public CroppingCapability CroppingCapability
 		{
-			get
-			{
-				return new CroppingCapability(this);
-			}
+			get { return m_croppingCapablity; }
 		}
 
+        
 		public GeneralIntCapability BrightnessCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Brightness);
-			}
+			get	{ return m_brightnessCapability;}
 		}
 
 		public GeneralIntCapability ContrastCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Contrast);
-			}
+			get { return m_contractCapability; }
 		}
 
 		public GeneralIntCapability SaturationCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Saturation);
-			}
+			get	{ return m_saturationCapability;}
 		}
 
 		public GeneralIntCapability HueCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Hue);
-			}
+			get	{ return m_heuCapability; }
 		}
 
+
 		public GeneralIntCapability SharpnessCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Sharpness);
-			}
+			get	{ return m_sharpnessCapability;	}
 		}
 
 		public GeneralIntCapability GammaCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Gamma);
-			}
+			get	{ return m_gammaCapability;	}
 		}
 
 		public GeneralIntCapability WhiteBalanceCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.WhiteBalance);
-			}
+			get	{ return m_whiteBalanceCapability; }
 		}
 
 		public GeneralIntCapability BacklightCompensationCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.BacklightCompensation);
-			}
+			get	{ return m_backlightCompensationCapability; }
 		}
 
 		public GeneralIntCapability GainCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Gain);
-			}
+			get	{ return m_gainCapability; }
 		}
 
 		public GeneralIntCapability PanCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Pan);
-			}
+			get { return m_panCapability; }
 		}
 
 		public GeneralIntCapability TiltCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Tilt);
-			}
+			get	{ return m_tiltCapability; }
 		}
 
 		public GeneralIntCapability RollCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Roll);
-			}
+			get { return m_rollCapability; }
 		}
 
 		public GeneralIntCapability ZoomCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Zoom);
-			}
+			get	{ return m_zoomCapability; }
 		}
 
-		public GeneralIntCapability ExposureCapability
+
+        public GeneralIntCapability ExposureCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Exposure);
-			}
+			get	{ return m_exposureCapability;	}
 		}
 
 		public GeneralIntCapability IrisCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Iris);
-			}
+			get { return m_irisCapability; }
 		}
 
 		public GeneralIntCapability FocusCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.Focus);
-			}
+			get	{ return m_focusCapability;	}
 		}
 
 		public GeneralIntCapability LowLightCompensationCapability
 		{
-			get
-			{
-				return new GeneralIntCapability(this, Capabilities.LowLightCompensation);
-			}
+			get	{ return m_lowLightCompensationCapability;	}
 		}
 
 		public AntiFlickerCapability AntiFlickerCapability
 		{
-			get
-			{
-				return new AntiFlickerCapability(this);
-			}
+			get { return m_antiFlickerCapability; }
 		}
 
 		protected MapData<T> GetMapData<T>(IntPtr dataBuff)
@@ -203,6 +254,127 @@ namespace OpenNI
 			return new MapData<T>(mode.XRes, mode.YRes, dataBuff);
 		}
 
+        ///  @todo this is a temporary solution for capability not being disposed by anyone external
+        public override void Dispose()
+        {
+            if (m_antiFlickerCapability != null)
+            {
+                m_antiFlickerCapability.InternalDispose();
+                m_antiFlickerCapability = null;
+            }
+            if (m_croppingCapablity != null)
+            {
+                m_croppingCapablity.InternalDispose();
+                m_croppingCapablity = null;
+            }
+            if (m_brightnessCapability!=null)
+            {
+                m_brightnessCapability.InternalDispose();
+                m_brightnessCapability=null;
+            }
+            if (m_contractCapability != null)
+            {
+                m_contractCapability.InternalDispose();
+                m_contractCapability = null;
+            }
+            if (m_saturationCapability != null)
+            {
+                m_saturationCapability.InternalDispose();
+                m_saturationCapability = null;
+            }
+            if (m_heuCapability != null)
+            {
+                m_heuCapability.InternalDispose();
+                m_heuCapability = null;
+            }
+            if (m_sharpnessCapability != null)
+            {
+                m_sharpnessCapability.InternalDispose();
+                m_sharpnessCapability = null;
+            }
+            if (m_gammaCapability != null)
+            {
+                m_gammaCapability.InternalDispose();
+                m_gammaCapability = null;
+            }
+            if (m_whiteBalanceCapability != null)
+            {
+                m_whiteBalanceCapability.InternalDispose();
+                m_whiteBalanceCapability = null;
+            }
+            if (m_backlightCompensationCapability != null)
+            {
+                m_backlightCompensationCapability.InternalDispose();
+                m_backlightCompensationCapability = null;
+            }
+            if (m_gainCapability != null)
+            {
+                m_gainCapability.InternalDispose();
+                m_gainCapability = null;
+            }
+            if (m_panCapability != null)
+            {
+                m_panCapability.InternalDispose();
+                m_panCapability = null;
+            }
+            if (m_tiltCapability != null)
+            {
+                m_tiltCapability.InternalDispose();
+                m_tiltCapability = null;
+            }
+            if (m_rollCapability != null)
+            {
+                m_rollCapability.InternalDispose();
+                m_rollCapability = null;
+            }
+            if (m_zoomCapability != null)
+            {
+                m_zoomCapability.InternalDispose();
+                m_zoomCapability = null;
+            }
+            if (m_exposureCapability != null)
+            {
+                m_exposureCapability.InternalDispose();
+                m_exposureCapability = null;
+            }
+            if (m_irisCapability != null)
+            {
+                m_irisCapability.InternalDispose();
+                m_irisCapability = null;
+            }
+            if (m_focusCapability != null)
+            {
+                m_focusCapability.InternalDispose();
+                m_focusCapability = null;
+            }
+            if (m_lowLightCompensationCapability != null)
+            {
+                m_lowLightCompensationCapability.InternalDispose();
+                m_lowLightCompensationCapability = null;
+            }
+            base.Dispose();
+        }
+
 		private StateChangedEvent mapOutputModeChanged;
+        protected AntiFlickerCapability m_antiFlickerCapability;
+        protected CroppingCapability m_croppingCapablity;
+
+        protected GeneralIntCapability m_brightnessCapability;
+        protected GeneralIntCapability m_contractCapability;
+        protected GeneralIntCapability m_saturationCapability; 
+        protected GeneralIntCapability m_heuCapability;
+        protected GeneralIntCapability m_sharpnessCapability;
+        protected GeneralIntCapability m_gammaCapability;
+        protected GeneralIntCapability m_whiteBalanceCapability;
+        protected GeneralIntCapability m_backlightCompensationCapability;
+        protected GeneralIntCapability m_gainCapability;
+        protected GeneralIntCapability m_panCapability;
+        protected GeneralIntCapability m_tiltCapability;
+        protected GeneralIntCapability m_rollCapability;
+        protected GeneralIntCapability m_zoomCapability;
+        protected GeneralIntCapability m_exposureCapability;
+        protected GeneralIntCapability m_irisCapability;
+        protected GeneralIntCapability m_focusCapability;
+        protected GeneralIntCapability m_lowLightCompensationCapability;
 	}
 }
\ No newline at end of file
diff --git a/Wrappers/OpenNI.net/MapMetaData.cs b/Wrappers/OpenNI.net/MapMetaData.cs
index ed47548..94aad63 100644
--- a/Wrappers/OpenNI.net/MapMetaData.cs
+++ b/Wrappers/OpenNI.net/MapMetaData.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/MirrorCapability.cs b/Wrappers/OpenNI.net/MirrorCapability.cs
index c07b81b..3e1570c 100644
--- a/Wrappers/OpenNI.net/MirrorCapability.cs
+++ b/Wrappers/OpenNI.net/MirrorCapability.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/MockAudioGenerator.cs b/Wrappers/OpenNI.net/MockAudioGenerator.cs
index 80b4627..113017d 100644
--- a/Wrappers/OpenNI.net/MockAudioGenerator.cs
+++ b/Wrappers/OpenNI.net/MockAudioGenerator.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/MockDepthGenerator.cs b/Wrappers/OpenNI.net/MockDepthGenerator.cs
index e8a58c3..c0be08d 100644
--- a/Wrappers/OpenNI.net/MockDepthGenerator.cs
+++ b/Wrappers/OpenNI.net/MockDepthGenerator.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/MockIRGenerator.cs b/Wrappers/OpenNI.net/MockIRGenerator.cs
index 8a794a2..acbef86 100644
--- a/Wrappers/OpenNI.net/MockIRGenerator.cs
+++ b/Wrappers/OpenNI.net/MockIRGenerator.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/MockImageGenerator.cs b/Wrappers/OpenNI.net/MockImageGenerator.cs
index 1e52d23..5541047 100644
--- a/Wrappers/OpenNI.net/MockImageGenerator.cs
+++ b/Wrappers/OpenNI.net/MockImageGenerator.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/NodeInfo.cs b/Wrappers/OpenNI.net/NodeInfo.cs
index 23f3f4b..45a8392 100644
--- a/Wrappers/OpenNI.net/NodeInfo.cs
+++ b/Wrappers/OpenNI.net/NodeInfo.cs
@@ -1,6 +1,28 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
+using System.Text;
 
 namespace OpenNI
 {
@@ -25,7 +47,9 @@ namespace OpenNI
 		{
 			get
 			{
-				return SafeNativeMethods.xnNodeInfoGetDescription(this.InternalObject);
+                IntPtr pDescription = SafeNativeMethods.xnNodeInfoGetDescription(this.InternalObject);
+                ProductionNodeDescription description = ProductionNodeDescription.Empty;
+                return (ProductionNodeDescription)Marshal.PtrToStructure(pDescription, typeof(ProductionNodeDescription));
 			}
 		}
 
@@ -62,14 +86,27 @@ namespace OpenNI
 		{
 			get
 			{
-				IntPtr handle = SafeNativeMethods.xnNodeInfoGetHandle(this.InternalObject);
+				IntPtr handle = SafeNativeMethods.xnNodeInfoGetRefHandle(this.InternalObject);
 				if (handle == IntPtr.Zero)
 					return null;
 				else
-					return ProductionNode.FromNative(handle);
+				{
+					ProductionNode result = ProductionNode.FromNative(handle);
+					SafeNativeMethods.xnProductionNodeRelease(handle);
+					return result;
+				}
 			}
 		}
 
+        public override string ToString()
+        {
+            const int size = 4096;
+            StringBuilder sb = new StringBuilder(size);
+            int status = SafeNativeMethods.xnNodeInfoGetTreeStringRepresentation(this.InternalObject, sb, size);
+            WrapperUtils.ThrowOnError(status);
+            return sb.ToString();
+        }
+
 		protected override void FreeObject(IntPtr ptr, bool disposing)
 		{
 			// no need to free anything
diff --git a/Wrappers/OpenNI.net/NodeInfoList.cs b/Wrappers/OpenNI.net/NodeInfoList.cs
index c21df1c..e4f32d4 100644
--- a/Wrappers/OpenNI.net/NodeInfoList.cs
+++ b/Wrappers/OpenNI.net/NodeInfoList.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/OpenNIImporter.cs b/Wrappers/OpenNI.net/OpenNIImporter.cs
index b222214..df73654 100644
--- a/Wrappers/OpenNI.net/OpenNIImporter.cs
+++ b/Wrappers/OpenNI.net/OpenNIImporter.cs
@@ -1,4 +1,25 @@
-using System;
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System;
 using System.Text;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
@@ -70,6 +91,17 @@ namespace OpenNI
 
 		/** A Codec **/
 		Codec = 12,
+
+		/** A general production node **/
+		ProductionNode = 13,
+
+		/** A general generator **/
+		Generator = 14,
+
+		/** A general map generator **/
+		MapGenerator = 15,
+
+		ScriptNode = 16,
 	}
 
 	public enum LogSeverity
@@ -178,6 +210,59 @@ namespace OpenNI
 		Hz60 = 60,
 	};
 
+    public enum Direction
+    {
+        Illegal = 0,
+        Left = 1,
+        Right = 2,
+        Up = 3,
+        Down = 4,
+        Forward = 5,
+        Backward = 6,
+    }
+
+    /** Possible statuses for pose detection */
+    public enum PoseDetectionStatus
+    {
+	    OK = 0,
+	    NoUser = 1,
+	    TopFOV = 2,
+	    SideFoV = 3,
+	    Error = 4,
+        NoTracking = 5
+    }
+
+    public enum PoseDetectionState
+    {
+        InPose = 0,
+        OutOfPose = 1,
+        Undefined = 2
+
+    }
+
+/** Possible statuses for calibration */
+    public enum CalibrationStatus
+    {
+	    OK = 0,
+	    NoUser = 1,
+	    Arm = 2,
+	    Leg = 3,
+	    Head = 4,
+	    Torso = 5,
+	    TopFOV = 6,
+	    SideFoV = 7,
+	    Pose = 8,
+        ManualAbort = 9,
+        ManualReset = 10,
+        Timeout = 11
+    }
+
+    public enum SkeletonPostProcessing
+    {
+    	None	= 0,
+    	All		= 1,
+    }
+
 	public static class Capabilities
 	{
 		public static string ExtendedSerialization = "ExtendedSerialization";
@@ -209,12 +294,37 @@ namespace OpenNI
 		public static string Focus = "Focus";
 		public static string LowLightCompensation = "LowLightCompensation";
 		public static string AntiFlicker = "AntiFlicker";
+        public static string HandTouchingFOVEdge = "Hands::HandTouchingFOVEdge";
 	};
 
 	[StructLayout(LayoutKind.Sequential)]
 	public struct Version
 	{
-		public byte Major
+		public static Version Current
+		{
+			get
+			{
+				Version retVal = Version.Zero;
+				int status = SafeNativeMethods.xnGetVersion(ref retVal);
+				WrapperUtils.ThrowOnError(status);
+				return retVal;
+			}
+		}
+
+        public static Version Zero
+        {
+            get
+            {
+                Version retVal;
+                retVal.build = 0;
+                retVal.major = 0;
+                retVal.maintenance = 0;
+                retVal.minor = 0;
+                return retVal;
+            }
+        }
+        
+        public byte Major
 		{
 			get { return major; }
 			set { major = value; }
@@ -329,6 +439,7 @@ namespace OpenNI
 	[StructLayout(LayoutKind.Sequential)]
 	public struct Point3D
 	{
+		public static Point3D ZeroPoint = new Point3D(0,0,0);
 		public Point3D(XnFloat x, XnFloat y, XnFloat z)
 		{
 			this.x = x;
@@ -622,7 +733,7 @@ namespace OpenNI
 	}
 
 	[StructLayout(LayoutKind.Sequential)]
-	public class ProductionNodeDescription
+	public struct ProductionNodeDescription
 	{
 		public NodeType Type
 		{
@@ -645,6 +756,19 @@ namespace OpenNI
 			set { version = value; }
 		}
 
+        public static ProductionNodeDescription Empty
+        {
+            get
+            {
+                ProductionNodeDescription description;
+                description.type = NodeType.Invalid;
+                description.strVendor = "";
+                description.strName = "";
+                description.version = Version.Zero;
+                return description;
+            }
+        }
+
 		private NodeType type;
 		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Defs.XN_MAX_NAME_LENGTH)]
 		private string strVendor;
@@ -654,7 +778,7 @@ namespace OpenNI
 	};
 
 	[StructLayout(LayoutKind.Sequential)]
-	public class License
+	public struct License
 	{
 		public string Vendor
 		{
@@ -775,17 +899,24 @@ namespace OpenNI
 		};
 
 		public delegate void XnErrorStateChangedHandler(XnStatus errorState, IntPtr pCookie);
+		public delegate void XnContextShuttingDownHandler(XnContext pContext, IntPtr pCookie);
 		public delegate void XnStateChangedHandler(XnNodeHandle hNode, IntPtr pCookie);
 		public delegate void XnGestureRecognized(XnNodeHandle hNode, string strGesture, ref Point3D pIDPosition, ref Point3D pEndPosition, IntPtr pCookie);
 		public delegate void XnGestureProgress(XnNodeHandle hNode, string strGesture, ref Point3D pPosition, XnFloat fProgress, IntPtr pCookie);
-		public delegate void XnCalibrationStart(XnNodeHandle hNode, XnUserID user, IntPtr pCookie);
+        public delegate void XnGestureIntermediateStageCompleted(XnNodeHandle hNode, string strGesture, ref Point3D pPosition, IntPtr pCookie);
+        public delegate void XnGestureReadyForNextIntermediateStage(XnNodeHandle hNode, string strGesture, ref Point3D pPosition, IntPtr pCookie);
+        public delegate void XnCalibrationStart(XnNodeHandle hNode, XnUserID user, IntPtr pCookie);
 		public delegate void XnCalibrationEnd(XnNodeHandle hNode, XnUserID user, XnBool bSuccess, IntPtr pCookie);
+        public delegate void XnCalibrationComplete(XnNodeHandle hNode, XnUserID user, CalibrationStatus status, IntPtr pCookie);
+        public delegate void XnCalibrationInProgress(XnNodeHandle hNode, XnUserID user, CalibrationStatus status, IntPtr pCookie);
 		public delegate void XnPoseDetectionCallback(XnNodeHandle hNode, string strPose, XnUserID user, IntPtr pCookie);
+        public delegate void XnPoseDetectionInProgress(XnNodeHandle hNode, string strPose, XnUserID user, PoseDetectionStatus status, IntPtr pCookie);
 
 		public delegate void XnUserHandler(XnNodeHandle hNode, XnUserID user, IntPtr pCookie);
 		public delegate void XnHandCreate(XnNodeHandle hNode, XnUserID user, ref Point3D pPosition, XnFloat fTime, IntPtr pCookie);
 		public delegate void XnHandUpdate(XnNodeHandle hNode, XnUserID user, ref Point3D pPosition, XnFloat fTime, IntPtr pCookie);
 		public delegate void XnHandDestroy(XnNodeHandle hNode, XnUserID user, XnFloat fTime, IntPtr pCookie);
+        public delegate void XnHandTouchingFOVEdge(XnNodeHandle hNode, XnUserID user, ref Point3D pPosition, XnFloat fTime, Direction dir, IntPtr pCookie);
 
 #if Win_x64
 		private const string openNILibraryName = "OpenNI64";
@@ -793,729 +924,850 @@ namespace OpenNI
 		private const string openNILibraryName = "OpenNI";
 #endif
 
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnInit(out XnContext pContext);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		[Obsolete]
 		public static extern XnStatus xnContextRunXmlScriptFromFile(XnContext pContext, string strFileName, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnContextRunXmlScriptFromFileEx(XnContext pContext, string strFileName, XnEnumerationErrors pErrors, out XnNodeHandle hScriptNode);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		[Obsolete]
 		public static extern XnStatus xnContextRunXmlScript(XnContext pContext, string xmlScript, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnContextRunXmlScriptEx(XnContext pContext, string xmlScript, XnEnumerationErrors pErrors, out XnNodeHandle hScriptNode);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		[Obsolete]
 		public static extern XnStatus xnInitFromXmlFile(string strFileName, out XnContext ppContext, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnInitFromXmlFileEx(string strFileName, out XnContext ppContext, XnEnumerationErrors pErrors, out XnNodeHandle hScriptNode);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		[Obsolete]
 		public static extern XnStatus xnContextOpenFileRecording(XnContext pContext, string strFileName);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnContextOpenFileRecordingEx(XnContext pContext, string strFileName, out XnNodeHandle hScriptNode);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnContextAddRef(XnContext pContext);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern void xnContextRelease(XnContext pContext);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		[Obsolete]
 		public static extern void xnShutdown(XnContext pContext);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern void xnForceShutdown(XnContext pContext);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnContextRegisterForShutdown(XnContext pContext, [MarshalAs(UnmanagedType.FunctionPtr)] XnContextShuttingDownHandler pHandler, IntPtr pCookie, out XnCallbackHandle phCallback);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern void xnContextUnregisterFromShutdown(XnContext pContext, XnCallbackHandle hCallback);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumerateProductionTrees(XnContext pContext, NodeType Type, XnNodeQuery pQuery, out XnNodeInfoList ppTreesList, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateProductionTree(XnContext pContext, XnNodeInfo pTree, out XnNodeHandle phNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateAnyProductionTree(XnContext pContext, NodeType type, XnNodeQuery pQuery, out XnNodeHandle phNode, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateMockNode(XnContext pContext, NodeType type, string strName, out XnNodeHandle phNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateMockNodeBasedOn(XnContext pContext, XnNodeHandle hOriginalNode, string strName, out XnNodeHandle phMockNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnProductionNodeAddRef(XnNodeHandle hNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnProductionNodeRelease(XnNodeHandle hNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumerateExistingNodes(XnContext pContext, out XnNodeInfoList ppList);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumerateExistingNodesByType(XnContext pContext, NodeType type, out XnNodeInfoList ppList);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		[Obsolete]
 		public static extern XnStatus xnFindExistingNodeByType(XnContext pContext, NodeType type, out XnNodeHandle phNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnFindExistingRefNodeByType(XnContext pContext, NodeType type, out XnNodeHandle phNode);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		[Obsolete]
 		public static extern XnStatus xnGetNodeHandleByName(XnContext pContext, string strInstanceName, out XnNodeHandle phNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnGetRefNodeHandleByName(XnContext pContext, string strInstanceName, out XnNodeHandle phNode);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnWaitAndUpdateAll(XnContext pContext);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnWaitOneUpdateAll(XnContext pContext, XnNodeHandle hNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnWaitAnyUpdateAll(XnContext pContext);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnWaitNoneUpdateAll(XnContext pContext);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStartGeneratingAll(XnContext pContext);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStopGeneratingAll(XnContext pContext);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetGlobalMirror(XnContext pContext, XnBool bMirror);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnGetGlobalMirror(XnContext pContext);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetGlobalErrorState(XnContext pContext);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToGlobalErrorStateChange(XnContext pContext, [MarshalAs(UnmanagedType.FunctionPtr)] XnErrorStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromGlobalErrorStateChange(XnContext pContext, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumerationErrorsAllocate(out XnEnumerationErrors ppErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnEnumerationErrorsFree(XnEnumerationErrors pErrors);
-		//		[DllImport(openNILibraryName)]
+		//		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		//		public static extern XnStatus xnEnumerationErrorsAdd(XnEnumerationErrors pErrors, ProductionNodeDescription pDesc, XnStatus nError);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumerationErrorsToString(XnEnumerationErrors pErrors, StringBuilder csBuffer, XnUInt32 nSize);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumerationErrorsClear(XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnEnumerationErrorsIterator xnEnumerationErrorsGetFirst(XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnEnumerationErrorsIterator xnEnumerationErrorsGetNext(XnEnumerationErrorsIterator it);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnEnumerationErrorsIteratorIsValid(XnEnumerationErrorsIterator it);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern ProductionNodeDescription xnEnumerationErrorsGetCurrentDescription(XnEnumerationErrorsIterator it);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumerationErrorsGetCurrentError(XnEnumerationErrorsIterator it);
 
-		/*		[DllImport(openNILibraryName)]
+		/*		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnFPSInit(XnFPSData pFPS, XnUInt32 nSamplesCount);
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnFPSMarkFrame(XnFPSData pFPS, XnUInt64 nNow);
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnDouble xnFPSCalc(XnFPSData pFPS, XnUInt32 nAverageOver, XnUInt64 nNow);
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnFPSFree(XnFPSData pFPS);
 		*/
-		[DllImport(openNILibraryName)]
-		public static extern XnStatus xnAddLicense(XnContext pContext, License pLicense);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnAddLicense(XnContext pContext, IntPtr pLicense);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumerateLicenses(XnContext pContext, out IntPtr paLicenses, out XnUInt32 pnCount);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnFreeLicensesList(IntPtr aLicenses);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogInitSystem();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogInitFromINIFile(string csINIFile, string csSectionName);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogInitFromXmlFile(string strFileName);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogStartNewFile();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogClose();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogSetMaskState(string csMask, XnBool bEnabled);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnDumpSetMaskState(string csMask, XnBool bEnabled);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogSetSeverityFilter(LogSeverity nMinSeverity);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogSetConsoleOutput(XnBool bConsoleOutput);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogSetFileOutput(XnBool bFileOutput);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogSetLineInfo(XnBool bLineInfo);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLogSetOutputFolder(string strOutputFolder);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnLogIsEnabled(string csLogMask, LogSeverity nSeverity);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnLogWrite(string csLogMask, LogSeverity nSeverity, string csFile, XnUInt32 nLine, string csFormat);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnLogWriteNoEntry(string csLogMask, LogSeverity nSeverity, string csFormat);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnLogWriteBinaryData(string csLogMask, LogSeverity nSeverity, string csFile, XnUInt32 nLine, IntPtr pBinData, XnUInt32 nDataSize, string csFormat);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnLogIsDumpMaskEnabled(string csDumpMask);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnNodeInfo xnGetNodeInfo(XnNodeHandle hNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetNodeName(XnNodeHandle hNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		[Obsolete]
 		public static extern XnContext xnGetContextFromNodeHandle(XnNodeHandle hNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnContext xnGetRefContextFromNodeHandle(XnNodeHandle hNode);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsCapabilitySupported(XnNodeHandle hInstance, string strCapabilityName);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetIntProperty(XnNodeHandle hInstance, string strName, XnUInt64 nValue);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetRealProperty(XnNodeHandle hInstance, string strName, XnDouble dValue);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetStringProperty(XnNodeHandle hInstance, string strName, string strValue);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetGeneralProperty(XnNodeHandle hInstance, string strName, XnUInt32 nBufferSize, IntPtr pBuffer);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetIntProperty(XnNodeHandle hInstance, string strName, out XnUInt64 pnValue);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetRealProperty(XnNodeHandle hInstance, string strName, out XnDouble pdValue);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetStringProperty(XnNodeHandle hInstance, string strName, StringBuilder csValue, XnUInt32 nBufSize);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetGeneralProperty(XnNodeHandle hInstance, string strName, XnUInt32 nBufferSize, IntPtr pBuffer);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLockNodeForChanges(XnNodeHandle hInstance, out XnLockHandle phLock);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnUnlockNodeForChanges(XnNodeHandle hInstance, XnLockHandle hLock);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLockedNodeStartChanges(XnNodeHandle hInstance, XnLockHandle hLock);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLockedNodeEndChanges(XnNodeHandle hInstance, XnLockHandle hLock);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnAddNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRemoveNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode);
-		[DllImport(openNILibraryName)]
+
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnCreateDevice(XnContext pContext, out XnNodeHandle phDevice, XnNodeQuery pQuery, XnEnumerationErrors pErrors);
+
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnGetDeviceName(XnNodeHandle hInstance, StringBuilder buffer, ref XnUInt32 pnBufferSize);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnGetVendorSpecificData(XnNodeHandle hInstance, StringBuilder buffer, ref XnUInt32 pnBufferSize);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnGetSerialNumber(XnNodeHandle hInstance, StringBuilder buffer, ref XnUInt32 pnBufferSize);
+
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetNodeErrorState(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToNodeErrorStateChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromNodeErrorStateChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern  XnStatus xnGetGeneralIntRange(XnNodeHandle hNode, string strCap, out XnInt32 pnMin, out XnInt32 pnMax, out XnInt32 pnStep, out XnInt32 pnDefault, out XnBool pbIsAutoSupported);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern  XnStatus xnGetGeneralIntValue(XnNodeHandle hNode, string strCap, out XnInt32 pnValue);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern  XnStatus xnSetGeneralIntValue(XnNodeHandle hNode, string strCap, XnInt32 nValue);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern  XnStatus xnRegisterToGeneralIntValueChange(XnNodeHandle hNode, string strCap, XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern  void xnUnregisterFromGeneralIntValueChange(XnNodeHandle hNode, string strCap, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+
+        // Generator
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStartGenerating(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsGenerating(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStopGenerating(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToGenerationRunningChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromGenerationRunningChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToNewDataAvailable(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromNewDataAvailable(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsNewDataAvailable(XnNodeHandle hInstance, out XnUInt64 pnTimestamp);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnWaitAndUpdateData(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsDataNew(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern IntPtr xnGetData(XnNodeHandle hInstance);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnUInt32 xnGetDataSize(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnUInt64 xnGetTimestamp(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnUInt32 xnGetFrameID(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+
+        // Mirror
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetMirror(XnNodeHandle hInstance, XnBool bMirror);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsMirrored(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToMirrorChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromMirrorChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsViewPointSupported(XnNodeHandle hInstance, XnNodeHandle hOther);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetViewPoint(XnNodeHandle hInstance, XnNodeHandle hOther);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnResetViewPoint(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsViewPointAs(XnNodeHandle hInstance, XnNodeHandle hOther);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToViewPointChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromViewPointChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnCanFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStopFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsFrameSyncedWith(XnNodeHandle hInstance, XnNodeHandle hOther);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToFrameSyncChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromFrameSyncChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+
+        // MapGenerator
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnUInt32 xnGetSupportedMapOutputModesCount(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetSupportedMapOutputModes(XnNodeHandle hInstance, [In][Out] MapOutputMode[] aModes, ref XnUInt32 pnCount);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetMapOutputMode(XnNodeHandle hInstance, ref MapOutputMode pOutputMode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetMapOutputMode(XnNodeHandle hInstance, ref MapOutputMode pOutputMode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToMapOutputModeChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromMapOutputModeChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnUInt32 xnGetBytesPerPixel(XnNodeHandle hInstance);
+
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetCropping(XnNodeHandle hInstance, ref Cropping pCropping);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetCropping(XnNodeHandle hInstance, ref Cropping pCropping);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToCroppingChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromCroppingChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetPowerLineFrequency(XnNodeHandle hGenerator, PowerLineFrequency nFrequency);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern PowerLineFrequency xnGetPowerLineFrequency(XnNodeHandle hGenerator);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToPowerLineFrequencyChange(XnNodeHandle hGenerator, XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromPowerLineFrequencyChange(XnNodeHandle hGenerator, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateDepthGenerator(XnContext pContext, out XnNodeHandle phDepthGenerator, XnNodeQuery pQuery, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnDepthPixel xnGetDeviceMaxDepth(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetDepthFieldOfView(XnNodeHandle hInstance, ref FieldOfView pFOV);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToDepthFieldOfViewChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromDepthFieldOfViewChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnConvertProjectiveToRealWorld(XnNodeHandle hInstance, XnUInt32 nCount, Point3D[] aProjective, [In][Out] Point3D[] aRealWorld);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnConvertRealWorldToProjective(XnNodeHandle hInstance, XnUInt32 nCount, Point3D[] aRealWorld, [In][Out] Point3D[] aProjective);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetDepthMap(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnGetDepthMetaData(XnNodeHandle hInstance, IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnUInt32 xnGetSupportedUserPositionsCount(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, ref BoundingBox3D pPosition);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, ref BoundingBox3D pPosition);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToUserPositionChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromUserPositionChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateImageGenerator(XnContext pContext, out XnNodeHandle phImageGenerator, XnNodeQuery pQuery, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetRGB24ImageMap(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetYUV422ImageMap(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetGrayscale8ImageMap(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetGrayscale16ImageMap(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetImageMap(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsPixelFormatSupported(XnNodeHandle hInstance, PixelFormat Format);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetPixelFormat(XnNodeHandle hInstance, PixelFormat Format);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern PixelFormat xnGetPixelFormat(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToPixelFormatChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromPixelFormatChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnGetImageMetaData(XnNodeHandle hInstance, IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateIRGenerator(XnContext pContext, out XnNodeHandle phIRGenerator, XnNodeQuery pQuery, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetIRMap(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnGetIRMetaData(XnNodeHandle hInstance, IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateGestureGenerator(XnContext pContext, out XnNodeHandle phGestureGenerator, XnNodeQuery pQuery, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnAddGesture(XnNodeHandle hInstance, string strGesture, ref BoundingBox3D pArea);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnAddGesture(XnNodeHandle hInstance, string strGesture, IntPtr pArea);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRemoveGesture(XnNodeHandle hInstance, string strGesture);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetAllActiveGestures(XnNodeHandle hInstance, [In] [Out] IntPtr[] pstrGestures, XnUInt32 nNameLength, ref XnUInt16 nGestures);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumerateAllGestures(XnNodeHandle hInstance, [In] [Out] IntPtr[] pstrGestures, XnUInt32 nNameLength, ref XnUInt16 nGestures);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsGestureAvailable(XnNodeHandle hInstance, string strGesture);
-		[DllImport(openNILibraryName)]
-		public static extern XnBool xnIsGestureProgressSupported(XnNodeHandle hInstance, string strGesture);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnUInt32 xnGetNumberOfAvailableGestures(XnNodeHandle hInstance);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnBool xnIsGestureProgressSupported(XnNodeHandle hInstance, string strGesture);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterGestureCallbacks(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnGestureRecognized RecognizedCB, [MarshalAs(UnmanagedType.FunctionPtr)] XnGestureProgress ProgressCB, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterGestureCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToGestureIntermediateStageCompleted(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnGestureIntermediateStageCompleted GestureIntermediateStageCompletedCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromGestureIntermediateStageCompleted(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnGestureReadyForNextIntermediateStage GestureReadyForNextIntermediateStageCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToGestureChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromGestureChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateSceneAnalyzer(XnContext pContext, out XnNodeHandle phSceneAnalyzer, XnNodeQuery pQuery, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetLabelMap(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetFloor(XnNodeHandle hInstance, ref Plane3D pPlane);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnGetSceneMetaData(XnNodeHandle hInstance, IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateUserGenerator(XnContext pContext, out XnNodeHandle phUserGenerator, XnNodeQuery pQuery, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnUInt16 xnGetNumberOfUsers(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetUsers(XnNodeHandle hInstance, [In][Out] XnUserID[] users, ref XnUInt16 pnUsers);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetUserCoM(XnNodeHandle hInstance, XnUserID user, out Point3D pCoM);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetUserPixels(XnNodeHandle hInstance, XnUserID user, IntPtr pScene);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterUserCallbacks(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnUserHandler NewUserCB, [MarshalAs(UnmanagedType.FunctionPtr)] XnUserHandler LostUserCB, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterUserCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToUserExit(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnUserHandler UserExitCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromUserExit(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToUserReEnter(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnUserHandler UserReEnterCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromUserReEnter(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsJointAvailable(XnNodeHandle hInstance, SkeletonJoint eJoint);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsProfileAvailable(XnNodeHandle hInstance, SkeletonProfile eProfile);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetSkeletonProfile(XnNodeHandle hInstance, SkeletonProfile eProfile);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetJointActive(XnNodeHandle hInstance, SkeletonJoint eJoint, XnBool bState);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsJointActive(XnNodeHandle hInstance, SkeletonJoint eJoint);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToJointConfigurationChange(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromJointConfigurationChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumerateActiveJoints(XnNodeHandle hInstance, SkeletonJoint pJoints, XnUInt16 pnJoints);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetSkeletonJoint(XnNodeHandle hInstance, XnUserID user, SkeletonJoint joint, ref SkeletonJointTransformation transformation);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetSkeletonJointPosition(XnNodeHandle hInstance, XnUserID user, SkeletonJoint joint, ref SkeletonJointPosition position);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetSkeletonJointOrientation(XnNodeHandle hInstance, XnUserID user, SkeletonJoint joint, ref SkeletonJointOrientation orientation);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsSkeletonCalibrated(XnNodeHandle hInstance, XnUserID user);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsSkeletonCalibrating(XnNodeHandle hInstance, XnUserID user);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRequestSkeletonCalibration(XnNodeHandle hInstance, XnUserID user, XnBool bForce);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnAbortSkeletonCalibration(XnNodeHandle hInstance, XnUserID user);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSaveSkeletonCalibrationDataToFile(XnNodeHandle hInstance, XnUserID user, string strFileName);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLoadSkeletonCalibrationDataFromFile(XnNodeHandle hInstance, XnUserID user, string strFileName);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSaveSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnLoadSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnClearSkeletonCalibrationData(XnNodeHandle hInstance, XnUInt32 nSlot);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsSkeletonCalibrationData(XnNodeHandle hInstance, XnUInt32 nSlot);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStartSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStopSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnResetSkeleton(XnNodeHandle hInstance, XnUserID user);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnNeedPoseForSkeletonCalibration(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetSkeletonCalibrationPose(XnNodeHandle hInstance, StringBuilder sb);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetSkeletonSmoothing(XnNodeHandle hInstance, XnFloat fFactor);
-		[DllImport(openNILibraryName)]
-		public static extern XnStatus xnRegisterCalibrationCallbacks(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnCalibrationStart CalibrationStartCB, [MarshalAs(UnmanagedType.FunctionPtr)] XnCalibrationEnd CalibrationEndCB, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterCalibrationCallbacks(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnCalibrationStart CalibrationStartCB, [MarshalAs(UnmanagedType.FunctionPtr)] XnCalibrationEnd CalibrationEndCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterCalibrationCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToCalibrationStart(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnCalibrationStart CalibrationStartCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromCalibrationStart(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToCalibrationInProgress(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnCalibrationInProgress CalibrationInProgressCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromCalibrationInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToCalibrationComplete(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnCalibrationComplete CalibrationCompleteCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromCalibrationComplete(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnUInt32 xnGetNumberOfPoses(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetAllAvailablePoses(XnNodeHandle hInstance, [In] [Out] IntPtr[] pstrPoses, XnUInt32 nNameLength, ref XnUInt32 pnPoses);
-		[DllImport(openNILibraryName)]
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnBool xnIsPoseSupported(XnNodeHandle hInstance, string strPose);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnGetPoseStatus(XnNodeHandle hInstance, XnUserID userID, string poseName, out XnUInt64 poseTime, out PoseDetectionStatus eStatus,out PoseDetectionState eState);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStartPoseDetection(XnNodeHandle hInstance, string strPose, XnUserID user);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStopPoseDetection(XnNodeHandle hInstance, XnUserID user);
-		[DllImport(openNILibraryName)]
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnStopSinglePoseDetection(XnNodeHandle hInstance, XnUserID user, string poseName);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToPoseCallbacks(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnPoseDetectionCallback PoseDetectionStartCB, [MarshalAs(UnmanagedType.FunctionPtr)] XnPoseDetectionCallback PoseDetectionEndCB, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromPoseCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToPoseDetected(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnPoseDetectionCallback PoseDetectionStartCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromPoseDetected(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToOutOfPose(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnPoseDetectionCallback PoseDetectionStartCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromOutOfPose(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToPoseDetectionInProgress(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnPoseDetectionInProgress PoseDetectionInProgressCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromPoseDetectionInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateHandsGenerator(XnContext pContext, out XnNodeHandle phHandsGenerator, XnNodeQuery pQuery, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterHandCallbacks(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnHandCreate CreateCB, [MarshalAs(UnmanagedType.FunctionPtr)] XnHandUpdate UpdateCB, [MarshalAs(UnmanagedType.FunctionPtr)] XnHandDestroy DestroyCB, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterHandCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnRegisterToHandTouchingFOVEdge(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnHandTouchingFOVEdge TouchingCB, IntPtr pCookie, out XnCallbackHandle phCallback);
+        [DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void xnUnregisterFromHandTouchingFOVEdge(XnNodeHandle hInstance, XnCallbackHandle hCallback);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStopTracking(XnNodeHandle hInstance, XnUserID user);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStopTrackingAll(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnStartTracking(XnNodeHandle hInstance, ref Point3D pPosition);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetTrackingSmoothing(XnNodeHandle hInstance, XnFloat fFactor);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateAudioGenerator(XnContext pContext, out XnNodeHandle phAudioGenerator, XnNodeQuery pQuery, XnEnumerationErrors pErrors);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetAudioBuffer(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnUInt32 xnGetSupportedWaveOutputModesCount(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetSupportedWaveOutputModes(XnNodeHandle hInstance, [In][Out] WaveOutputMode[] aSupportedModes, ref XnUInt32 pnCount);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetWaveOutputMode(XnNodeHandle hInstance, ref WaveOutputMode OutputMode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetWaveOutputMode(XnNodeHandle hInstance, ref WaveOutputMode OutputMode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToWaveOutputModeChanges(XnNodeHandle hInstance, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromWaveOutputModeChanges(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnGetAudioMetaData(XnNodeHandle hInstance, IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnMockDepthSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, IntPtr pData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnMockImageSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, IntPtr pData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnMockIRSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, IntPtr pData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnMockAudioSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, IntPtr pData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateCodec(XnContext pContext, XnCodecID codecID, XnNodeHandle hInitializerNode, out XnNodeHandle phCodec);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnCodecID xnGetCodecID(XnNodeHandle hCodec);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEncodeData(XnNodeHandle hCodec, IntPtr pSrc, XnUInt32 nSrcSize, IntPtr pDst, XnUInt32 nDstSize, [MarshalAs(UnmanagedType.SysUInt)] out UInt32 pnBytesWritten);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnDecodeData(XnNodeHandle hCodec, IntPtr pSrc, XnUInt32 nSrcSize, IntPtr pDst, XnUInt32 nDstSize, [MarshalAs(UnmanagedType.SysUInt)] out UInt32 pnBytesWritten);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreateRecorder(XnContext pContext, string strFormatName, out XnNodeHandle phRecorder);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetRecorderDestination(XnNodeHandle hRecorder, RecordMedium destType, string strDest);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnAddNodeToRecording(XnNodeHandle hRecorder, XnNodeHandle hNode, XnCodecID compression);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRemoveNodeFromRecording(XnNodeHandle hRecorder, XnNodeHandle hNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRecord(XnNodeHandle hRecorder);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetRecorderFormat(XnNodeHandle hRecorder);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCreatePlayer(XnContext pContext, string strFormatName, out XnNodeHandle phPlayer);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetPlayerRepeat(XnNodeHandle hPlayer, XnBool bRepeat);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetPlayerSource(XnNodeHandle hPlayer, RecordMedium sourceType, string strSource);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetPlayerSource(XnNodeHandle hPlayer, out RecordMedium pSourceType, StringBuilder strSource, XnUInt32 nBufSize);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnPlayerReadNext(XnNodeHandle hPlayer);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSeekPlayerToTimeStamp(XnNodeHandle hPlayer, XnInt64 nTimeOffset, PlayerSeekOrigin origin);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSeekPlayerToFrame(XnNodeHandle hPlayer, string strNodeName, XnInt32 nFrameOffset, PlayerSeekOrigin origin);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnTellPlayerTimestamp(XnNodeHandle hPlayer, out XnUInt64 pnTimestamp);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnTellPlayerFrame(XnNodeHandle hPlayer, string strNodeName, out XnUInt32 pnFrame);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetPlayerNumFrames(XnNodeHandle hPlayer, string strNodeName, out XnUInt32 pnFrames);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetPlayerSupportedFormat(XnNodeHandle hPlayer);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnEnumeratePlayerNodes(XnNodeHandle hPlayer, out XnNodeInfoList ppList);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsPlayerAtEOF(XnNodeHandle hPlayer);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterToEndOfFileReached(XnNodeHandle hPlayer, [MarshalAs(UnmanagedType.FunctionPtr)] XnStateChangedHandler handler, IntPtr pCookie, out XnCallbackHandle phCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnUnregisterFromEndOfFileReached(XnNodeHandle hInstance, XnCallbackHandle hCallback);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnSetPlaybackSpeed(XnNodeHandle hInstance, XnDouble dSpeed);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnDouble xnGetPlaybackSpeed(XnNodeHandle hInstance);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeInfoSetInstanceName(XnNodeInfo pNodeInfo, string strInstanceName);
-		[DllImport(openNILibraryName)]
-		public static extern ProductionNodeDescription xnNodeInfoGetDescription(XnNodeInfo pNodeInfo);
-		[DllImport(openNILibraryName)]
-		public static extern XnStatus xnNodeInfoGetTreeStringRepresentation(XnNodeInfo pNodeInfo, IntPtr csResult, XnUInt32 nSize);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern IntPtr xnNodeInfoGetDescription(XnNodeInfo pNodeInfo);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern XnStatus xnNodeInfoGetTreeStringRepresentation(XnNodeInfo pNodeInfo, StringBuilder csBuffer, XnUInt32 nSize);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnNodeInfoGetInstanceName(XnNodeInfo pNodeInfo);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnNodeInfoGetCreationInfo(XnNodeInfo pNodeInfo);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnNodeInfoList xnNodeInfoGetNeededNodes(XnNodeInfo pNodeInfo);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		[Obsolete]
 		public static extern XnNodeHandle xnNodeInfoGetHandle(XnNodeInfo pNodeInfo);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnNodeHandle xnNodeInfoGetRefHandle(XnNodeInfo pNodeInfo);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeInfoListAllocate(out XnNodeInfoList ppList);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnNodeInfoListFree(XnNodeInfoList pList);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeInfoListAdd(XnNodeInfoList pList, ProductionNodeDescription pDescription, string strCreationInfo, XnNodeInfoList pNeededNodes);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeInfoListAddNode(XnNodeInfoList pList, XnNodeInfo pNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeInfoListAddNodeFromList(XnNodeInfoList pList, XnNodeInfoListIterator otherListIt);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeInfoListRemove(XnNodeInfoList pList, XnNodeInfoListIterator it);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeInfoListClear(XnNodeInfoList pList);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeInfoListAppend(XnNodeInfoList pList, XnNodeInfoList pOther);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnNodeInfoListIsEmpty(XnNodeInfoList pList);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnNodeInfoListIterator xnNodeInfoListGetFirst(XnNodeInfoList pList);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnNodeInfoListIterator xnNodeInfoListGetLast(XnNodeInfoList pList);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnNodeInfoListIteratorIsValid(XnNodeInfoListIterator it);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnNodeInfo xnNodeInfoListGetCurrent(XnNodeInfoListIterator it);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnNodeInfoListIterator xnNodeInfoListGetNext(XnNodeInfoListIterator it);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnNodeInfoListIterator xnNodeInfoListGetPrevious(XnNodeInfoListIterator it);
-		/*		[DllImport(openNILibraryName)]
+		/*		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnProfilingInit(XnUInt32 nProfilingInterval);
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnProfilingInitFromINI(string cpINIFileName, string cpSectionName);
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnProfilingShutdown();
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnBool xnProfilingIsActive();
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnProfilingSectionStart(char csSectionName, XnBool bMT, XnProfilingHandle pHandle);
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnProfilingSectionEnd(XnProfilingHandle pHandle);
 		*/
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQueryAllocate(out XnNodeQuery ppQuery);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnNodeQueryFree(XnNodeQuery pQuery);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQuerySetVendor(XnNodeQuery pQuery, string strVendor);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQuerySetName(XnNodeQuery pQuery, string strName);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQuerySetMinVersion(XnNodeQuery pQuery, ref Version pMinVersion);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQuerySetMaxVersion(XnNodeQuery pQuery, ref Version pMaxVersion);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQueryAddSupportedCapability(XnNodeQuery pQuery, string strNeededCapability);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQueryAddSupportedMapOutputMode(XnNodeQuery pQuery, ref MapOutputMode pMapOutputMode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQuerySetSupportedMinUserPositions(XnNodeQuery pQuery, XnUInt32 nCount);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQuerySetExistingNodeOnly(XnNodeQuery pQuery, XnBool bExistingNode);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQueryAddNeededNode(XnNodeQuery pQuery, string strInstanceName);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQuerySetCreationInfo(XnNodeQuery pQuery, string strCreationInfo);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnNodeQueryFilterList(XnContext pContext, XnNodeQuery pQuery, XnNodeInfoList pList);
-		/*		[DllImport(openNILibraryName)]
+		/*		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnSchedulerStart(out XnScheduler ppScheduler);
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnSchedulerShutdown(out XnScheduler ppScheduler);
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnSchedulerAddTask(XnScheduler pScheduler, XnUInt64 nInterval, XnTaskCallbackFuncPtr pCallback, IntPtr pCallbackArg, out XnScheduledTask ppTask);
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnSchedulerRemoveTask(XnScheduler pScheduler, out XnScheduledTask ppTask);
-				[DllImport(openNILibraryName)]
+				[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 				public static extern XnStatus xnSchedulerRescheduleTask(XnScheduler pScheduler, XnScheduledTask pTask, XnUInt64 nInterval);
 		*/
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetStatusString(XnStatus Status);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnGetStatusName(XnStatus Status);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnPrintError(XnStatus Status, string csUserMessage);
-		//		[DllImport(openNILibraryName)]
+		//		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		//		public static extern XnStatus xnRegisterErrorCodeMessages(XnUInt16 nGroup, XnUInt16 nFirst, XnUInt16 nCount, XnErrorCodeData pErrorCodeData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnGetVersion(ref Version pVersion);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnProductionNodeTypeToString(NodeType Type);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnProductionNodeTypeFromString(string strType, NodeType pType);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnBool xnIsTypeGenerator(NodeType type);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnPixelFormatToString(PixelFormat format);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnPixelFormatFromString(string strName, PixelFormat pFormat);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnUInt32 xnResolutionGetXRes(Resolution resolution);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnUInt32 xnResolutionGetYRes(Resolution resolution);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern Resolution xnResolutionGetFromXYRes(XnUInt32 xRes, XnUInt32 yRes);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern Resolution xnResolutionGetFromName(string strName);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnResolutionGetName(Resolution resolution);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnInt32 xnVersionCompare(ref Version pVersion1, ref Version pVersion2);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnVersionToString(ref Version pVersion, IntPtr csResult, XnUInt32 nSize);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus XnProductionNodeDescriptionToString(ProductionNodeDescription pDescription, IntPtr csResult, XnUInt32 nSize);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern Point3D xnCreatePoint3D(XnFloat x, XnFloat y, XnFloat z);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern Point3D xnCreatePlane3D(Point3D ptPoint, Point3D vNormal);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterModule(string strModule, string strConfigDir);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnUnregisterModule(string strModule);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnPrintRegisteredModules();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnRegisterGlobalLicense(License pLicense);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnUnregisterGlobalLicense(License pLicense);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnPrintRegisteredLicenses();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnAllocateOutputMetaData();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnFreeOutputMetaData(IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCopyOutputMetaData(IntPtr pDestination, IntPtr pSource);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnAllocateMapMetaData();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnFreeMapMetaData(IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCopyMapMetaData(IntPtr pDestination, IntPtr pSource);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnAllocateDepthMetaData();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnFreeDepthMetaData(IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCopyDepthMetaData(IntPtr pDestination, IntPtr pSource);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnAllocateImageMetaData();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnFreeImageMetaData(IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCopyImageMetaData(IntPtr pDestination, IntPtr pSource);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnAllocateIRMetaData();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnFreeIRMetaData(IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCopyIRMetaData(IntPtr pDestination, IntPtr pSource);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnAllocateAudioMetaData();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnFreeAudioMetaData(IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCopyAudioMetaData(IntPtr pDestination, IntPtr pSource);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern IntPtr xnAllocateSceneMetaData();
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern void xnFreeSceneMetaData(IntPtr pMetaData);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnCopySceneMetaData(IntPtr pDestination, IntPtr pSource);
-		[DllImport(openNILibraryName)]
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
 		public static extern XnStatus xnAutoEnumerateOverSingleInput(XnContext pContext, XnNodeInfoList pList, ProductionNodeDescription pDescription, string strCreationInfo, NodeType InputType, XnEnumerationErrors pErrors, XnNodeQuery pQuery);
+
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnCreateScriptNode(XnContext pContext, string strFormat, out XnNodeHandle phScript);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern IntPtr xnScriptNodeGetSupportedFormat(XnNodeHandle hScript);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnLoadScriptFromFile(XnNodeHandle hScript, string strFileName);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnLoadScriptFromString(XnNodeHandle hScript, string strScript);
+		[DllImport(openNILibraryName, CallingConvention = CallingConvention.Cdecl)]
+		public static extern XnStatus xnScriptNodeRun(XnNodeHandle hScript);
 	}
 }
diff --git a/Wrappers/OpenNI.net/OutputMetaData.cs b/Wrappers/OpenNI.net/OutputMetaData.cs
index b16d9ca..56cd436 100644
--- a/Wrappers/OpenNI.net/OutputMetaData.cs
+++ b/Wrappers/OpenNI.net/OutputMetaData.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/Player.cs b/Wrappers/OpenNI.net/Player.cs
index 4c2c3a4..6e75132 100644
--- a/Wrappers/OpenNI.net/Player.cs
+++ b/Wrappers/OpenNI.net/Player.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/PoseDetectionCapability.cs b/Wrappers/OpenNI.net/PoseDetectionCapability.cs
index b6220b8..9b9a745 100644
--- a/Wrappers/OpenNI.net/PoseDetectionCapability.cs
+++ b/Wrappers/OpenNI.net/PoseDetectionCapability.cs
@@ -1,4 +1,25 @@
-using System;
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using UserID = System.Int32;
@@ -53,6 +74,73 @@ namespace OpenNI
 		private string pose;
 		private UserID id;
 	}
+    public class OutOfPoseEventArgs : EventArgs
+    {
+        public OutOfPoseEventArgs(string pose, UserID id)
+        {
+            this.pose = pose;
+            this.id = id;
+        }
+
+        public string Pose
+        {
+            get { return pose; }
+            set { pose = value; }
+        }
+
+        public UserID ID
+        {
+            get { return id; }
+            set { id = value; }
+        }
+
+        private string pose;
+        private UserID id;
+    }
+
+    public class PoseInProgressEventArgs : EventArgs
+    {
+        public PoseInProgressEventArgs(string pose, UserID id, PoseDetectionStatus status)
+        {
+            this.pose = pose;
+            this.id = id;
+            this.status = status;
+        }
+
+        public string Pose
+        {
+            get { return pose; }
+            set { pose = value; }
+        }
+
+        public UserID ID
+        {
+            get { return id; }
+            set { id = value; }
+        }
+        public PoseDetectionStatus Status
+        {
+            get { return status; }
+            set { status = value; }
+        }
+
+        private string pose;
+        private UserID id;
+        private PoseDetectionStatus status;
+    }
+
+    /// Utility structure to provide information about the state and status of a pose
+    public struct PoseDetectionStateStatus
+    {
+        public Int64 m_poseTime; ///< @brief The time stamp in which the user entered into the pose (0 if not in pose). 
+
+        /// @brief The status of the user's pose.
+        /// 
+        /// The progress error for getting into pose (PoseDetectionStatus, the same as received from
+        /// the in progress callback. See @ref xnRegisterToPoseDetectionInProgress).
+        public PoseDetectionStatus m_eStatus;
+        public PoseDetectionState m_eState; ///< @brief The state of the user pose (i.e. in pose, out of pose).
+    }
 
     public class PoseDetectionCapability : Capability
     {
@@ -61,6 +149,8 @@ namespace OpenNI
         {
             this.internalPoseDetected = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseDetected);
             this.internalPoseEnded = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseEnded);
+            this.internalOutOfPose = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalOutOfPose);
+            this.internalPoseDetectionInProgress = new SafeNativeMethods.XnPoseDetectionInProgress(this.InternalPoseDetectionInProgress);
         }
 
         public int NumberOfPoses
@@ -106,6 +196,20 @@ namespace OpenNI
 			return poses;
 		}
 
+        public bool IsPoseSupported(string pose)
+        {
+            return SafeNativeMethods.xnIsPoseSupported(this.InternalObject,pose);
+        }
+
+        public PoseDetectionStateStatus GetPoseStatus(UserID userID, string poseName)
+        {
+            UInt64 outPoseTime;
+            PoseDetectionStateStatus poseStatus = new PoseDetectionStateStatus();
+            int status = SafeNativeMethods.xnGetPoseStatus(this.InternalObject,userID, poseName, out outPoseTime,out poseStatus.m_eStatus,out poseStatus.m_eState);
+            poseStatus.m_poseTime = (Int64)outPoseTime;
+            WrapperUtils.ThrowOnError(status);
+            return poseStatus;
+        }
 		public void StartPoseDetection(string pose, UserID user)
         {
             int status = SafeNativeMethods.xnStartPoseDetection(this.InternalObject, pose, user);
@@ -116,6 +220,12 @@ namespace OpenNI
 			int status = SafeNativeMethods.xnStopPoseDetection(this.InternalObject, user); 
 			WrapperUtils.ThrowOnError(status);
         }
+        public void StopSinglePoseDetection(UserID user, string pose)
+        {
+            int status = SafeNativeMethods.xnStopSinglePoseDetection(this.InternalObject, user, pose);
+            WrapperUtils.ThrowOnError(status);
+        }
+
 
         #region Pose Detected
         private event EventHandler<PoseDetectedEventArgs> poseDetectedEvent;
@@ -125,7 +235,7 @@ namespace OpenNI
             {
                 if (this.poseDetectedEvent == null)
                 {
-                    int status = SafeNativeMethods.xnRegisterToPoseCallbacks(this.InternalObject, internalPoseDetected, null, IntPtr.Zero, out poseDetectedHandle);
+                    int status = SafeNativeMethods.xnRegisterToPoseDetected(this.InternalObject, internalPoseDetected, IntPtr.Zero, out poseDetectedHandle);
                     WrapperUtils.ThrowOnError(status);
                 }
                 this.poseDetectedEvent += value;
@@ -136,7 +246,7 @@ namespace OpenNI
 
                 if (this.poseDetectedEvent == null)
                 {
-                    SafeNativeMethods.xnUnregisterFromPoseCallbacks(this.InternalObject, this.poseDetectedHandle);
+                    SafeNativeMethods.xnUnregisterFromPoseDetected(this.InternalObject, this.poseDetectedHandle);
                 }
             }
         }
@@ -152,7 +262,8 @@ namespace OpenNI
 
         #region Pose Ended
         private event EventHandler<PoseEndedEventArgs> poseEndedEvent;
-		public event EventHandler<PoseEndedEventArgs> PoseEnded
+        [Obsolete("use PoseDetectionCapability.OutOfPose instead")]
+        public event EventHandler<PoseEndedEventArgs> PoseEnded
         {
             add
             {
@@ -183,5 +294,71 @@ namespace OpenNI
         private IntPtr poseEndedHandle;
         #endregion
 
+        #region Out of Pose
+        private event EventHandler<OutOfPoseEventArgs> outOfPoseEvent;
+        public event EventHandler<OutOfPoseEventArgs> OutOfPose
+        {
+            add
+            {
+                if (this.outOfPoseEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterToOutOfPose(this.InternalObject, this.internalOutOfPose, IntPtr.Zero, out outOfPoseHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.outOfPoseEvent += value;
+            }
+            remove
+            {
+                this.outOfPoseEvent -= value;
+
+                if (this.outOfPoseEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterFromOutOfPose(this.InternalObject, this.outOfPoseHandle);
+                }
+            }
+        }
+        private void InternalOutOfPose(IntPtr hNode, string pose, UserID id, IntPtr pCookie)
+        {
+            EventHandler<OutOfPoseEventArgs> handlers = this.outOfPoseEvent;
+            if (handlers != null)
+                handlers(this.node, new OutOfPoseEventArgs(pose, id));
+        }
+        private SafeNativeMethods.XnPoseDetectionCallback internalOutOfPose;
+        private IntPtr outOfPoseHandle;
+        #endregion
+
+        #region Pose In Progress
+        private event EventHandler<PoseInProgressEventArgs> poseDetectionInProgressEvent;
+        public event EventHandler<PoseInProgressEventArgs> PoseDetectionInProgress
+        {
+            add
+            {
+                if (this.poseDetectionInProgressEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterToPoseDetectionInProgress(this.InternalObject, this.internalPoseDetectionInProgress, IntPtr.Zero, out poseDetectionInProgressHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.poseDetectionInProgressEvent += value;
+            }
+            remove
+            {
+                this.poseDetectionInProgressEvent -= value;
+
+                if (this.poseDetectionInProgressEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterFromPoseDetectionInProgress(this.InternalObject, this.poseDetectionInProgressHandle);
+                }
+            }
+        }
+        private void InternalPoseDetectionInProgress(IntPtr hNode, string pose, UserID id, PoseDetectionStatus status, IntPtr pCookie)
+        {
+            EventHandler<PoseInProgressEventArgs> handlers = this.poseDetectionInProgressEvent;
+            if (handlers != null)
+                handlers(this.node, new PoseInProgressEventArgs(pose, id, status));
+        }
+        private SafeNativeMethods.XnPoseDetectionInProgress internalPoseDetectionInProgress;
+        private IntPtr poseDetectionInProgressHandle;
+        #endregion
+
     }
 }
diff --git a/Wrappers/OpenNI.net/ProductionNode.cs b/Wrappers/OpenNI.net/ProductionNode.cs
index 275d3db..1bfbcf4 100644
--- a/Wrappers/OpenNI.net/ProductionNode.cs
+++ b/Wrappers/OpenNI.net/ProductionNode.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Text;
 using System.Collections.Generic;
diff --git a/Wrappers/OpenNI.net/PublisherPolicy.config b/Wrappers/OpenNI.net/PublisherPolicy.config
index 27b8d9e..1a63b9a 100644
--- a/Wrappers/OpenNI.net/PublisherPolicy.config
+++ b/Wrappers/OpenNI.net/PublisherPolicy.config
@@ -5,8 +5,8 @@
       <dependentAssembly>
         <assemblyIdentity name="OpenNI.Net" publicKeyToken="6b43d0c6cf74ee7f"/>
         <!-- Redirecting to newest version (we're backwards compatible to versions up to 1.1.0.31). -->
-        <bindingRedirect oldVersion="1.1.0.31 - 1.1.0.41"
-                         newVersion="1.1.0.41"/>
+        <bindingRedirect oldVersion="1.1.0.31 - 1.5.2.23"
+                         newVersion="1.5.2.23"/>
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
diff --git a/Wrappers/OpenNI.net/Query.cs b/Wrappers/OpenNI.net/Query.cs
index 3d50432..1a24a04 100644
--- a/Wrappers/OpenNI.net/Query.cs
+++ b/Wrappers/OpenNI.net/Query.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
@@ -6,7 +27,7 @@ namespace OpenNI
 {
 	public class Query : ObjectWrapper
 	{
-		Query() : 
+		public Query() : 
 			this(Create())
 		{
 		}
diff --git a/Wrappers/OpenNI.net/Recorder.cs b/Wrappers/OpenNI.net/Recorder.cs
index ace4e66..4b0bbc4 100644
--- a/Wrappers/OpenNI.net/Recorder.cs
+++ b/Wrappers/OpenNI.net/Recorder.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/SceneAnalyzer.cs b/Wrappers/OpenNI.net/SceneAnalyzer.cs
index aa82ca6..4d9a975 100644
--- a/Wrappers/OpenNI.net/SceneAnalyzer.cs
+++ b/Wrappers/OpenNI.net/SceneAnalyzer.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/SceneMetaData.cs b/Wrappers/OpenNI.net/SceneMetaData.cs
index ce0cc83..3ceeb4a 100644
--- a/Wrappers/OpenNI.net/SceneMetaData.cs
+++ b/Wrappers/OpenNI.net/SceneMetaData.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/ScriptNode.cs b/Wrappers/OpenNI.net/ScriptNode.cs
new file mode 100644
index 0000000..360e749
--- /dev/null
+++ b/Wrappers/OpenNI.net/ScriptNode.cs
@@ -0,0 +1,74 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace OpenNI
+{
+	public class ScriptNode : ProductionNode
+	{
+		internal ScriptNode(Context context, IntPtr nodeHandle, bool addRef) :
+			base(context, nodeHandle, addRef)
+		{
+		}
+
+		public ScriptNode(Context context, string format) :
+			this(context, Create(context, format), false)
+		{
+		}
+
+		public string Format
+		{
+			get
+			{
+				return Marshal.PtrToStringAnsi(SafeNativeMethods.xnScriptNodeGetSupportedFormat(this.InternalObject));
+			}
+		}
+
+		public void LoadScriptFromFile(string fileName)
+		{
+			int status = SafeNativeMethods.xnLoadScriptFromFile(this.InternalObject, fileName);
+			WrapperUtils.ThrowOnError(status);
+		}
+
+		public void LoadScriptFromString(string script)
+		{
+			int status = SafeNativeMethods.xnLoadScriptFromString(this.InternalObject, script);
+			WrapperUtils.ThrowOnError(status);
+		}
+
+		public void Run()
+		{
+			int status = SafeNativeMethods.xnScriptNodeRun(this.InternalObject);
+			WrapperUtils.ThrowOnError(status);
+		}
+
+		private static IntPtr Create(Context context, string format)
+		{
+			IntPtr nodeHandle;
+			int status = SafeNativeMethods.xnCreateScriptNode(context.InternalObject, format, out nodeHandle);
+			WrapperUtils.ThrowOnError(status);
+			return nodeHandle;
+		}
+	}
+}
\ No newline at end of file
diff --git a/Wrappers/OpenNI.net/SkeletonCapability.cs b/Wrappers/OpenNI.net/SkeletonCapability.cs
index b0294d7..430765d 100644
--- a/Wrappers/OpenNI.net/SkeletonCapability.cs
+++ b/Wrappers/OpenNI.net/SkeletonCapability.cs
@@ -1,4 +1,25 @@
-using System;
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System;
 using System.Text;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
@@ -31,6 +52,22 @@ namespace OpenNI
 		private bool success;
 	}
 
+    public class CalibrationProgressEventArgs : UserEventArgs
+    {
+
+        public CalibrationProgressEventArgs(UserID id, CalibrationStatus status)
+            : base(id)
+        {
+            this.status = status;
+        }
+        public CalibrationStatus Status
+        {
+            get { return status; }
+            set { status = value; }
+        }
+        private CalibrationStatus status;
+    }
+
     public class SkeletonCapability : Capability
     {
 		internal SkeletonCapability(ProductionNode node)
@@ -42,6 +79,8 @@ namespace OpenNI
 
             this.internalCalibrationStart = new SafeNativeMethods.XnCalibrationStart(this.InternalCalibrationStart);
             this.internalCalibrationEnd = new SafeNativeMethods.XnCalibrationEnd(this.InternalCalibrationEnd);
+            this.internalCalibrationInProgress = new SafeNativeMethods.XnCalibrationInProgress(this.InternalCalibrationInProgress);
+            this.internalCalibrationComplete = new SafeNativeMethods.XnCalibrationComplete(this.InternalCalibrationComplete);
         }
 
         public bool IsJointAvailable(SkeletonJoint joint)
@@ -210,7 +249,7 @@ namespace OpenNI
             {
                 if (this.calibrationStartEvent == null)
                 {
-                    int status = SafeNativeMethods.xnRegisterCalibrationCallbacks(this.InternalObject, internalCalibrationStart, null, IntPtr.Zero, out calibrationStartHandle);
+                    int status = SafeNativeMethods.xnRegisterToCalibrationStart(this.InternalObject, internalCalibrationStart, IntPtr.Zero, out calibrationStartHandle);
                     WrapperUtils.ThrowOnError(status);
                 }
                 this.calibrationStartEvent += value;
@@ -221,7 +260,7 @@ namespace OpenNI
 
                 if (this.calibrationStartEvent == null)
                 {
-                    SafeNativeMethods.xnUnregisterCalibrationCallbacks(this.InternalObject, this.calibrationStartHandle);
+                    SafeNativeMethods.xnUnregisterFromCalibrationStart(this.InternalObject, this.calibrationStartHandle);
                 }
             }
         }
@@ -237,7 +276,8 @@ namespace OpenNI
 
         #region Calibration End
 		private event EventHandler<CalibrationEndEventArgs> calibrationEndEvent;
-		public event EventHandler<CalibrationEndEventArgs> CalibrationEnd
+        [Obsolete("use SkeletonCapability.CalibrationComplete instead")]
+        public event EventHandler<CalibrationEndEventArgs> CalibrationEnd
         {
             add
             {
@@ -267,5 +307,71 @@ namespace OpenNI
         private SafeNativeMethods.XnCalibrationEnd internalCalibrationEnd;
         private IntPtr calibrationEndHandle;
         #endregion
+
+        #region Calibration In Progress
+        private event EventHandler<CalibrationProgressEventArgs> calibrationInProgressEvent;
+        public event EventHandler<CalibrationProgressEventArgs> CalibrationInProgress
+        {
+            add
+            {
+                if (this.calibrationInProgressEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterToCalibrationInProgress(this.InternalObject, internalCalibrationInProgress, IntPtr.Zero, out calibrationInProgressHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.calibrationInProgressEvent += value;
+            }
+            remove
+            {
+                this.calibrationInProgressEvent -= value;
+
+                if (this.calibrationInProgressEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterFromCalibrationInProgress(this.InternalObject, this.calibrationInProgressHandle);
+                }
+            }
+        }
+        private void InternalCalibrationInProgress(IntPtr hNode, UserID id, CalibrationStatus status, IntPtr pCookie)
+        {
+            EventHandler<CalibrationProgressEventArgs> handlers = this.calibrationInProgressEvent;
+            if (handlers != null)
+                handlers(this.node, new CalibrationProgressEventArgs(id, status));
+        }
+        private SafeNativeMethods.XnCalibrationInProgress internalCalibrationInProgress;
+        private IntPtr calibrationInProgressHandle;
+        #endregion
+
+        #region Calibration Complete
+        private event EventHandler<CalibrationProgressEventArgs> calibrationCompleteEvent;
+        public event EventHandler<CalibrationProgressEventArgs> CalibrationComplete
+        {
+            add
+            {
+                if (this.calibrationCompleteEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterToCalibrationComplete(this.InternalObject, internalCalibrationComplete, IntPtr.Zero, out calibrationCompleteHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.calibrationCompleteEvent += value;
+            }
+            remove
+            {
+                this.calibrationCompleteEvent -= value;
+
+                if (this.calibrationCompleteEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterFromCalibrationComplete(this.InternalObject, this.calibrationCompleteHandle);
+                }
+            }
+        }
+        private void InternalCalibrationComplete(IntPtr hNode, UserID id, CalibrationStatus status, IntPtr pCookie)
+        {
+            EventHandler<CalibrationProgressEventArgs> handlers = this.calibrationCompleteEvent;
+            if (handlers != null)
+                handlers(this.node, new CalibrationProgressEventArgs(id, status));
+        }
+        private SafeNativeMethods.XnCalibrationComplete internalCalibrationComplete;
+        private IntPtr calibrationCompleteHandle;
+        #endregion
     }
 }
diff --git a/Wrappers/OpenNI.net/StateChangedEvent.cs b/Wrappers/OpenNI.net/StateChangedEvent.cs
index 597a8b9..b419713 100644
--- a/Wrappers/OpenNI.net/StateChangedEvent.cs
+++ b/Wrappers/OpenNI.net/StateChangedEvent.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/UserGenerator.cs b/Wrappers/OpenNI.net/UserGenerator.cs
index d6544d1..a6d0995 100644
--- a/Wrappers/OpenNI.net/UserGenerator.cs
+++ b/Wrappers/OpenNI.net/UserGenerator.cs
@@ -1,4 +1,25 @@
-using System;
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using UserID = System.Int32;
@@ -31,6 +52,16 @@ namespace OpenNI
 		public UserLostEventArgs(UserID id) : base(id) { }
 	}
 
+    public class UserExitEventArgs : UserEventArgs
+    {
+        public UserExitEventArgs(UserID id) : base(id) { }
+    }
+
+    public class UserReEnterEventArgs : UserEventArgs
+    {
+        public UserReEnterEventArgs(UserID id) : base(id) { }
+    }
+
 	public class UserGenerator : Generator
     {
 		public UserGenerator(Context context, IntPtr nodeHandle, bool addRef) : 
@@ -38,6 +69,14 @@ namespace OpenNI
         {
             this.internalNewUser = new SafeNativeMethods.XnUserHandler(this.InternalNewUser);
             this.internalLostUser = new SafeNativeMethods.XnUserHandler(this.InternalLostUser);
+            this.internalUserExit = new SafeNativeMethods.XnUserHandler(this.InternalUserExit);
+            this.internalUserReEnter = new SafeNativeMethods.XnUserHandler(this.InternalUserReEnter);
+            if (IsCapabilitySupported(Capabilities.Skeleton))
+                m_skeletonCapability = new SkeletonCapability(this);
+            else m_skeletonCapability = null;
+            if (IsCapabilitySupported(Capabilities.PoseDetection))
+                m_poseDetectionCapability = new PoseDetectionCapability(this);
+            else m_poseDetectionCapability = null;
         }
 
         public UserGenerator(Context context, Query query, EnumerationErrors errors) :
@@ -106,14 +145,14 @@ namespace OpenNI
         {
 			get
 			{
-				return new SkeletonCapability(this);
+				return m_skeletonCapability;
 			}
         }
 		public PoseDetectionCapability PoseDetectionCapability
         {
 			get
 			{
-				return new PoseDetectionCapability(this);
+				return m_poseDetectionCapability;
 			}
         }
 
@@ -182,5 +221,97 @@ namespace OpenNI
         private SafeNativeMethods.XnUserHandler internalLostUser;
         private IntPtr lostUserHandle;
         #endregion
+
+        #region User Exit
+        private event EventHandler<UserExitEventArgs> userExitEvent;
+        public event EventHandler<UserExitEventArgs> UserExit
+        {
+            add
+            {
+                if (this.userExitEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterToUserExit(this.InternalObject, this.internalUserExit, IntPtr.Zero, out userExitHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.userExitEvent += value;
+            }
+            remove
+            {
+                this.userExitEvent -= value;
+
+                if (this.userExitEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterFromUserExit(this.InternalObject, this.userExitHandle);
+                }
+            }
+        }
+        private void InternalUserExit(IntPtr hNode, UserID id, IntPtr pCookie)
+        {
+            EventHandler<UserExitEventArgs> handlers = this.userExitEvent;
+            if (handlers != null)
+                handlers(this, new UserExitEventArgs(id));
+        }
+        private SafeNativeMethods.XnUserHandler internalUserExit;
+        private IntPtr userExitHandle;
+        #endregion
+
+        #region User ReEnter
+        private event EventHandler<UserReEnterEventArgs> userReEnterEvent;
+        public event EventHandler<UserReEnterEventArgs> UserReEnter
+        {
+            add
+            {
+                if (this.userReEnterEvent == null)
+                {
+                    int status = SafeNativeMethods.xnRegisterToUserReEnter(this.InternalObject, this.internalUserReEnter, IntPtr.Zero, out userReEnterHandle);
+                    WrapperUtils.ThrowOnError(status);
+                }
+                this.userReEnterEvent += value;
+            }
+            remove
+            {
+                this.userReEnterEvent -= value;
+
+                if (this.userReEnterEvent == null)
+                {
+                    SafeNativeMethods.xnUnregisterFromUserReEnter(this.InternalObject, this.userReEnterHandle);
+                }
+            }
+        }
+        private void InternalUserReEnter(IntPtr hNode, UserID id, IntPtr pCookie)
+        {
+            EventHandler<UserReEnterEventArgs> handlers = this.userReEnterEvent;
+            if (handlers != null)
+                handlers(this, new UserReEnterEventArgs(id));
+        }
+        private SafeNativeMethods.XnUserHandler internalUserReEnter;
+        private IntPtr userReEnterHandle;
+        #endregion
+
+        ///  @todo this is a temporary solution for capability not being disposed by anyone external
+        public override void Dispose()
+        {
+            if (m_skeletonCapability != null)
+            {
+                m_skeletonCapability.InternalDispose();
+                m_skeletonCapability = null;
+            }
+            if (m_poseDetectionCapability != null)
+            {
+                m_poseDetectionCapability.InternalDispose();
+                m_poseDetectionCapability = null;
+            }
+            
+            base.Dispose();
+        }
+
+        // protected members
+
+        // internal capabilities to avoid doing "new" all the time. They are initialized in
+        // the construction and are null if not supported.
+        // NOTE: everyone getting a capability will get THE SAME capability! i.e. dispose should not be 
+        // called!
+        protected SkeletonCapability m_skeletonCapability;
+        protected PoseDetectionCapability m_poseDetectionCapability;
     }
 }
diff --git a/Wrappers/OpenNI.net/UserPositionCapability.cs b/Wrappers/OpenNI.net/UserPositionCapability.cs
index b79d82f..c3145be 100644
--- a/Wrappers/OpenNI.net/UserPositionCapability.cs
+++ b/Wrappers/OpenNI.net/UserPositionCapability.cs
@@ -1,3 +1,24 @@
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
diff --git a/Wrappers/OpenNI.net/Wrappers.cs b/Wrappers/OpenNI.net/Wrappers.cs
index 48cd29e..e175a1b 100644
--- a/Wrappers/OpenNI.net/Wrappers.cs
+++ b/Wrappers/OpenNI.net/Wrappers.cs
@@ -1,4 +1,25 @@
-using System;
+/****************************************************************************
+*                                                                           *
+*  OpenNI 1.x Alpha                                                         *
+*  Copyright (C) 2011 PrimeSense Ltd.                                       *
+*                                                                           *
+*  This file is part of OpenNI.                                             *
+*                                                                           *
+*  OpenNI is free software: you can redistribute it and/or modify           *
+*  it under the terms of the GNU Lesser General Public License as published *
+*  by the Free Software Foundation, either version 3 of the License, or     *
+*  (at your option) any later version.                                      *
+*                                                                           *
+*  OpenNI is distributed in the hope that it will be useful,                *
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
+*  GNU Lesser General Public License for more details.                      *
+*                                                                           *
+*  You should have received a copy of the GNU Lesser General Public License *
+*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
+*                                                                           *
+****************************************************************************/
+using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
@@ -89,7 +110,7 @@ namespace OpenNI
 
 		#region IDisposable Members
 
-		public void Dispose()
+        public virtual void Dispose()
 		{
 			Dispose(true);
 			GC.SuppressFinalize(this);
@@ -109,6 +130,11 @@ namespace OpenNI
 			}
 		}
 
+		protected internal void UnsafeReplaceInternalObject(IntPtr ptr)
+		{
+			this.ptr = ptr;
+		}
+
 		protected abstract void FreeObject(IntPtr ptr, bool disposing);
 
 		protected virtual void Dispose(bool disposing)
@@ -120,11 +146,6 @@ namespace OpenNI
 			}
 		}
 
-		internal void MarkAlreadyFreed()
-		{
-			this.ptr = IntPtr.Zero;
-		}
-
 		private IntPtr ptr;
 	}
 
@@ -251,10 +272,19 @@ namespace OpenNI
 		internal NodeWrapper(IntPtr hNode, bool addRef)
 			: base(hNode)
 		{
+			this.contextShuttingDownHandler = OnContextShuttingDown;
+
 			if (addRef)
 			{
 				WrapperUtils.ThrowOnError(SafeNativeMethods.xnProductionNodeAddRef(hNode));
 			}
+
+			IntPtr pContext = SafeNativeMethods.xnGetRefContextFromNodeHandle(hNode);
+			
+			int status = SafeNativeMethods.xnContextRegisterForShutdown(pContext, this.contextShuttingDownHandler, IntPtr.Zero, out this.hShutdownCallback);
+			WrapperUtils.ThrowOnError(status);
+
+			SafeNativeMethods.xnContextRelease(pContext);
 		}
 
 		public override bool Equals(object obj)
@@ -291,8 +321,23 @@ namespace OpenNI
 
 		protected override void FreeObject(IntPtr ptr, bool disposing)
 		{
+			IntPtr pContext = SafeNativeMethods.xnGetRefContextFromNodeHandle(ptr);
+			SafeNativeMethods.xnContextUnregisterFromShutdown(pContext, this.hShutdownCallback);
+			SafeNativeMethods.xnContextRelease(pContext);
 			SafeNativeMethods.xnProductionNodeRelease(ptr);
 		}
+
+		private void OnContextShuttingDown(IntPtr pContext, IntPtr pCookie)
+		{
+			// the context is shutting down
+			// no need to unregister from shutting down event - the event is destroyed anyway
+			UnsafeReplaceInternalObject(IntPtr.Zero);
+
+			Dispose();
+		}
+
+		private SafeNativeMethods.XnContextShuttingDownHandler contextShuttingDownHandler;
+		private IntPtr hShutdownCallback;
 	};
 
 	public class Capability : NodeWrapper
@@ -304,6 +349,19 @@ namespace OpenNI
 		}
 
 		internal ProductionNode node;
+
+        /// @todo this is a temporary solution for capability not being disposed by anyone external
+        public override void Dispose()
+        {
+            // we do nothing because we basically want to make the public dispose do nothing!
+
+        }
+
+        /// @todo this is a temporary solution for capability not being disposed by anyone external
+        internal virtual void InternalDispose()
+        {
+            base.Dispose();
+        }
 	}
 
 	public interface IMarshaler : IDisposable

-- 
openni packaging



More information about the pkg-multimedia-commits mailing list